math - Simple MATLAB/Octave simulation -
this should simple question has experience in area, i'm still new this.
i have following system (or here image better resolution):
alt text http://img199.imageshack.us/img199/2140/equation1.png
given following input:
u = min(2 - t/7.5, 2*(mod(t, 2) < 1));
i need plot output of system y.
i describing system following function:
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); ];
and simulating ode23
, this:
[tout, xout] = ode23(@func, [0 15], [1.5; 3; -0.5; 0; -1])
after simulation, xout
have 5 columns. question is: how know 1 output of y system?
edit: ok, put simple, i'd plot solution this:
a = 1 % goes here? 1, 2, 3, 4 or 5? plot(tout, xout(:,a))
the 1 corresponds y, appears x(1), of course.
if compare code equations, can see x(1) appears in code every place y appears in equations. best guess.
Comments
Post a Comment