Differential Equation and Engineering gapplication ATH 220 Application of Laplace Tranform
Introduction to Laplace Tranform /3 For any function ft, it Laplace Tranform i given a: F t e f t dt 0 ft i aid to be in time-domain, where the independent variable, time t i a real quantity F [Laplace Tranform of ft] i aid to be in - domain, where independent variable, ia complex quantity
Introduction to Laplace Tranform 2/3 2 Laplace Tranform i a mathematical tool, which help in analyzing the ytem of interet. It take u from Time-Domain decription of ytem repreented by Differential Equation to a -Domain decription repreented by algebraic equation in variable. It i relatively l eay to olve algebraic equation, rather than the differential equation.
Introduction to Laplace Tranform 3/3 4 Solution of algebraic equation in, with zero initial iti condition, give Tranfer Function of fthe ytem. Tranfer Function Ratio of the Laplace Tranform of the output to the Laplace Tranform of input, when the initial condition are zero. Once we know the tranfer function of a ytem, we can eaily evaluate the repone of the ytem for any input ignal. The root of denominator of the tranfer function called a Pole of the ytem determine the tability of ytem. Sytem i STABLE if all pole have ve real part.
Propertie of Laplace Tranform 5
Propertie of Laplace Tranform 6
Some Ueful Laplace Tranform Pair 7
Application of Laplace Tranform to Differential Equation 8 Conider t order differential equation: y ' t ay t x t; y0 Taking Laplace Tranform of both ide, thi timedomain equation can be written in -domain a [ Y y0] a[ Y ] X Y X y0 a a Forced Repone Natural Repone
Application of Laplace Tranform to Diff ti l E ti 9 Differential Equation The repone of ytem to the forcing function alone i called forced repone: t y X Y f f t y X a Y f f The repone of ytem due to the initial condition of ytem only i called natural repone: 0 Y 0 t y y a Y n n The total repone of the ytem: The total repone of the ytem: t y t y t y n f
Application of Laplace Tranform to Differential Equation The tranfer function of the ytem i defined a: Tranfer Function H INPUT force, heat, where Y X OUTPUTdiplacement, temperature, N D IC I.C zero N and D are polynomial in. a The root of N are called ZERO of ytem. The root of D are called POLE of the ytem. 0
Application of Laplace Tranform to Differential Equation Tranfer Function Analyi: Repone of Sytem: Once tranfer function H of the ytem i known to u, the repone of ytem for any input can be calculated a: OUTPUT Y Tranfer Function H X, INPUT and y t Repone { Y } Stability of Sytem: The tability of the ytem can be checked from the pole of H, i.e., the root of the denominator polynomial D, a Sytem i STABLE if all pole have ve real part. L
Activity: Find the Laplace tranformation of the following o equation: 2 dx dx m B kx dt 2 dt f t 2What are the Force and the Natural repone of the ytem 3Find Tranfer Function
Activity: For the following TF, find zero and the tability of the ytem: H 2 5 6 2Find the correponding DE?
-Domain Analyi in ATLAB 4 Tranfer Function HRepreentation Uing ATLAB: H N 2 D 2 2 0 num[no, no2,, ] den[no, no2,, ] Jut name ytfnum,den Tranfer Function Generator Command
>> % Coefficient of N >> num[ 2]; >> % Coefficient of D >> den[ 2 0]; >> % Tranfer Function H of ytem >> ytfnum,den; 2 2 2 0 >> % Type y and check the reutl diplayed >>y Tranfer function: 2 -------------- OUTPUT ^2 2 0
Repone of Sytem Zero Initial Condition Impule Load Find H by defining: num and den uing: tfnum,den impuley,time
Impule Command compute the impule repone of a function Laplace Function [f,t] impuley,t; where t ti:dt:tf Time Example:Find impule repone of the following function for 0<t<30 : N 2 H 2 D 2 0
N 2 H 2 D 2 0 >> num[ 2]; % Coefficient of N >> den[ 2 0]; % Coefficient of D >> ytfnum,den; % Sytem Tran.Func. H >> t0:0.:30; % Time vector >> [h,t] impuley,t; >> plott,h, grid 8 u t
2Repone of Sytem Zero Initial Condition Sine or Square or Pule Load Find H by defining num and den uing: tfnum,den Generate ignal type uing: [x,t]genig type,period,duration,tep Solve ytem by: Solve ytem by: limy,x,time
20 -Domain Analyi in ATLAB Generating Signal: The ATLAB command genig g i ued to generate time-domain analog ignal. [u,t] genig Type,tau,tf,t Generate Signal Type ine, quare, pule tau Period one cycle tf Duration total time t Time pacing tep u value of ignal t correponding time intant
-Domain Analyi in ATLAB 2 >> % Generate and Plot Sine wave of period 5 ec for a total time of 30 ec. Total Time >> [u,t] genig'ine',5,30,0.; >> plott,u, grid Type Period Step u t
22 if H i given and it requete to find y t for x t Tranfer Function known H INPUT available Y X OUTPUTDeired? I.C zero Generate the input ignal xt uing genig 2 Generate Tranfer Function ytfnum,den 3 Ue limy,x,t
Ex.:Find repone of the following function N 2 H 2 D 2 0 >> % Sytem Tranfer Function H >> num[,2]; den[,2,0]; >> ytfnum,den; >> [x,t] genig'ine',5,30,0.; >> lim y,x,t; 23 input output
Initial Condition are not zero Find H by defining: num and den uing: ytfnum,den Find tate pace by uing: [A,B,C,D]tf2num,den Generate ignal type uing: [x,t]genig type,period,duration,tep Solve ytem by: lima,b,c,d,x,time,ic
25 Repone of Sytem Non-zero Initial Condition: H i given and it i requeted to find y tfor x t Generate the input ignal xt Repreent the ytem in State- pace form uing tf2num,den lima,b,c,d,x,t,x0; where y i ytem decription i tate-pace and x0 i initial tate vector
>> % Sytem Tranfer Function H >> num[,2]; den[,2,0];, >> % Tranfer Function to State Space >> [A,B,C,D]tf2num,den; >> % Generate the input ignal xt >> [x,t] genig'ine',5,30,0.; >> lima,b,c,d,x,t,[0 5]; 26 output input
27 Application of Laplace Tranform. Thermal Sytem
Variable: Temperature: Ө [kelvin]] Heat flow rate, q [J/] 28 Element Law: Thermal Capacitance: & θ t [ qin t qout t ], C where C: thermal capacitance [J/K] Thermal Reitance: where R: thermal reitance of the path between the two bodie [K/J] q t [ θ t θ 2 t ], R θ perfect inulation R q θ 2
Example : 29 A thermal capacitance C, i encloed by inulation of reitance R. Heat i added at a rate q i t. The ambient temperature urrounding the exterior i Ө a. Find the ytem model in term of Өt, q i t, and Ө a.
Example : Differential Equation: 30 & θ t [ qin t qout t ], C where q t q t, in i q out t θ t θa. R Hence, θ i a C R & θ t θ t qi t θa. RC C RC & t q t θ t θ,
Example : -Domain Repreentation ti 3 Taking Laplace Tranform of the differential equation: qi θa θ θ 0 θ RC C RC q θ a θ θ 0 RC C RC i θ q C θa RC RC i θ 0 RC and θ t L qi θa θ 0 C RC RC { θ }
Example : Simulation Parameter 32 Simulate the thermal capacitance ytem for: C.0*0 3 J/K, R2.0*0-3 -K/J, Ө a 300 K, and q i t000 K. Aume Ө0Ө a 300 K.
Example : Function for ODE Solver 33 function dthetadt ThermalExt,theta R2e-3; Ce3; qi000; theta_a300; dthetadt[/r*c*theta/c*qi/r*c*theta_a];
Example : ATLAB Simulation ODE analyi qi θa θ θ 0 θ RC C RC q i θa θ θ 0 RC C RC >> clear all, clc >> t0:30; >> [t,theta_ode] ode45'thermalex',t,[300]; q C tranfer function Analyi θ θa RC θ 0 RC RC i 34 qi θa θ 0 C RC RC >> R2e-3; Ce3; qi000; >> theta_a300; theta_zero300; >> num [theta_zero,/c*qi/r*c*theta_a]; >> den [, /R*C, 0]; >> ytfnum,den; >> [theta_tf, t2]impuley, t; >> ubplot2,,, plott,theta_ode, title'ode Analyi' >> ubplot2,,2, plott2,theta_tf, tf, >> title'tranfer Function Analyi'
Example : ATLAB Simulation Reult 302 ODE Analyi 35 30 300 0 5 0 5 20 25 30 302 Tranfer Function Analyi 30 300 0 5 0 5 20 25 30
Example 2: 36 Conider the following thermal capacitance, C, of temperature Өt. It i aumed that the ytem i perfectly inulated except for the thermal reitance R and R2. Heat i added at a rate qit, and the ambient temperature i Өa.
37 Example 2: Diff ti l E ti Differential Equation: [ ], t q t q where t q t q C t out in θ& 2, t R t R t q t q t q where a a out i in θ θ θ θ, 2 2, 2 R R C t R R C t q C t Hence R R i θ a θ θ&. 2,, 2 2 R R C a C b b t aq t b t R R C R R C C i θ a θ θ& 2,, R R C C q a i
Example 2: -Domain Repreentation ti Taking Laplace Tranform of the differential equation: aqi bθa θ θ 0 bθ [ ] aqi bθa b θ θ 0 38 θ θ 0 [ aq ] i bθa [ b] and θ t L { θ }
Example 2: Simulation Parameter 39 Simulate the ytem for 5 ec. C.0*0 3 J/K, R2.0*0-3 -K/J, R2.5*0-3 -K/J, Ө a 300 K, and q i t000 K. Aume Ө0Ө a 300 K.
Example 2: Function for ODE Solver 40 function dthetadt ThermalEx2t,theta Ce3; R2e-3; R2.5e-3; a/c; b/c*/r/r2; qi000; theta_a300; dthetadt [-b*thetaa*qib*theta_a];
Example 2: ATLAB Simulation 4 clear all, clc t0:0.:5; ODE analyi [t,theta_ode] ode45'thermalex2',t,[300]; Tranfer function Analyi R2e-3; R2.5e-3; Ce3; qi000; a/c; b/c*/r/r2; theta_a300; theta_zero300; θ num [theta_zero,a*qib*theta_a]; den [,b,0]; ytfnum,den; [theta_tf, t2]impuley,t; a/c; b/c*/r/r2; θ 0 [ aqi b θa ] [ b] ubplot2,,, plott,theta ode, title'ode Analyi' ubplot2,,, plott,theta_ode, title ODE Analyi ubplot2,,2, plott2,theta_tf, title'tranfer Function Analyi'
Example 2: ATLAB Simulation Reult 30 ODE Analyi 42 300.5 300 0 2 3 4 5 30 Tranfer Function Analyi 300.5 300 0 2 3 4 5
43 Application of Laplace Tranform 2. echanical Sytem
Variable: 44 Diplacement x Velocity vdx/dt Acceleration adv/dt Element Law: a Newton econd law: d f mv dt d d f mv m v ma dt dt mx & x v a m f
Element Law: 45 Friction Friction reitance force: f B Δv B v 2 v f f v m B v 2 m 2 dahpot repreentation v 2 m 2 xxxxxxxx m v Oil film repreentation Stiffne Stiffne reitance force: B f kδx k x x 2 2 x m k x 2 m 2
Example 46 Conider the following model xt B K f a t, K00, B2 Obtain differential equation repreentation. Obtain -domain repreentation Simulate the ytem for following cae: CASE : Initial Condition are zero, and f a t0 CASE 2: Initial Condition are zero, and f a t 50 in2t i2t CASE 3: I.C. x[2.5; 2.5],and f a t 50 in2t
Example - Differential Equation B && x x& K x f a B K xt f a t 47 Kx Bx& && x f a
Example - -Domain Repreentation 48 Example Domain Repreentation B 0 0 2 2 K B x x B K B F X a & 2 2 K B K B 0 0 x x B F a f &., 2 2 K B X K B X n f
Example - CASE 49 Example CASE CASE : Initial Condition are zero, and f a t0 Initial condition are zero, and hence, we need to determine the forced repone due to the forcing function only. F t f a a 0 0 0 N F X a 2 2 D K B K B X
Example - Function for ODE Solver 50 function dzdt echext,z ; K00; B2; fa0; %fa50*in2*t; dzdt [ z2; -B/*z2-K/*z/*fa ];
Example CASE ATLAB Code 5 clear all, clc t0:0.005:20; % Simulation Time %ODE analyi [t,z_ode] ode45'echex',t,[0;0]; % tranfer function Analyi ; K00; B2; fa0; num [fa/]; den [ B/ K/ 0]; ytfnum,den; [x_tf, t2]impuley, t; X 2 0 B K ubplot2,,, plott,z_ode:,,title'ode Analyi' ubplot2,,2, plott2,x_tf, tf, title'tranfer Function Analyi'
Example CASE ATLAB Simulation Reult 52 0.2 ODE Analyi 0 0. 0.2 0. 0 0 5 0 5 20 Tranfer Function Analyi 0 0 5 0 5 20
Example - CASE 2 53 CASE 2: Initial Condition are zero, and f a t50 in2t Some inuoidal force i applied, and initial condition are zero, therefore, in order to perform -domain analyi, we proceed a follow: Generate the input ignal uing genig Determine the tranfer function for the ytem Simulate the ytem uing lim H X N B Fa D 2 IC 0 K
Example CASE 2 ATLAB Code clear all, clc 54 t0:0.005:20; % Simulation Time %ODE analyi [t,z_ode] ode45'echex',t,[0;0]; 2 B K % tranfer function Analyi % Parameter X ; K00; B2; % Generate the input ignal fat [fa,t] genig'ine',pi,20,0.005; fa50*fa; % Sytem Tranfer Function H num [/]; den [ B/ K/]; ytfnum,den; % Sytem Repone xlimy,fa,t; ubplot2,,, plott,z_ode:,, title'ode Analyi' ubplot2,,2, plott,x, title'tranfer Function Analyi'
Example CASE 2 ATLAB Simulation Reult 55 ODE Analyi 0-0 5 0 5 20 Tranfer Function Analyi 0-0 5 0 5 20
Example - CASE 3 56 CASE 3: Non-Zero Initial Condition and f a t50 in2t Some inuoidal force i applied, and initial condition are non-zero, therefore, in order to perform -domain analyi, we proceed a follow: Generate the input ignal uing genig Determine the tranfer function for the ytem Trnafrom the ytem fuction to tate-pacepace form Simulate the ytem uing lim, with give initial condition H X F N D B a 2 IC 0 [A,B,C,D] tf2num,den K
Example CASE 3 ATLAB Code clear all, clc t0:0 0:0.005:20; 005:20; % Simulation Time %ODE analyi [t,z_ode] ode45'echex',t,[2.5;2.5]; % tranfer function Analyi X N % Parameter H ; K00; B2; F D IC 0 % Generate the input ignal fat [fa,t] genig'ine',pi,20,0.005; fa50*fa; % tate pace ytem [A,B,C,D]tf2num,den B a 2 xlima,b,c,d,fa,t,[2.5;2.5]; ubplot2,,, plott,z_ode:,, title'ode Analyi' ubplot2,,2, plott,x, title'tranfer Function Analyi' 57 K
Example CASE 3 ATLAB Simulation Reult 4 ODE Analyi 58 2 0-2 0 5 0 5 20 4 2 0 Tranfer Function Analyi -2 0 5 0 5 20
59 Application of Laplace Tranform 3. Electrical Sytem
Variable: Voltage v volt Current i ampere 60 Element Law: Reitor Ohm law: i v R v Ri R reitance in ohm Open Circuit R infinite Short circuit it R zero
Element Law: 6 Capacitor v - i Curren through h capacitor i q Cv given a C capacitance in farad dq d Cv dv i C dt dt dt dv idt, C by integrating, the voltage acro capcitor i given a t v t v t 0 i λ dλ C t 0
Element Law: Inductor L - v i v L di dt which can be re - arrnaged a di vdt L which can be olved a t i t i t 0 v λ dλ L t 0 L inductance in henry 62
-Domain Circuit Analyi 63 RESISTOR v t Ri t R Tranforming thi equation, we get R V R I R R v t i t R R - R or I V R R R
-Domain Circuit Analyi 64 v C or CAPACITOR t v t i C C t 0 C ic λ dλ t t C 0 dv C t dt Tranforming thi equation, we get V v t C i t C C c o I C C v C t - C or I CV CV Cv t C C C 0
-Domain Circuit Analyi 65 INDUCTOR v L t L di i t L dt i L v L t - L or i L t i L t 0 v L λ dλ L Tranforming thi equation, we get or V t t 0 L L I L Li t0 i L t0 V L I L 0 L
66 Example For the circuit hown in the Figure, v i 0V, R 0,000000 Ω, C 0μF. vi R C v o t Uing Nodal analyi, find the mathematical model that repreent the circuit conidering the initial condition equal to zero and a time interval of 0 to 20 m. Ue atlab to find the numerical olution of the model. Solution: Uing Nodal Analyi: R v i v o dvo t C dt t v v t dvo i o dt CR CR vi v o R C v o t
Simulation Uing ODE Solver dvo dt t v v t o i o CR CR vi clear [t,v] ode45 ELEC_Ex',[0 0.5],[0]; plott,v:,, title The Output Voltage'; xlabel'time t'; ylabel Voltage V '; function dvdt ELEC_EXt,v Vi 0; R 0000; C 0e-6; dvdt [ V / C*R - v / C*R]; v o 67 R C v o t
Simulation Reult Uing ODE Solver 68 0 The Output Voltage 8 Voltag ge V 6 4 2 0 0. 0.2 0.3 0.4 0.5 0 time t
Example Analyi in -Domain 69 V o [ V ] i v C t 0 RC RC Voltage H v Tranfer Function RC V o V i RC
Example Analyi in -Domain 70 CASE : v i 0V, R 0,000 Ω, C 0μF Vct0 0 Capacitor i initially dicharged clear all, clc t0:0.005:; % Simulation Time % ODE analyi [t,v] ode45'elec_ex',t,[0]; % tranfer function Analyi R0e3; C0e-6; num2 [0/R*C]; den2 [ /R*C 0]; y2tfnum2,den2; V o RC 0 RC [vc, t3]impuley2, t; ubplot3,,, plott,v:,, title'tranfer Function Analyi' ubplot3,,2, plott3,vc,
Example Analyi in -Domain 7 CASE : v i 0V, R 0,000 Ω, C 0μF Vct0 0 Capacitor i initially dicharged V o RC 0 RC
Example Analyi in -Domain 72 CASE 2: v i 0 in2*pi*50*t t, R 0,000 Ω, C 0μF Vct0 0 Capacitor i initially dicharged clear all, clc t0:0.00:; % Simulation Time % ODE analyi [t,v] ode45'elec_ex',t,[0]; % tranfer function Analyi % Generate the input ignal tau/50; [vi,t2] genig'ine',tau,,0.00; vi0*vi; % Parameter R0e3; C0e-6; num2 [/R*C]; den2 [ /R*C]; y2tfnum2,den2; H v RC RC vclimy2,vi,t2;
Example Analyi in -Domain 73 CASE 2: v i 0 in2*pi*50*t t, R 0,000 Ω, C 0μF Vct0 0 Capacitor i initially dicharged H v RC RC