Shooting Method on ODE
조회 수: 3 (최근 30일)
이전 댓글 표시
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
Jan
2019년 3월 7일
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
2019년 3월 7일
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!