SciML / ModelingToolkit.jl

An acausal modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations
https://mtk.sciml.ai/dev/
Other
1.43k stars 209 forks source link

Feature request: JSON serialization of models? #570

Open sdwfrost opened 4 years ago

sdwfrost commented 4 years ago

I'm working with a platform to run models in the cloud using GitHub Actions (see here, which takes JSON inputs, and expects JSON outputs. Here is an example for a simple DifferentialEquations model (as a Typescript interface, which gets converted into a JSON schema):

export interface ModelInput {
  p: number[]
  u0: number[]
  tspan: number[]
}

where p is an array of parameters, u0 is an array of initial conditions, and tspan is the time over which the simulation is run. At the moment, I read in JSON files to access parameters, etc., but it would be great to have (at least for experimentation) a JSON representation of the ModelingToolkit model itself. I know I could simply include the stringified function as an argument, but that isn't very readable.

ChrisRackauckas commented 4 years ago

This could be a good storage format. I think the hard part would be how to do the Julia expression. Maybe it just works with JSON.jl? @shashi might know some of this because of his webio background.

shashi commented 4 years ago

It should be easy to formalize a schema and implement the serialize deserialize methods. Any schema suggestions are welcome!