heat and mass transfer problem nonlinear differential equations
The code is running, the graph is also came. But it does not give the convergence for the curves , , , and .
fluid_Sol_bvp4c2
function fluid_Sol_bvp4c2
Pr = 10;
Le = 10;
Nr = 0.5;
Nb = 0.5;
Nt = 0.5;
% Defining parameters
solinit = bvpinit(linspace(0, 10, 100), [0 0 1 1 0 1 0]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y
% Plotting of the functions
figure(1)
plot(x, y(1,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the velocity
figure(2)
plot(x, y(2,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s^{prime}(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(4,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the fun
figure(4)
plot(x, y(6,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘f(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1); % y1 to start at 0
y0(2); % y2 to start at 0
y0(4) – 1; % y4 to start at 1
y0(6) – 1; % y6 to start at 1
yinf(2) – 0; % desire y2 to converge to 0
yinf(4) – 0; % desire y4 to converge to 0
yinf(6) – 0]; % desire y5 to converge to 0
end
% System of First Order ODEs
function dydx = bvp2D(~, y)
yy1 = – 1/(4*Pr)*(3*y(1)*y(3) – 2*y(2)^2) – y(4) + Nr*y(6);
yy2 = – 3/4*y(1)*y(5) – Nb*y(7)*y(5) – Nt*y(5)^2;
yy3 = – 3/4*Le*y(7) – (Nt/Nb)*yy2;
dydx = [y(2); y(3); yy1; y(5); yy2; y(7); yy3];
end
end
I dont know whether i have to use extend code in bvp4c. Please help me do the needful. Thanks in advance.The code is running, the graph is also came. But it does not give the convergence for the curves , , , and .
fluid_Sol_bvp4c2
function fluid_Sol_bvp4c2
Pr = 10;
Le = 10;
Nr = 0.5;
Nb = 0.5;
Nt = 0.5;
% Defining parameters
solinit = bvpinit(linspace(0, 10, 100), [0 0 1 1 0 1 0]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y
% Plotting of the functions
figure(1)
plot(x, y(1,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the velocity
figure(2)
plot(x, y(2,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s^{prime}(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(4,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the fun
figure(4)
plot(x, y(6,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘f(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1); % y1 to start at 0
y0(2); % y2 to start at 0
y0(4) – 1; % y4 to start at 1
y0(6) – 1; % y6 to start at 1
yinf(2) – 0; % desire y2 to converge to 0
yinf(4) – 0; % desire y4 to converge to 0
yinf(6) – 0]; % desire y5 to converge to 0
end
% System of First Order ODEs
function dydx = bvp2D(~, y)
yy1 = – 1/(4*Pr)*(3*y(1)*y(3) – 2*y(2)^2) – y(4) + Nr*y(6);
yy2 = – 3/4*y(1)*y(5) – Nb*y(7)*y(5) – Nt*y(5)^2;
yy3 = – 3/4*Le*y(7) – (Nt/Nb)*yy2;
dydx = [y(2); y(3); yy1; y(5); yy2; y(7); yy3];
end
end
I dont know whether i have to use extend code in bvp4c. Please help me do the needful. Thanks in advance. The code is running, the graph is also came. But it does not give the convergence for the curves , , , and .
fluid_Sol_bvp4c2
function fluid_Sol_bvp4c2
Pr = 10;
Le = 10;
Nr = 0.5;
Nb = 0.5;
Nt = 0.5;
% Defining parameters
solinit = bvpinit(linspace(0, 10, 100), [0 0 1 1 0 1 0]);
sol = bvp4c(@bvp2D, @bc2D, solinit);
x = sol.x;
y = sol.y
% Plotting of the functions
figure(1)
plot(x, y(1,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the velocity
figure(2)
plot(x, y(2,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘s^{prime}(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of theta
figure(3)
plot(x, y(4,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘theta ‘, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Plotting of the fun
figure(4)
plot(x, y(6,:), ‘linewidth’, 1), grid
hold on
xlabel(‘eta’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
ylabel(‘f(eta)’, ‘fontweight’, ‘bold’, ‘fontsize’, 16)
hold off
% Residual of the boundary conditions
function res = bc2D(y0, yinf)
res = [y0(1); % y1 to start at 0
y0(2); % y2 to start at 0
y0(4) – 1; % y4 to start at 1
y0(6) – 1; % y6 to start at 1
yinf(2) – 0; % desire y2 to converge to 0
yinf(4) – 0; % desire y4 to converge to 0
yinf(6) – 0]; % desire y5 to converge to 0
end
% System of First Order ODEs
function dydx = bvp2D(~, y)
yy1 = – 1/(4*Pr)*(3*y(1)*y(3) – 2*y(2)^2) – y(4) + Nr*y(6);
yy2 = – 3/4*y(1)*y(5) – Nb*y(7)*y(5) – Nt*y(5)^2;
yy3 = – 3/4*Le*y(7) – (Nt/Nb)*yy2;
dydx = [y(2); y(3); yy1; y(5); yy2; y(7); yy3];
end
end
I dont know whether i have to use extend code in bvp4c. Please help me do the needful. Thanks in advance. bvp4c method MATLAB Answers — New Questions