systemSolverDemo.frink

Download or view systemSolverDemo.frink in plain text format


// Demonstration of solving system of equations.
use systemSolver2.frink

symbolicMode[true]

// These equations define an ellipse.
c = new System[[x^2/a^2 + y^2/b^2 === 1,
                e === sqrt[(a^2-b^2)/a^2],
                area===pi a b],
               ["pi"]]

println[join["\n",c.solveAll[]]]

println["\nPlugging in numbers:"]
values = [["area", 1 foot^2], ["a", 1 inch]]
println["b=" + (eval[c.solveForValues["b", values]] -> "in")]
println["e=" + eval[c.solveForValues["e", values]]]


Download or view systemSolverDemo.frink in plain text format


This is a program written in the programming language Frink.
For more information, view the Frink Documentation or see More Sample Frink Programs.

Alan Eliasen was born 19966 days, 4 hours, 58 minutes ago.