Symbolic expansions, is it possible to express a solution as a series of exponentials
1 回表示 (過去 30 日間)
古いコメントを表示
Lets say I have something like
f_t = (A*cos(a*t) + B*sin(b*t))*(C*cos(c*t) + D*sin(c*t)),
what I would like is something of the form
f_t = c_1 exp(k1*t) + c_2 exp(k2*t) + ... + c_N exp(kN*t) .
I can't find anything within the symbolic toolbox that allows expansion in this form. I don't really want to write one either until I know for sure there isn't one included / on the FEX. Anyone that can help?
0 件のコメント
採用された回答
Star Strider
2014 年 6 月 9 日
To wit:
syms A a t
f_t = (A*cos(a*t) + B*sin(b*t))*(C*cos(c*t) + D*sin(c*t));
f_t = rewrite(f_t, 'exp')
produces:
f_t =
(A*(exp(-a*t*i)/2 + exp(a*t*i)/2) + B*((exp(-b*t*i)*i)/2 - (exp(b*t*i)*i)/2))*(C*(exp(-c*t*i)/2 + exp(c*t*i)/2) + D*((exp(-c*t*i)*i)/2 - (exp(c*t*i)*i)/2))
You’ll have to play with it it get the result in your example. There may not be any direct way to do that.
4 件のコメント
Star Strider
2014 年 6 月 10 日
編集済み: Star Strider
2014 年 6 月 11 日
It would seem so.
I also experimented with subexpr, but wasn’t sure that’s what you wanted to do, so didn’t suggest it earlier. If the constants are related in some way, subs may also help. To break them out into fractional numerators and denominators, numden could help.
Explore the options in the Formula Rearrangement and Rewriting section of the documentation. I’m not certain you can do exactly what you want, but you can probably get close. Delving into MuPad directly may also provide options the Symbolic Math Toolbox does not, at least easily.
EDIT — I’ll take a look at it!
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!