Symbolic solver help again
Show older comments
So i have had multiple issues with the solver getting different values because matlab has allowed so many intricacies with this tool.
I have two examples here. One works and proves my method. The other does not and i have no clue why given they are almost the same
The first is as follows.
syms s
syms k wn real
equation = (s^3+3*s^2+((10+1.26)/(5))*s+k)
S1 = -wn + wn*sqrt(3)*i
p = subs(equation,s,S1)
[wn k] = solve(real(p) == 0,imag(p) == 0,[wn k])
double(wn)
double(k)
this works just fine and i get the result i should.
Next is the exact same thing with just a change of numbers.
syms s
syms k wn real
equation = 1+((s+1.4))/((s+5))*(10*(s+10))/(s*(s+1)*(s+10)+10*k*s)
pretty(equation)
S1 = -wn + wn*sqrt(3)*i
p = subs(equation,s,S1)
[wn k] = solve(real(p) == 0,imag(p) == 0,[wn k])
The second example will not give me the correct answer. Can someone tell me why? The only other constraint i can think to tell it is that K>0 and I've already told it that Wn and K are real which is one thing i ran into before hand and that is how i got example 1 to work.
Can anyone tell me whats going on here? Thanks
P.S example 2 K should 9.08 Wn is unimportant
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!