When I solve the system of differential equations I get two solutions for each variable (See the picture). My question is how I can neglect one of the solutions at the plot (The yellow and the blue). Thanks.



Code for the plot:


Thnks.enter image description here


1 Answer 1


First I take your solution with smaller integration range:

sol = NDSolve[{3 y[x] - 0.5 z[x]^2 == y[x]*z'[x]^2 (0.5 + 9 y[x]), -y'[x] == 
y[x]*z'[x]^2 + y[x]^2*z'[x]^2 (18 + 4) - y[x]*y'[x]*z'[x]^2,y[0] == 1, z[0] == 0.2}, {z, y}, {x, 0, .5}]

sol contains two different solution pairs sol[[1]] and sol[[2]]

Plot[Evaluate[{Sqrt[y[x]], z[x]} /. sol[[1]]], {x, 0, 0.5}]

enter image description here

Plot[Evaluate[{Sqrt[y[x]], z[x]} /. sol[[2]]], {x, 0, 0.5}]

enter image description here


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.