Questions tagged [yacas]

Acronym for Yet Another Computer Algebra System. An open-source software package, YACAS is an easy to use, general purpose Computer Algebra System, a program for symbolic manipulation of mathematical expressions. It uses its own programming language designed for symbolic as well as arbitrary-precision numerical computations. The system has a library of scripts that implement many of the symbolic algebra operations; new algorithms can be easily added.

Yacas (Yet Another Computer Algebra System) is a small and highly flexible general-purpose computer algebra system and programming language. The language has a familiar, C-like infix-operator syntax. The distribution contains a small library of mathematical functions, but its real strength is in the language in which you can easily write your own symbolic manipulation algorithms. The core engine supports arbitrary precision arithmetic, and is able to execute symbolic manipulations on various mathematical objects by following user-defined rules.

You can use Yacas directly from the web site as a Java applet (it runs inside your browser without needing a connection to a remote server). This means that no additional software needs to be installed (other than a free Java environment if this is not installed yet).

Yacas can also be downloaded. The download contains an off-line version of Yacas, a native executable that can run on your computer. The menu entry starts the console of the "Yacas calculation center".

Source

25 questions
3
votes
0 answers

RYacas: Increase MaxEvalDepth to solve equation

I am trying to solve several equations for A like the one below but continue to get the error "CommandLine(1): Max evaluation stack depth reached. Please use MaxEvalDepth to increase the stack size as needed." I can't seem to find information about…
3
votes
5 answers

Solving an algebraic equation

I'm trying to solve this equation: ((2300+1900*1)+(x+2300+1900*1)*0.002)/(600-400) =1 Is there a way to do this with R? ATTEMPT with incorrect solution: library(Ryacas) eq <- "((2300+1900*1)+(x+2300+1900*1)*0.002)/(600-400) ==1 " # simplify the…
RIckHenr
  • 361
  • 1
  • 10
3
votes
2 answers

RMarkdown Yacas Latex

I'm trying to do computer algebra in R using Ryacas and RMarkdown. Here's a quick example. ```{r} library(Ryacas) x = Sym("x") y = Sym("y") x0 = Sym("x0") y0 = Sym("y0") x1 = Sym("x1") y1 = Sym("y1") yacas("TeXForm(Solve( (y - y0) / (x - x0) == (y1…
bramtayl
  • 4,004
  • 2
  • 11
  • 18
2
votes
1 answer

TeXForm from Ryacas package as R markdown output

I was attempting to use the Ryacas package in generating math questions involving fractions. Below is some minimal code in R: a1 = 1 a2 = 2 b1 = 1 b2 = 3 linearFactor1 = x+1 linearFactor2 = x+3 question1 = (1/linearFactor1 + 2/linearFactor2) %>%…
2
votes
1 answer

Symbolic matrix mutiplication error (Ryacas)

I would like to do symbolic matrix operations with Ryacas using a function that converts base R matrices to Ryacas format. The result of the function seems to match Ryacas format. But when I attempt to multiply the matrices, the error # Error in aa…
mert
  • 371
  • 2
  • 9
2
votes
1 answer

Symbolic computation in R with Ryacas - results become character

I have a small MATLAB script mainly doing derivatives using symbolic toolbox that I want to rewrite into R. I chose Ryacas package because I found rSymPy too tricky to install... Here is my R code # install.packages('Ryacas') library(Ryacas) z…
2
votes
3 answers

Convert R yacas equation to LaTeX without solving it

I want to show step-by-step calculations that were made using 'TeXForm' in Ryacas. To do that I must be able to obtain LaTeX from given equation. Issue is that yacas automatically solves them before converting to LaTeX form. If I try to apply…
Alex Alex
  • 235
  • 2
  • 14
2
votes
1 answer

symbolic matrix multiplication by Ryacas

I define two matrices mat1 and mat2 in Sym class which is suitable for Ryacas symbolic computation: library(Ryacas) x <- Sym("x") mat1 <- List( List(x, 2), List(x^3, x)) and mat2 <- List( List(x, x), List(3, 6 * x)) now the question is how I can…
Ehsan Masoudi
  • 712
  • 10
  • 19
1
vote
0 answers

Indicator function in Ryacas

I'm trying to symbolically integrate functions that are defined piecewise in Ryacas but I don't know how to define them properly. In this example evaluation of the function gives the correct values at several points but the integrator is not able to…
snaut
  • 2,261
  • 18
  • 37
1
vote
1 answer

R - how to define a "symbolic sequence"

Let's say that we have this sequence of numbers: 1/2, 1/3, 1/4, ..., 1/N Sorry for the bad formatting, but the LaTeX doesn't work here. Let's say that we define a function which sums all the elements of this sequence: Σ n = 1N 1/n The N is supposed…
J. Doe
  • 1,544
  • 1
  • 11
  • 26
1
vote
2 answers

Treat a literal variable as a constant with Ryacas (or an alternative)

With Ryacas, one has: > yac_str("Simplify(2*x^2*4 + x^2*5)") [1] "13*x^2" Now, instead of 4 and 5, I would like to give two letters treated as constants. That is, Ryacas does: > yac_str("Simplify(2*x^2*a + x^2*b)") [1] "2*x^2*a+x^2*b" but I would…
Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
1
vote
0 answers

Ryacas leaves 'restart' unevaluated

The Yacas tutorial claims: A session can be restarted (forgetting all previous definitions and results) by typing restart. All memory is erased in that case. But for me, that doesn't happen in Ryacas (version 1.3.1.1): > yac_cli() Enter Yacas…
Quigi
  • 149
  • 1
  • 8
1
vote
1 answer

Ryacas substitute but don't simplify or evaluate

I am using the Ryacas package in R and am trying to substitute variables for values but not simplify or solve the equation to show the working out. I have searched Stackoverflow, read the Ryacas documentation and have attempted to find this in the…
1
vote
3 answers

Symbolically calculate the Hessian in (r)yacas

Background: I am using the Ryacas package, trying to figure out a symbolic expression for a the large-sample variance of an MLE estimator. To do that, I need the (inverse of the) Hessian matrix of the likelihood function. I don't have mathematica…
Jean_N
  • 489
  • 1
  • 4
  • 19
1
vote
1 answer

How to derivate using Ryacas

I am totally nil in using the Ryacas package. I would like to get successive derivatives of polynomials, so I tried the following lines: library(Ryacas) x <- Sym("x") P <- 1 for (k in 1:10) { P <- (1+k*x)*P + x*(1-x)*deriv(P, x) P } I expected…
Andrew
  • 926
  • 2
  • 17
  • 24
1
2