Graphics Programs Reference
In-Depth Information
function shoot4
% Shooting method for 4th-order boundary value
% problem in Example 8.4.
global XSTART XSTOP H
% Make these params. global.
XSTART = 0; XSTOP = 1;
% Range of integration.
H = 0.5;
% Step size.
freq = 1;
% Frequency of printout.
u = [0 1];
% Trial values of u(1).
% and u(2).
x = XSTART;
u = newtonRaphson2(@residual,u);
[xSol,ySol] = bulStoer(@dEqs,x,inCond(u),XSTOP,H);
printSol(xSol,ySol,freq)
functionF=dEqs(x,y)
%Differentialequations.
F = [y(2) y(3) y(4) x;];
functiony=inCond(u)
%Initialconditions;u(1)
y = [0 u(1) 0 u(2)];
% and u(2) are unknowns.
functionr=residual(u) %Boundaryresiduals.
global XSTART XSTOP H
r = zeros(length(u),1);
x = XSTART;
[xSol,ySol] = bulStoer(@dEqs,x,inCond(u),XSTOP,H);
lastRow = size(ySol,1);
r(1)= ySol(lastRow,1);
r(2) = ySol(lastRow,3);
Here is the output:
>> x y1 y2 y3 y4
0.0000e+000 0.0000e+000 1.9444e-002 0.0000e+000 -1.6667e-001
5.0000e-001 6.5104e-003 1.2150e-003 -6.2500e-002 -4.1667e-002
1.0000e+000 -4.8369e-017 -2.2222e-002 -5.8395e-018 3.3333e-001
Noting that
w 0 L 4
E I
1
L =
w 0 L 3
E I
dv
dx =
dv
d
d
ξ
dx =
dy
d
dy
d
ξ
ξ
ξ
Search WWH ::




Custom Search