Skip to content

Include functionality for modifying parameters #350

@FinbarArgus

Description

@FinbarArgus

For replacing the Python OpenCOR API with LibOpenCOR, we need to be able to run the following commands:

self.simulation = oc.open_simulation(cellml_path)
self.simulation.valid():
self.simulation.data()
self.data.odeSolverProperties():
self.data.set_ode_solver_property(key, value)
self.data.set_point_interval(self.dt)  # time interval for data storage
self.data.set_starting_point(0)
self.data.set_ending_point(self.stop_time)

self.simulation.run()
self.simulation.reset()
self.simulation.release_all_values()
self.simulation.clear_results()
self.simulation.reset(False) # True resets everything, False resets only the states

self.simulation.results().states():
self.simulation.results().states()[variable_name].values()[-self.n_steps - 1:].copy())
self.simulation.results().algebraic():
self.simulation.results().algebraic()[variable_name].values()[-self.n_steps-1:].copy())
self.data.constants():
self.data.constants()[variable_name])

self.data.states()[param_name] = param_vals[JJ]
self.data.constants()[param_name] = param_vals[JJ]

Or equivalent commands.

For context see https://github.com/FinbarArgus/circulatory_autogen/blob/devel/src/utilities/opencor_helper.py

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions