fryer.frink

Download or view fryer.frink in plain text format

// Demonstration and test of solving systems of equations.

use Solver.frink
symbolicMode[true]
showApproximations[false]

// Deep fryer is a cylinder that we want to fill to a
// certain depth (which is marked.)  How much oil do
// we need to by
fryer = new Solver[[ area === pi radius^2,
                     volume === area height,
                     diameter === 2 radius,
                     circumference === pi diameter],
                    ["pi"]]

println["All solutions:"]
println[join["\n", fryer.solveAll[]]]

println[]
println["Solution for volume, incompletely specified:"]
args = []
println[join["\n", fryer.solveFor["volume"]]]
println[]

println[]
println["Symbolic solution, incompletely specified: "]
args = [["height", 7 in]]
println[fryer.solveForSymbolic["volume",args]->"gallons"]
println[]

println[]
println["Numeric solution, incompletely specified: "]
println[fryer.solveFor["volume",args]->"gallons"]
println[]

println["Numeric solution, completely specified."]
args = [["diameter", 10.5 in], ["height", 7 in]]
println[fryer.solveFor["volume",args]->"gallons"]
println[]


Download or view fryer.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 19945 days, 12 hours, 57 minutes ago.