How graph second order differential equation with Matlab?
Mostra commenti meno recenti
Looking to get some help on how to use matlab to solve and plot the following equation, all help is appreciated! Thank You! I haven't used matlab in 2 years very rusty, image is reference to original problem statement.
x^2*y"-7xy'+16y=0 & y*y"=2y'^2
1 Commento
Rena Berman
il 12 Dic 2019
(Answers Dev) Restored edit
Risposte (1)
Star Strider
il 18 Gen 2018
0 voti
Do them the same as you did before. Define ‘Dy’ and ‘D2y’, then substitute them for y' and y" respectively. Use both of them in your dsolve call, separated by commas, and include the requisite initial conditions, as I did. See the dsolve documentation for details,
2 Commenti
jake thompson
il 18 Gen 2018
Star Strider
il 18 Gen 2018
I didn’t take a close look at it. You have two equations, so you need to code both of them.
It appears to be a system of nonlinear differential equations. Most nonlinear differential equations do not have analytic solutions. It would be necessary to solve them numerically.
The best way to do that is to use the odeToVectorFiled function first, then matlabFunction on that result, to get an anonymous function to integrate with one of the numerical ODE solvers, such as ode45.
Prototype code for that:
[V,S] = odeToVectorField(ode1,ode2)
M = matlabFunction(V,'vars',{'t','Y'})
You would then use ‘M’ with ode45.
Categorie
Scopri di più su Ordinary Differential Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!