orbit.frink

View or download orbit.frink in plain text format

// Demonstrate using Frink's solving ability to solve orbital equations.

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

orbit = new System[[ a === v^2 / r,
                     a === G earthmass / r^2,
                     r === earthradius + h,
                     c === 2 pi r,
                     T === c / v],
                    ["G", "earthmass", "earthradius", "pi"]]

println["All solutions:"]
println[join["\n", orbit.solveAll[false, true]]]

args = [["h", 180 km]]

println[]
println["Solution for v:"]
println[positive[eval[orbit.solveForValues["v", args]]] -> "mph"]
println[]

println[]
println["Solution for T:"]
println[join["\n", orbit.solveForValues["T", args]]]
println[]


View or download orbit.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 17646 days, 9 hours, 36 minutes ago.