- #1
robijnix
- 4
- 0
Homework Statement
I have a set of differential equations, which need to be solved by matlabs solvers. all of the states have to stay between 0 and 1, but they don't. I'm 100% sure my equations are right, but MATLAB is taking too big steps, causing the state to go negative or above 1.
most of the time it's only something like -10^6, but this is still wrong and causes a lot of problems. Sometimes the negative values don't stay that low and as state get a value like -400. Again, I'm sure my equations are right, and saying that they aren't isn't going to help me. If someone has any idea on how to fix this it would be greatly appreciated.
(also I'v tried lowering the tolerance and using 'NonNegative', and I'v tried all different solvers)