Title: | Interface to the Computer Algebra System 'Giac' |
---|---|
Description: | 'Giac' <https://www-fourier.ujf-grenoble.fr/~parisse/giac/doc/en/cascmd_en/cascmd_en.html> is a general purpose symbolic algebra software. It powers the graphical interface 'Xcas'. This package allows to execute 'Giac' commands in 'R'. |
Authors: | Stéphane Laurent [aut, cre], Renée De Graeve [cph] (Giac), Bernard Parisse [cph] (Giac) |
Maintainer: | Stéphane Laurent <[email protected]> |
License: | GPL-3 |
Version: | 1.0.1 |
Built: | 2024-10-26 02:54:22 UTC |
Source: | https://github.com/stla/giacr |
Creates an object allowing to execute Giac commands.
new()
Create a new Giac
instance.
Giac$new(chromePath = find_chrome())
chromePath
path to the Chrome executable (or Chromium, Brave,
etc); if find_chrome()
does not work, you can set the
environment variable CHROMOTE_CHROME
to the path and it will
work
A Giac
object.
execute()
Execute a Giac command.
Giac$execute(command, timeout = 10000)
command
the command to be executed given as a character string
timeout
timeout in milliseconds
The result of the command in a character string.
if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$execute("2 + 3/7") giac$execute("integrate(ln(x))") giac$close() }
implicitization()
Gröbner implicitization (see examples)
Giac$implicitization( equations, relations = "", variables, constants = "", timeout = 10000 )
equations
comma-separated equations
relations
comma-separated relations, or an empty string if there is no relation; the relations between the constants must placed first, followed by the relations between the variables
variables
comma-separated variables
constants
comma-separated constants, or an empty string if there is no constant
timeout
timeout in milliseconds
The implicitization of the equations.
library(giacR) if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$implicitization( equations = "x = a*cost, y = b*sint", relations = "cost^2 + sint^2 = 1", variables = "cost, sint", constants = "a, b" ) giac$close() }
close()
Close a Giac session
Giac$close()
TRUE
or FALSE
, whether the session has been closed.
## ------------------------------------------------ ## Method `Giac$execute` ## ------------------------------------------------ if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$execute("2 + 3/7") giac$execute("integrate(ln(x))") giac$close() } ## ------------------------------------------------ ## Method `Giac$implicitization` ## ------------------------------------------------ library(giacR) if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$implicitization( equations = "x = a*cost, y = b*sint", relations = "cost^2 + sint^2 = 1", variables = "cost, sint", constants = "a, b" ) giac$close() }
## ------------------------------------------------ ## Method `Giac$execute` ## ------------------------------------------------ if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$execute("2 + 3/7") giac$execute("integrate(ln(x))") giac$close() } ## ------------------------------------------------ ## Method `Giac$implicitization` ## ------------------------------------------------ library(giacR) if(!is.null(chromote::find_chrome())) { giac <- Giac$new() giac$implicitization( equations = "x = a*cost, y = b*sint", relations = "cost^2 + sint^2 = 1", variables = "cost, sint", constants = "a, b" ) giac$close() }