Академический Документы
Профессиональный Документы
Культура Документы
Laboratory Activity
2
Midterms
Feedback and Control Systems
Submitted to:
Engr. Joey P. Sarmiento
Submitted by:
Monsalud, Robert Russell N.
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) =
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
>> Monsalud_Exercise2_la2
ans =
ans =
ans =
>>
12/18/18 11:54 AM C:\Users\2...\Monsalud_Exercise3_la2.m 1 of 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 =
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 =
>>
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.