expressions in a high-level way. For example, it can take symbolic derivatives. 2. Using code generation avoids mistakes that come from translating mathematics into low level code.
expressions in a high-level way. For example, it can take symbolic derivatives. 2. Using code generation avoids mistakes that come from translating mathematics into low level code. 3. It’s possible to deal with expressions that are otherwise too large to write by hand.
expressions in a high-level way. For example, it can take symbolic derivatives. 2. Using code generation avoids mistakes that come from translating mathematics into low level code. 3. It’s possible to deal with expressions that are otherwise too large to write by hand. 4. Some “mathematical” optimizations are possible, which a normal compiler would not be able to do.
131I only results in three species, 131I, 131*Xe, and 131Xe • A typical decay chain may result in hundreds of species • With SymPy, we can avoid mistakes by representing the decay equations in a high level way, and deriving the low level representations
the equations of motion for a mechanical system • The resulting equations are a large system of nonlinear ODEs which need to be integrated (F=Ma) • Code generation allows creating fast callbacks which can be integrated over many time steps
In this example, sin(x)⋅cos(y) - sin(y)⋅cos(x) ⟶ sin(x - y) • The equations must be evaluated at each time step, so this can make a significant difference in performance
tree and call methods corresponding to children (visitor pattern) • Subclass CodePrinter, define methods for the expression types to code generate • Easy to write your own code printers, or to extend existing code printers to do the things you need
• python library for solving chemical kinetics problems with possible diffusion and drift contributions • SymPyBotics • Symbolic Framework for Modeling and Identification of Robot Dynamics
high-level way. For example, it can take symbolic derivatives. 2. Using code generation avoids mistakes that come from translating mathematics into low level code. 3. It’s possible to deal with expressions that are otherwise too large to write by hand. 4. Some “mathematical” optimizations are possible, which a normal compiler would not be able to do.