boundary conditions at infinity
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Good afternoon one and all. Good afternoon torsten sir
Sir my code is working by taking the boundary conditions as x = linspace(0,1,100) but doesnot working at x = linspace(0,Inf,100);
I request you sir please help me how to write the code for 3 sets of boundary conditions at η ≥0 , η =0 and η→∞.
I attached my equations image and my code error below.
My code :
x = linspace(0,Inf,100);
yinit = [0 1 0 1 0 1 ];
init = bvpinit(x,yinit);
options = bvpset('RelTol',1e-8,'AbsTol',1e-12);
sol = bvp4c(@odefun, @bcfun, init,options);
plot(sol.x, sol.y)
hold on
function dydx = odefun(x,y) % equations being solved
x0=1;x1=1;x2=1;x3=1;x4=1;x5=1;x6=1;s=1;Da=1;Gr=1;Gc=1;prs=1;Ra=1;Qr=1;Sc=1; Kr=1; E=1;n=1;s=1;
us = y(1);
usy = y(2);
theta = y(3);
thetay = y(4);
phi = y(5);
phiy = y(6);
dydx = zeros(6,1);
dydx(1) = usy;
dydx(2) = ((1/x0)*(x1*s*us)+(x0/Da)*us-x2*Gr*theta-x3*Gc*phi-(E/s)*(exp(-s*n)));
dydx(3) = thetay;
dydx(4) = ((1/x5)*(x4*prs*theta)+Ra*theta-Qr*theta);
dydx(5) = phiy;
dydx(6) = (Sc/x6)*(s*phi+Kr*phi);
end
function res = bcfun(yL,yR)
s=1;k=1;
res = zeros(6,1);
res(1) = yL(1)-(1/(2*1i))*(1/(s-1i*k)-1/(s+1i*k));
res(2) = yL(3)-(1/s^2)*(1-exp(-s));
res(3) = yL(5)-(1/s^2)*(1-exp(-s));
res(4)= yR(1);
res(5)= yR(3);
res(6)= yR(5);
end
ERROR:
Error using bvp4c (line 248)
Unable to solve the collocation equations -- a singular Jacobian encountered.
Error in bvpmodel (line 12)
sol = bvp4c(@odefun, @bcfun, init,options);
0 commentaires
Voir également
Catégories
En savoir plus sur Mathematics and Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!