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

The main equation may not really be anywhere near so simple as that. E.g. for the kind of stuff I do for work the main equation is something like output a vector which is the instructions for every powerplant in Texas of how much power to produce, such that every person and business that needs power has power, subject to constraints about the capacity of each powerline Differentiate total emissions of this process with respect to demand. It's is an equation yes. But it's actually a multi-hundred line program that includes thousands more lines of constants and a step of running ab internal linear optimization solver inside the problem.

Symbolic Differentiation, like Mathematica tends to start to slow down and generate massively amounts of code once functions get complicated. I am also not sure that it can handle dynamic length loops.

Source to Source AD, like Zygote (Julia), Tapenade (Fortran), Jax (Python), Enzyme (LLVM) have a lot of what you might want though.




Thanks to both answers here! I think this is finally clicking. Probably many more ticks before I get it, but such is progress.

Would love to see a blog or other post on solving this kind of problem. One with an inner LP would be amazing to see. I'm pretty sure some of the stuff I've looked at in the past on supply chain solutions could find relevance here.




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

Search: