Interest in a library for building simulations of dynamical systems?

Is there interest in a library for building simulations of dynamical systems represented by time-based differential equations? The proposed library would implement ideas found in the C++ Model Developer (CMD) library developed by Ray Sells, but in a more generic way. For example, the proposed library would support the use of user defined data types when defining states and their derivatives. Other CMD features to be included in the proposed library are: 1. The ability to mix both continuous and discrete events. 2. Support for a simulation structure that makes it easy to go from a mathematical description of a system to code. 3. Support for time-varying system topologies (e.g., multi-stage missiles). 4. User extendable set of numerical integration algorithms. For more information on CMD see: http://www.dtic.mil/srch/doc?collection=t2&id=ADA433836 and http://rocket.itsc.uah.edu/u/education/files/R/IPT_Producer/AIAA/Sells/Sells... Code snippet: // Define states and their derivatives struct x_pos : state< double, // state type double // derivative type
{};
struct y_pos : state< double, double > {}; // Define a simulation object struct Ball: obj< rk4, // fourth-order Runge-Kutta numerical integration algorithm mpl::vector< x_pos, y_pos > // State vector
{ Ball(double x, double y, double vx, double vy) { // Initial state s_<x_pos>().value = x; s_<y_pos>().value = y; this->vx = vx; this->vy = vy; // Integrators add_integrator<x_pos>(this->vx); add_integrator<y_pos>(this->vy); } template< typename S, typename C > inline void update(S &sim, C &clock) { // Update the derivatives vx = 0.8*vx; vy = 0.8*vy; // Use a discrete event to stop the simulation // after 10 seconds if (clock.event(10.0)) { sim.halt(); } } template< typename C > void report(C &clock) { // Report current state at 1 second intervals if (clock.sample(1.0)) { std::cout << "Ball" << clock.t << " " << s_<x_pos>().value << " " << s_<y_pos>().value << "\n"; } } double vx; double vy; }; // Define the integration time-step struct dts { typedef double time_type; static time_type value() { return 0.01; } }; // Define a simulation stage struct stage_1 : stage< dts, mpl::vector<Ball> > {}; main() { // Create a simulation object Ball ball(0.0, 0.0, 10.0, 5.0); // Create the simulation execution object sim< mpl::vector< stage_1 > > sim(); // Initialize the simulation stage sim.stage_<stage_1>().obj_<Ball>() = &ball; // Run the simulation run(sim); }

Здравствуйте, Jay. Вы писали 30 января 2009 г., 4:05:31:
Is there interest in a library for building simulations of dynamical systems represented by time-based differential equations?
It would be great! -- С уважением, Андрей Наумов.

Jay Graham wrote:
Is there interest in a library for building simulations of dynamical systems represented by time-based differential equations?
The proposed library would implement ideas found in the C++ Model Developer (CMD) library developed by Ray Sells, but in a more generic way. For example, the proposed library would support the use of user defined data types when defining states and their derivatives. Other CMD features to be included in the proposed library are:
1. The ability to mix both continuous and discrete events. 2. Support for a simulation structure that makes it easy to go from a mathematical description of a system to code. 3. Support for time-varying system topologies (e.g., multi-stage missiles). 4. User extendable set of numerical integration algorithms.
I want to think some about your proposed syntax. I'm not yet convinced it is the best way to go. However, with good syntax, I'm interested. John

Jay Graham wrote:
Is there interest in a library for building simulations of dynamical systems represented by time-based differential equations?
Yes.
The proposed library would implement ideas found in the C++ Model Developer (CMD) library developed by Ray Sells, but in a more generic way.
Ok
For more information on CMD see:
http://www.dtic.mil/srch/doc?collection=t2&id=ADA433836
and
http://rocket.itsc.uah.edu/u/education/files/R/IPT_Producer/AIAA/Sells/Sells...
These documents indicate that CMD itself comes in an open source distribution with permissive licensing. However, I was not able to find a download site for the distribution. Anybody have a pointer to where this may be downloaded? -- Bjørn

Bjørn Roald <bjorn <at> 4roald.org> writes:
These documents indicate that CMD itself comes in an open source distribution with permissive licensing. However, I was not able to find a download site for the distribution. Anybody have a pointer to where this may be downloaded?
CMD is distributed through the U.S. Army RDEC. You can get the latest release via an e-mail request to jeffrey.hester@us.army.mil.

On Thu, 29 Jan 2009, Jay Graham wrote:
Is there interest in a library for building simulations of dynamical systems represented by time-based differential equations?
I'm not sure Boost is the right place for this sort of enterprise; Boost has a strong heritage for low-level C++ utilities, but not much in the way of mathematics. Have you used the Sundials project? https://computation.llnl.gov/casc/sundials/main.html There are many specialized needs for different classes of simulation, and I'm not sure they will go away with just a little OO/template magic. Later, Daniel
participants (7)
-
Andrew Naumov
-
Bjørn Roald
-
dherring@ll.mit.edu
-
Gevorg Voskanyan
-
Jay Graham
-
John Phillips
-
Max