Having problems solving this differential equation system
2 views (last 30 days)
Show older comments
I have an assingment where I have to find the equilibrium points of the following differential equation system:
Which is obviously a Non Linear System and it might have n amount of solutions and equilibrium points, so I'm proceding as follows:
Using the following matlab code to solve the system:
syms X_1 X_2
eq1= - 3*X_1 - 3*(X_2^1.7) == -13;
eq2= X_1^0.8 - 2*(X_2^1.2) == 7;
sol=solve([eq1 eq2],[X_1 X_2]); %At this point i'm getting a solution of 68x1 Struct
%so i'm extracting only the real values on the next lines since solve([eq1 eq2],[X_1 X2],'Real',true)
%was not working for me at all. It was returning solutions with x and it was weird.
x1=vpa(sol.X_1,3);
x1=x1(real(x1)&imag(x1)==0)
x2=vpa(sol.X_2,3);
x2=x2(real(x2)&imag(x2)==0)
Which resulted as 2 real equilibrium points as the following:
The problem is when I try to simulate the same system in Simulink, I'm getting pretty much a different solution and if i set initial conditions in both of the integrators with the x1 and x2 values obtained with the solve code the system doesn't behaves as steady which means something is wrong and it becames stable on those points shown in the image below (5.996 ; -1.334).
Which makes me think that my code to find the equilibrium points is wrong or either the Block diagram is wrong, I've been trying so hard to find what my error is but It's been hours working to find it but I had no luck.
Maybe it is something with the way I'm doing the code to solve the system since I tried using:
sol=solve([eq1 eq2],[X_1 X_2],'Real',true);
and for some reason it returns the next warnings:
- Warning: Possibly spurious solutions.
- Warning: Solutions are parameterized by the symbols: x. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
- Warning: Solutions are valid under the following conditions: in(x, 'real') & (338*x^34)/3 - (8788*x^17)/27 - 13720*x^24 - 24010*x^12 - 3920*x^36 - 560*x^48 - (52*x^51)/3 - 32*x^60 + x^68 - 1332806/81 == 0. To include parameters and conditions in the solution, specify the 'ReturnConditions' value as 'true'.
and also I get those expresions with x as symbolic which is weird.
I will attach the .slx where I'm running the block diagram if anyone wants to check it out from first hand.
Thanks for the help.
0 Comments
Answers (0)
See Also
Categories
Find more on Equation Solving 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!