How do i resolve this problem ??????
古いコメントを表示
this is state space model of dynamical system. in this problem, v is input of system. i'd like to put a function ( i made a function v below ) on v what should i do?
function xdot=example(t,x,v)
xdot=zeros(2,1);
xdot(1)=x(2);
xdot(2)=(v-4*x(1)-7*x(2))/5;
end
//////////////////////////////////////////////////////
tspan=0:0.01:20;
k=0;
for time=0:0.01:20;
k=k+1;
if time<1
v(k)=10*time;
elseif time<=4
v(k)=10;
elseif time<=5
v(k)=-10*(time-4)+10;
else
v(k)=0;
end
end
[t,x]=ode45(@example,tspan,[0 9],[],v);
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Numeric Solvers についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!