Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Applying an Asymptotic Condition to a Shooting Method Script

Asked by pxg882 on 20 Nov 2012

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 Comments

pxg882

Products

No products are associated with this question.

0 Answers

Contact us