Web interface to a system of stochastic differential equations
I have a system of stochastic differential equations implemented in MATLAB. Just 4 variables integrated with Euler-Maruyama, so nothing too fancy... the technical details aren't important for this question though.
How would you recommend I go about building a web interface (i.e., let people change the p开发者_如何学运维arameters and initial conditions in their web browser and then display the results)?
The first step should be translating the code to numpy/matplotlib, right?
Should I be saving the output as an image or doing some fancy HTML5 plotting stuff?
Are there any publicly available tools/frameworks that will make it easy to build a nice web UI for this kind of thing?
Any tips on where to host this kind of thing, or am I basically limited to setting up my own server?
If there are no constraints on the target language, I'd simply translate to R
and use RApache
. There are plenty of libraries to support this. In fact, you may not need to reimplement much code, given what's available in R libraries.
The reason I suggest R is that I've ported a lot of Matlab code to make it reusable or open, and R has usually been the easiest target for me, due to the libraries already developed.
EDIT/UPDATE: I overlooked using RStudio as a server. That might be the easiest way to go. See this page: http://www.rstudio.org/docs/server/getting_started.
Regarding where to set this up, you could look at using Amazon's "micro instances", if the amount of computation is very limited. There are also some new startups doing cloud stuff. One choice might be http://cloudnumbers.com/.
So, I'd recommend:
- Post a question about the SDE stuff (to get pointers to the right package(s) on CRAN).
- Install RStudio and play with the package
- Try out RStudio server
- Look for hosting :)
- ...
- Profit! :) :)
I would not recommend saving stuff to disk and re-loading it. It's best to have things as smoothly coupled as possible, so that you don't have to code stuff to maintain a state on the server or browser side.
RStudio is quite cool if you want to take the R route. If you want to stick with Python, I recommend you to take a look at Femhub. It's perhaps the most mature and well developed web interface to do numerical computations in Python. Jut take a look to the "Published worksheets" examples to see what is capable of.
精彩评论