Shooting Method on ODE

3 Ansichten (letzte 30 Tage)
Alexander Kimbley
Alexander Kimbley am 7 Mär. 2019
Kommentiert: darova am 7 Mär. 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 Kommentare
Jan
Jan am 7 Mär. 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 am 7 Mär. 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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by