Airy equation with ode solver
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Sensor Models en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!