Saturday, 21 April 2012
Friday, 20 April 2012
Part 2 of Pharaoh's Taylor series and modified Euler question from Yahoo Answers
consider van der pol's equationy" - 0.2(1-y^2)y' + y = 0 y(0)=0.1 y'(0)=0.1
2)Write down the above problem as a system of first order differential equations.Calculate the numerical solution at x = 0.2 using the Modified Euler method. Take thestep-length h = 0.1 and work to 6 decimal places accuracy. Compare with your solutionin part (i) and comment on your answers.
There is a standard method of converting higher order ODEs into first order systems, in this case it is to introduce the state vector:
\(Y(t)=\left[ \begin{array}{c} y(t) \\ y'(t) \end{array} \right] \)
Then the ODE becomes:
\( Y'(t)= F(t,Y)=\left[ \begin{array}{c} y'(t) \\ y''(t) \end{array} \right]= \left[ \begin{array}{c} y'(t) \\ 0.2 \left(1-(y(t))^2 \right) y'(t)-y(t) \end{array} \right] \)
Now you can use the standard form of the modified Euler method on this vector first order ODE.
.
Pharaoh's Taylor series and modified Euler question from Yahoo Answers
consider van der pol's equationy" - 0.2(1-y^2)y' + y = 0 y(0)=0.1 y'(0)=0.1
1)You are asked to find the approximate solution for this problem using the Taylor seriesmethod. Your expansion should include the first three non-zero terms and you shouldwork to six decimal places accuracy. First find the approximate solutions for both y (0.1)and y’(0.1) using the first three non-zero terms of Taylor series expansion for eachfunction and then use this information to calculate the approximate solution at x = 0.2.
The Taylor series expansion about \(t=0\) is of the form:
\(y(t)=y(0)+y'(0)t+\frac{y''(0)t^2}{2}+.. \)
We are given \(y(0)\) and \(y'(0)\) in the initial condition, and so from the equation we have:
\(y''(0) = 0.2(1-(y(0))^2)-y(0)=0.2(1-0.1^2)-0.1=-0.0802\)
So the Taylor series about \(t=0\) is:
\(y(t)=0.1+0.1t-0.0401t^2+... \)
and using the first three terms of this we have \(y(0.1)\approx 0.109599\),
Also:
\(y'(t)=0.1-0.0802t+...\)
and so \(y'(0.1) \approx 0.09198\)
Now the Taylor expansion about \(t=0.1\) is:
\(y(t)=y(0.1)+(t-0.1)y'(0.1)+\frac{(t-0.1)^2y''(0.1)}{2}+...\)
where \(y''(0.1)=0.2\left(1-(y(0.1))^2\right)y'(0.1)-y(0.1)=-0.08178796\).
So:
\(y(0.2)\approx 0.109599+0.1\times 0.0198-0.1^2\times 0.8178796 = 0.108789 \) to 6 six DP
.
Sunday, 15 April 2012
Another POTW proposal
Prove that \(|\sin(nx)|\le n|\sin(x)|\) for all \(x \in \mathbb{R}\) and \(n \in \mathbb{N}_+\).
==========================
Solution: This is just an excesise in induction.
The base case \(n=1\) holds obviously and trivialy.
Now suppose that for some \(k \in \mathbb{N}_+\):
\[|\sin(kx)| \le k |\sin(x)|\].
Now consider:
\[|\sin((k+1)x)|=| \sin(kx)\cos(x)+\cos(kx)\sin(x)| \].
Then by the triangle inequality we get:
\[|\sin((k+1)x)|\le |\sin(kx)\cos(x)|+|\cos(kx)\sin(x)| \\ \phantom{[ \sin((k+1)x)xxx}\le |\sin(kx)| + |\sin(x)|=(k+1)|\sin(x)|\].
QED
==========================
Solution: This is just an excesise in induction.
The base case \(n=1\) holds obviously and trivialy.
Now suppose that for some \(k \in \mathbb{N}_+\):
\[|\sin(kx)| \le k |\sin(x)|\].
Now consider:
\[|\sin((k+1)x)|=| \sin(kx)\cos(x)+\cos(kx)\sin(x)| \].
Then by the triangle inequality we get:
\[|\sin((k+1)x)|\le |\sin(kx)\cos(x)|+|\cos(kx)\sin(x)| \\ \phantom{[ \sin((k+1)x)xxx}\le |\sin(kx)| + |\sin(x)|=(k+1)|\sin(x)|\].
QED
Monday, 9 April 2012
David's question from Yahoo Answers
This is the prototype for the posting of this question/solution to MathHelpBoards: http://www.mathhelpboards.com/showthread.php?824-David-s-question-from-Yahoo-Answers
2. Let X be a random variable that follows a Uniform(0; 1) distribution.
(a) Show that E(X) = 1/2 and Var(X) = 1/12.
(b) Using Chebyshev's inequality fi nd an upper bound on the prob-
ability that X is more than k standard deviations away from its
expected value.
(c) Compute the exact probability that X is more than k standard
deviations from its expected value.
(d) Compare the bound to the exact probability.
Thanks
============================================
(a) By definition of the expectation: \[E(X)= \int_{-\infty}^{\infty} x p(x)\; dx\]
but \(X \sim U(0,1)\) so \(p(x)=1\) for \(x\) in \([0,1]\) and zero otherwise this becomes:
\[E(X) = \int_0^1 x dx\]
Hence \[E(X)= \biggl[ \frac{x^2}{2} \biggr]_0^1= \frac{1^2}{2}-\frac{0^2}{2}=1/2 \]
Similarly for the variance:
\[V(X)=E( (X - \overline{X})^2 ) = \int_0^1 (x-1/2)^2\; dx = \frac{1}{12}\]
(b) I don't know what is being asked for here, Chebyshev's inequality is just this:
\[P( |X-\overline{X}| \ge k \sigma) \le \frac{1}{k^2}\]
(c) There are a number of ways of doing this, the easiest involves a diagram, but that is not convienient to use here, so we take the definition of the required probability:
\[P( |X-\overline{X}| \ge k \sigma)= P( X-\overline{X} \le - k \sigma) + P( X-\overline{X} \ge k \sigma)\]
Which may be written as a sum of integrals:
\[P( X-\overline{X} \le - k \sigma)=P(X \le \overline{X}-k \sigma)=\int_0^{\frac{1}{2}-\frac{k}{\sqrt{12}}} dx\] when \(k < \sqrt{12}/2\) and zero otherwise, and:
\[P( X-\overline{X} \ge - k \sigma)=P(X \ge \overline{X}+k \sigma)=\int_{\frac{1}{2}+\frac{k}{\sqrt{12}}}^1 dx\] when \(k < \sqrt{12}/2\) and zero otherwise.
CB
2. Let X be a random variable that follows a Uniform(0; 1) distribution.
(a) Show that E(X) = 1/2 and Var(X) = 1/12.
(b) Using Chebyshev's inequality fi nd an upper bound on the prob-
ability that X is more than k standard deviations away from its
expected value.
(c) Compute the exact probability that X is more than k standard
deviations from its expected value.
(d) Compare the bound to the exact probability.
Thanks
============================================
(a) By definition of the expectation: \[E(X)= \int_{-\infty}^{\infty} x p(x)\; dx\]
but \(X \sim U(0,1)\) so \(p(x)=1\) for \(x\) in \([0,1]\) and zero otherwise this becomes:
\[E(X) = \int_0^1 x dx\]
Hence \[E(X)= \biggl[ \frac{x^2}{2} \biggr]_0^1= \frac{1^2}{2}-\frac{0^2}{2}=1/2 \]
Similarly for the variance:
\[V(X)=E( (X - \overline{X})^2 ) = \int_0^1 (x-1/2)^2\; dx = \frac{1}{12}\]
(b) I don't know what is being asked for here, Chebyshev's inequality is just this:
\[P( |X-\overline{X}| \ge k \sigma) \le \frac{1}{k^2}\]
(c) There are a number of ways of doing this, the easiest involves a diagram, but that is not convienient to use here, so we take the definition of the required probability:
\[P( |X-\overline{X}| \ge k \sigma)= P( X-\overline{X} \le - k \sigma) + P( X-\overline{X} \ge k \sigma)\]
Which may be written as a sum of integrals:
\[P( X-\overline{X} \le - k \sigma)=P(X \le \overline{X}-k \sigma)=\int_0^{\frac{1}{2}-\frac{k}{\sqrt{12}}} dx\] when \(k < \sqrt{12}/2\) and zero otherwise, and:
\[P( X-\overline{X} \ge - k \sigma)=P(X \ge \overline{X}+k \sigma)=\int_{\frac{1}{2}+\frac{k}{\sqrt{12}}}^1 dx\] when \(k < \sqrt{12}/2\) and zero otherwise.
CB