Skip to main content
1-Visitor
March 22, 2021
Question

Modeling ODEs in State Space and using test data as a forcing function

  • March 22, 2021
  • 1 reply
  • 3549 views

I am using Mathcad Prime 4.0 M010

Looking at Task3-1: "Modeling ODEs in State-Space" in the help file it does not appear that the C or D matrices are used in the state space solution. Can you explain how these matrices would be included? Also, is it possible to use test data (force vs time history from a load cell) for the input forcing function instead of an equation? If so how would this be accomplished. Thanks!

1 reply

19-Tanzanite
March 22, 2021

CornelBejan_0-1616444472544.png

 

With the first equation from above, you can simulate and visualize just the state variables (x1,x2,...xn).
The first equation from above includes only matrices: A and B.
The solution for the first equation has nothing to do with matrices C and D.

If you want to simulate and visualize some output variables then you must use the second equation in which you define C and D matrices.
If your system is physically achievable then D = 0, and therefore what you have left is just the C matrix.

Matrice D and C are used only if you want to use the second equation above (which is the output equation, meaning that in this equation you enter only output variables that do you want and need to see at the output of your system).
If you want to simulate just state variables then matrices A and B are necessary and sufficient.

19-Tanzanite
March 22, 2021

CornelBejan_0-1616446991763.png

The output equation is a linear combination of state variables, as you can see above.

19-Tanzanite
March 23, 2021

With the predefined function in Mathcad: state-space you can calculate your state variables, of course using only matrices A and B (because only they are involved in calculating state variables, ie the first equation above), at different times, as the first solution to see different variables/sizes that you want to view, and which are found in the second equation, defined by the matrices C and D, you can proceed as follows:

CornelBejan_0-1616494829891.png

CornelBejan_1-1616494846052.png

CornelBejan_2-1616494857065.png

CornelBejan_3-1616494872528.png

 

CornelBejan_4-1616494885837.png

CornelBejan_5-1616494897190.png

 

CornelBejan_6-1616494917740.png

Where: 

CornelBejan_7-1616495273011.png

But your C matrix can have output variables as many as you want (it does not have to be limited to just one).
I just choose 1 variable output to demonstrate an example of how it can be used.
The matrix D usually in physically achievable systems is 0, that's why we didn't include it, but it can be included.

 

Don't be scared that it appears red, that it's just a template to get an idea of ​​how it should be implemented.

You just set your example, with your matrices and that's about it.

Here is an example I found of what I have done in the past:

CornelBejan_8-1616495908803.png

CornelBejan_9-1616495918959.png

 

CornelBejan_10-1616495930807.png