Second Order ODE Solver using ODE23
显示 更早的评论
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?
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!