1
\$\begingroup\$

All simulations I've done in simulink as yet have not matrix in their block diagram like the following picture : enter image description here

and they have block diagram structure like :

enter image description here

for simulating a system that has matrices with variable parameters in matrice ,in its structrue, how can use matrices as block diagram in it? for example for following system:

enter image description here

enter image description here

enter image description here

enter image description here

I can't set and adapt the dimesnsion of blocks.

\$\endgroup\$
2
\$\begingroup\$

If you want to build a block that has matrix operations there are to blocks that will let you do this, the Fcn block and the MATLAB function block, you can

enter image description here

You can carry through matrices with signals as shown below. The example shows a 1x3 vector multiplied by itself and displayed in the scope as a 3x3 matrix.

Care must be taken to ensure size is preserved for the matrix operation

enter image description here

But the math you have shown above does not make sense, as you should either be creating two states (for example \$x_4\$ should be split into two states) OR you should be carrying the \$x_4\$ through to simplify \$\dot{x_4}\$ to a scalar in your analysis of the system. Usually states are scalars at least with my experience with nonlinear control.

$$\left( \begin{bmatrix} u_2 \\ u_3 \end{bmatrix}+ \begin{bmatrix} \frac{-l K_4}{l_1} & 0 \\ 0 & \frac{-l K_4}{l_1} \end{bmatrix} \right) x_4 $$

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ thanks for your help although I don't understand solution for conditions that parameters of matrices are state variables. can you explain more? \$\endgroup\$ – Rwy5 Jan 25 '18 at 19:56
  • \$\begingroup\$ What do you want me to explain? You haven't defined your problem properly and you haven't taken the time to upvote. Where did you get the system you described above? \$\endgroup\$ – Voltage Spike Jan 25 '18 at 19:58
1
\$\begingroup\$

To perform matrix multiplication in simulation is as simple as using a gain block.

A gain block doesn't have to be a scalar, it can be a matrix.

enter image description here

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Thanks for your help, but my problem is the conditions, when elements of matrix are not scalar and they're variables such as the degree of pitching or rolling. what is your suggestion about this? \$\endgroup\$ – Rwy5 Jan 27 '18 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.