General Principle
We've seen many methods to solve Initial Value Problems, but none of these methods can be used directly to solve the following Boundary Value Problem:
>
,
in
,
with the boundary conditions
,
.
>
All methods seen require initial data to advance the calculations. One way to resolve this dilemma is to guess the missing initial value and then adjust this guess until the value at the next boundary is sufficiently close to the value required. Consider the above problem, and use as a guess for the second initial value
.
Then the calculation yields
> f:=(t,y,nu)->nu;
> g:=(t,y,nu)->-2*nu/t+2*y/t^2+sin(ln(t))/t^2;
> RK4sys2(f,g,1.,1.,0.,0.01,100);
> ll1:=[]:for i from 0 to 100 do ll1:=[op(ll1),[x(i),u(i)]]: od:
>
A second guess, e.g.,
,
yields
>
> RK4sys2(f,g,1.,1.,1.,0.01,100);
> ll2:=[]:for i from 0 to 100 do ll2:=[op(ll2),[x(i),u(i)]]: od:
> plot({ll1,ll2},1..2);
>
So that the correct value lies somewhere in between:
>
> beta:=0.9:
> RK4sys2(f,g,1.,1.,beta,0.01,100);
> ll3:=[]:for i from 0 to 100 do ll3:=[op(ll3),[x(i),u(i)]]: od:
>
> beta:=0.92:
> RK4sys2(f,g,1.,1.,beta,0.01,100);
> ll4:=[]:for i from 0 to 100 do ll4:=[op(ll4),[x(i),u(i)]]: od:
>
> plot({ll1,ll2,ll3,ll4,2},1..2);
>
This method is called the Shooting Method .
>