-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssertionError: Event handling for fixed step solvers currently requires step_size
to be provided in options.
#502
Comments
This fixes the problem: def make_var_threshold(var: str, threshold: torch.Tensor):
return lambda time, state: state[var] - threshold
infection_threshold = make_var_threshold("I", torch.tensor(40.0))
dynamic_parameter_interventions1 = {infection_threshold: {"p_cbeta": torch.tensor(0.3)}}
# Specify solver options including the step_size
solver_options = {"step_size": 1e-2} # Example step size, adjust as needed
result = pyciemss.sample(model3, end_time, logging_step_size, num_samples, start_time=start_time,
dynamic_parameter_interventions=dynamic_parameter_interventions1,
solver_method="euler",
solver_options=solver_options) However, you do not need to specify def make_var_threshold(var: str, threshold: torch.Tensor):
return lambda time, state: state[var] - threshold
infection_threshold = make_var_threshold("I", torch.tensor(400.0))
dynamic_parameter_interventions1 = {infection_threshold: {"p_cbeta": torch.tensor(0.3)}}
# Specify solver options including the step_size
solver_options = {"step_size": 1e-2} # Example step size, adjust as needed
result = pyciemss.sample(model3, end_time, logging_step_size, num_samples, start_time=start_time,
dynamic_parameter_interventions=dynamic_parameter_interventions1,
solver_method="dopri5")
#solver_options=solver_options) |
I believe this issue is now resolved and can be closed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting the error message below when I try:
Where
model3 = os.path.join(MODEL_PATH, "SIR_stockflow.json")
andMODEL_PATH = "https://raw.githubusercontent.com/DARPA-ASKEM/simulation-integration/main/data/models/"
The text was updated successfully, but these errors were encountered: