User:Egm6322.s14.team2/report3: Difference between revisions
Line 205: | Line 205: | ||
{{NumBlk|::|<math>\mathbf{a}=(\ddot{r}-r\dot{{\theta}}^{2})\mathbf{e_{r}}+\frac{1}{r}\frac{d}{dt}(r^{2}\dot{{\theta}})\mathbf{e_{{\theta}}}</math> |{{EquationRef|Eq 2-10}}|}} |
{{NumBlk|::|<math>\mathbf{a}=(\ddot{r}-r\dot{{\theta}}^{2})\mathbf{e_{r}}+\frac{1}{r}\frac{d}{dt}(r^{2}\dot{{\theta}})\mathbf{e_{{\theta}}}</math> |{{EquationRef|Eq 2-10}}|}} |
||
==R3.4: Solutions to First Oder Linear ODE with Variable Coefficients using Euler Integrating Factor== |
|||
==R3.4:== |
|||
===Problem Statement=== |
===Problem Statement=== |
||
Line 275: | Line 275: | ||
{{NumBlk|::|<math>2+\frac{k_2}{\sqrt{x^2+1}}</math>|{{EquationRef|Eq 3-11}}|}} |
{{NumBlk|::|<math>2+\frac{k_2}{\sqrt{x^2+1}}</math>|{{EquationRef|Eq 3-11}}|}} |
||
==R3.5:== |
==R3.5: Commented problems from R2== |
||
===Problem Statement=== |
===Problem Statement=== |
||
Line 445: | Line 445: | ||
This code did not test a Bessel integral of the form given in problem R2.7. |
This code did not test a Bessel integral of the form given in problem R2.7. |
||
==R3.6: Testing Gauss-Laguerre Quadrature Part 2== |
|||
==R3.6:== |
|||
===Problem Statement=== |
===Problem Statement=== |
||
Line 567: | Line 567: | ||
In both Figure 6.1 and Figure 6.2, the quadrature converge quickly to the correct value for larger values of <math>\epsilon</math>, but fail to converge to the correct answer for smaller <math>\epsilon</math> |
In both Figure 6.1 and Figure 6.2, the quadrature converge quickly to the correct value for larger values of <math>\epsilon</math>, but fail to converge to the correct answer for smaller <math>\epsilon</math> |
||
=Contributing Team Members= |
|||
* [[User:csstewart10|Cameron Stewart]] Solved problem 6, part b of problem 4, and the part of problem 5 pertaining to R2.7. Reviewed problem 3. |
|||
* [[User:Bartlete2|Elizabeth Bartlett]] |
|||
* [[User:kev1109|Kevin Frost]] |
|||
* [[User:Egm6322.s14.team2.chris|Christopher Neal]] |
|||
<br /><br /><br /> |
|||
{| class="prettytable" style="margin: 1em auto 1em auto;" |
|||
| colspan="3" | <center>'''Problem Assignments'''</center> |
|||
|- |
|||
| Problem # |
|||
| Solved by |
|||
| Reviewed by |
|||
|- |
|||
|1 |
|||
| Bartlett, Elizabeth |
|||
| |
|||
|- |
|||
|2 |
|||
| Bartlett, Elizabeth; Neal, Christopher |
|||
| |
|||
|- |
|||
|3 |
|||
| Bartlett, Elizabeth |
|||
| Stewart, Cameron |
|||
|- |
|||
|4 |
|||
| Frost, Kevin; Stewart, Cameron |
|||
| |
|||
|- |
|||
|5 |
|||
| Bartlett, Elizabeth; Stewart, Cameron |
|||
| |
|||
|- |
|||
|6 |
|||
| Stewart, Cameron |
|||
| |
|||
|} |
|||
=References= |
|||
{{Reflist}} |
Revision as of 15:59, 21 February 2014
Report 3 PEA 2 Spring 2014 Team 2
Problems are given in lecture notes
R3.1:
Problem Statement
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
(a): (b):
Solution
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
Problem Statement
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
(a): A suitable change of variable to show that (
) can be written as the Hermite differential equation of the form of ( )Solution
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
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 the only difference.Plot Solution for 2 Cases
Here we are asked to plot the solution to the Hermite differential equation for the cases when .
Case for
Here the Hermite differential equation takes the following form.
-
(
)
-
Case for
Here the Hermite differential equation takes the following form.
-
(
)
-
R3.3:
Problem Statement
sec.70a, Pb-70.1 (Kepler’s equation, acceleration vector in planar motion using Euler formula)
Show,
-
(
)
-
Find
(a): (b):
Solution
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
Problem Statement
A general First Order Linear Differential Equation with Varying Coefficients (L1-ODE-VC) has the following form:
-
(
)
Find
(a)
-
(
)
(b)
-
(
)
Solution
On our honor, we did this assignment on our own, without looking at the solutions in previous semesters or other online solutions.
Part a
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
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
Problem Statement
Redo commented problems from Report 2.
R2.4:Differential Element in Spherical Coordinates
Given Information
The following equation is given for ds2:
-
(
)
-
xi is written in spherical coordinates in (
) through ( ).-
(
)
-
-
(
)
-
-
(
)
-
Problem Statement
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
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
Given Information
The following equation is given for P2(x), the Legendre Polynomial of degree n=2:
-
(
)
-
Problem Statement
Using variation of parameters, show that Equation 5-2 is a second solution to the Legendre differential equation in Equation 5-3 as given in Pb.R*6.11 on pp.37-4 in sec.37 of the notes.
-
(
)
-
Solution
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
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
Problem Statement
Test the following integrals using Gauss-Laguerre quadrature.
-
(
)
-
-
(
)
-
Where
Find
Plot the convergence of the integrals in:
(a) (
)(b) (
)as the number of integration points are increased.
Solution
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
Part b
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
- 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
- Kevin Frost
- Christopher Neal
Problem # | Solved by | Reviewed by |
1 | Bartlett, Elizabeth | |
2 | Bartlett, Elizabeth; Neal, Christopher | |
3 | Bartlett, Elizabeth | Stewart, Cameron |
4 | Frost, Kevin; Stewart, Cameron | |
5 | Bartlett, Elizabeth; Stewart, Cameron | |
6 | Stewart, Cameron |
|