Second Order ODE Solver using ODE23
Afficher commentaires plus anciens
I am trying to use ode23 to solve
xy''- 1y'- 8(x^3)(y^3)=0
what I have so far is.
%%%xy''-y'-8*x^3*y^3=0
%%y''= y'/x + 8y^3x^2
% y'= x(1)
% y=x(2)
%y''= x(1)/x(1) + 8*(x(2)^3)*(x(1)^2) = 1 + 8*(x(2)^3)*(x(1)^2)
yDoublePrime = @(t,x) [x(2); 1+8*(x(1)^2)*(x(2)^3)];
tspan = [1 4];
[y,yPrime]=ode23(yDoublePrime,tspan,[0.5 -0.5])
The solution to this problem is supposed to be 0.0456, but i keep getting large vectors? It's late, I am tired, What am I missing?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!