Skip to main content

SysOpt - Systems Modelling and Optimisation

Overview

sysopt is a python3 framework for component based modelling, simulation and optimisation of continuous time dynamic and control systems.

It allows users to design modular plant and control systems, simulate the trajectory of closed loop systems, and run joint parameter/path optimisation studies.

A Minimal Example

Test problem 3 from Herber and Allison1 provides a minimal example of sysopt usage. First, we define some components (plant, and controller), assemble a composite model then setup a optimsation problem for that model and solve it.

from sysopt import Metadata, Composite, SolverContext, PiecewiseConstantSignal, Parameter
from sysopt.modelling.builders import FullStateOutput
from sysopt.blocks import ConstantSignal

k_star = 0.8543 # Known optimal gain. 
t_f = 10

# Define the plant    
def dxdt(t, x, u, p):
    return [x[1], - p[0] * x[0]  + u[0]]

def x0(p):
    return [0, 0]

plant_metadata = Metadata(inputs=['u'], states=['x', 'v'], parameters=['k'])
plant = FullStateOutput(plant_metadata, dxdt, x0)

# Define the controller
controller = ConstantSignal(['u'], name='Controller')

# Define the Composite system via components and wires
model = Composite(name='Model', components=[plant, controller])
model.declare_outputs(['x', 'v', 'u'])
model.wires = [(controller.outputs, plant.inputs),
               (plant.outputs, model.outputs[0:2]),
               (controller.outputs, model.outputs[2])]

k = Parameter('k'')
u = PiecewiseConstantSignal('u', 100)
parameters = {
    plant.parameters['k']: k,
    controller.parameters['u']:u
}
# Setup the joint optimisation problem. 
with SolverContext(model=model, t_final=t_f, parameters=parameters) as solver:

    
    y_final = model.outputs(solver.t_final)
    
    cost = -y_final[0]

    constraints = [u <= 1, u >= -1,
                   y_final[1] >= 0, y_final[1] <= 0]

    problem = solver.problem(arguments=[k, u],  
                             cost=cost,
                             subject_to=constraints)
    
    soln = problem.solve(guess=[0, 0])
    k_min, u_min = soln.argmin
    assert abs(k_min - k_star) < 1e-2
  1. Herber, Daniel R., and James T. Allison. "Nested and simultaneous solution strategies for general combined plant and control design problems." Journal of Mechanical Design 141.1 (2019). ↩

Metadata

Release files for sysopt 0.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sysopt 0.6.4
File Size Uploaded Provenance Actions
sysopt-0.6.4.tar.gz 87.9 kB Without provenance Details for sysopt-0.6.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sysopt 0.6.4
File Interpreter ABI Platform Actions
sysopt-0.6.4-py3-none-any.whl Python 3 none any Details for sysopt-0.6.4-py3-none-any.whl

Total release size: 154.7 kB

Release files / sysopt-0.6.4.tar.gz

Download URL sysopt-0.6.4.tar.gz
Size 87.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ebc145d58995d5ac81cd8361c31f113af2ecebb5eeefb062dfb77e8f7e0669bf
BLAKE2b-256 checksum
How to use checksums
07ba8fc0d5b4f62988582859d856c309abb832bd51fb6f3f286a39ef627b4b70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Release files / sysopt-0.6.4-py3-none-any.whl

Download URL sysopt-0.6.4-py3-none-any.whl
Size 66.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edd65d2421138412014342666a1463bb990dea74185abc2a7f9949bb4808c8b3
BLAKE2b-256 checksum
How to use checksums
cd91b90afe7d7560b4d5248629da34f0d267a64af195bfc7573cbd3666222eb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.15

Security for sysopt 0.6.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page