Mathematical Applications · BE5B15MAA · Topic 6 of 13
Introduction into Simulink: basic blocks, wiring techniques, examples
Week 6. A Simulink model draws an ODE as blocks: sources, sums, gains and a chain of integrators.
Key ideas
Blocks and wiring
The course models are built from Step, Sine Wave and Pulse Generator sources, Sum blocks with a sign list such as +−+, Gain, Product, Integrator with an initial condition, Transfer Fcn, Dead Zone and Scope blocks, solved by ode45 up to a stop time. The order of the signs follows the order of the input ports.
From an ODE to an integrator chain
Solve the equation for its highest derivative and let a Sum block build it. Feed that signal into integrators in series: each output is the next lower derivative, and its initial condition is that derivative’s initial value. The model model_eng.slx realises y‴=u−5y″+y with y(0)=1, y′(0)=5, y″(0)=3.
Linear systems as Transfer Fcn
Transfer Fcn takes the coefficients of the numerator and the denominator in descending powers: [1] over [1 2 1] is 1/(s+1)². The roots of the denominator decide stability: a pole with a positive real part makes the system unstable. The commands tf, roots, step and bode do the same in the Matlab window.
In one line: Read a model from the highest derivative down: Sum, then integrators, with initial conditions on the integrators.
Formulas
- From an ODE to an integrator chain
- Linear systems as Transfer Fcn
Practice with worked solutions
Question 1
In model_eng.slx the Sum block (signs +−+) adds the pulse generator u, minus 5 times y″ from the Gain block, and plus y. Its output y‴ feeds three integrators in series with initial conditions y″(0)=3, y′(0)=5, y(0)=1. The pulse generator has a phase delay of 1 s, so u(0)=0. What is y‴(0)?
Worked solution
Answer: -14
At t=0 the pulse has not started, so y‴(0) = 0 − 5·3 + 1.
Question 2
In model_eng2.slx the first Sum (signs +−+) adds x2, subtracts 3·x1 (Gain 3) and adds the sine source u(t)=2+2.5·sin(2πt/3). Its output x1′ feeds the integrator with initial condition x1(0)=1, and x2(0)=5. What is x1′(0)?
Worked solution
Answer: 4
At t=0 the sine term vanishes, so u(0)=2 and x1′(0) = 5 − 3·1 + 2.
Question 3
In model_eng2.slx the second Sum (signs −+−) takes the Product x1·x2, then x1, then 5·x2 from the Gain block. Its output x2′ feeds the integrator with x2(0)=5, and x1(0)=1. What is x2′(0)?
Worked solution
Answer: -29
The signs are −, +, −, so x2′ = −x1·x2 + x1 − 5·x2 and at t=0 it is −5 + 1 − 25.
More Mathematical Applications practice in Ucenly
Sources
Written by Ucenly. Based on the BE5B15MAA course materials:
- Course card BE5B15MAA (Bílá kniha), p. 1
- Simulink model model_eng.slx, text description of blocks and wiring, p. 1
- Simulink model model_eng2.slx, text description of blocks and wiring, p. 1
- Simulink model model_eng3.slx, text description of blocks and wiring, p. 1
- Simulink model matlaeng.slx, text description of blocks and wiring, p. 1
- Matlab tutorial 2 slides of the department course APP (APP_cv2_Matlab.ppt, Czech), text extract, p. 1