Вы находитесь на странице: 1из 12

P.

Paderes Street, Sampaloc, Manila 1015

Laboratory Activity

2
Midterms
Feedback and Control Systems

Submitted to:
Engr. Joey P. Sarmiento

Submitted by:
Monsalud, Robert Russell N.

December 18, 2018


12/18/18 11:38 AM C:\Users\...\Monsalud_Exercise1a_la2.m 1 of 1

syms y(t)
ode = diff (y,t,2)+ 16 * y == 0
ySol(t) = dsolve(ode)
MATLAB Command Window Page 1

>> Monsalud_Exercise1a_la2

ode(t) =

16*y(t) + diff(y(t), t, t) == 0

ySol(t) =

C3*cos(4*t) + C4*sin(4*t)

>>
12/18/18 11:42 AM C:\Users\...\Monsalud_Exercise1b_la2.m 1 of 1

syms y(t)
ode = diff (y,t,2)+ 8 * diff (y,t,1) + 16 * y == 0
ySol(t) = dsolve(ode)
MATLAB Command Window Page 1

>> Monsalud_Exercise1b_la2

ode(t) =

16*y(t) + 8*diff(y(t), t) + diff(y(t), t, t) == 0

ySol(t) =

C1*exp(-4*t) + C2*t*exp(-4*t)

>>
12/18/18 11:49 AM C:\Users\2...\Monsalud_Exercise2_la2.m 1 of 1

dsolve('D2y + 8*Dy + 16*y = 1 + t^2')


dsolve('D2y + 8*Dy + 16*y = 2*e^(-2*t)')
dsolve('D2y + 8*Dy + 16*y = 10*cos(2*t-(pi/2))')
MATLAB Command Window Page 1

>> Monsalud_Exercise2_la2

ans =

t^2/16 - t/16 + C5*exp(-4*t) + C6*t*exp(-4*t) + 11/128

ans =

C7*exp(-4*t) + C8*t*exp(-4*t) + (2*(t*(2*log(e) - 4) + 1))/(e^(2*t)*(2*log(e) - 4)^2)


- t/(e^(2*t)*(log(e) - 2))

ans =

C9*exp(-4*t) - cos(2*t + atan(3/4))/2 + C10*t*exp(-4*t)

>>
12/18/18 11:54 AM C:\Users\2...\Monsalud_Exercise3_la2.m 1 of 1

dsolve('D2y + 8*Dy + 16*y = 1 + t^2','y(0)=0')


MATLAB Command Window Page 1

>> Monsalud_Exercise3_la2
Warning: Support of character vectors that are not valid
variable names or define a number will be removed in a
future release. To create symbolic expressions, first
create symbolic variables and then use operations on them.
> In sym>convertExpression (line 1559)
In sym>convertChar (line 1464)
In sym>tomupad (line 1216)
In sym (line 179)
In solve>getEqns (line 405)
In solve (line 225)
In Monsalud_Exercise3_la2 (line 1)
Warning: Support of character vectors that are not valid
variable names or define a number will be removed in a
future release. To create symbolic expressions, first
create symbolic variables and then use operations on them.
> In sym>convertExpression (line 1559)
In sym>convertChar (line 1464)
In sym>tomupad (line 1216)
In sym (line 179)
In solve>getEqns (line 405)
In solve (line 225)
In Monsalud_Exercise3_la2 (line 1)
Warning: Do not specify equations and variables as
character vectors. Instead, create symbolic variables with
syms.
> In solve>getEqns (line 445)
In solve (line 225)
In Monsalud_Exercise3_la2 (line 1)

ans =

struct with fields:

t: [0×1 sym]
y: [0×1 sym]

>>
12/18/18 11:57 AM Untitled7 1 of 1

syms s
ilaplace((s^2-1)/((s)*(s + 2)*(s - 3)))
MATLAB Command Window Page 1

>> Monsalud_Exercise4_la2

ans =

(3*exp(-2*t))/10 + (8*exp(3*t))/15 + 1/6

>>
Conclusion:

Experiment 2 is about Solving Differential Equations using MATLAB. Throughout the activity,
there are many ways to solve a differential equation. Laplace(F) command can be used but in this
experiment, commands such as dsolve, uSol(x), etc. have been used to acquire the correct output.
Moreover, ilaplace command which stands for inverse laplace has been used also. To sum it up,
any Differential Equations can be solved using MATLAB. Additionally, Laplace transforms
whether function to Laplace or vice versa can also be applied to MATLAB.

Вам также может понравиться