当前位置:   article > 正文

matlab ode45 初值,为什么设定的初值在ode45里无效?

ode45的初始条件为什么不确认自变量的取值

function dx= exercisesub(t,x,u,d)

J=2.0;

d=sin(t);

x1dot=x(2);

x2dot=(1/J)*u+(1/J)*d;

dx=[x1dot; x2dot];

----------------------------

主程序:

clear;close;clc;

% setting known values;

c=10;

k=10;

J=2;

xite=1.1;

x0=[0 0];  % Initial Conditions;这里设定了x0的初值

y(1,1)=x0(1);

x1(1)=x0(1,1);

x2(1)=x0(1,2);

timestep=0.01;  % Integration step;

t0=0.0;

tfinal=0.0;

d(1,1)=sin(t0);   % setting d=sin(t) as disterbance term;

iterations=1000;  % setting iterations range, repeat from 2 to 1000;

th_ref=ones(iterations,1); % design th_ref as reference;

e(1,1)=th_ref(1,1)-x1(1,1);  %tracking error;

edot(1,1)=-x2(1,1);    % derivative of e, the derivative

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/814100
推荐阅读
相关标签
  

闽ICP备14008679号