Where in my code using runge- kutta four step method did I make a mistake?
조회 수: 2 (최근 30일)
이전 댓글 표시
% compute our trajectory
dt = .01;
tspan = 0:dt:4;
Y(:,1) = y0;
yk = y0;
for i=1:length(tspan)
time= i*dt;
ykplus1=rk4singlestep(@(t,y)lorenz(t,y,sigma,beta,rho),dt,time,yk);
Y =[Y ykplus1];
yk = ykplus1;
end
plot3(Y(1,:),Y(2,:),Y(3,:),'b')
댓글 수: 7
채택된 답변
James Tursa
2021년 2월 11일
Type the following at the command line:
edit rk4singlestep.m
Then copy your code into that file and save it.
댓글 수: 3
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!