This function as currently implemented is very confusing:
if_lt0_else(time, psi_phi, 0)
In its current implementation if time < 0 then the second argument is used where as if time >= 0 then the 3rd argument is used. Generally I would have thought you'd expect the second argument to be used if the condition in the name of the function is true but thats not the case here. Might need renaming or some other tweak to make it clear what it is doing.
This function as currently implemented is very confusing:
In its current implementation if
time < 0
then the second argument is used where as iftime >= 0
then the 3rd argument is used. Generally I would have thought you'd expect the second argument to be used if the condition in the name of the function is true but thats not the case here. Might need renaming or some other tweak to make it clear what it is doing.