필터 지우기
필터 지우기

Applying an Asymptotic Condition to a Shooting Method Script

조회 수: 2 (최근 30일)
pxg882
pxg882 2012년 11월 20일
Hi all,
I need to apply an asymptotic boundary condition for a shooing method script that I am using and was wondering if anyone could help me?
I'm running the following script:
dF2=0.0001;
dG2=0.0001;
initF2=0.5017;
initG2=-0.6532;
K=zeros(2);
etaspan=[0 175];
H=[1;1];
options=odeset('AbsTol',1e-9,'RelTol',1e-8);
while max(abs(H))>1e-8
[eta,X]=ode45(@nN,etaspan,[0;initF2+dF2;1;initG2;0],options);
n=size(eta,1);
X2=[X(n,1);X(n,3)];
[eta,X]=ode45(@nN,etaspan,[0;initF2;1;initG2+dG2;0],options);
n=size(eta,1);
X3=[X(n,1);X(n,3)];
[eta,X]=ode45(@nN,etaspan,[0;initF2;1;initG2;0],options);
n=size(eta,1);
X1=[X(n,1);X(n,3)];
K(1,1)=(X2(1)-X1(1))/dF2;
K(2,1)=(X2(2)-X1(2))/dF2;
K(1,2)=(X3(1)-X1(1))/dG2;
K(2,2)=(X3(1)-X1(2))/dG2;
H=K\-X1;
initF2=initF2+H(1);
initG2=initG2+H(2);
end
figure;
hold all;
plot(eta,X(:,1));
plot(eta,X(:,3));
plot(eta,(-1)*X(:,5));
plot(eta,X(:,2));
plot(eta,X(:,4));
hold off;
xlabel('\eta')
hleg = legend('F','G','-H','F\prime','G\prime','Location','SouthEast');
disp('Value of F''(0)')
a = X(1,2);
disp(a)
disp('Value of G''(0)')
b = X(1,4);
disp(b)
disp('Value of H(175)')
c = X(end,5);
disp(c)
Calling the function:
function Y=nN(x,X)
n=0.7;
dF1deta=X(2);
dF2deta=n^(-1)*((X(2)^(2)+X(4)^(2))^((n-1)/2))^(-1)*((X(1)^(2)-X(3)^(2)+(X(5)+((1-n)/(n+1))*X(1)*x)*X(2))*(1+(n-1)*(X(2)^(2)+X(4)^2)^(-1)*X(4)^(2))-(n-1)*X(2)*X(4)*(X(2)^(2)+X(4)^(2))^(-1)*(2*X(1)*X(3)+(X(5)+((1-n)/(n+1))*X(1)*x)*X(4)));
dG1deta=X(4);
dG2deta=n^(-1)*((X(2)^(2)+X(4)^(2))^((n-1)/2))^(-1)*((2*X(1)*X(3)+(X(5)+((1-n)/(n+1))*X(1)*x)*X(4))*(1+(n-1)*(X(2)^(2)+X(4)^2)^(-1)*X(2)^(2))-(n-1)*X(2)*X(4)*(X(2)^(2)+X(4)^(2))^(-1)*(X(1)^(2)-X(3)^(2)+(X(5)+((1-n)/(n+1))*X(1)*x)*X(2)));
dH1deta=-2*X(1)-(1-n)/(n+1)*x*X(2);
Y = [dF1deta; dF2deta; dG1deta; dG2deta; dH1deta];
I need to impose the following conditions as eta tends towards infinity:
X(2)=(1/eta)*(n/(n-1))*X(1)
and
X(4)=(1/eta)*(n/(n-1))*X(3)
I've tried a few things but can't seem to get any of them to work. Does anybody have any suggestions for what I can do here?
I've also tried running this problem (with the asymptotic boundary conditions included) using BVP4C but have had no luck.
Thanks.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by