solving 1D diffusion problem using pdepe tool. From experimental data , I have 90 data points showing values of concentrations after every 0.16mm distance in x direction, and 5 seconds time step . I am facing problem in defining IC /BCfrom expt data
1 view (last 30 days)
Show older comments
my code folder=load ('project-data.txt'); con_i=folder(:,1); con_f=folder(:,15); m = 0; tol=0.1; % tolerance x = linspace(0,2.4,15); t = linspace(0,15,90); D_in=3.47*10^(-3); pdex1(D_in,folder); % function pdex1(D_in,folder)
m = 0; tol=0.1; % tolerance x = linspace(1,2.4,15); t = linspace(0,15,90);
sol = pdepe(m,@pdefun,@icfun,@bcfun,x,t); %%%% %%%%% for j_=1:100 if abs(sol-folder)<=tol res=abs(sol-folder);
D_in=D_in(j_);
sol = pdepe(m,pdefun(D_in(j_)),icfun,bcfun,x,t,res,sol);
% D_in=D_new;
S0=[D_in];
lt=[0];
ut=[3.47*10^(-3)];
[sol,res]=lsqnonlin(@(sol)...
pdepe(m,pdefun(D_in),icfun,bcfun,S0,lt,ut,options));
j_=j_+1;
end
end
% sig=20;
% siz=30;
u = sol(:,:,:);
%fil=gauss_filter_my(u, sig, siz);
surf(x,t,u)
title('Numerical solution computed with 15 mesh points.')
xlabel('Time t[sec]')
ylabel('Distance x[mm]')
zlabel('S_C_O_2.S^-1_C_-_H')
% zlim([0.0 0.8]) ;
% ylim([0 6.4])
% xlim([0 60])
function [c,f,s] = pdefun(x,t,u,DuDx) %D_in=3.47*10^(-3); c =1;%/ D_in; f = DuDx; s = 0;
%Defining initial condition function u0 = icfun(x) folder=load ('project-data.txt'); u0 = folder(1,1); %Defining boundary condition function [pl,ql,pr,qr] = bcfun(xl,ul,xr,ur,t) folder=load ('project-data.txt'); pl = ul; ql=1; pr =folder(:,15); qr = 2.4;
0 Comments
Answers (0)
See Also
Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!