twine-macros

Crates.iotwine-macros
lib.rstwine-macros
version0.3.0
created_at2025-01-24 17:19:27.370427+00
updated_at2025-08-05 14:02:18.679521+00
descriptionMacros for Twine, a Rust framework for functional and composable system modeling.
homepage
repositoryhttps://github.com/isentropic-dev/twine
max_upload_size
id1529749
size19,576
Greg Troszak (gdtroszak)

documentation

README

Twine

⚠️ Disclaimer: Twine is in early development and subject to frequent breaking changes.

What is Twine?

Twine is an open-source Rust framework for functional and composable system modeling. It enables engineers and researchers to build complex system models from simple, reusable building blocks. By emphasizing functional purity and strong typing, Twine makes models more reliable, testable, and easier to understand.

A Functional Approach to System Modeling

Twine models systems as compositions of functions with strongly typed inputs and outputs that are deterministic, always returning the same output for the same input. This functional approach allows users to build and understand larger systems from simple, reusable parts by ensuring:

  • Testability: Deterministic functions are easier to test in isolation since they have no hidden state or side effects.
  • Parallelism: Independent functions can be executed concurrently without race conditions.
  • Composability: System models can be built hierarchically from simple, reusable parts.
  • Reliability: Pure functions eliminate side effects and make models more predictable.

Models and Simulations

Component functions can be combined into a Model that represents a complete system's behavior. Twine provides built-in numerical integration to evolve a Model over time through a Simulation, enabling seamless simulation of dynamic systems while preserving functional purity.

Built-in Components

Though still early in development, Twine’s component library is designed to support a broad range of common system modeling needs, including:

  • Controllers: Thermostats, PID controllers, etc.
  • Schedules: Weekly and daily schedules, time-based control, etc.
  • Thermal: Storage tanks, heat exchangers, mixing valves, etc.

Twine also provides a consistent API for thermodynamic and fluid property modeling, designed to integrate with libraries such as REFPROP, CoolProp, and FIT. Support for these integrations is coming soon.

Commit count: 67

cargo fmt