having different results when I put numbers manually and parameterize
显示 更早的评论
I am dealing with an 8th equation and I used vpasolve to store all the roots of that equation.
S = vpasolve(equation, s);
The matrix S contains values of
- 1.9718709247834585063477203451543 - 2.7588590897673713478450366516503i
- 1.9718709247834585063477203451543 + 2.7588590897673713478450366516503i
- 1.6602104863153775396745015860611 - 0.28007873122724886824752325586177i
- 1.6602104863153775396745015860611 + 0.28007873122724886824752325586177i
1.6602104863153775396745015860611 - 0.28007873122724886824752325586177i
1.6602104863153775396745015860611 + 0.28007873122724886824752325586177i
1.9718709247834585063477203451543 + 2.7588590897673713478450366516503i
1.9718709247834585063477203451543 - 2.7588590897673713478450366516503i
I want to use the top four terms from the matrix above, which will be referenced by S(1, 1), S(2, 1), S(3, 1), S(4, 1).
And I made another equation using the four terms.
transferFunction1 = 1 / (e*(s-(S(1, 1)))*(s-(S(2, 1)))*(s-(S(3, 1)))*(s-(S(4, 1))));
and when I collect transferFunction1 using
collect(transferFunction1, s)
the result is like:
3.125e129/(3.140625e128*s^4 + s^3*(2.2814011363464563914077081505446e129 + 2.59375e96i) + s^2*(8.6144845457243503826611646706711e129 + 1.5020097307246571807203237553397e97i) + s*(1.5503047021173869741531698334942e130 + 2.8629059987527271695020531485894e97i) + (1.0237918954506870666034283717819e130 + 1.8164339501566283459635589516081e97i))
This is an undesired result.
And when I rewrite the transfer function with the manually substituted values instead of parameterized variables(S(1, 1), S(2, 1), S(3, 1), S(4, 1)) like below,
transferFunction2 = 1 / (e*(s-(- 1.9718709247834585063477203451543 - 2.7588590897673713478450366516503i))*(s-(- 1.9718709247834585063477203451543 + 2.7588590897673713478450366516503i))*(s-(- 1.6602104863153775396745015860611 - 0.28007873122724886824752325586177i))*(s-(- 1.6602104863153775396745015860611 + 0.28007873122724886824752325586177i)));
Collecting the new equation
collect(transferFunction2, s)
gives a result like:
13164036458569648337239753460458804039861886925068638906788872192000/(1322985664086249657892595222776109806006119635969398210132281655296*s^4 + 9610383275355832527232770828822326943683998340855816099663336964096*s^3 + 36288444362144045831281522444278455028973192738350821636975383019520*s^2 + 65306456385808769742610307072344572612367098640388197158826643816448*s + 43127148280643104621971678322654245056669000802947019363760884284265)
There is no imaginary term, and this is the correct form I've been expecting. I can't understand why the manual substitution is required to get the desired result. What is the difference between transferFunction1 and transferFunction2?
回答(1 个)
Torsten
2017-4-26
0 个投票
You have to substitute the terms as a+b*i, not as a+bi.
Best wishes
Torsten.
1 个评论
Gyuwon Lee
2017-4-27
编辑:Gyuwon Lee
2017-4-27
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!