- #1
Twinflower
- 109
- 0
Homework Statement
The problem describes a two tank system where liquid is put into tank 1 and is flowing through a pipe from the bottom of tank 1 into the bottom of tank 2 where it is pumped out from the other side of the tank.
The liquid level of the tanks are described like this:
Tank 1:
[tex]-\frac{k}{A_1} x_1 + \frac{k}{A_1} x_2 + \frac{1}{A_1} u[/tex]
Tank 2:
[tex]-\frac{k}{A_2} x_1 + \frac{k}{A_2} x_2 + \frac{1}{A_2} v[/tex]
Where:
k = 0.01 (square meter pr second)
A1 = 2 (square meter)
A2 = 1 (square meter)
The attempt at a solution
I put this info into the follow matrices:
A = [-0.005, 0.005; 0.01,-0.01]
B = [0.5,0; 0,-1]
C = [0 1]
D = [0 0]
(This is the same values i enter in the State-Space dialog box in Simulink)
After the State-Space block, i put a DeMux followed by two scopes. One for Tank1 and the other for Tank 2.
The input for the State-Space block is a constant which describes the flow into tank 1.
This arrangement creates a nasty error messeage i don't understand as I am a newbie when it comes to MATLAB and simulink.
Error in port widths or dimensions. Input port 1 of 'oppgave2/State-Space' has 2 elements. This port does not accept the dimensions (or orientation) specified by the input signal.
Error in port widths or dimensions. Output port 1 of 'oppgave2/Constant' is a one dimensional vector with 1 elements.
What do I do wrong?