You are on page 1of 17

Lets do Figure 3! ...

lol
A Suave Man and a Stunningly Attractive Woman March 22, 2013

Identifying the System


We decided to move forward with the negative feed-forward circuits depicted below. The state variables for systems A and B are x1 and x2 . The parameters for system A are X0 , k1 , k2 and k3 , Km ,Vm , where X0 is the constant system input. The key dierence between these two systems is the location that X1 acts as an inhibitor - either v2 or v3 .

Figure 1: Systems A and B

Modeling the System


System A
System A can be modeled by the following mathematical model. v1 d x1 1 1 0 dx v2 = d x2 0 1 1 dx v3 Where: v1 = k1 X0 k2 x1 , v2 = Vm (x2 1 + 12x1 ) , 2 10x1 + x1 + Km v 3 = k 3 x2

System B
System B can be modeled by the following mathematical model. v d x1 1 1 0 1 dt v2 = d x2 0 1 1 dt v3 Where: v1 = k1 X0 k2 x1 , v2 = k 4x2, v3 = V m x2 (x2 1 + 12x1 ) 2 10x1 + x1 + Km

Exploring Parameter Space via Concentration Proles


The parameters that we manipulated for each system were X0 , Vm , and Km . The graphs below show the resulting concentration proles as they reach steady state for variances in each of the parameters. Each of the following manipulation of variables is done with the other system parameters set equal to each other, that is, only the variable in question varies between each of the gures.

System A
Figure 2 depicts the changes in Km for system A are shown below. We can see that as Km is increased, x1 responds my reaching steady state more quickly. However for the Km = 0.5 line, x1 reaches a very small steady state. The same is true for x2 at this Km value. This goes to show that system A has at least two potential steady states and that Km serves to be a determinant in the switch between the two dierent states. The third gure varies Vm for the system. Vm acts as sort of a rate scaling factor, for low Vm we see a build up of x1 and a very low stead state concentration of x2 , as would be expected. The inverse is true for large values of Vm . Because v2 is increased, we see small steady state concentrations of x1 and large concentrations of x2 . As X0 varies, the initial portion of the concentration proles of x1 are very predictable, since v1 is linearly dependent on X0 . However, as x1 increases, its aect on v2 is felt, dampening v2 . This means that while x1 increases rapidly initially it has a low concentration which means that v2 is fast, causing x2 to increase rapidly as well. However, as x1 increases, v2 is drastically lowered and thus the concentration of x2 falls (due to the waste rate). Once again, we can see that the systemm is able to reach two steady states.

Figure 2:

Figure 3:

Figure 4:

System B
Now that Km is the waste rate of x2 , it makes sense that for various Km the concentration prole would not vary. However x2 is aected. For increasing Km , x2 trends toward the same steady state value, although at slightly dierent initial speeds. When some large, critical Km value is used for the system, x2 reaches a dierent steady state concentration. Once again we notice that x1 does not depend on v3 . x2 however does and tends to increase more rapidly as Vm is decreased. This is logical because Vm directly multiples v3 and for low values it suppresses v3 , the rate at which x2 goes to waste. When this waste rate decreases, x2 builds up in the system. For extremely small Vm , it seems to nd a third, very large, steady state. For gure 7, we varied the input, X0 . As would be expected, x1 varies linearly with X0 , changing the steady state concentration accordingly. This has a direct aect on the concentration prole of x2 because interdependence. In system B, v1 and v2 are linearly determined so x1 and x2 increase as X0 increases. x2 increases even more greatly because v2 is not inhibited by x1 and instead the waste rate for x2 is inhibited by x1 . So the greater the x1 concentration the lower the waste rate is and the more x2 builds up in the system. The reason x2 does not go o to innity is because v1 is reversible and as x1 increases some of it is converted back to X0 , preventing instability.

Figure 5:

Figure 6:

Figure 7:

Linearization
Linearization is an important tool that allows us to better characterize the system and its response around the point of linearization, meaning that the result of linearization is only valid for small perturbations of the state variables. Systems A and B can be linearized using the following equation: dx dv dv =N x+N dt dx dp Where: 1 1 0 0 1 1 dv1 dv1 v1 x 0 dx dx 1 2 1 dv dv2 dv2 v2 0 = dx1 dx = x 1 2 dx v3 dv3 dv3 0 x 2 dx1 dx2 dv1 v1 X 0 0 dv dX dv2 = dX = 0 0 dp dv2 0 dX N=
0

System A
v 1 1 dx 1 1 0 x v2 x = 1 0 1 1 dt 0 v1 X0 0 x 1 1 0 0 0 1 + x2 0 1 1 v3 x 0 2

System B
v 1 1 dx 1 1 0 x v2 x = 1 0 1 1 dt v3 x 1 v1 X0 0 x 1 1 0 0 0 1 + x2 0 1 1 v3 x 0 2

The Transfer Function


System A
The transfer function is a useful characterization of the system because it allows us to develop a corresponding system response to any input after it has been transformed into the Laplace domain, simply through multiplication of the two. Taking the inverse Laplace of the result yields the system response in the time domain. Each state variable has a v 1 dv transfer function of the general form H(s) = (sI N d dx ) N dp . Where: v x1 0 F1 0 1 dv v2 2 0 = x1 0 = v x1 F2 dx v 3 0 x2 0 F3 v1 F dv X0 4 = 0 = 0 dp 0 0 It is useful to convert to elasticities when deriving the transfer function. In the above matrices, is the unscaled elasticity and is the scaled elasticity. Noting that, because of linearity, = 1. We can simplify the transfer function by dening: F1 = v1/x1 , F2 = v2/x1 , F3 = v3/x2 , F4 = v1/X0

Plugging these in to get the transfer function of system A results in: F4 (s + F3 ) 2 F4 ( v x1 F 2 ) HA (s) = 2 v2 s + s( x1 F2 + F3 F1 ) + F3 (

v2 x1 F2

F1 )

System B
For system B, the N and dv/dp matrices remains the same as those from system A, but v3 after dening F5 = x , dv/dx becomes: 1

v 1 1 dv x v2 = x 1 dx v3 x 1

F1 0 v F 0 = x2 1 2 v3 F v3 x x1 5 2

0 0 v3 F x2 3

The transfer function of system B , then becomes:


3 F4 (s + v x1 F3 ) v F4 (F2 x3 F ) 1 5 HB (s) = 2 v3 3 s + s( x2 F3 + F2 F1 ) + v x2 F3 (F2 F1 )

Frequency Response
Deriving the frequency response H (j ) is done by replacing s in the transfer function with j .

System A
F4 (j + F3 ) 2 F4 ( v x1 F2 ) HA (j ) = 2 (j )2 + j (F1 + v x1 F2 + F3 ) F1 F3 +

v2 x1 F2 F3

Multiplying HA (j ) by the complex conjugate of the denominator removes the imaginary term from the denominator, which allows us to split the resultant into real and imaginary parts. After laborious algebra and several sacriced goats, the frequency response for A becomes: 2 + j 2 + j HA (j ) = 4 + 2 ( 2 2 ) + 2 Where: = F3 (
v2 x1 F2

F1 ),

= F3 +

v2 x1 F2

F1 ,

= F4 (j + F3 ),

= F4 (

v2 x1 F2 )

System B
3 F4 (j + v x1 F 3 ) v 3 F4 (F2 x1 F5 ) HB (j ) = v3 2 (j ) + j ( x2 F3 + F2 F1 ) +

v3 x2 F3 (F2

F1 )

After several more bowls of goats blood spread across the altar: 2 + j 2 + j HB (j ) = 4 + 2 ( 2 2 ) + 2 8

Where: =
v3 x2 F3 +F2 F1 ,

v3 x2 F3 (F2 F1 ),

= F4 (j +

v3 x1 F3 ),

= F4 (F2

v3 x1 F5 )

Exploring Parameter Space via Bode Plots


The separation of the imaginary and real parts of the frequency responses above allow us to create Bode plots of the systems to see the eects that the parameters have on them.

System A
Looking at gure 8, we see the bode plot of x1 for system A. For larger elasticities, represented in the gures as more red, the frequency response is extended and the system response is less damped at higher frequencies. This suggests that at higher rates, the system in x1 concentration is able to reproduce the amplitude of the input for increasingly larger frequencies, and is therefore less aected by external changes. The higher elasticities also have a more responsive degradation step, reducing the DC gain. For negative elasticites, the phase begins at zero and approaches a 90 shift in response to high frequencies. Positive elasticities start inverted at 180 and then approach 90. Smaller elasticities approached 90 sooner than the larger elasticities.This is most likely 2 due to the imaginary part of the frequency responses numerator being a function of v x1 . We know that v2 is heavily dependent of x1 therefore it would make sense that as the frequency of the input is increased the phase would congregate because at higher frequencies the system will diminish the output in response to the input. When the system is not responding to the input because of high frequency the phase should be the same for the dierent elasticities. x2 shows little to no eect of the elasticity on the magnitude plots. However, the phase plot is dependent on both sign and magnitude. The negative elasticities result in phase plots that deviate from 0 to about 45 and then return to 0. Positive ones, on the other hand, go from 0 to 180, as is seen in gure 9. I have no idea how to interpret why this phase shift and then lack of phase shift happens. It could be that the system is resistant to specic frequencies, somewhat like an inverse resonance frequency of the system.

Figure 8:

Figure 9:

10

System B
x1 is very interesting, in that there is no dierence in any of the plots. The phase shift is constant at 90 for all elasticities. This makes sense because x1 depends on v1 and v2 . The only elasticities that the transfer function depends on, and that we manipulated, were with respect to v3 . Therefore it is logical that the changing of elasticities does not aect either phase or magnitude. In general, x2 also shows little dependency of elasticity on the magnitude spectrum. The negative elasticities had phases that started at 270 and whent to 180, having a net positive 90 shift. Positive elasticities, on the other hand, have a negative 90 phase shift for higher frequencies. Once again, because we have never seen a system such as this one, it is dicult to interpret what these phase shifts actually mean with regard to our system. But it does make sense, following the logic stated for the frequency response of x1 from system A that at high frequencies the phase shift would be the same for each category of elasticities.

Figure 10:

11

Figure 11:

Stability
The stability of a system can be determined by looking at the characteristic equation, or the denominator of the transfer function. Having all negative roots indicates stability, therefore we need to determine the conditions under which the roots are all negative. For a quadratic 2 4ac b b equation in the form of ax2 + bx + c, the roots are given by 2a The characteristic equations for the two systems are:

System A
s2 + s(F1 + a = 1, b = F3 +
v2 x1 F2 v2 x1 F2

+ F3 ) F1 F3 + F1 ,

v2 x1 F2 F3 v2 x1 F2

c = F3 (

F1 )

System B
s2 + s( a = 1, b=
v3 x2 F3

+ F2 F1 ) + + F2 F1 ,

v3 x2 F3 (F2

F1 )
v3 x2 F3 (F2

From these, a is always positive. In order for the roots to be negative then, b b2 4ac < 0. Due to the , b2 4ac must be less than b. Rearranging shows that b2 4ac < b2 will 12

v3 x2 F3

c=

F1 )

give negative roots, therefore ac must be positive. As stated before, because a is positive, being 1 for both systems, the system is stable at long as c is positive. If b is negative, the system is not stable because the discriminant should always be positive if there are two real roots and as a result, the roots will not be negative. Generalizing these conditions, we can say that the system will be stable if a, b, and c are all positive. In terms of Fs and elasticities, system A is unstable when: F1 > System B is unstable when: F1 >
v3 x2 F3 v2 x1 F2

+ F3

or

F1 >

v2 x1 F2

+ F2

or

F1 > F2

Sadly, all good things must come to a close...


This project analysis has been a painstakingly wonderful experience. We have been able to take the general concepts that were learned in BIOEN 336 and apply them to a completely new and unstudied system. It is pretty awesome that in a single quarter we have gained the tools that allow us to characterize a given system and explore how it responds with dierent parameters. There is some satisfaction in characterizing and analyzing a system that cant just be looked up on the internet because there are not known systems like this, and if there are they go unstudied.

Matlab Code
Generation of Bode Plots
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

clear all ; close all ; clc ; F1 F2 F3 F4 F5 =1; = 1; = 1; = 1; = 1; % varying e l a s t i c i t y

E = 20:4:20;

for i = 1:11 i f abs (E( i ) ) > 15 color = { r }; e l s e i f abs (E( i ) ) > 10 color = { y }; e l s e i f abs (E( i ) ) > 5 13

17 18 19 20 21 22 23 24 25

color = { g }; else color = { b }; end end end s=t f ( s ) ; figure (1) Hx1A = ( F4 ( s + F3 ) / ( s 2 + s (E( i ) F2 + F3 F1 ) + F3 (E( i ) F2 F1 ) ) ) ; bode (Hx1A , c o l o r { 1 } ) t i t l e ( x { 1 } o f System A ) h o l d on figure (2) Hx2A = ( ( F4 E( i ) F2 ) / ( s 2 + s (E( i ) F2 + F3 F1 ) + F3 (E( i ) F2 F1 ) ) ) ; bode (Hx2A , c o l o r { 1 } ) t i t l e ( x { 2 } o f System A ) h o l d on figure (3) Hx1B = ( F4 ( s + E( i ) F3 ) ) / ( s 2 + s (E( i ) F3 + F2 F1 ) + F3 E( i ) ( F2 F1 ) ) ; bode (Hx1B , c o l o r { 1 } ) t i t l e ( x { 1 } o f System B ) h o l d on figure (4) Hx2B = ( F4 ( F2 E( i ) F5 ) ) / ( s 2 + s (E( i ) F3 + F2 F1 ) + F3 E( i ) ( F2 F1 ) ) ; bode (Hx2B , c o l o r { 1 } ) t i t l e ( x { 2 } o f System B ) h o l d on end

26 27 28 29 30 31

32 33 34 35 36 37

38 39 40 41 42 43

44 45 46 47

Concentration Plots
1 2 3 4 5 6 7 8

clear all ; close all ; clc ; BVm = x l s r e a d ( System A C o n c e n t r a t i o n P r o f i l e s , Varying Vm ) ; BXo = x l s r e a d ( System A C o n c e n t r a t i o n P r o f i l e s , Varying Xo ) ; BKm = x l s r e a d ( System A C o n c e n t r a t i o n P r o f i l e s , Varying Km ) ; x = BKm( 2 : end , 1 ) ; x1 = [BKm( 2 : end , 2 ) ,BKm( 2 : end , 6 ) ,BKm( 2 : end , 1 0 ) ,BKm( 2 : end , 1 4 ) ] ; 14

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

x2 = [BKm( 2 : end , 3 ) ,BKm( 2 : end , 7 ) ,BKm( 2 : end , 1 1 ) ,BKm( 2 : end , 1 5 ) ] ; v a l u e = [BKm( 1 , 1 ) ,BKm( 1 , 5 ) ,BKm( 1 , 9 ) ,BKm( 1 , 1 3 ) ] ; s t y l e = { r . , g , . b , k } ; for i = 1:4 subplot (1 ,2 ,1) p l o t ( x , x1 ( : , i ) , s t y l e { i } ) t i t l e ( System A x { 1 } C o n c e n t r a t i o n P r o f i l e , Varying Km ) y l a b e l ( C o n c e n t r a t i o n ) ; x l a b e l ( Time ) ; h o l d on subplot (1 ,2 ,2) p l o t ( x , x2 ( : , i ) , s t y l e { i } ) t i t l e ( System A x { 2 } C o n c e n t r a t i o n P r o f i l e , Varying Km ) x l a b e l ( Time ) ; h o l d on l e g e n d I n f o { i } = [ Km = num2str ( v a l u e ( i ) ) ] ; end legend ( legendInfo )

Jarnac Code
System A
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

Jarnac 3 a : p = defn c e l l J1 : $X0 > X1 ; k1 X0k2 X1 ; J2 : X1 > X2 ; Vm (X12 + 12 X1) / ( 1 0 X12 + X1 + Km) ; X2 > $ waste ; k3 X2 ; end ; p . X0 = 3 . 5 5 ; p . X1 = 0 ; p . X2 = 0 ; p . waste = 0 ; p . k1 = 1 ; p . k3 = 1 ; p .Vm = 2 ; p .Km = 1 ; p . k2 = 0 . 4 m = p . sim . e v a l ( 0 , 1 0 , 1 0 0 ) ; s e t t i t l e ( C o n c e n t r a t i o n s o v e r Time , X0 = 3 . 5 5 ) ; graph (m) ; s e t x a x i s t i t l e ( Time ) ;

System B
1 2 3 4

Jarnac 3b : p = defn c e l l J1 : $X0 > X1 ; k1 X0k2 X1 ; 15

5 6 7 8 9 10 11 12 13 14

J2 : X1 > X2 ; k4 X1 ; X2 > $ waste ; Vm X2 (X12 + 12 X1) / ( 1 0 X12 + X1 + Km) ; end ; p . X0 = 5 ; p . X1 = 0 ; p . X2 = 0 ; p . waste = 0 ; p . k1 = 1 ; p . k4 = 1 ; p .Vm = 2 ; p .Km = 1 ; p . k2 = 0 . 4 m = p . sim . e v a l ( 0 , 1 0 , 1 0 0 ) ; graph (m) ;

16

17

You might also like