online advertising

Friday, November 27, 2015

Scientific Computing - Quiz 3 - Question 1-3

Problem:

Solve the simple boundary value problem
$ y′′=−4y $ with $ y(0)=0 $, $ y′(1)=\cos(2) $

(Use your above work and solution to continue with this question)

With boundary value problem considered previously
$ y′′=−4y $ with $ y(0)=0 $, $y′(1)=\cos(2) $

Consider instead

$ y′′=−4y $ with $ y(0) = 0 $, $ y′(0) = A $ and use a bisection to compute the iterative values of $ A_1 = 0.5 $ that converge to the solution using a shooting algorithm (NOTE: use your known solution in the interval $t \in [0,1]$. Here assume that $ A_1 = 0.5 $ (too low) and $ A_2 = 2 $ (too high) to compute (a) $A_3$, (b) $A_4$ and (c) $A_5$.

Solution:

Taking Laplace transform on both side gives

$ \begin{eqnarray*} \mathcal{L}(y'') &=& \mathcal{L}(-4y) \\ s\mathcal{L}(y') - y'(0) &=& -4\mathcal{L}(y) \\ s(s\mathcal{L}(y) - y(0))- y'(0) &=& -4\mathcal{L}(y) \\ s(s\mathcal{L}(y))- y'(0) &=& -4\mathcal{L}(y) \\ s^2\mathcal{L}(y) + 4\mathcal{L}(y) &=& y'(0) \\ \mathcal{L}(y) &=& \frac{y'(0)}{s^2 + 4} \\ \mathcal{L}(y) &=& \frac{y'(0)}{2}\frac{2}{s^2 + 4} \\ y(t) &=& \frac{y'(0)}{2}\sin(2t) \\ \end{eqnarray*} $

Now we see the general form of $ y $, using the boundary condition we can solve for the unknown $ y'(0) $ as follow:

$ \begin{eqnarray*} y'(t) &=& y'(0)\cos(2t) \\ y'(1) &=& y'(0)\cos(2) \\ \cos(2) &=& y'(0)\cos(2) \\ y'(0) &=& 1 \\ y(t) &=& \frac{1}{2}\sin(2t) \\ \end{eqnarray*} $

The rest is just bisection.

Note that $ y'(1) = Acos(2) $

$ A $
$ y'(1) $
goal
$ y'(1) $ is …
$ A $ is …
0.5000
-0.2081
-0.4161
too high
too low
2.0000
-0.8323
-0.4161
too low
too high
1.2500
-0.5202
-0.4161
too low
too high
0.8750
-0.3641
-0.4161
too high
too low
1.0625
-0.4422
-0.4161
too low
too high

Note that the question is confusing me saying $ A = 0.5 $ is too low while $ y'(1) $ when $ A = 0.5 $ is actually too high :(

Also be very careful with the requirement for the number of digits.

No comments:

Post a Comment