Project Code Structure

CoSApp_ is a Python library, with sporadic JavaScript and HTML content intended for object rendering in Jupyter notebooks. It allows the creation of elemental simulation units referred to as systems, and the assembly of existing systems into composite models. More importantly, it is focused on the design of such systems, that is the computation of critical parameters to satisfy operating constraints.

Package description

Users define their models by specializing base classes contained in module cosapp.base. In particular:

  • System, defining systems;

  • Port, defining variable sets at the interface of systems;

  • Driver, defining algorithms acting on systems, referred to as drivers.

Drivers typically modify system variables to solve mathematical problems addressing specific simulation intents. For example:

  • NonLinearSolver, to solve design problems and/or equilibrate systems with loops;

  • RungeKutta, for transient simulations with a Runge-Kutta explicit scheme;

  • Optimizer, to minimize or maximize an objective in the system.

Various helpers are also available:

  • recorders: probes recording simulation results;

  • set_log(), to activate a simulation logger;

  • to_fmu(), to export a CoSApp system as an FMU;

  • display_doc(), to display the documentation of CoSApp .

cosapp itself is a Python namespace rather than a traditional Python package. This allows third-party packages to be included under the same umbrella.