- #1
Ein Krieger
- 34
- 0
Hello, guys
I am struggling with attaining stability values for u in solving the diffusion equation. The stability of u depends on the value of r from :
Values of u doesn't oscillate and follow stable path from r at i=1 i.e. at r=200 as can be seen from the code above. Ideally u should vary with time and r exponentially as you will see from the graph in the code attached. However, when I replace 200 from the above equation with 1 to obtain u at r=1, the results become unstable and oscillates. So I would like to obtain variation of u from r=1 not from r=200 without osciallation
Can you please help me to fix that problem.
All necessary codes are attached.
I am struggling with attaining stability values for u in solving the diffusion equation. The stability of u depends on the value of r from :
Code:
D=1000;
r0=1000;
std=1.0;
tau=1.0;
IP=2500; %initial pressure
%
% Radial grid and inhomogeneous term
nr=51;
dr=r0/(nr-1);
dr=50;
for i=1:nr
r(i)=(i-1)*dr+200;
end
Values of u doesn't oscillate and follow stable path from r at i=1 i.e. at r=200 as can be seen from the code above. Ideally u should vary with time and r exponentially as you will see from the graph in the code attached. However, when I replace 200 from the above equation with 1 to obtain u at r=1, the results become unstable and oscillates. So I would like to obtain variation of u from r=1 not from r=200 without osciallation
Can you please help me to fix that problem.
All necessary codes are attached.