How can I save internal variable to a vector with ode45.

2 ビュー (過去 30 日間)
Foufa.h
Foufa.h 2017 年 4 月 9 日
コメント済み: Jan 2017 年 4 月 9 日
function [dx]= system(t,x)
global m I
F= expression;
u=F+alpha*u(t-1);
dx(1)=x(2);
dx(2)=m*x(1)+u/I;
dx(3)=-m*x(1)-u/I;
dx=[dx(1);dx(2);dx(3)]';
end
[time,Xs]=ode45(@system(t,x),[0:0.1: 7],x01)
x01=[0.05 0.05 0 ]'
I want to save u , and use it to have u(t-1)
  2 件のコメント
Stephen23
Stephen23 2017 年 4 月 9 日
Use a nested function.
Jan
Jan 2017 年 4 月 9 日
How should this work at the initial t?

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by