作业帮 > 综合 > 作业

形如dx/dt=Ax+Bu+Ew;y=Cx+Du;的状态空间表达式用matlab怎么求解啊?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/17 04:28:23
形如dx/dt=Ax+Bu+Ew;y=Cx+Du;的状态空间表达式用matlab怎么求解啊?
matlab中 ss(A,B,C,D)可以构造形如dx/dt=Ax+Bu;y=Cx+Du;的状态空间表达式,可是现在还有一个扰动Ew,该如何用matlab求解?
这个取决于你要做什么,你要做系统辨识么?还是仿真?
如果是仿真,用下面的例子
This example shows how to simulate a continuous-time state-space model using a random binary input u and a sampling interval of 0.1 s.
Consider the following state-space model:
dx/dt =[-1 1;-0.5 0]x + [1; 0.5]u + [0.5;0.5]e
y = [1,0]x+ e;
where e is Gaussian white noise with variance 7.
Use the following commands to simulate the model:
% Set up the model matrices
A = [-1 1;-0.5 0]; B = [1; 0.5];
C = [1 0]; D = 0; K = [0.5;0.5];
% Create a continuous-time state-space model
% Ts = 0 indicates continuous time
model_ss = idss(A,B,C,D,K,'Ts',0,'NoiseVariance',7)
% Create a random binary input
u = idinput(400,'rbs',[0 0.3]);
% Create an iddata object with empty output to represent just the input signal
data = iddata([],u);
data.ts = 0.1
% Simulate the output using the model
opt = simOptions('AddNoise',true);
y=sim(model_ss,data,opt);
再问: 是做仿真,还有优化,是连续系统的,能不能把完整的例子发一下啊? 42463126@qq.com
再答: 上面这个例子就很完整啊?有问题吗
再问: idss是建立离散系统的啊,那连续系统呢?
再答: idss既可以是连续,也可以是离散,取决于后面的Ts是不是0,我上面的例子,Ts就是0,所以已经是连续系统的了。