Hacker News new | past | comments | ask | show | jobs | submit login

Can you imagine how weird I felt when I finished my "forever" project?

Ever since school I wanted to write a simulation tool similar to one I've used in school, which basically lets you write differential equations in graphical form, and integrates them for you. And back when I was in school, I didn't know a thing about differential equations, and it all looked like amazing magic to me.

And while studying physics, I learned about DGLs and Runge-Kutta integration, and then I "just" needed to manage all the data (do a topological sort on the nodes to evaluate all the formulas in correct order), stuff it into the Runge-Kutta solver, and graph the output. Yay.

I never got around to writing the graphical front end, but the all interesting (to me) parts of the program are there. Oh, and it's written in Perl 6, the programming language I help to develop in my free time. If you're interested, check out http://perlgeek.de/blog-en/perl-6/physical-modelling.html

These days Perl 6 is my main "forever"-project, and it's coming along nicely.




Nice! I've always been fascinated by tools and techniques that reduce the burden of solving complicated PDEs. After deriving, by hand, the finite difference matrix for a two-dimensional 2nd order PDE with varied boundary conditions I thought "there has to be a better way!"

In a similar manner to you I wrote an internal DSL in Python that lets you specify your system, for example that pesky 2D 2nd order PDE

    pde = PDE('dx_dt', V)
    pde.eqn = mu_e * E * d(V, E) - \
              (1-tau)*sigma_E*E*(sigma_gamma*A*rho_gamma_E + sigma_D*D*rho_E_D) * d(V, A*E) + \
              (1 - tau) * (E - gamma*A - r_f*D) * d(V, A) + \
              0.5 * (1-tau)**2 * ((sigma_gamma * A)**2 + \
                                  (sigma_D*D)**2 - \
                                  2*sigma_gamma*A*sigma_D*D*rho_gamma_D) * d(V, A**2) + \
              0.5 * sigma_E**2 * E**2 * d(V, E**2) - \
              (r_f + lambda_gamma + lambda_E) * V
and appropriate boundary conditions in Python. My pdegen tool then works on the resultant AST to generate the primary finite difference matrix. Given some initial conditions this matrix can then be used with any linear algebra library to time-step the system.

You've given me motivation to clean up my code and release it :)


Modeling dynamic systems is kind of where I'm moving towards with my project at the moment. It's a visual programming language where you create "non-casual" models instead of functions. My current lead is to use a modelica-like library, Hydra, as the back-end.

A somewhat outdated and presentation of the idea (it's a bit buzz-wordy): https://patch-tag.com/r/worldsayshi/nodespace-staging/wiki/

It is very much a project of taking on more than I currently grasp. But I have already learned a lot by working on and thinking about it. :)


Pretty awesome that you completed a project using a not yet released* programming language!

* for various definitions of the word released


It's enough that a compiler is released.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: