Hello everyone,
In my code below, how can I make the code input the values of "Pe" from { 25 to 1025 } and record the generated output values for EACH single input number.
For example; when I input a value of "Pe" of 25, the generated value of "MainpADM" is { 0.0054 }, and another input value of "Pe" of { 26 } will generate { 0.0065 }. and of course I am recording each corresponding output
This old-fashioned way will take A LOT of time to reach the final 1025 input. Therefore, Could you kindly help me in this regard?
The three codes of bvp4c:
MainADM
global Pe Taw Yx B A;
Pe = 61;
Taw=4.5;
Yx=0.212;
B=0.482;
A=1.01;
xlow = 0;
xhigh = 1;
y=[];
solinit = bvpinit(linspace(xlow,xhigh,20),[0 1]);
sol = bvp4c(@bvpode5,@bvpbc5,solinit);
plot(sol.x,sol.y(1,:),'r-')
xlabel('Rxtr Length Z/L')
ylabel('Concentration Fraction (S/So)')
axis ([0 1 0 1]);
grid on
legend('alpha')
fh=figure(1);
set(fh,'color','white')
title('Concentration Profiles Across the Rxtr')
disp (sol.y(1,end));
bvpode5
function dydx = bvpode5(x,y)
global Pe Taw Yx B A;
dydx = [y(2)
Pe*y(2)+((Pe*Taw*y(1)*(A-y(1)))/(B*Yx*(A-y(1))+y(1)))];
end
bvpbc5
function res = bvpbc5(ya,yb)
global Pe Taw Yx B;
res = [ ya(1)-1-((1/Pe)*ya(2))
yb(2)];
end