Airy equation with ode solver
Show older comments
I am trying to solve Airy equation
with matlab ode solvers (ode45, ode23, etc..)
Here is my function
function dPsidy = gpe(y,Psi)
dPsidy = zeros(2,1);
dPsidy(1) = Psi(2);
dPsidy(2) = y.*Psi(1);
and my initial conditions
yspan = linspace(5,-10,1000);
Psi0 = [1e-4 1e-4];
After applying ode45 or other solvers I have solution that differs from built-in matlab airy function.
[y,Psi] = ode45(@(y,Psi) gpe(y,Psi), yspan, Psi0);
plot(yspan, Psi(:,1),yspan,airy(yspan))

How I can obtain the proper solution?
Accepted Answer
More Answers (0)
Categories
Find more on Sensor Models in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!