I am using Mathematica 8.
I have two ODEs (in time) and a diffusion PDE (in radius and time) which are all coupled to each other. I solve them using
NDSolve by adding a degenerate space dimension to the ODE functions. Let the space dimension be $[a, b]$. As boundary conditions for the diffusion PDE I take a value determined by one of the ODEs at $a$ and a constant 1 at $b$. Initially, I assume a constant 1 besides at $a$, where the value is given by the ODE-function's initial value.
Mathematica can solve the equations, but for some parameter sets, the concentration becomes negative - which should not happen. I want to try to increase the numerical precision of the calculation by
- StartingStepSize -> small
- MaxSteps -> high
- MaxStepSize -> small
- AccuracyGoal -> high
eventually also by increasing
WorkingPrecision if necessary. The problem is that this would drastically increase calculation time and when I tried it, Mathematica crashed. At the same time, all this precision is needed for only about 20% of the spatial interval (which I want to keep large in order to minimise side effects from the box).
Therefore, my question is:
Is it possible in
NDSolve to specify different values for above-mentioned options for different parts of the solution interval?
As was pointed out to me in the comments, not all the options I mentioned are relevant for the spatial acccuracy. I therefore want to reformulate my question.
I see numerical errors over the first ~20% of the spatial interval and would like to increase precision there. Which of the above-mentioned options actually do apply to the spatial discretisation and how can I selectively increase them for the critical interval?