Airy equation with ode solver
Afficher commentaires plus anciens
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?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Sensor Models 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!