online advertising
Processing math: 100%

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 A1=0.5 that converge to the solution using a shooting algorithm (NOTE: use your known solution in the interval t[0,1]. Here assume that A1=0.5 (too low) and A2=2 (too high) to compute (a) A3, (b) A4 and (c) A5.

Solution:

Taking Laplace transform on both side gives

L(y)=L(4y)sL(y)y(0)=4L(y)s(sL(y)y(0))y(0)=4L(y)s(sL(y))y(0)=4L(y)s2L(y)+4L(y)=y(0)L(y)=y(0)s2+4L(y)=y(0)22s2+4y(t)=y(0)2sin(2t)

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

y(t)=y(0)cos(2t)y(1)=y(0)cos(2)cos(2)=y(0)cos(2)y(0)=1y(t)=12sin(2t)

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