Lab Manual Ws 3 4
Lab Manual Ws 3 4
3.1 OBJECTIVES:
To determine the limits and one-sided limits of a function,
understanding how systems behave at specific points.
To calculate the rate of change of a system using differentiation,
providing insights into system dynamics.
To apply these concepts to real-world problems in Aerospace,
Automobile, Civil, Mechanical, and Mechatronics Engineering, in
line with SDG 9 (Industry, Innovation, and Infrastructure) and SDG 13
(Climate Action).
3.2 PROCEDURE:
Follow these steps to execute the MATLAB code for any given task:
Open MATLAB.
Create a new script file (M-file).
Input the program code.
Save the file in the working directory.
Execute the program.
Observe the results in the Command Window or Figure Window.
Code:
1
limit_value = limit(f, x, point);
% Compute the first derivative of the function and evaluate it at the point
first_derivative = diff(f, x);
first_derivative_at_point = subs(first_derivative, x, point);
efficiency.
1. Find the initial battery efficiency at 𝑡 = 0 (when the drone starts flying).
2. Determine the long-term efficiency of the battery as 𝑡 → ∞ (when the drone
has been flying for a
long time).
3. Evaluate the one-sided limits as 𝑡 → 0+ (from the right) and 𝑡 → 0− (from
the left) to analyze how the efficiency behaves when approaching 𝑡 = 0 from
both directions.
2
Code:
syms t
𝑓 = (3 ∗ 𝑡 2 − 2 ∗ 𝑡 + 4)/(𝑡 2 + 𝑡 + 1);
% Limit as t approaches infinity
limit_infinity = limit(f, t, inf);
% Limit as t approaches 0
limit_zero = limit(f, t, 0);
Output :
At 𝑡 = 0 ∶ The limit is 4.
As 𝑡 → ∞: The limit is 3.
One-sided limit as 𝑡 → 0+ (from the right): The limit is 4.
One-sided limit as 𝑡 → 0− (from the left): The limit is 4.
3
Inference (Limits and One-Sided Limits):
At 𝑡 = 0: The initial efficiency is 4 units, indicating the system is
operating at its peak performance when it starts. In real-world
applications, this could represent a system at full charge or optimal
conditions.
As 𝑡 → ∞: The efficiency stabilizes at 3 units, showing that the system
reaches a steady state over time. This behavior is crucial for designing
systems that can maintain performance over long periods.
One-sided limits:
From the right 𝑡 → 0+ and left 𝑡 → 0− : Both one-sided limits approach 4,
meaning the function behaves consistently as it approaches 𝑡 = 0 from
either direction. This ensures that there are no sudden jumps or drops in
performance when the system starts, which is important for avoiding
disruptions in real-world scenarios.
4
Task 2 (Differentiation):
1. Calculate the rate of change of efficiency at 𝑡 = 0, when the drone begins its
monitoring flight.
2. Find the rate of change of efficiency at 𝑡 = 24 hours, reflecting a full day of
operation to assess how
the battery stabilizes over a typical day.
Code (Differentiation):
syms t
𝑓 = (3 ∗ 𝑡 2 − 2 ∗ 𝑡 + 4)/(𝑡 2 + 𝑡 + 1);
% Differentiate the function to find the rate of change of efficiency
f_prime = diff(f, t);
% Rate of change at t = 0
rate_at_zero = subs(f_prime, t, 0);
% Rate of change at t = 24 hours
rate_at_24_hours = subs(f_prime, t, 24);
Output (Differentiation):
Rate of change at𝑡 = 0: The rate is 2 units per hour.
Rate of change at𝑡 = 24 ℎ𝑜𝑢𝑟𝑠: The rate is approximately 1.03 units per hour.
Inference:
At 𝑡 = 0: The efficiency is decreasing at 2 units per hour. Initially, the
drone uses a lot of power, causing a rapid drop in battery efficiency.
However, as the solar panels recharge the battery, the decrease slows
down.
At 𝑡 = 24 hours, the rate of change of efficiency is 1.03 units per hour.
This means that after a full day, the battery efficiency stabilizes. The solar
5
panels are helping recharge the battery, slowing the loss of efficiency,
which allows the drone to keep flying efficiently for longer.
HANDS-ON TASK
1.Scenario: Jet Engine Fuel Consumption
Jet engines consume fuel at varying rates depending on altitude and speed
during a flight. Understanding long-term fuel consumption is critical for
optimizing flight efficiency. The fuel consumption is modeled by 𝑓(𝑥) =
4𝑥 2 +5𝑥+6
, where 𝑥 represents time (in hours), 𝑓(𝑥) represents fuel consumption
𝑥 2 +2𝑥+1
In bridge design, it's important to understand how structures behave under near-
critical loads to prevent failure. The structural response of a bridge under load is
6
𝑥 3 −2𝑥+1
modeled by 𝑓(𝑥) = , where 𝑥 represents load (in tons), 𝑓(𝑥) represents
𝑥−1
8
5. Scenario: Signal Response in Automation Systems
9
Find the derivative of the temperature function to understand the rate of change
of temperature along the aircraft surface.
10
WORKSHEET- 4
DETERMINATION OF MAXIMA AND MINIMA OF A FUNCTION OF
ONE VARIABLE
4.1 OBJECTIVE
Learn to find critical points of functions using differentiation.
Apply maxima and minima concepts to solve optimization problems in
Aerospace, Automobile, Civil, Mechanical, and Mechatronics
engineering.
Enhance system efficiency in line with SDG 9 (Industry, Innovation, and
Infrastructure) and SDG 13 (Climate Action).
4.2 PROCEDURE
Follow these steps to execute the MATLAB code for any given task:
Open MATLAB.
Create a new script file (M-file).
Input the program code.
Save the file in the working directory.
Execute the program.
Observe the results in the Command Window or Figure Window.
Code:
11
critical_points = double(a);
% Display critical points
critical_points
% Compute the second derivative
fxx = diff(fx, x);
% Check for first critical point (replace 8 with the first critical point value)
D = subs(fxx, x, 8);
if D > 0
% If second derivative is positive, it attains a minima
disp('Attains Minima')
elseifD < 0
% If second derivative is negative, it attains a maxima
disp('Attains Maxima')
else
% If second derivative is zero, the test is inconclusive
disp('Second derivative test is inconclusive')
end
% Find the value of the function at this critical point
min_max_value = subs(f, x, 8);
% Check for second critical point (replace 0 with the second critical point
value)
D = subs(fxx, x, 0);
if D > 0
% If second derivative is positive, it attains a minima
disp('Attains Minima')
12
elseifD < 0
% If second derivative is negative, it attains a maxima
disp('Attains Maxima')
else
% If second derivative is zero, the test is inconclusive
disp('Second derivative test is inconclusive')
end
% Find the value of the function at this critical point
min_max_value = subs(f, x, 0);
Task:1
Find the optimal speed that maximizes fuel efficiency for the vehicle, reducing
energy consumption and environmental impact.
Code:
f = -v^3 + 15*v^2 - 60*v + 100;
dE = diff(f, v);
critical_points = solve(dE == 0, v);
critical_points = double(critical_points);
d2E = diff(dE, v);
D = subs(d2E, v, 10);
if D > 0
disp('Attains Minima');
elseif D < 0
disp('Attains Maxima');
else
disp('Second derivative test is inconclusive');
end
D = subs(d2E, v, 20);
if D > 0
disp('Attains Minima');
elseif D < 0
disp('Attains Maxima');
else
disp('Second derivative test is inconclusive');
14
end
Maximum value = subs(f, v, 20);
Maximum value
Output:
f = -v^3 + 15*v^2 - 60*v + 100
dE = -3*v^2 + 30*v - 60
critical_points = 10,20
d2E = -6*v + 30
D = 0 (at v = 10)
Second derivative test is inconclusive.
D = -30 (at v = 20)
Attains Maxima
Maximum value = 180
Max Fuel Efficiency at v = 20 km/h: 180 km/kWh
Inference:
The analysis shows that the vehicle reaches maximum fuel efficiency at a
speed of 20 km/h, where the efficiency is 180 km/kWh. At 10 km/h, the
second derivative test is inconclusive, meaning we cannot determine if it's a
maximum or minimum.
By operating at 20 km/h, the vehicle uses energy most efficiently, allowing it to
travel the longest distance per unit of energy, which supports the reduction of
energy consumption and emissions, aligning with sustainable transportation
goals.
HANDS-ON TASK
Electric vehicles (EVs) are key to reducing emissions, but their efficiency
depends heavily on speed. Driving too fast drains the battery quickly, while
driving too slowly may not be optimal for covering distance. To enhance the
range of an electric vehicle, engineers are tasked with finding the optimal speed
at which the vehicle can travel the farthest on a single charge. The relationship
between speed and range is described by the function 𝑓(𝑠) = −3𝑠 2 + 150𝑠 −
16
600, where 𝑠 is the speed in kilometers per hour (km/h). Determine the speed
that maximizes the vehicle’s range.
17
4.Scenario:Minimizing Material Stress in Mechanical Joints
18
5.Scenario:Optimizing Response Time of Robotic Arms
efficiency. However, the response time of a robotic arm -the time it takes to
complete a task- can be affected by multiple factors such as speed, load, and
19
control settings. To optimize performance, engineers need to determine the time
that minimizes the robotic arm's response time, allowing it to complete tasks
100,where 𝑡 is time in seconds. Determine the time that minimizes the robotic
20
6. Find the minimum value of the function 𝑓(𝑥) = 7𝑥 3 − 2𝑥 2 − 5
21