Hello, guys(adsbygoogle = window.adsbygoogle || []).push({});

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 osciallationCode (Text):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

Can you please help me to fix that problem.

All necessary codes are attached.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Stability issues of ODE solutions using Matlab

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

**Physics Forums | Science Articles, Homework Help, Discussion**