Class LTF::Maxima
In: lib/ltf/maxima.rb
Parent: Object

Maxima wraps an IO object to communicate with an external Maxima process.

Methods

Classes and Modules

Class LTF::Maxima::Error
Class LTF::Maxima::Inconsistent
Class LTF::Maxima::InvalidInput
Class LTF::Maxima::Reader
Class LTF::Maxima::TooManyEquations
Class LTF::Maxima::TooManyUnknowns

Constants

MaximaWait = 0.00001
ValidInputPattern = /^[^;]+;$/
OutputPromptPattern = /^\(\%o\d+\) (.*)\n/m
InconsistentPattern = /^Inconsistent equations/
TooManyUnknownsPattern = /^More unknowns than equations/
TooManyEquationsPattern = /^More equations than unknowns/
SolvedVariablePattern = /([^,\[\d\s]\w*) = ([^,\]]+)/

Attributes

last_response  [R] 

Public Class methods

Create a new Maxima object. Raises a MaximaError if Maxima could not be run. Raises InvalidInput if max_input is invalid.

  • max_input: Initial input to send to Maxima.

Private Class methods

Strip the response out of the read string. Raises Inconsistent if inconsistent input was given. Raises Invalid if invalid input was given.

  • str: The string containing the response.

Public Instance methods

Send an input string to Maxima.

Send the quit command to Maxima.

Solve a system of equations, returning a Hash of Symbol variable names and their values. Raises Maxima::TooManyUnknowns or Maxima::TooManyEquations if the solver string is invalid.

Private Instance methods

Setup initial Maxima settings, and possibly send an initial input string.

  • max_input: Initial input to send to Maxima, nil for none.

Return all text up to the current input prompt.

[Validate]