Trigonometric approximation on symbolic variables
古いコメントを表示
Hi,
I would like to know how to perform or represent trigonometric approximations in Matlab. For example, let's say I have the set of symbolic equations
cos(x) + sin(y) = Tp;
1 + x + sin(x) = Tw;
When making the assumption that x and y are small, I want to transform the equations into the form
1 + y = Tp;
1 + x + x = Tw;
Using the subs function to replace all the sines and cosines does not seem to be feasible when I have many variables.
Thank you
2 件のコメント
Walter Roberson
2019 年 10 月 6 日
Is it the case that some of the sin() and cos() arguments will be small but others will not? For example in cos(x1x2x3) should it be assumed that x1*x2*x3 will be "small", or is there the possibility that even though x1 and x2 are "small" that when multiplied by x3 that the result might be large enough to count ? Does it all need to be made conditional, something like
piecewise(x < small & y < small & 0 <= small + x & 0 <= small + y, y - Tp + 1, x < small & 0 <= small + x, sin(y) - Tp + 1, y < small & 0 <= small + y, y - Tp + cos(x), cos(x) - Tp + sin(y))
Here -small < x < small was used for the test on x being small enough for the substitution to be valid, with the case where it is not small preserved.
Aik Ann Seng
2019 年 10 月 6 日
編集済み: Aik Ann Seng
2019 年 10 月 6 日
採用された回答
その他の回答 (1 件)
darova
2019 年 10 月 5 日
subs works ok for me
syms x y Tp Tw
eqn{1} = cos(x) + sin(y) - Tp;
eqn{2} = 1 + x + sin(x) - Tw;
for i = 1:2
eqn{i} = subs(eqn{i},{'sin(y)' 'sin(x)' 'cos(x)'},{y,x,1})
end
1 件のコメント
Aik Ann Seng
2019 年 10 月 6 日
カテゴリ
ヘルプ センター および File Exchange で Numeric Solvers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!