User:Oh Isaac/R7-4

Problem 4: plot and compare the equation of motion in air
Report problem 5.11 and 6.10 from

Given:
The schematic of the motion of a particle in the air :

Derive the equations of motion:

Consider the case $$k\neq 0$$ and $$v_{x0}=0$$: ($$) turns into

Which can be written as :

Separation of variables

For all values of $$n$$ :

Give particular values of some parameters :

Initial vertical velocity:$$z(t):=v_y(0)=50$$

Find:

 * For each value of $$n$$, find the vertical velocity $$z(t)$$ vs. time t, plot this function.
 * For each value of $$n$$, find the altitude $$y(t)$$ vs. time t, find the time when the projectile returns to the ground.

Use numerical methods to find the value of each given value of time t if the explicit expression cannot be obtained.


 * 1) $$n=2$$
 * 2) $$n=3$$. Use the matlab command "roots" to find the appropriate roots z for each given time t; verify with WA. Plot z versus t. Find $$y(t)$$by integrating $$z(t)$$ using the trapezoidal rule.
 * 3) $$n=3$$. Use the matlab function "hypergeom" to find the time t for each given value of z in the interval $$[-10,50]$$. Plot t versus z. Find $$y(t)$$by integrating $$z(t)$$ using the trapezoidal rule. Compare to Part 2.
 * 4) Verify the results in Parts 1 and 2 using the matlab in 2 steps:(a)use the command ode45 to integrate the L1-ODE-CC(1)p63-8 to obtain $$z(t)$$,(b)use the trapezoidal rule to integrate $$z(t)$$ to obtain $$y(t)$$.
 * 5) the equation of motion can be written as a system 1st order ODEs to be integrated using matlab ode45:$$\begin{align}z'&=-az^n-b\\y'&=z\end{align}$$.


 * 1) Verify Part 2.

Solution

 * {| style="width:100%" border="0"

On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * style="width:92%; padding:10px; border:2px solid #8888aa" |
 * }

According to $$, $$and$$, the uniform expression can be written as:

The inverse funciton of $$can be show as below in terms of $$t$$:

So we get:

When n=2
As what we have done in [Repot 6.10], it shows that:

the figure of z(t) vs t:

the figure of t vs z(t):

We can see that the expression of y(t) is a periodic function, the positive value which is nearest to 0 is $$0.6825$$, at which time the projectile reach the ground.

So can we solve this problem by numerical methods. The program and plot obtained by MATLAB are showed below

When n=3, use MATLAB command "roots"
The $$comes to be written as:

With the initial value of $$to obtain the valve of k:

The number of $$k\doteq0.20667$$ by WolframAlpha, so we just write the expression as below :

According to $$, we can get the expression written as a form of polynomial and calculate each value of the terms. Expand the hyper-geometric function into power series, and truncate to approximate:

Use MATLAB command "roots" to obtain the roots of z(t) according to each given t. So we get the roots and generate the figure as below.


 * {| class="prettytable"


 * Time t (s)
 * 0
 * 0.0715
 * 0.0720
 * 0.0725
 * 0.0730
 * 0.0735
 * 0.0740
 * 0.0745
 * 0.0750
 * $$\cdots$$
 * Velocity z(t) (m/s)
 * 50
 * 1.6608
 * 1.6342
 * 1.6139
 * 1.5966
 * 1.5811
 * 1.5669
 * 1.5536
 * 1.5411
 * $$\cdots$$
 * }
 * $$\cdots$$
 * }

Using to trapezoidal rule to integrate the z(t) to get y(t), showed below:

Because of truncating the polynomial series to finite powers, the data is not accurate or identical with the theoretical value.

When n=3, use MATLAB command "hypergeom"
The $$comes to be written as:

With the initial value of $$to obtain the valve of k:

The number of $$k\doteq0.20667022059582652141$$ by WolframAlpha, so we just write the expression as below :

With MATLAB command "hypergeom" directly solving the expression, so we can plot the figure of z(t) vs t as follow:

The inverse function of $$cannot be obtained by MATLAB, So numerical methods is needed.

Discard the part that contains imaginary number for these have no physical meaning, then exchange the axes of z(t) vs t to t vs z(t), get the graph like this:

Then integrate z(t) to get y(t). When the projectile reach ground, the value of y(t) should reach 0, which means that the accumulative sum of $$should be 0. The plot and MATLAB programs are showed below.

The answer, according to the $$, is $$0.5024$$, at which time the projectile reach the ground.

Use MATLAB command "ode45" to verify
According to $$, when n=3, the expression can be written as:

Input the expression in to MATLAB and solve it. We get the figure below shows that:

When n=3
The figures showed above are the same with that in Part 1 and Part 2.

Use MATLAB command "ode45" to verify Part 2 as a system 1st order ODE
According to $$, the expression can be written as:

They can be solved by MATLAB to obtain y(t).

The figures showed above is the same with that in Part 2.