Att*_* O. 5 simulation math matlab octave
对于在该领域有一些经验的任何人来说,这应该是一个非常简单的问题,但我对此仍然不熟悉。
我有以下系统(或者这里是分辨率更高的图像):
替代文字 http://img199.imageshack.us/img199/2140/equation1.png
给定以下输入:
u = min(2 - t/7.5, 2*(mod(t, 2) < 1));
Run Code Online (Sandbox Code Playgroud)
我需要绘制系统y的输出。
我正在描述具有以下功能的系统:
function xprime = func(t, x)
u = min(2 - t/7.5, 2*(mod(t, 2) < 1));
xprime = [
x(2);
x(3);
0.45*u - 4*x(3)^2 - x(2)*x(1) - 4*x(2) - 2*x(1);
x(5);
sin(t) - 3*x(5)*x(1);
];
Run Code Online (Sandbox Code Playgroud)
并用 模拟ode23
,像这样:
[tout, xout] = ode23(@func, [0 15], [1.5; 3; -0.5; 0; -1])
Run Code Online (Sandbox Code Playgroud)
模拟后,xout
将有五列。我的问题是:我怎么知道哪个是y系统的输出?
编辑:好的,简单来说,我想像这样绘制解决方案:
a = 1 % what goes here? 1, 2, 3, 4 or 5?
plot(tout, xout(:,a))
Run Code Online (Sandbox Code Playgroud)