You are on page 1of 4

Instrumentation and Control Worksheet 1

The written exercises are aim the student will be able to do the basic calculation by hand and enhance their skills through
learning the MATLAB. For this worksheet, type your answer in the below before placing the
MATLAB scips. After answering it type the scrip and save this with file as name as [ name]_[course]_[course code] and email
to kentroferos@gmail.com

Example 1 Transform the Laplace Transform of a Time Function to inverse Laplace.


–at
f(t) = Ae u(t)

Find for inverse Laplace and write your code at the code block below. Ans:

syms a t A
f = A*exp(-a*t);
F = laplace(f)

Excercis A :

1. Find for1 inverse Laplace


f(t) = e–atu(t)

Ans: F =
s+ a

syms a t

f = exp(-a*t);

F=laplace(f)

F=1/(a+s)

1
2. Find for inverse Laplace of F 1(s) =
(s+ 3)( s+1)
Ans:
–t –3t
e e
F = –
2 2

syms s t
ilaplace(1/((s+3)*(s+1))) ans
=

exp(-t)/2 - exp(-3*t)/2
3. Roots of the Denominator of F (s) Are Real and Distinct, Find for inverse Laplace
2
F 1( s) =
( s+1)( s+ 2 )

–t – 2t
Ans: F = 2e – 2e
syms s t
ilaplace(2/((s+1)*(s+2))) ans
=
2*exp(-t) - 2*exp(-2*t)

4. transforming the laplace to original expression:

1
F =
s
Ans: F=1
syms s t

ilaplace(1/s)

ans =

5. Transform the Differential Equation into Laplace

d2 y dy
+ 12 + 32 y = 32 u(t) dt
dt2
Ans:

syms s Y(s) U(s) t

% Define the symbolic variables and functions y =


sym('y(t)');
u = sym('u(t)');

% Define the ODE


ODE = diff(y, t, 2) + 12 * diff(y, t) + 32 * y - 32 * u;

% Take the Laplace transform Laplace_ODE =


laplace(ODE, t, s);

% Display the Laplace-transformed ODE


pretty(Laplace_ODE)
Exercise B Solve for equation of Motion:

u = 0, t = 0 sec sec
o
, uT = 500 N, Mass = 1000 kg, b = 50 N
m m

1. Draw the free body diagram for the car to control. please refer from the above figure with respect to the given
parameters.

2. Identify the forces involve and write the transfer function.


• Gravity(mg) acting downward.
• Applied force(u) in the direction of motion.
• Damping force(b) opposing the motion.
• Mass(m) of the car.

Transfer function G(s)= Velocity(V(s))


Applied Force(U(s))

G(s)=
1
ms+b
3. Solve for the velocity v and take sy tem model through transfer function.
G(s)= 1
ms+b
G(s)= 1
1000kg(s)+ 50N sec/m

Taking the inverse laplace transform:

V(t)= (1/1000)(1-e^(-50t))

Use the MATLAB to find the response of the velocity of the car from sec
u
0
= 0, t = 0
m
% Define system parameters m

= 1000; % Mass (kg)

b = 50; % Damping coefficient (N sec/m)

% Create a transfer function G

= tf([1], [m, b]);

% Time vector

t = 0:0.1:10; % Adjust the time range as needed

% Input force (u) - Assuming u = 500 N for the entire time u =

500 * ones(size(t));

% Simulate the system

[t, v] = lsim(G, u, t);

% Plot the velocity response

plot(t, v);

xlabel('Time (s)');

ylabel('Velocity (m/s)');

title('Velocity Response of the Car');

You might also like