Variable in a simulink state space matrix

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

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)
tmp.png
Are you trying to sell a book or something? That information was of no help on how to solve this situation. If you do have a way for me to use a variable in a matrix being fed into a simulink block please share the information, otherwise don't post things like this to waste my time.
The book is free.
But I guess it still would be a waste of your time.
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.
@ David, I apologize for the way I responded, but I did not see any link to your book in your first post, and I didn't know that you had a book with more information on the topic that I could access. I do understand that the system is nonlinear etc. I also understand that I cannot use the simple tools for a linear ss system, which I am not using. I have already built the system in Simulink, however the issue that I am having is using the variable in the matrix. I know it must be a simple solution to feed into the matrix, but I am missing it and that is the issue that I am referring to not the actual understanding of the system and building it as a whole. I didn't mean to be a jerk about it, but I didn't feel that the picture explained how to send a signal into a matrix within one of my blocks. If it does please clarify for me.
I suppose the part concerning the ss system can be ignored in my question. I simply want to know how to send a signal to a variable that lies within a matrix within a Simulink simulation.
Again, I apologize for the way I responded, and I do appreciate your willingness to help.
@David Wilson — Thank you for the links! I’ll peruse them later.
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.
@Walter Robertson Thank you for the information and the link. I will be looking more into it tomorrow.

Sign in to comment.

Answers (0)

Products

Release

R2019a

Asked:

on 20 Apr 2019

Edited:

on 23 Apr 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!