transient
¤
Transient solvers to be used with Diffrax.
Classes:
| Name | Description |
|---|---|
VectorizedTransientSolver |
Transient solver that works strictly on FLAT (Real) vectors. |
Functions:
| Name | Description |
|---|---|
setup_transient |
Configures and returns a function for executing transient analysis. |
VectorizedTransientSolver
¤
Bases: AbstractSolver
Transient solver that works strictly on FLAT (Real) vectors.
Delegates complexity handling to the 'linear_solver' strategy.
setup_transient
¤
setup_transient(
groups: list,
linear_strategy: CircuitLinearSolver,
transient_solver: AbstractSolver = None,
) -> Callable[..., Solution]
Configures and returns a function for executing transient analysis.
This function acts as a factory, preparing a transient solver that is
pre-configured with the circuit's linear strategy. It returns a callable
that executes the time-domain simulation using diffrax.diffeqsolve.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
groups
|
list
|
A list of component groups that define the circuit. |
required |
linear_strategy
|
CircuitLinearSolver
|
The configured linear solver
strategy, typically obtained from |
required |
transient_solver
|
optional
|
The transient solver class to use.
If None, |
None
|
Returns:
| Type | Description |
|---|---|
Callable[..., Solution]
|
Callable[..., Any]: A function that executes the transient analysis. |
Callable[..., Solution]
|
This returned function accepts the following arguments: t0 (float): The start time of the simulation.
t1 (float): The end time of the simulation.
dt0 (float): The initial time step for the solver.
y0 (ArrayLike): The initial state vector of the system.
saveat (diffrax.SaveAt, optional): Specifies time points at which
to save the solution. Defaults to None.
max_steps (int, optional): The maximum number of steps the solver
can take. Defaults to 100000.
throw (bool, optional): If True, the solver will raise an error on
failure. Defaults to False.
term (diffrax.AbstractTerm, optional): The term defining the ODE.
Defaults to a zero-value ODETerm.
stepsize_controller (diffrax.AbstractStepSizeController, optional):
The step size controller. Defaults to |
Source code in circulax/solvers/transient.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | |