1

Background: I have a complex mechanical oscillation system. With analogies I transformed it into an electrical circuit (every element is a RLC-oscillator). The only way to calculate the circuit is nodal analysis and it's too complex to do it by hand.

As the Symbolic Math Toolbox and the SimPowerSystems toolbox is not available, there is no convenient way to calculate the transfer function G(s) to use the transfer function block.

So I thought about using custom functions, but after consulting the documentation I'm still quite helpless. I hope to find some initial thoughts here.

My system can by described by the matrix equation:

A*x = y

where A is a 8x8 Matrix containing the RLC-impedances of my circuit, so basically every element is a polynomial Z(s) e.g. Z_11(s) = (s^1+2s^0)/(s^2+3s-s^-1) where s is the laplace-domain variable. The vector x is a 8x1 row vector containing my 8 scalar outputs. And y is a 8x1 row vector whose elements are either one of my 4 input signals or 0.

Finally I need a Simulink block with 4 inputs and 8 outputs which solves the linear equation system with s as variable.

Alternative I could imagine to use 4 blocks with just one input each (setting the other inputs to ´zero`) and superpose them. The selection of just one output is thinkable also.

Is there any way to implement this? How can I create a block, which works in the Laplace-Domain and not in the time-domain?

Robert Seifert
  • 25,078
  • 11
  • 68
  • 113

2 Answers2

1

You can use 4 Transfer Function (SISO) blocks as you suggested, but for a MIMO system such as yours, I would advise you to convert your system to or re-write it as a state-space representation and use a State-Space block instead.

am304
  • 13,758
  • 2
  • 22
  • 40
  • It doesn't really solve my problem. I'm currently working on a solution using the "LTI-System" Block of the Control System Toolbox, which allows me to evaluate my system matrix filled with transfer functions. If it finally works, I'll post it here. – Robert Seifert Aug 28 '13 at 15:11
  • In what way does it not solve your problem? The two approaches I suggested work (I have used them before), the state-space representation being a better way to model a MIMO system. – am304 Aug 28 '13 at 15:22
  • For several reasons. 1) people who are unfamiliar with my code need to use the model as well, I'm sure they can create the square system matrix, but I doubt they could create the state-space system. I also have my problems as some differential equations are 4th order or even higher. One single matrix for everything is just the most transparent. 2) I heard the conversion to ss matlab can do is not always reliable. 3) my first idea of using several SISO blocks seems to complicated as the system size is necessarily equal and I don't want to add blocks for every particular problem. – Robert Seifert Aug 28 '13 at 15:46
  • The solution I'm working on involves a ´n x n` transfer matrix, every element represents a single oscillation circuit. By inverting the matrix I can use the LTI-System block with multiple inputs and outputs. If it works, it seems to me to be clean solution. – Robert Seifert Aug 28 '13 at 15:51
1

The n x n system matrix needs to be defined with transfer functions:

W = minreal( [  tf( ... ) ... tf(...) ; ... ; tf( ... ) ... tf(...)  ];

e.g.:

Z_11(s) = (s^1+2s^0)/(s^2+3s-s^-1)

->

Z_11 = tf( [1 2 0] , [1 3 -1] );

Usually an inversion is necessary

H = inv(W);

This matrix can directly be included in the LTI-Sytem Block of the Control System Toolbox. The input and output vectors are embedded using mux and demux.

Internally the LTI system is using n*n of the proposed state space models, therefore it would be to complicated for big system to create them manually.

Robert Seifert
  • 25,078
  • 11
  • 68
  • 113