solve.frink

View or download solve.frink in plain text format


// Program to demonstrate solving using the solvingTransformations.frink file.
// This wee program will do your algebra for you.

use derivatives.frink
use integrals.frink
use solvingTransformations.frink
use BooleanTransformations.frink
use powerTransformations.frink

showApproximations[false]
symbolicMode[true]
while (text = input["Enter expression: "])
{
   expr = parseToExpression[text]

//   println["expr is $expr"]
 // This version shows without trace.
//   res = transformExpression[expr]
//   println["\n$res"]

   // This version shows trace
   res = transformExpressionTrace[expr]
   println["\n" + join["\n",res]]
   last = res@(length[res]-1)

   // Evaluate right-hand sides of solved expressions like a === solution
   for eq = toArray[last]
   {
      if structureEquals[_a === _b, eq]
      {
         println["\nSymbolic: " + eq]
         println["Numeric:  " + getChild[eq, 0] + " = " + eval[getChild[eq, 1]]]
      }
   }

 


View or download solve.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 17840 days, 0 hours, 53 minutes ago.