getODEderivatives()

버전 1.0.0.0 (1.5 KB) 작성자: Luca Cerone
Get derivatives of an ODE syste,
다운로드 수: 426
업데이트 날짜: 2010/5/4

라이선스 보기

Syntax: dydt=getODEderivatives(t,y,odehandler)

This function is used to get the time course derivatives
evaluated to solve an ode system using Matlab solvers
(ode45,ode23,ode23s and so on).

Example:

Want to solve the system and plot the solution as well as how the derivatives change:
dudt=w;
dwdt=-u;

u(0)=0;
w(0)=1;

odehandler=@(t,y) [y(2);-y(1)];
[t,y]=ode45(odehandler,[0 4*pi],[0 1]);
u=y(:,1);
w=y(:,2);

(select the code below and press F9 to run it).

dydt=getODEderivatives(t,y,odehandler);
dudt=dydt(:,1);
dwdt=dydt(:,2);

%Check that dudt=w;
sum(dudt==w)==length(t)
plot(t,dudt,'r--',t,w,'g-.')
legend('dudt','w')

%Check that dwdt=-u;
sum(dwdt==-u)==length(t)
figure
plot(t,dwdt,'r--',t,-u,'g-.')
legend('dwdt','-u')

인용 양식

Luca Cerone (2024). getODEderivatives() (https://www.mathworks.com/matlabcentral/fileexchange/27469-getodederivatives), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0