Variable in a simulink state space matrix
Show older comments
How can I implement a matrix in a state space model in simulink that has a variable that is dependent on another component of the model signal such as an angle etc?
I have tried sending the signal to the workspace and calling in the matrix with a variable (of the same name) in it and it does not work.
Thank you.
8 Comments
David Wilson
on 20 Apr 2019
First up, you do realise that if you have a varying parameters in your state-space model, it is no longer a linear constant coefficient time-invariant ODE, so that means no more simple linear tools such as ss, lti etc. You have now a nonlinear model.
One way is to use a matlab funciton block to assemble you [A] matrix. Then you'll have to build your own dynamic ss model such as below (from my text book)

Sugs
on 20 Apr 2019
David Wilson
on 20 Apr 2019
Edited: David Wilson
on 20 Apr 2019
The book is free.
But I guess it still would be a waste of your time.
Andreas Bernatzky
on 20 Apr 2019
Hey Sugs,
David is right you would produce a non-linear model. But I will not bother you with it.
The picture David posted is the solution so ¯\_(ツ)_/¯ It means you can not use the built in StateSpace-Block you have to build your State-Space Model by your own. And a State-Space model consists of your 4 Matrices A,B,C,D.
Depending on your application you have to manipulate one of your matrices, but which one depends on your real system.
Sugs
on 20 Apr 2019
Star Strider
on 20 Apr 2019
@David Wilson — Thank you for the links! I’ll peruse them later.
Walter Roberson
on 22 Apr 2019
Edited: Walter Roberson
on 23 Apr 2019
Tunable models in Simulink correspond to ss() with a genmat() parameter, or to genss() .
When you have a tunable model, then at any one time each parameter has a distinct value, but you can change the parameter and the effect will be reflected on the model blocks. This differs from creating something like a symbolic representation with a variable name and using laplace transform and so on, in that for symbolic representations the calculation is generalized and the variable does not have a value until later, if ever. The MATLAB tools for symbolic control systems are mostly missing.
Sugs
on 23 Apr 2019
Answers (0)
Categories
Find more on Time and Frequency Domain Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!