Pathsim

Latest version: v0.6.3

Safety actively analyzes 723152 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 4

0.4.5

- fixed path length estimation for nested subsystems and added tests and an example
- renamed utils.funcs to utils.utils, which makes more sense

0.4.4

- minor fixes
- fixed RKDP54 butcher table
- test coverage for Value and Parameter classes for AD framework

0.4.3

- refactoring of numerical integrators (solvers), separate parent classes for diagonally implicit and explicit runge kutta methods simplifies the specific methods significantly
- performance of runge kutta methods improved >10% by using explicit loops with indexing to construct slope instead of sum comprehension

0.4.2

- created interface for automatic differentiation framework to numpy ufuncs
- updated testsuite
- general bugfixing regarding implicit solvers (jacobian computation)

0.4.0

Lots of refactors, improvements and new features since the last release including:

- Added rudimentary automatic differentiation (AD) framework in `pathsim.diff` to make the simulations differentiable w.r.t. predefined parameters
- Refactoring of numerical integrators to be compatible with AD framework for transient simulation
- Added lots of test, initial coverage was above 85%, more coming in the future
- Overall cleanup

0.02

step delay
tau = 3

blocks that define the system
Src = Source(lambda t: int(t>tau))
Int = Integrator()
Amp = Amplifier(-1)
Add = Adder()
Sco = Scope(labels=["step", "response"])

blocks = [Src, Int, Amp, Add, Sco]

the connections between the blocks
connections = [
Connection(Src, Add[0], Sco[0]),
Connection(Amp, Add[1]),
Connection(Add, Int),
Connection(Int, Amp, Sco[1])
]

initialize simulation with the blocks, connections, timestep and logging enabled
Sim = Simulation(blocks, connections, dt=dt, log=True)

print(Sim)


becomes this:

code
{
"metadata": {
"name": "Model",
"description": "",
"created": "2025-02-28T21:13:42.847434"
},
"blocks": [
{
"id": "2037130594352",
"type": "Source",
"params": {
"func": {
"type": "lambda",
"name": "<lambda>",
"source": "lambda t: int(t>tau))",
"globals": {
"tau": 3
},
"closures": {}
}
}
},
{
"id": "2037130594688",
"type": "Integrator",
"params": {
"initial_value": 0.0
}
},
{
"id": "2037130595024",
"type": "Amplifier",
"params": {
"gain": -1
}
},
{
"id": "2037130595360",
"type": "Adder",
"params": {}
},
{
"id": "2037130595696",
"type": "Scope",
"params": {
"sampling_rate": null,
"t_wait": 0.0,
"labels": [
"step",
"response"
]
}
}
],
"connections": [
{
"id": "2037130596032",
"source": {
"block": "2037130594352",
"port": 0
},
"targets": [
{
"block": "2037130595360",
"port": 0
},
{
"block": "2037130595696",
"port": 0
}
]
},
{
"id": "2037129492624",
"source": {
"block": "2037130595024",
"port": 0
},
"targets": [
{
"block": "2037130595360",
"port": 1
}
]
},
{
"id": "2037129493584",
"source": {
"block": "2037130595360",
"port": 0
},
"targets": [
{
"block": "2037130594688",
"port": 0
}
]
},
{
"id": "2037130549568",
"source": {
"block": "2037130594688",
"port": 0
},
"targets": [
{
"block": "2037130595024",
"port": 0
},
{
"block": "2037130595696",
"port": 1
}
]
}
],
"events": [],
"simulation": {
"dt": 0.02,
"dt_min": 1e-16,
"dt_max": null,
"solver": "SSPRK22",
"tolerance_fpi": 1e-12,
"iterations_min": 2,
"iterations_max": 200
}
}


In the future this will be utilized for saving simulations and models to and loading them from external files that are readable and editable.

Page 4 of 4

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.