By Coding in Matlab A two-inch diameter craft ball is thrown vertically. This in
ID: 3861231 • Letter: B
Question
By Coding in Matlab
A two-inch diameter craft ball is thrown vertically. This initial velocity of the ball is 20 ft/s
a) Neglecting drag, draw a free body diagram and formulate a first order ODE that governs the velocity of the ball. Is the ODE linear or non-linear?
for part a I got t= 0.62 second
b) To determine the drag coefficient effect, an experiment has been conducted that showed the terminal velocity of the ball (during a free fall) to be 20 ft/s. Use Euler’s method to estimate the “actual” time to achieve maximum elevation for the case that the ball is thrown up with the given initial velocity (20 ft/s).
I need help to solve part b
Explanation / Answer
A) part has the answer as linear because drag is neglected. else it would be a non-linear ODE.
For solving part b we need to use the Euler's method of solving an initial value problem (IPV). So , here is MATLAB code for obtaining the required actual time and also a step by step explanation.
Basically we already know the terminal velocity. so using the euler's approach we caculate the value of "actual" time to reach maximum elevation by breaking it into smaller parts and then calculting the value at each instant.
So we simply use the equation of motion here in a modifed way namely , v=u+at
we use a function by the name f2 to calculate the accelaration value for each break of interval.
we run the following explained code to obtain the output :
clc
clear all
v=20; %initial velocity is 20 ft/s
t=0:.01:.48; %setting the time range
dt=0.01;
s=1; %s is a counter variable
x=length(t); %x will store the length of range of t
for n=t(2):dt:t(x) %solving problem using euler's approach
v(s+1)= v(s) + f2(t(s),v(s))*dt; %f2 is a function used to calculate effective acceleration at each instance , using equation v=u+at
s=s+1; %incrementing counter
end
fprintf( 'The time to achieve maximum elevation is about: %3.2fs ' ,t(x)); %displaying output
function out = f2(t,v)
%f2(t,y)
%output slope
vterm=20; %we have terminal velocity as 20 ft/s
g=32.2; %value of g is 32.2 ft/s
out=-g*(1+(v/vterm)^2); % function returns the value of a at the instance.
end
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.