Code Monkey home page Code Monkey logo

simsolve's Introduction

(Sim)ultaneous Non linear Equation (Solv)er

SimSolve is a simultaneous non linear equation solver. The aim is the solve a bunch of equations in an optimal way. The applications are engineering problems where you have a bunch of equations to solve. For example consider the kinematics problem. Assuming one knows the distance (S)and initial velocity (u) and acceleration (a) and wanted to know the final velocity (v).

S = u*t + 0.5*a*t*t
v = u + a*t
a = 0.5
u = 0
S = 10

Solving this using simsolve yields

S = 10
a = 0.5
t = 6.32455
u = 0
v = 3.16228

Note the important fact was dependency was not explicit. One could have equivalently stated

S - u*t = 0.5*a*t*t
(v - u)/t = a
a = 0.5
u = 0
S = 10

Method

SimSolv tries to numerically solve the equations by minimising the error. It uses NLOPT for the minimisation step.

However, rather than minimising all the errors simultaneously (which should in theory yield same results), SomSolve breaks down the given set into groups which need to be solved simultaneously.For example, in the equation set above, the equations are solved in this order

Solve: [a = 0.5 ] for a 
Solve: [u = 0 ] for u 
Solve: [S = 10 ] for S 
Solve: [S - u*t =  0.5*a*t*t ] for t 
Solve: [a = (v - u) / t ] for v 

This breaking down gives massive gains in the optimisation effort required.

Technique

For efficiency SimSolve does not parse the equations per-se. Simsolve generates a .cpp file, calls g++ to compile it to .so file and loads it on the fly and calls the routines.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.