openworm / org.geppetto

Geppetto is an open-source platform to build web-based applications to visualize and simulate neuroscience data and models.
http://geppetto.org
Other
209 stars 50 forks source link

symbolic math #230

Closed borismarin closed 9 years ago

borismarin commented 10 years ago

what is the status regarding symbolic expression support? Could something like that be used?

adrianq commented 10 years ago

I think we haven't implemented anything yet. I was having a look at js libs which allows us to display equations and this one seems to be a de facto standard. However, the one you suggest has some very interesting features...

borismarin commented 10 years ago

I am not worried about displaying, but with parsing and and handling composite expressions in order to (for example) plot stuff.

A concrete example: a LEMS model defines a "derived variable" which is a function of a state variable: f(x). Suppose now that the dynamics of x, is itself defined in terms of f(x). How can we then plot this "composite" function? We can probably delegate part of that to the backend (i.e. jLEMS), but I guess that it would be important to have such capabilities built into Geppetto. I wonder if it can be done using eval() in a smart (and safe) way...

On 4 September 2014 16:38, adrianq notifications@github.com wrote:

I think we haven't implemented anything yet. I was having a look at js libs which allows us to display equations and this one http://www.mathjax.org/ seems to be a de facto standard. However, the one you suggest has some very interesting features...

Reply to this email directly or view it on GitHub https://github.com/openworm/org.geppetto/issues/230#issuecomment-54496420 .

tarelli commented 10 years ago

To review with @borismarin and @adrianq

adrianq commented 9 years ago

@adrianq @borismarin I am looking at some js libs in order to solve this problem. http://www.nerdamer.com/ suggested by @borismarin looks nice but maybe this one http://mathjs.org is a more curated option (more contributors, releases, age...). I haven't implemented anything yet but at first sight both have more or less the same functionality...

borismarin commented 9 years ago

I like the idea of the "scope": you can dump all model pars and funcs into a scope and evaluate as needed.

adrianq commented 9 years ago

Are you talking about mathjs? it looks good to me as well. Here you have some other examples: https://github.com/josdejong/mathjs/blob/master/docs/expressions.md I am implementing sth today. Let you know...

borismarin commented 9 years ago

Yes, it has a "scope" object that works as a namespace On 11 Nov 2014 09:07, "adrianq" notifications@github.com wrote:

Are you talking about mathjs? it looks good to me as well. Here you have some other examples: https://github.com/josdejong/mathjs/blob/master/docs/expressions.md I am implementing sth today. Let you know...

Reply to this email directly or view it on GitHub https://github.com/openworm/org.geppetto/issues/230#issuecomment-62519999 .

borismarin commented 9 years ago

This library doesn't do proper symbolics, though. But it can potentially cover most of our needs.

adrianq commented 9 years ago

I have added this lib to the plot widget and it is working fine. There is a card that will add the lib as a general geppetto lib so it can be used by the user or any widget.