Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


Jason S
Posts:
57
Registered:
2/23/05


Simulink evaluation of (a<b) ? (a*a/b) : b
Posted:
Apr 17, 2012 2:39 PM


I posted on StackOverflow (http://stackoverflow.com/questions/10196654/simulinknumericalevaluationtopreventoverflow) but figured I'd ask here as well:
I have this function
f(a,b) = { a*a/b if a < b, b if a >= b }
defined for values of a and b between 0 and 1 inclusive.
The function is continuous at all valid values of a and b in this range. (Really! try it yourself!) But I'm not sure how to evaluate it in Simulink. The problem is that I can't figure out how to restate it in a way that I could evaluate both "forks" of the function and take the min or max (e.g. min(a*a,b*b)/b) without having a dividebyzero error at b=0, and I'd like to avoid getting into things like conditionallyexecuted subsystems.
Does anyone know how I might go about doing this?



