Heyoka time value as float #66
Replies: 2 comments 4 replies
-
Hi, could you please post here the full error message with traceback? Is the error happening when creating the event or when running the integration? In general, it should not be needed to pass the time variable as an argument to f(), as you can directly use hk.time inside the implementation of f() if your event equation is time-dependent. (I am on vacation until the end of the week, so apologies if my replies are a bit delayed) |
Beta Was this translation helpful? Give feedback.
-
@bluescarni Since I do not have time to implement all these functions to use the heyoka expression system, the best way to go seems to generate a fine grid and evaluating the event a posteriori from the integration result. |
Beta Was this translation helpful? Give feedback.
-
I am trying to create an event detection using heyoka, following the Event Detection Overview in the tutorial.
Below, the function f is a self defined function that evaluates when the object that is the target of integration (coordinate expressed by x) and another object approached each other close enough to be below a threshold.
However, this results in errors such as
TypeError: float() argument must be a string or a number, not 'heyoka.core.expression'
How can I explicitly get the value of hk.time as a float value, so as not to have such errors?
Beta Was this translation helpful? Give feedback.
All reactions