MATLAB Stability issues of ODE solutions using Matlab

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 :

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.
 

Attachments

Want to reply to this thread?

"Stability issues of ODE solutions using Matlab" You must log in or register to reply here.

Related Threads for: Stability issues of ODE solutions using Matlab

Replies
0
Views
3K
  • Posted
Replies
0
Views
6K
  • Posted
Replies
0
Views
3K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top