Question: How to restrict dsolve (numeric) to nonnegative values?

Hello,

I have a system of two ODEs.  The solutions of the system (U(t) and V(t)) should never take on negative values, but may approach zero.  When using dsolve (numeric) to solve the system and odeplot to plot the system, I can see that dsolve gives slightly negative values to the solutions when close to zero.  This may result in the solutions becomes increasingly negative over time.

How can I prevent dsolve from assigning negative values to the solutions?  I have tried the following without success:

"dsolve(...) assuming U(t)>=0, V(t)>=0"

"assume(U(t)>=0);  assume(V(t)>=0);"

I have also played with Events in dsolve.  Some of the events seem to actually encourage dsolve to avoid large negative values, although I'm not sure why.  For example, using "events=[[[U(t),U(t)<0],halt],[[V(t),V(t)<0],halt]]" seems to prevent the solutions from becoming large negative.

I am considering making error tolerances tighter, but I am hoping someone can provide a direct way of telling Maple that negative values are forbidden.

Thank you!

Please Wait...