Aug-04-2022, 06:16 PM
(This post was last modified: Aug-04-2022, 08:50 PM by deanhystad.)
Not surprised that you don't understand it since it doesn't make any sense.
This is True if tNow > 0 and tNow < 2, else it is False
This is True if tNow > 0 and tNow < 2, else it is False
(0.0 < tNow < 2.0)That result is multipled by Iin which is a float. When multiplying a boolean by a float, True = 1 and False = 0, so this is either Iin or 0.0 depending on the value of tNow.
(0.0 < tNow < 2.0) * IinNow for the makes no sense part. 0 * 0 == 0 and 1 * 0 == 0, so this is always zero.
(tNow >= 2.0 or tNow < 0) * 0Which means these are equivalent:
Iss = (0.0 < tNow < 2.0) * Iin + (tNow >= 2.0 or tNow < 0) * 0 Iss = (0.0 < tNow < 2.0) * IinWhich I think is easier to understand as:
Iss = Iin if (0.0 < tNow < 2.0) else 0