Fick's 2nd Law of Diffusion using Method of Lines

버전 1.0.0 (1.98 KB) 작성자: Roche de Guzman
PDE solution using Method of Lines
다운로드 수: 255
업데이트 날짜: 2019/4/26

라이선스 보기

%% Method of Lines with D = diffusivity: Fick's 2nd Law of Diffusion
% by Prof. Roche C. de Guzman
%% Custom fx
function Y1 = F(~,Y,D,nx,dx)
c = Y; % assign concentration as Y
Y1 = zeros(nx,1); % temporary derivatives
for i = 1:nx-2 % position counter
Y1(i+1) = D*(c(i+2)-2*c(i+1)+c(i))/dx^2; % solve for derivatives
end
Y1 = [Y1(2); Y1(2:nx-1); Y1(nx-1)]; % derivatives with zero-flux boundary
end

인용 양식

Roche de Guzman (2024). Fick's 2nd Law of Diffusion using Method of Lines (https://www.mathworks.com/matlabcentral/fileexchange/71354-fick-s-2nd-law-of-diffusion-using-method-of-lines), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2019a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Eigenvalue Problems에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0