want to get two solutions but error in 1st region of the solution: curve is not smooth
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
% This program solves MHD stagnation point flow of nanofluid % f'''+ff''-f'^2 + M*(\lambda-f') + lmbda^2=0 % with boundary conditions %f(x)=0,f'(x)=1, at x=0 %f'(x)=lambda, as "x" tends to "infinity" %*****************Back up function******
function [solu] = Love
global A M S L infinity
% Initial values solu1 = bvpinit(linspace(1e-10,infinity,10),zeros(3,1)); %solu1 = bvpinit(linspace(0,10,5),zeros(7,1)); % solinit=bvpinit(linspace(0,infinity,8),[0 1 1]); % bvp4c takes two functions defined below and give solution in structure % form options = bvpset('RelTol',1e-10,'AbsTol',1e-10); solu = bvp5c(@bvpex1, @bcex1,solu1,options);
x = solu.x;
y = solu.y;
%plot(x,y(2,:),'b') %xlabel('\eta') %ylabel('df/dx')
%hold on;
% Here I defined first order ODEs
function ysolu = bvpex1(x,y) ysolu = [y(2); y(3); - y(1) * y(3) + y(2)*y(2) + M * y(2)-M*A-A*A];
end
% residual of boundary conditions function res = bcex1(y0, yinf)
res = [y0(1)-S; y0(2)-L; yinf(2)-A]; end end
%**File.2 *******Running Code************ clear all; clc format long close all
global A M S L infinity
infinity = 5; S = 0.5; A = 1; M = 1; % stagnation
L_range = [-3:0.2:1]; N_L = numel(L_range);
y_prime0_n = zeros(N_L, 1); for j = 1:N_L L = L_range(j); [sol] = Love; y_prime0 = sol.y; y_prime0_n(j) = y_prime0(3,1); display(L)
end plot(L_range, y_prime0_n);
1 Commento
Chad Greene
il 24 Ott 2014
What is your question?
Also, please format your text so it's easier to read the code.
Risposte (0)
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!