Skip to main content

Symbolic math bridge for the GDS ecosystem — SymPy to ODE compilation

Project description

gds-symbolic

Symbolic math bridge for the GDS ecosystem — compiles SymPy expressions into plain Python callables for use with gds-continuous.

Installation

uv add gds-symbolic[sympy]

Quick Start

from gds_control.dsl.elements import State, Input, Sensor, Controller
from gds_symbolic import SymbolicControlModel, StateEquation

model = SymbolicControlModel(
    name="damped_oscillator",
    states=[State(name="x"), State(name="v")],
    inputs=[Input(name="force")],
    sensors=[Sensor(name="position", observes=["x"])],
    controllers=[Controller(name="actuator", reads=["position", "force"], drives=["x", "v"])],
    state_equations=[
        StateEquation(state_name="x", expr_str="v"),
        StateEquation(state_name="v", expr_str="-k*x - c*v + force"),
    ],
    symbolic_params=["k", "c"],
)

# Compile to plain callable (no SymPy at runtime)
ode_fn, state_order = model.to_ode_function()

# Linearize at origin
lin = model.linearize(x0=[0.0, 0.0], u0=[0.0])
print(lin.A)  # [[0, 1], [-k, -c]] evaluated at operating point

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gds_symbolic-0.99.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gds_symbolic-0.99.0-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file gds_symbolic-0.99.0.tar.gz.

File metadata

  • Download URL: gds_symbolic-0.99.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gds_symbolic-0.99.0.tar.gz
Algorithm Hash digest
SHA256 d6c112cdb9eef7b83f9f603276b8935279139c65e775eb2adc1bda3389f76f6e
MD5 0abe73ccede31b6fd4c3a6405de9b70e
BLAKE2b-256 b40f2b10ee49f9a8bc637d562409f5851186b53beb56116ac6671d8a63de9b1d

See more details on using hashes here.

File details

Details for the file gds_symbolic-0.99.0-py3-none-any.whl.

File metadata

  • Download URL: gds_symbolic-0.99.0-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gds_symbolic-0.99.0-py3-none-any.whl
Algorithm Hash digest
SHA256 123a24be913b3a062a42df8231813621617b319cc7837ebc7bf1ea75240fb367
MD5 d283b8c9747c84d253e4407de5830d60
BLAKE2b-256 1542124651f9c391e849ba6f5213a8ca5acf59db5d88cbfe3691f5d2904482bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page