1
ENGR Lab-07,
Authored by: Luke Thomspon
Authored on: 12/2/2021
Exercise #1 ... T11.2-2
Problem Presentation
Given two equations with three unknowns and are asked to solve for "x" and "y" in terms of "a".
Solution
Initialize variables
Preform calculations and display results
X =
Y =
Exercise #2 ... Problem 11.12
Problem Presentation
Determine all the local minima and maxima and all the inflection points where dy/dx=0 of the following function:
Solution
Initialize variables
Preform calculations
Find x and y values of interest
clear, clc, close all
syms a x y
eqn1 = x + 6*y == a;
eqn2 = 2*x - 3*y == 9;
[X, Y] = solve(eqn1,eqn2,{x y})
clear, clc, close all
syms x
y = x^4-(16/3)*x^3+8*x^2-4; % initialize function
dydx = diff(y); % find derivative
x_points = solve(dydx); % find roots of derivative dy/dx = 0
2
Loop to evaluate nature of zero points
Display results
A inflection point exists at x = 0.00, y = -4.00.
A inflection point exists at x = 2.00, y = 1.33.
A inflection point exists at x = 2.00, y = 1.33.
Exercise #3 ... Problem 11.20
Problem Presentation
Here we have the case of a rocket launch where fuel burns for a specified length of time and we are intrested
in knowing the velocity at the end of the fuel burn. We are given the functions that describes the acceleration
(dv/dt) and mass as a function of time as fuel burns.
Solution
Initialize variables
Preform calculations
Display results
y_points = subs(y,x,x_points);
for k = 1:length(x_points)
eval(k) = subs(dydx,x,x_points(k)); % solving 2nd derivative for x value
if double(eval(k)) > 0 % checking to see if local minima
outcomes(k) = "local minima";
elseif double(eval(k)) == 0 % checking to see if inflection point
outcomes(k) = "inflection point";
else
outcomes(k) = "local maxima"; % otherwise, point is local maxima
end
end
for k = 1:length(x_points)
fprintf('\nA %s exists at x = %4.2f, y = %4.2f.\n\n',outcomes{1,k},...
double(x_points(k)),double(y_points(k)))
end
fplot(y,[double(x_points(1))-1 double(x_points(length(x_points)))+1])
grid minor
clear, clc, close all
syms t T mo r b g to tf
v_t = int((T/(mo*(1-r*t/b)))-g,to,tf);
v_b = double(subs(v_t,{T mo r b g to tf},{48000 2200 0.8 40 9.81 0 40}));
3
Therocket velocity at fuel burnout is v = 1363.35 m/s.
fprintf('\nTherocket velocity at fuel burnout is v = %6.2f m/s. \n\n',v_b)