Message Boards Message Boards

0
|
6789 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Extract equations from a nonlilnearstatespace model ?

Posted 8 years ago

Hello all,

I have a complex set of ODE in the form :

y1'' = f(y1',y1,y2'',y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4) ; y2'' = f(y1'',y1',y1,y2',y2,y3'',y3',y3,y4'',....,y6'',y6',y6,u1,u2,u3,u4)  and so on ... y6''=(...)

As I want to resolve this coupled systeme in matlab using @ODE45... I wanted the equations in the form : y1''=f(y1',y1,y2',y2,....) and so on ... => X'[] = f(X[],U[])

So I have defined a NonlinearStateSpaceModel from my 6 very long ODE equations but it is very complex (12 states, 12 outputs, 4 inputs, 6 ODE)...

Mathematica had created the state space model and I'd like to extract the equations from the model ... The equations I want are in memory but I cannot visualize these because the are too big...

Is there a way to extract them so I can use them in matlab ?

Thanks you a lot...

2 Replies

Hello Thabks you very muche I'll try it !

Regards

If you have a nonlinear state space model of the form

nsys = NonlinearStateSpaceModel[{{u - x1 x2, u x2 + 1}, {x1}}, {x1, x2}, u]

nstatespace

You can extract the equations for the states:

In: nsys[[1, 1]]
Out: {u - x1 x2, 1 + u x2}

and for the outputs:

In: nsys[[1, 2]]
Out: {x1}

Hope that helps!

Patrik

POSTED BY: Patrik Ekenberg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract