Simple MATLAB / Octave Modeling

This should be a very simple question for those who have some experience in this field, but I'm still new to this.

I have the following system (or here is the image with the best resolution ):

alt text http://img199.imageshack.us/img199/2140/equation1.png

Given the following input:

u = min(2 - t/7.5, 2*(mod(t, 2) < 1)); 

I need to build the output of system y .

I describe a system with the 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 modeling with ode23 , for example:

 [tout, xout] = ode23(@func, [0 15], [1.5; 3; -0.5; 0; -1]) 

After the simulation, xout will have five columns. My question is: how do I know which one is the output of the y system?

EDIT: Well, so to make it simple, I would like to build such a solution as follows:

 a = 1 % what goes here? 1, 2, 3, 4 or 5? plot(tout, xout(:,a)) 
+4
source share
2 answers

One that matches y, which seems to be equal to x (1),

If you compare your code with the equations, you will see that x (1) appears in the code every time where y appears in the equations. That would be my best guess.

+3
source

[T, Y, TE, YE, IE] = ode23 (odefun, tspan, y0, options)

The following table lists the output arguments for solvers.

  • T Column of time point vectors.
  • array of solutions Y. Each row in Y corresponds to the solution at the time returned in the corresponding row T.
  • TE The time at which the event occurs.
  • YE Decision during the event.
  • IE Index I function an event that disappears.

Isten fizesse!

+1
source

Source: https://habr.com/ru/post/1299279/


All Articles