[討論] ODE45如何回傳變數
請問在使用ODE45時,如何回傳我的控制力tau,並且把tau的歷史軌跡記錄下來
如
function xdot=project_p3(t,x)
tau=H*(V+inv(H)*G+inv(H)*C*[x(3);x(4)])
ggg=inv(H);
fff=-inv(H)*C*[x(3);x(4)]-inv(H)*G;
xdot(1)=x(3);
xdot(2)=x(4);
xdot(3)=fff(1)+ggg(1,1)*tau(1)+ggg(1,2)*tau(2);
xdot(4)=fff(2)+ggg(2,1)*tau(1)+ggg(2,2)*tau(2);
xdot=xdot';
假設以上的變數 H V G C....等都已經定義好了
現在我只會回傳x這個變數,無法回傳tau,請各位幫幫忙@@感謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 115.43.208.52
→
05/17 00:23, , 1F
05/17 00:23, 1F