Is their the way we could put constraints for variables in ODE15s such that simulated values of these variables are always greater than 0.

5 views (last 30 days)
Some Values computed at different time through Ode15s solver are coming negative which ideally should not come. I just want to put constraints on these variables so that i could just get the positive values. Please let me know how can I put this constraint in ODE15s solver

Answers (1)

Sean de Wolski
Sean de Wolski on 15 Oct 2014
Edited: Sean de Wolski on 15 Oct 2014
It sounds like you need to add this to your odefun that ode15s is calling. If that values cannot be negative, then this function should not be returning negative values.
Actually, it looks like there is a 'NonNegative' option in odeset

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!