Deterministic Modeling and Simulation with matlab simulink

profileor103b
assignment.pdf

Deterministic Modeling and Simulation 

1. This problem describes the immune response triggered by encountering foreign antigens.  This is called the cytotoxic T cell or CTL response.   Suppose that z eliminates infected cells.  There are 4  variables: uninfected cells, x, infected cells, y, free virus particles v, and CTL cells z.  The equations are: 

x dx xv y xv ay pyz v ky uv z c bz

λ β β

= − − = − − = − = −

&

&

&

&

Uninfected cells are produced at a constant rateλ , die at a rate dx and are lost to infection at a rate of  xvβ .  Infected cells are produced from uninfected cells and free virus at the rate, xvβ  and die at a rate 

ay and are lost to CTL cells at a rate of pyz.  Free virus is produced from infected cells at a rate ky and die  at a rate uv.    The CTL cells are produced at a rate of c and die at a rate of b.  Parameter values are 

1; 0.01; 0.05; 0.005; p=1; 50; 5; 0.05.d a k u bλ β= = = = = = =  

a). Let c=0.  This produces no CTL response, or what happens without an immune system.   Simulate the above systems with initial values of 

( ) ( ) ( ) ( )

0 10

0 1;

0 1;

0 0

x

y

v

z

=

=

=

=

Determine the steady state value by running the simulation and by running the “trim” function.   Check  answers with the equations. 

b). Let c=10.  This is a strong immune response.  Repeat part (a) and compare the steady‐state  results via simulation and the trim function. 

c). Let c=0.05 to simulate a weak immune response.  Repeat part (a) and compare the steady‐ state results via simulation and the trim function. 

d). For part a, linearize the system using the “linmod” function around the steady‐state result for  part a. 

a. Write the state equations for this system

b. Add a new state in which  3 dx y y= −& where dy is the unit step and represents the desired

output of the system.  Write the new state equations treating dy as another input.

c. Now, pick a vector  [ ]1 2 3, ,k k k=k such that if u = −kx , the new states will have roots of the characteristic equation at ‐2, ‐3, and ‐4.  

d. Simulate the system and observe the output y and compare the response for yd = step input to the step response of the system without control.

3. Consider the control system shown below.  This system might represent the control of a DC motor.

We want to position the shaft to angle determined by, comψ .  The problem is to choose the parameters  Kr, the tachometer feedback and Kp, the motor shaft position, so as to minimize the integral squared 

error between the command input and the controlled output,ψ .  The command input is 5comψ = degrees and is shown as a step input of amplitude 5.  

4. The system of problem1 has the same parameters except that b, p and beta are different, but are between 0 and 1.5  in problem1.  The file prob_1_data.mat has the data from a simulation where the  first column is time, the second is x, the third is y, the fourth is v and the fifth is z.  In the data, the initial  condition for z is 0.5 not 0.  Write the Matlab® code to estimate the unknown parameters, b p and beta.  

psi_dot psi

5

Kr

tach

psi=5

Kp

position

1 s

motor int

5

10s+1 motor

5

amplifier Subtract1

Subtract

4). Do problem 7.17 on page 609.

Use a minimum square error criterion between the data and the model output to generate the parameter estimates.

2. Consider the following differential equation:

2

2

d y +

dy 3 2 y+ = u

dt dt