How graph second order differential equation with Matlab?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Antworten (1)
Star Strider
am 18 Jan. 2018
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 Kommentare
Star Strider
am 18 Jan. 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.
Siehe auch
Kategorien
Mehr zu Equation Solving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!