Shooting Method on ODE

3 visualizaciones (últimos 30 días)
Alexander Kimbley
Alexander Kimbley el 7 de Mzo. de 2019
Comentada: darova el 7 de Mzo. de 2019
Hi, I'm pretty new to Matlab so bare with me please. I need use the ODE below in the ode45 command for the shooting method but I'm unsure how to write it in the correct form i.e. Y_1=... and Y_2=... if anyone could be so kind to re-write this for me I should be fine.
Thanks.
  2 comentarios
Jan
Jan el 7 de Mzo. de 2019
The attached file MagneticShootingMethod.m contains this line only:
((x-c)^2 - B^2)*(y''-ay)=(2*B^2)*(y-(x-c)y')/((x-c)^2)
This is neither a clear description nor running Matlab code. I cannot guess, what "i.e. Y_1=... and Y_2=..." could mean.
Please post, what you have tried so far and explain the problem clearly.
darova
darova el 7 de Mzo. de 2019
function dy = odefcn(x,y,a,B,c)
dy = zeros(2,1);
dy(1) = y(2);
dy(2) = (2*B^2)*(y(1)-(x-c)*dy(1))./((x-c).^2);
dy(2) = dy(2) ./ ((x-c).^2 - B^2) + a*y(1);
end

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Ordinary Differential Equations en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by