Can I use matrix equations to create a custom component in Simscape language?

Can I use matrix equations to create a custom component in Simscape language?
I would like to create a custom Simscape component for which the dynamics are governed by an equation in matrix form. I know that I could convert the matrix equation into multiple scalar equations but I am wondering if I could directly use the matrix equation instead.

 Accepted Answer

Simscape language supports matrix and vector equations.
As an example, a dimensionless vector variable with two elements can be defined as follows.
 
variables
X = {[0; 0], '1'};
end
This variable "X" could then be used in a matrix equation as shown below.
 
equations
X.der == eye(2)*X;
end

More Answers (0)

Categories

Products

Release

R2015a

Community Treasure Hunt

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

Start Hunting!