Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Stability issues of ODE solutions using Matlab

  1. Apr 4, 2013 #1
    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 (Text):

    IP=2500;  %initial pressure
    % Radial grid and inhomogeneous term
    for i=1:nr
    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.

    Attached Files:

  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted