This assignment covers topics such as Laplace transform, impulse response, transfer function, and more using MATLAB. Solutions are provided for various problems including finding the steady-state amplitude, drawing free body diagrams, and partial fraction expansion.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
Running head: MATLAB1 MATLAB Name Institution
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
MATLAB2 MATLAB Assignment Question 1 Part a x''+2x'+x=5e−t+t Apply Laplace transform on both sides L{x''}+2L{x'}+L{X}=5L{e−t}+L{t} s2˙x−sx(0)−˙x(0)+2(s˙x−x(0))+˙x=5 s+1+1 s2 But we know thatx(0)=0∧˙x(0)=1. Substituting these into the above equation we get: s2˙x−1+s(s˙x)+˙x=5 s+1+1 s2 ˙x(s2+s+1)=1+5 s+1+1 s2 ˙x(s+1)2=1+5 s+1+1 s2 ˙x=1 (s+1)2+5 (s+1)3+1 s2(s+1)2 x=L−1 {1 (s+1)2}+5L−1 {1 (s+1)3}+L−1{1 s2(s+1)2} L−1 {1 (s+1)2}=e−tt
MATLAB3 5L−1 {1 (s+1)3}=5e−tt2 2 L−1 {1 s2(s+1)2}=t+2e−t+e−tt−2 x=e−tt+5e−tt2 2+t+2e−t+e−tt−2 Therefore,x=2e−tt+2e−t+5e−tt2 2+t−2 We can prove the answer using the MATLAB code, symsy(t) Dy = diff(y); ode = diff(y,t,2)+2*diff(y,'t',1)+y == 5*exp(-t)+t; cond1 = y(0) == 0; cond2 = Dy(0) == 1; conds = [cond1 cond2]; ySol(t) = dsolve(ode,conds); ySol = simplify(ySol) Part b⃛ y+3¨y+5˙y=⃛x+4¨x+6˙x+8x Apply Laplace transform on both sides (remember all initial conditions are zero) L{⃛y}+3L{¨y}+5L{˙y}=L{⃛x}+4L{¨x}+6L{˙x}+8L{x} L{⃛y}=s3Y(s)−s2y(0)−s˙y(0)−¨y(0)=s3Y(s) 3L{¨y}=3¿ 5L{˙y}=5¿
MATLAB4 L{⃛x}=s3X(s)−s2x(0)−s˙x(0)−¨x(0)=s3X(s) 4L{¨x}=4¿ 6L{˙x}=6¿ 8L{x)=8X(s) s3Y(s)+3s2Y(s)+5sY(s)=s3X(s)+4s2X(s)+6sX(s)+8X(s) Simplifying the above equation: Y(s)(s3+3s2+5s)=X(s)(s3+4s2+6s+8) G(s)=Y(s) X(s)=(s3+4s2+6s+8) (s3+3s2+5s) Using the final Value theorem, lim n→∞ ¿¿ Using MATLAB, the impulse response ofG(s)is shown below.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
MATLAB5 The MATLAB code used to obtain the above plot is: sys = tf([1 4 6 8],[1 3 5 0]); impulse(sys) We can see that the steady state amplitude equals 1.6. Therefore, we can see that the impulse response in MATLAB gives the same value as the Final Value theorem. Question 2 m1=400kg,m2=100kg,DampingCoefficient,B1=1000Ns/m Springconstant,k1=1600N m,Springconstant,k2=100000N m=105N m First, we have to draw the free body diagram of the system as shown
MATLAB6 Applying Newton’s second law of motion and writing the expressions of motion of the two masses: Formass1,m1¨Z=−{K1(Z−W)+B1(˙Z−˙W)} Finding the Laplace transform and simplifying we get: (m1s2+B1s+k1)Z(s)=B1sW(s)+k1W(s)…equation1 Formass2,m2¨W=K1(Z−W)+B1(˙Z−˙W)+K2(x−W) Finding the Laplace transform and simplifying we get: ¿ MakingW(s)the subject of the formula from equation 1, we get W(s)=(m1s2+B1s+k1)Z(s) B1s+k1
MATLAB7 Substituting this value in equation 2, ¿ Upon simplification we get: Z(s) R(s)=(B¿¿1s+k1)K2 m1m2s4+(m¿¿1+m2)B1s3+¿¿¿¿¿ Substituting the values in the above equation: Z(s) R(s)=(1000s+1600)105 40000s4+500000s3+(4×107+(500)1600)s2+108s+16×107 Simplifying Hence,Z(s) R(s)=2500s+4000 s4+12.5s3+1020s2+6500 Part b We can use the MATLAB code to plot the transfer function. H = tf([2500 4000],[1 12.5 1020 0 6500]); bode(H) The resulting plot is shown in figure 1 below
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
MATLAB8 Figure 1: Bode Plot of the System Using MATLAB Given that,r(t)=3sin(4πt) R(s)=L{3sin(4πt)}=3L{sin(4πt)=34π s2+16π2=12π s2+16π2 Z(s)=2500s+4000 s4+12.5s3+1020s2+6500R(s) Z(s)=2500s+4000 s4+12.5s3+1020s2+6500(12π s2+16π2)
MATLAB9 Part c When the input isr(t)=3sin(4πt), the peak occurs at t=3 seconds. The peak amplitude at this time equals -2.7. The MATLAB code for the above plot is: H = tf([2500 4000],[1 12.5 1020 0 6500]); bode(H) clf t=0:pi,1000*pi; u=3*sin(4*pi*t); lsim(H,u,t) sys=[1 12.5 1020 0 6500] roots(sys) Question 3 Part a
MATLAB10 The input voltage is 13 volts’ dc switched on at t=0. That is,V¿=13Vfort≥0 The Laplace transform,V¿(s)=13 s The inductor impedance in the s domain after Laplace transform¿sL The inductor impedance in the s domain after Laplace transform¿1 sC Vout(s) V¿(s)=Vo(s) Vi(s) Using Kirchhoff’s current law at the node where, R1=50mΩ=0.05Ω,C=100μF=0.0001F,∧R2=1Ωwe get, Vo 1 sC +Vo R2 +Vo−Vi sL+R1 =0 Substituting the value of capacitance, resistance and inductance, we get 0.0001Vos+Vo 1+Vo−Vi 0.05s+0.05=0 0.0001Vos+Vo 1+Vo 0.05(s+1)=Vi 0.05(s+1)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
MATLAB11 0.0001Vos+Vo 1+20Vo (s+1)=20Vi (s+1) Multiplying the equation by104(s+1)and simplifying we get: Vo(s2+10001s+210000)=200000Vi Vout(s) V¿(s)=Vo(s) Vi(s)=200000 s2+10001s+210000 Part b Given thatVi(s)=13 swe can substitute the value in the equationVo(s) Vi(s)to getVo(s) Vo(s) Vi(s)=200000 s2+10001s+210000 Vo(s)=200000Vi(s) s2+10001s+210000= 200000×13 s s2+10001s+210000 ¿ 200000×13 s s2+10001s+210000=2,600,000 s(s¿¿2+10001s+210000)¿ Using the quadratic formula, we can find the factors ofs2+10001s+210000as follows: s=−10001±√100012−4×210000 2=−5000.5±4979.458 s=9979.958∨s=21.042 Thus, we can substitute:
MATLAB12 s2+10001s+210000=(s+9979.958)(s+21.042) Vo(s)=2,600,000 s(s+9979.958)(s+21.042) 2,600,000 s(s+9979.958)(s+21.042)=A s+B (s+9979.958)+C (s+21.042) We can do a partial fraction expansion of the RHS of the above equation as follows: 2,600,000=A(s+9979.958)(s+21.042)+B(s)(s+21.042)+C(s)(s+9979.958) Ifs=0 2,600,000=A(0+9979.958)(0+21.042)=A(10001) A=2600000 209998.2762=12.381 Ifs=−9979.258 2,600,000=B(−9979.258)(−9979.258+21.042) B=0.0262 Ifs=−21.042 2,600,000=C(−21.042)(−21.042+9979.958) C=−12.4072 We can rewrite the equation as: Vo(s)=A s+B (s+9979.958)+C (s+21.042)=12.381 s+0.0262 (s+9979.958)−12.4072 (s+21.042) Taking the inverse Laplace transform of the above equation we get: Vo(t)=12.381+0.0262e−9979.958t−12.4072e−21.042t Part c How long it takes forVo(t)to reach 6V Vo(t)=12.381+0.0262e−9979.958t−12.4072e−21.042t 6=12.381+0.0262e−9979.958t−12.4072e−21.042t Simplifying
MATLAB13 6.381=12.4072e−21.042t−0.0262e−9979.958t Using the Excel function “What if Analysis” by following the following steps First, type the function=12.381+0.0262 {e} ^ {-9979.958t} -12.4072 {e} ^ {-21.042tin cell B3 as shown in the screenshot below: Second, type any value in cell B2. Then, go to Data→WhatIfanalysis→GoalSeek. After that, set the values as shown in the screenshot below. After clicking ok, Excel will return the value of t=0.031594411 as shown in cell B2 t(Vo=6V)=0.031594411s≈315.94×10−4Seconds Question 4 For the electrical part, we apply KVL to obtain ea−RaIa−LdIa dt−Kbωm=0 Ia= ea−LdIa dt−Kbωm Ra ButTm=KtIa
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
MATLAB14 Tm=Kt( ea−LdIa dt−Kbωm Ra ) Tm=Ktea Ra −KtL Ra dIa dt−KtKb Ra ˙θm Taking Laplace transform and assuming zero initial conditions Tm(s)=Kt Ra Ea(s)−KtL Ra (sIa(s))−KtKb Ra sθm(s)….equation1 For the mechanical part J¨θm=Tm−Kθm−b˙θm m¨x=k(x−θm)+b˙x Taking the Laplace transform and assuming zero initial conditions Js2θm(s)=Tm(s)−kθm(s)−bsθm(s) (Js2+k−bs)θm(s)=Tm(s) θm(s)=Tm(s) (Js2+k−bs) ms2X(s)=kX(s)−kθm(s)+bsX(s) ms2X(s)=kX(s)−kTm(s) (Js2+k−bs)+bsX(s) MakingTm(s)the subject of the formula we obtain Tm(s)=X(s){k+bs−ms2}{(Js2+k−bs)} k But we also know that, Tm(s)=Kt Ra Ea(s)−KtL Ra (sIa(s))−KtKb Ra sθm(s)….equation1 Substituting the value ofTm(s)into the equation yields
MATLAB15 X(s){k+bs−ms2}{(Js2+k−bs)} k=Kt Ra Ea(s)−KtL Ra (sIa(s))−KtKb Ra sθm(s) X(s){k+bs−ms2}{(Js2+k−bs)}=kKt Ra Ea(s)−kKtL Ra (sIa(s))−kKtKb Ra sθm(s) Rearranging and simplifying we obtain X(s) Ea(s)= kKt Ra b(s)+KKb s{(k+bs−ms2)(Js2+k−bs)−kKtL Ra (sIa(s))+kKtKb Ra s} Part b Inserting the values of the unknowns and simplifying we obtain X(s) Ea(s)=20s+1 20s3+42s2+52s+100 ea(t)=24u(t) L−1 {X(s) Ea(s)}=L−1 {20s+1 20s3+42s2+52s+100} Part c For an input ofea(t)=24u(t) Ea(s)=24 s X(s)=20s+1 20s3+42s2+52s+100Ea(s)=24(20s+1) 20s3+42s2+52s+100 1 s The step response of the system can be determined via MATLAB to obtain:
MATLAB16 The MATLAB code to obtain the output is: sys=tf([480 24],[20 42 52 100]) step(sys) The system has a settling time of 114seconds and a peak overshoot of 2.47e^3% Part d i, ii, and iii The bode plot of the system is given below. The plot shows the asymptotes, corner frequencies and the frequency where the phase crosses∅=−180°
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser