Simplify outputs huge result for diff symbolic expression with hyperbolic functions
古いコメントを表示
Matlab R2019 Update 3
syms x y k real;
syms f(x,y);
syms a b;
xd = -a*tanh(k*f)+b*sech(k*f);
yd = -b*tanh(k*f)-a*sech(k*f);
chid = atan2(yd, xd);
d_chid_dx = diff(chid, x);
simplify(d_chid_dx, 'Steps', 100, 'Criterion', 'preferReal')
produces result
ans(x, y) =
(((real(b*k*diff(f(x, y), x)*(tanh(k*f(x, y))^2 - 1)) - imag((b*k*sinh(k*f(x, y))*diff(f(x, y), x))/cosh(k*f(x, y))^2) + real((a*k*sinh(k*f(x, y))*diff(f(x, y), x))/cosh(k*f(x, y))^2) + imag(a*k*diff(f(x, y), x)*(tanh(k*f(x, y))^2 - 1)))/(imag(b*tanh(k*f(x, y))) - real(a*tanh(k*f(x, y))) + imag(a/cosh(k*f(x, y))) + real(b/cosh(k*f(x, y)))) - ((imag((a*k*sinh(k*f(x, y))*diff(f(x, y), x))/cosh(k*f(x, y))^2) - real(a*k*diff(f(x, y), x)*(tanh(k*f(x, y))^2 - 1)) + real((b*k*sinh(k*f(x, y))*diff(f(x, y), x))/cosh(k*f(x, y))^2) + imag(b*k*diff(f(x, y), x)*(tanh(k*f(x, y))^2 - 1)))*(imag(a*tanh(k*f(x, y))) + real(b*tanh(k*f(x, y))) - imag(b/cosh(k*f(x, y))) + real(a/cosh(k*f(x, y)))))/(imag(b*tanh(k*f(x, y))) - real(a*tanh(k*f(x, y))) + imag(a/cosh(k*f(x, y))) + real(b/cosh(k*f(x, y))))^2)*(imag(b*tanh(k*f(x, y))) - real(a*tanh(k*f(x, y))) + imag(a/cosh(k*f(x, y))) + real(b/cosh(k*f(x, y))))^2)/((imag(a*tanh(k*f(x, y))) + real(b*tanh(k*f(x, y))) - imag(b/cosh(k*f(x, y))) + real(a/cosh(k*f(x, y))))^2 + (imag(b*tanh(k*f(x, y))) - real(a*tanh(k*f(x, y))) + imag(a/cosh(k*f(x, y))) + real(b/cosh(k*f(x, y))))^2)
while calculation by hand gives
-a*k*sech(k*f(x,y))
which is correct.
I tried options for simplification (rewrite, steps, criterion) but with no luck.
Any answer will be greatly appreciated.
採用された回答
その他の回答 (1 件)
Andrey Mironenko
2019 年 12 月 20 日
編集済み: Andrey Mironenko
2019 年 12 月 20 日
カテゴリ
ヘルプ センター および File Exchange で Phased Array System Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!