University of Florida/Egm6341/s10.Team2/HW7

Statement
Pg.38-4 Show the case of stable growth for Verhulst equation

Author
Egm6341.s10.team2.lee 20:56, 23 April 2010 (UTC)

Statement
P.39-1

Solution
We have Verhulst model or the Logistic equation as P.38-3

$$\dot{x}=\frac{dx}{dt}=rx(1-\frac{x}{x_{max}})$$

Separating variables and integrating we have

$$\int_{x_0}^{x}\frac{x_{max}}{x(x_{max}-x)}dx=\int_{t_0=0}^{t}rdt$$

which can be written as

$$\int_{x_0}^{x}\frac{1}{x}dx+\int_{x_0}^{x}\frac{1}{(x_{max}-x)}dx=\int_{t_0=0}^{t}rdt$$

We get

$$log_e(\frac{x}{x_0})-log_e(\frac{x_{max}-x}{x_{max}-x_0})= r(t-0)$$

$$\frac{x(x_{max}-x_0)}{x_0(x_{max}-x)}=e^{rt}$$

Rearranging we have

$$x=\frac{x_{max}x_0e^{rt}}{x_{max}+x_0(e^{rt}-1)}$$

Author
--Egm6341.s10.team2.niki 12:31, 23 April 2010 (UTC)

===problem 3: Hermite-Simpson Algorithm to solve for the non-linear first order differential equation i.e. Verhulst population growth model on Pg.38-3 ===

Statement
Pg.39-1

Use the Hermit-Simpson Algorithm to integrate the Verhulst population growth model on Pg.38-3:

$$ \frac{\mathrm{d} x}{\mathrm{d} t}= r x\left ( 1-\frac{x}{x_{max}} \right ) $$

Consider the following: $$x_{max}=10 \;\; r=1.2 \;\; t\in \left [ 0,10 \right ] $$ and Case 1: $$\; x_{0}=2$$ Case 2: $$\; x_{0}=7$$

And also plot the two cases using matlab.

Solution
Matlab code

THE PLOT SHOWING THE POPULATION CHANGE W.R.T TIME, HERE VERHULST MODEL IS USED TO COMPUTE THE POPULATION WHERE XO=INITIAL POPULATION=2



THE PLOT SHOWING THE POPULATION CHANGE W.R.T TIME, HERE VERHULST MODEL IS USED TO COMPUTE THE POPULATION WHERE XO=INITIAL POPULATION=7



Author
Solved by--Srikanth Madala (SM)

Statement
Pg.40-1

Produce the diagrams showing the bifurcation diagram for the logistic map and its sensitivity to initial conditions, as shown on figures 15.6 and 15.7, of the book "Differential Equations: Linear,Nonlinear,Ordinary,Partial" by King,Billingham and Otto (Pg.455-456).

Creating Figure 15.6:Bifurcation Diagram
Logistic Map:

$$ x_{n+1} = r x_{n}(1-x_{n}) $$

The Bifurcation Diagram shows the period doubling process of the logistic map. As the constant r increases the period is doubled to 2 periods and then stability is lost which then leads to a doubling of period to 4 and so on.

The plot is as follows:



Matlab Code
Matlab code used to create the graph as outlined in Pg. 455 of King et. al

Creating Figure 15.7: Sensitivity to Initial Conditions
The Following Plot explores the big effect of a small change in the initial conditions. One can note the changes as 'n' becomes larger than 50. The graph was produced for the following Conditions:

$$ r = 4 \qquad 100 iterations \qquad IC1= 0.1 \qquad IC2=0.1+10^{-16}$$

The Following Equation was used to produce the iterations for the graph:

$$ x_{n+1} = r x_{n}(1-x_{n}) $$



Matlab Code
Matlab Code used to produce the aforementioned plot.

Author
--Egm6341.s10.Team2.GV 16:28, 23 April 2010 (UTC)

Statement
Pg.40-2

Solution
Matlab code

THE PLOT SHOWING THE POPULATION CHANGE W.R.T TIME, HERE VERHULST MODEL IS USED TO COMPUTE THE POPULATION WHERE XO=INITIAL POPULATION=2



Author
Solved by--Srikanth Madala (SM)

Statement
Pg.40-3 and Pg.41-1

Solve the following Group of ODE's as they relate to the problem mentioned in the lecture pages mentioned above. The problem is of the motion of an airplane through different maneuvers.

for a vector with the following parameters:

$$ z = [ x, y, V, \gamma ] $$ $$ \dot{z} = [ \dot{x}, \dot{y}, \dot{V}, \dot{gamma}]$$

$$ \dot{x} = Vcos (\gamma) $$

$$ \dot{y} = Vsin( \gamma) $$

$$ \dot{v} = (\frac{T-D}{m}cos( \alpha) + \frac{L}{m} sin(\alpha) - g sin(\gamma) $$

$$ \dot{\gamma} = (\frac{T-D}{mV}sin( \alpha) + \frac{L}{mV} cos(\alpha) - \frac{g}{V} cos(\gamma) $$

Initial Conditions are as follows:

$$ \gamma_{0} = 0 \quad degrees $$

$$ V_{0} = 272 \quad meters/sec $$

$$ x_{0} = 0 \quad meters $$

$$ y_{0} = 0 \quad meters $$

The Physical Modeling Parameters to be used are

$$ m = 1005 \quad Kg $$ $$ g = 9.81 \quad m/sec^{2} $$ $$ Sref = 0.3376 \quad m^{2} $$ $$ A1 = -1.9431 \qquad A2=-0.1499 \qquad A3=0.2359 $$ $$ B1=21.9 \qquad B2= 0 $$ $$ C1= 3.312 x 10^{-9} \quad Kgm^{-5} $$ $$ C2= -1.142x 10^{-4} \quad Kgm^{-4} $$ $$ C3 =1.1224 \quad Kgm^{-3} $$

$$ \rho = C1y^{2} + C2y + C3 $$ $$ L = \frac{1}{2}C_{l} \rho V^{2} Sref $$ $$ C_{l} = B1 \alpha + B2 $$ $$ D = \frac{1}{2}C_{d}\rho V^{2} Sref $$ $$ C_{d} = A1 \alpha^{2} + A2\alpha + A3 $$

The Inputs are defined as follows:

Input T:

for $$ 0\leq t<27 seconds = 6000N $$ for $$ 27\leq t<33 seconds = 1000N $$ for $$ 33\leq t \leq 40 seconds = 6000N $$

Input $$ \alpha $$:

for $$ 0\leq t<21 seconds = 0.03 $$ for $$ 21\leq t<27 seconds = 0.09 to 0.13 $$ as it varies linearly for $$ 27\leq t<33 seconds = -0.13 to -0.2 $$ as it varies linearly for $$ 33\leq t \leq 40 seconds = -0.2 to -0.13 $$ as it varies linearly

Defining the Inputs
The first part of the solution is to create a function that will calculate the thrust and angle of a attack at a particular time. The following Matlab Codes were used:

Thrust:

Angle of Attack:

Technique used to solve the problem
The overall goal is to find a solution for each of the states being considered (x,y,V,gamma).

From P 36.3, of the lectures, the following was established using the Hermite-Simpson Algorithm:

$$ Z_{i+1} = z_{i} + \frac{h/2}{3} \left[ f_{i} + 4f(g(z_{i},z_{i+1})) + f(z_{i+1}) \right] \qquad \qquad EQUATION 1$$

The Following is recognized and derived as:

$$ g(z_{i},z_{i+1}) = \frac{1}{2}(z_{i}+ z_{i+1}) + \frac{h}{8}\left[(f(z_{i}) - f(z_{i+1})\right] \qquad \qquad EQUATION 2$$

It is now necessary to define the following using the previously mentioned Eq. 1:

$$ F(Z_{i+1}) = 0 = Z_{i+1} - z_{i} - \frac{h/2}{3} \left[ f_{i} + 4f(g(z_{i},z_{i+1})) + f(z_{i+1}) \right] \qquad \qquad EQUATION 3$$

The next step is to apply the Newton Raphson Method to solve the function $$ F(Z_{i+1}) = 0 $$

A Matlab Algorithm is used to apply the Newton Raphson Method as follows:

Newton Raphson Method
Function for obtaining $$ f(z) $$

Function for obtaining $$ df(z) $$

Function for using the Newton Raphson Operations until an error threshold is reached

This Matlab code was developed using the published code of Team 3 as part of their HW 7 Report( HW 7: Team 3)

Results of Methods Used and comparison to ODE45
Plot of Horizontal Position Vs. Time

Plot of Vertical Position(Height) Vs. Time



Plot of Velocity Vs. Time



Plot of Gamma Vs. Time



From each of these plots it can be concluded that the combination of the Hermite Simpson Algorith and the Newton Raphson Method is an effective way to solve the set of ordinary differential equations without much error, as compared to ODE45 solver of Matlab. The downside to this method is that it takes a high amount of computational resources and time.

Author
--Egm6341.s10.Team2.GV 23:41, 27 April 2010 (UTC)

Statement
Integrate the Logistic equation using the inconsistent Trapezoidal-Simpson approximation $$x_{i+1/2}=x_i + x_{i+1}$$

Pg.41-2

Solution
The Matlab code is a slight alteration of the code used to integrate above.

%Matlab code to integrate the the Verhulst population growth model clear; clc; xmax=10; r=1.2; t=0:0.1:10; h=0.1; %time step size syms x;  syms x11; f=r*x*(1-(x/xmax)); %case 1: when x0=2 for i=1:1:100 x1(1)=2; f1=subs(f,x,x1(i)); f11=subs(f,x,x11); x1half=((1/2)*(x1+x11))%Trapezoidal_simpson approxiamtion; f1half=subs(f,x,x1half); F=x1(i)-x11+(h/6)*(f1+f11+(4*f1half)); guessx11(i)=x1(i); dummy=1; while dummy==1 newx11(i)=guessx11(i)-((1/(subs(diff(F(i)),x11,guessx11(i))))*(subs(F(i),x11,guessx11(i)))); if double(abs(newx11(i)-guessx11(i)))<=10^(-6) x1(i+1)=newx11(i); dummy=0; break; else guessx11(i)=newx11(i); dummy=1; end end end plot(t,x1);

for $$x_0=2$$

for $$x_0=7$$

Author
--Egm6341.s10.team2.niki 20:33, 28 April 2010 (UTC)

Statement
Pg.42-1

Statement
Pg.42-1

Given the parameterization for an ellipse as follows for the x and y coordinates, Eliminate 't' as a parameter.

$$ x = a \cos(t) \qquad \qquad y = b \sin(t) $$

Solution
$$ x = a \cos(t) $$ $$ x^{2} = a^{2} \cos^{2}(t) $$ $$ y = b \sin(t) $$ $$ y^{2} = b^{2} \sin^{2}(t) $$

$$ \frac{x^{2}}{a^{2}} = \cos^{2}(t) $$ $$ \frac{y^{2}}{b^{2}} = \sin^{2}(t) $$

$$ \frac{x^{2}}{a^{2}} + \frac{y^{2}}{b^{2}} = \cos^{2}(t) + \sin^{2}(t) = 1 $$ At this point t can be eliminated as a parameter.

Author
--Egm6341.s10.Team2.GV 17:51, 23 April 2010 (UTC)

Statement
Pg.42-2

Statement
Pg.42-2 To show the integral for elliptical circumference

Author
Egm6341.s10.team2.lee 20:58, 23 April 2010 (UTC)

Statement
Pg.42-2

Statement
Pg.42-2

To show that $$I=\int_{-1}^{+1}f(x)dx = \int_{0}^{\pi}f(cos\theta)sin\theta d\theta$$

Solution
We have the integral as

$$I=\int_{-1}^{+1}f(x)dx$$.

Using the transformation $$\displaystyle{x=cos\theta}$$ we have

$$\displaystyle{f(x)=f(cos\theta)}$$

$$\displaystyle{dx=-sin\theta d\theta}$$

and using the inverse transformation the limits $$\displaystyle{[-1,1]}$$ can be written $$\displaystyle{[\pi,0]}$$

thus we have

$$I=\int_{-1}^{+1}f(x)dx = \int_{\pi}^{0}-f(cos\theta)sin\theta d\theta=\int_{0}^{\pi}f(cos\theta)sin\theta d\theta$$

Author
--Egm6341.s10.team2.niki 18:47, 23 April 2010 (UTC)

Statement
Pg.42-3

We have the cosine series expressed as $$f(cos\theta )=\frac{a_0}{2}+\sum_{k=1}^{\infty }a_k cos(k\theta)$$, we need to express teh constants $$a_k$$ as

$$a_k=\frac{2}{\pi }\int_{0}^{\pi}f(cos\theta)cos(k\theta)d\theta$$

Solution
We have the given expression for the cosine series as

$$f(cos\theta )=\frac{a_0}{2}+\sum_{k=1}^{\infty }a_k cos(k\theta)$$

multiplying both sides by $$cos(m\theta)$$ where k is not the same as m and integrating we get,

$$\int_{0}^{2\pi}f(cos\theta )(cos(m\theta))=\int_{0}^{2\pi}\frac{a_0cos(m\theta)}{2}+\int_{0}^{2\pi}\sum_{k=1}^{\infty }a_k cos(k\theta)cos(m\theta)$$

Using the property of orthogonality we know that $$\int_{0}^{2\pi}a_k cos(k\theta)cos(m\theta)$$ exists only when k = m i.e

$$\int_{0}^{2\pi}f(cos\theta )(cos(k\theta))d\theta=\frac{a_0}{2}\int_{0}^{2\pi}cos(m\theta)d\theta+a_k\int_{0}^{2\pi} cos^2(k\theta)d\theta                                    $$

wkt,

$$\int_{0}^{2\pi}cos(m\theta)d\theta=0$$ and

$$\int_{0}^{2\pi}cos^2(k\theta)d\theta = \frac{2\pi-0}{2}=\pi$$

Thus we have by substituting and rearranging terms,

$$a_k=\frac{2}{\pi }\int_{0}^{\pi}f(cos\theta)cos(k\theta)d\theta$$

Author
--Egm6341.s10.team2.niki 14:43, 23 April 2010 (UTC)

Statement
Pg.42-3 Simplification of Clenshaw-Curtis Quadrature Rule

Signatures
solutions of problems 2,7,13,14 --Egm6341.s10.team2.niki 18:48, 23 April 2010 (UTC)

solutions of problems 4,6, 9 --Egm6341.s10.Team2.GV 20:58, 23 April 2010 (UTC)

solutions of problems 1,11,15 --Egm6341.s10.team2.lee 22:47, 23 April 2010 (UTC)