Dsolve solves differential equation with a very long output, is something wrong?

3 views (last 30 days)
Hi Matlab Community,
I am currently running version R2022a and I am trying to solve the following system of differential equations using dsolve by the following way:
The output (see image below) of the struct is so long that I cannot see it all entirely, seeing as the three dots in the end indicate that it continues. Have I done something wrong from the code or is there any way to expand/simplify so i can see the entire fields? I tried closing down any windows in matlab and still cannot see it all.
Thank you.

Accepted Answer

Torsten
Torsten on 19 Apr 2023
Edited: Torsten on 19 Apr 2023
syms lambda mu real positive
syms t p1(t) p2(t) p3(t)
eqn1 = diff(p1,t) == -5*lambda*p1 + mu*p2;
eqn2 = diff(p2,t) == 5*lambda*p1 -(4*lambda+mu)*p2;
eqn3 = diff(p3,t) == 4*lambda*p2;
cond1 = p1(0)==1;
cond2 = p2(0)==0;
cond3 = p3(0)==0;
sol = dsolve([eqn1,eqn2,eqn3],[cond1,cond2,cond3]);
simplify(sol.p1)
ans = 
simplify(sol.p2)
ans = 
simplify(sol.p3)
ans = 
simplify(sol.p1+sol.p2+sol.p3)
ans = 
1
  1 Comment
L_J
L_J on 19 Apr 2023
Thank you for your reply. Interesting to learn how you made it simplified, I shall take good note. I am currently setting up to test on maple as well, will be interesting to see if the same answer is generated.
Have a good one!

Sign in to comment.

More Answers (0)

Tags

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!