User:Egm6322.s14.team2/report3
Report 3 PEA 2 Spring 2014 Team 2
[edit | edit source]Problems are given in lecture notes
R3.1:
[edit | edit source]Problem Statement
[edit | edit source]sec.67a, Pb-67.1 (equilibrium of line defects, Legendre diff. eq., Legendre polynomials)
Provide a detailed justification for the following relations:
-
(
)
-
and thus,
-
(
)
-
-
(
)
-
satisfies the differential equation,
-
(
)
-
-
(
)
-
Find
[edit | edit source]Provide a detailed justification for the following:
(a):
-
(
)
-
(b):
-
(
)
-
(c):
-
(
)
-
(d): satisfies the differential equation,
(e):
-
(
)
-
Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Given at equilibrium,
-
(
)
(
) is the definition of S(u), a summation of N terms.-
(
)
Substituting (
)for the N-1 terms (excluding j=i) in ( ) and evaluating the behavior of the function as u approaches ui results in ( ).-
(
)
P(u) is defined in equation (
) and the derivative is displayed in ( ).-
(
)
-
(
)
Substituting (
) and ( ) into ( ), ( ) was established.-
(
)
Using the chain rule the following equation can be defined using ( ).
-
(
)
(.
) is the derivative of S as-
(
)
Substituting ( yields P''(u)/P'(u) approaches 0 as .
) and ( ) into ( ), multiplying the last term by (u-ui)/(u-ui), and evaluating the behavior of the system as-
(
)
Evaluating the product in (
), a power series with constant coefficients that are products of the ui positions can be expressed as follows:-
(
)
And the first and second derivatives can also be expressed as a power series as follows:
-
(
)
-
(
)
Given that P''(u) is proportional to ,
-
(
)
Substituting the power series expressions of the solutions into the above equation:
-
(
)
Considering just the final term in the summation:
-
(
)
The above equation simplifies to c=N(N-1). Substituting the coefficient, c, back into (
)-
(
)
Now, using the transformation for P as a function of Q, and the first and second derivatives:
-
(
)
-
(
)
-
(
)
Substituting the transformation into the differential equation in (
)-
(
)
R3.2: Hermite Differential Equation Form of Line Defect Differential Equation
[edit | edit source]Problem Statement
[edit | edit source]sec.67b, Pb-67.2 (equilibrium of line defects, Hermite diff. eq., Hermite polynomials)
Equation (
) is given:-
(
)
-
Find a suitable change of variable to show that (
) ((6) p.68-5) can be written as the Hermite differential equation of the form:-
(
)
-
For the 2 cases of particles, find the non-dimensional equilibrium positions and plot them.
Find
[edit | edit source](a): A suitable change of variable to show that (
) can be written as the Hermite differential equation of the form of ( )Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Part (a): Find Suitable Change of Variable
[edit | edit source]For this problem we seek to determine a suitable change of variables that will give us (
) from ( ). The variable of interest is changing from u to x in this problem. We need to find some sort of relation between the two variables that will gives us what we want. We can observe the differences between the two forms of the differential equations and conclude that a factor of 2 on the zeroth and first derivative terms is an observable difference. We can also observe that the transformed differential equation is of the same order as the original, therefore the change of variables does not include a derivative term. It must therefore only contain the independent variables u and x.Using the transformation and the first and second derivatives below in the function P:
-
(
)
-
-
(
)
-
-
(
)
-
Make the substitution and then divide the equation by to get.
-
(
)
-
Examining equation ( and . Using y instead of P(u) and x instead of , the equation takes the form of the Hermite differential equation above.
) in comparison to the the Hermite differential equation ,Plot Solution for 2 Cases
[edit | edit source]Here we are asked to plot the solution to the Hermite differential equation for the cases when .
Here the differential equation takes the following form when .
-
(
)
-
The equation for the coefficients of the Hermite polynomial can be obtained by using a power series solution to the even or odd Hermite differential equation:
-
(
)
-
Therefore, the 7th and 8th order Hermite polynomials, respectively, are:
-
(
)
-
-
(
)
-
The roots from Wolfram Alpha using the functions HermiteH[7,x] and HermiteH[8,x] are:
Hermite Polynomial Roots
| ||
Root # | 'Root' H7}(x) | 'Root' H8(x) |
-2.6520 | -2.9306 | |
-1.6736 | -1.9817 | |
-.81629 | -1.5719 | |
0 | -.38119 | |
.81629 | .38119 | |
-1.6736 | 1.5719 | |
2.6520 | 1.9817 | |
2.9306 |
This equation is a second order linear differential equation that is homogenous with variable coefficients. A solution is sought in the form of a finite power series. It is finite in this case because the original polynomial that we are solving for is a finite polynomial i.e. it only contains terms up to
Wolfram Alpha gives the solution
-
(
)
-
R3.3: Derivation of acceleration vector in cylindrical coordinate system
[edit | edit source]Problem Statement
[edit | edit source]sec.70a, Pb-70.1 (Kepler’s equation, acceleration vector in planar motion using Euler formula)
Show,
-
(
)
-
Find
[edit | edit source](a): (
)Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Using polar coordinates, the unit vectors that form a basis in the orbital plane and their first order time derivatives are:
-
(
)
-
-
(
)
-
-
(
)
-
-
(
)
-
The position vector, r, in this basis is:
-
(
)
-
The time derivative of the position vector is the velocity:
-
(
)
-
The second derivative with respect to time is the acceleration:
-
(
)
-
After combining like terms and factoring a out of the term, the equation above simplifies to:
-
(
)
-
Recognizing the derivative of and performing the integration, Kepler's equation takes the form:
-
(
)
-
R3.4: Solutions to First Oder Linear ODE with Variable Coefficients using Euler Integrating Factor
[edit | edit source]Problem Statement
[edit | edit source]A general First Order Linear Differential Equation with Varying Coefficients (L1-ODE-VC) has the following form:
-
(
)
Find
[edit | edit source](a)
-
(
)
(b)
-
(
)
Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Part a
[edit | edit source]The equation in 1 can be written as follows:
-
(
)
-
The general solution for the Euler Integrating Factor Method is:
-
(
)
-
And is:
-
(
)
-
( is arbitrary, it scales the integrating factor by a constant but has no effect on the final solution. Here we set it to 0 for ease of computation.)
Plugging into and integrating gives:
-
(
)
-
Plugging into the general solution we get:
-
(
)
-
Integrating this gives the solution:
-
(
)
-
Part b
[edit | edit source]The equation 2 can be rewritten as:
-
(
)
-
( in order to have the coefficient of the leading derivative be unity.
) is divided by-
(
)
-
is then found by the following equation:
-
(
)
-
(
) then becomes:-
(
)
-
Which after evaluating the integral can be simplified to:
-
(
)
-
R3.5: Commented problems from R2
[edit | edit source]Problem Statement
[edit | edit source]Redo commented problems from Report 2.
R2.4:Differential Element in Spherical Coordinates
[edit | edit source]Given Information
[edit | edit source]The following equation is given for ds2:
-
(
)
-
xi is written in spherical coordinates in (
) through ( ).-
(
)
-
-
(
)
-
-
(
)
-
Problem Statement
[edit | edit source]Show that the infinitesimal length ds2 in (sec.39 of the notes.
) can be written in spherical coordinates, ( ), as given in Pb.R*7.3 on pp.39-[1,3] of-
(
)
-
Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
The derivatives of xi are given in (
) through ( ).-
(
)
-
-
(
)
-
-
(
)
-
(
) was developed by substituting the squared derivatives in the summation of ( ) and combining like terms.-
(
)
-
Using the Pythagorean Trigonometric Identity, (
) reduces to ( ).-
(
)
-
The magnitude of the tangent vector h are then identified as follows:
-
(
)
-
-
(
)
-
-
(
)
-
The definition of the Laplace operator, , in cartesian coordinates:
-
(
)
-
The Laplace operator can be expressed in spherical coordinates from equation (2) from the class notes 39-2,
-
(
)
-
After substituting the values of h from (
) through ( ), the Laplacian takes the form:-
(
)
-
Factoring the from the first term, the partial derivative with respect to r, and the from the third term, the partial derivative with respect to , since both values are fixed in the partial derivatives, the Laplacian takes the form:
-
(
)
-
R2.5: Using Variation of Parameters To Find Second Solution To The Legendre Differential Equation
[edit | edit source]Given Information
[edit | edit source]The following equation is given for P2(x), the Legendre Polynomial of degree n=2:
-
(
)
-
Problem Statement
[edit | edit source]Using variation of parameters, show that sec.37 of the notes.
is a second solution to the Legendre differential equation in as given in Pb.R*6.11 on pp.37-4 in-
(
)
-
Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
The Legendre differential equation of degree n=2 is given in equation 5-3.
-
(
)
-
Using reduction of order, some function, v, times P2(x) and the first two derivatives of the product are substituted into the Legendre differential equation in equation 5-7. Furthermore, since P2(x) is a solution to the Legendre equation the coefficient of the first order term, v, reduces to zero. Since the lowest order term cancels out, the second order differential equation is reduced to a first order differential equation where w=v' and w'=v'' in Equation 5-8 which can be solved through separation of variables.
-
(
)
-
-
(
)
-
-
(
)
-
-
(
)
-
-
(
)
-
Through partial fraction decomposition, the integral is
-
(
)
-
Through integration
-
(
)
-
Using properties of the natural logarithm and then inverting it using the exponential function, equation 5-9 becomes
-
(
)
-
Substituting v' back into Equation 5-10 and again using partial fraction decomposition
-
(
)
-
Using integration by parts
-
(
)
-
where u and v are defined as follows:
-
(
)
-
-
(
)
-
-
(
)
-
Using the properties of the natural logarithm to combine the first two terms and performing the simple integration on the last term:
-
(
)
-
Substituting v into Equation 5-4 then identifying the new solution as Q2
-
(
)
-
R2.6: Testing Gauss Laguerre quadrature
[edit | edit source]The Bessel function integration test performed by Dr. Burkardt's code [1] test the following integral:
and has the following raw output:
7 0.162669 1 0.19313 0.0304616 2 0.0346675 0.128001 4 0.0367188 0.12595 8 0.0395037 0.123165 16 0.0970831 0.0655858 32 0.100708 0.0619605 64 0.107105 0.0555637
The top row cow is the problem number, and the exact solution. The first column of numbers is the number of integration points, the second column is the approximated answer, and the third column is the absolute error.
This code did not test a Bessel integral of the form given in problem R2.7.
R3.6: Testing Gauss-Laguerre Quadrature Part 2
[edit | edit source]Problem Statement
[edit | edit source]Test the following integrals using Gauss-Laguerre quadrature.
-
(
)
-
-
(
)
-
Where
Find
[edit | edit source]Plot the convergence of the integrals in:
(a) (
)(b) (
)as the number of integration points are increased.
Solution
[edit | edit source]On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Neither integral given converges, nor has a principle value for . However, the exercise is carried out for a variety of decreasing values of ranging from to
The Gauss-Laguerre quadrature rule was given in Equation 7.7 Report2
-
(
)
-
Plots were generated using the following numpy script.
Source:
################################################################################
# Name: gausslagtestEi.py
# Author: Cameron Stewart
# Date: 2/18/2014
#################################################################################
import numpy as np
import matplotlib.pyplot as plt
from scipy.special import expi
# Test functions 1 and 2 are the functions tested by the G-L quad
def TestFunction1(x):
y=1./x
return y
def TestFunction2(x):
y=1./(x**2)
return y
#################################################################################
# Uses the numpy Laguerre Gauss quadrature routine:
# numpy.polynomial.laguerre.laggauss(deg) to find roots and weight points.
# Output is tuple of 1d arrays for the weights and integration points.
# Note: Not tested for deg>100
#################################################################################
weight=(np.polynomial.laguerre.laggauss(4))
# Array for the lower integral bound
a=np.array([1.0,0.1,0.01,0.001,0.0001,0.00001,0.000001])
#################################################################################
# Plot to show the convergence with increasing integration points
#################################################################################
# Function1
exact=-expi(-a)
for j in range(0,len(a)):
t=np.linspace(2,100,99)
error=[]
for i in range(2, 101):
weight=(np.polynomial.laguerre.laggauss(i))
func=TestFunction1(weight[0]+a[j])
integ=weight[1]*func
integ=np.exp(-a[j])*np.sum(integ)
error.append((np.abs(integ-exact[j]))/exact[j]*100.)
plt.plot(t,error,label=r'$\epsilon$ = '+ str(a[j]))
plt.title(r'Convergence test for Gauss-Laguerre quadrature: $f(x)=\frac{1}{x}$')
plt.xlabel(r'Integration points: $n$')
plt.ylabel(r'Error %')
plt.legend(loc=1)
plt.ylim(-5,100)
plt.xlim(2,100)
#plt.show()
plt.clf()
# Function2
exact=expi(-a)+1./(np.exp(a)*a)
for j in range(0,len(a)):
t=np.linspace(2,100,99)
error=[]
for i in range(2, 101):
weight=(np.polynomial.laguerre.laggauss(i))
func=TestFunction2(weight[0]+a[j])
integ=weight[1]*func
integ=np.exp(-a[j])*np.sum(integ)
error.append((np.abs(integ-exact[j]))/exact[j]*100.)
plt.plot(t,error,label=r'$\epsilon$ = '+ str(a[j]))
plt.title(r'Convergence test for Gauss-Laguerre quadrature: $f(x)=\frac{1}{x^2}$')
plt.xlabel(r'Integration points: $n$')
plt.ylabel(r'Error %')
plt.legend(loc=5)
plt.ylim(-5,110)
plt.xlim(2,100)
plt.show()
Part a
[edit | edit source]Part b
[edit | edit source]In both Figure 6.1 and Figure 6.2, the quadrature converge quickly to the correct value for larger values of , but fail to converge to the correct answer for smaller
Contributing Team Members
[edit | edit source]- Cameron Stewart Solved problem 6, part b of problem 4, and the part of problem 5 pertaining to R2.7. Reviewed problem 3.
- Elizabeth Bartlett Solved problems 1, 2, 3, and the portion of problem 5 related to R2.4 and R2.5. Reviewed problem 4.
- Kevin Frost Solved problem 4 part a.
- Christopher Neal Solved problem 2.
Problem Assignments
| ||
Problem # | Solved by | Reviewed by |
1 | Bartlett, Elizabeth | |
2 | Bartlett, Elizabeth; Neal,Christopher | Neal,Christopher |
3 | Bartlett, Elizabeth | Stewart, Cameron |
4 | Frost, Kevin; Stewart, Cameron | Elizabeth Bartlett |
5 | Bartlett, Elizabeth; Stewart, Cameron | |
6 | Stewart, Cameron |
|