changeVariables {symbolicQspray} | R Documentation |
Change of variables in a 'symbolicQspray' polynomial
Description
Replaces the variables of a symbolicQspray
polynomial
with some symbolicQspray
polynomials. E.g. you have a polynomial
P_a(x, y)
and you want the polynomial P_a(x+a, y+a)
(see
example).
Usage
## S4 method for signature 'symbolicQspray,list'
changeVariables(x, listOfQsprays)
Arguments
x |
a |
listOfQsprays |
a list containing at least |
Value
The symbolicQspray
polynomial obtained by replacing the
variables of the polynomial given in the x
argument with the
polynomials given in the listOfQsprays
argument.
See Also
If you want to change the parameters of a symbolic qspray, use
changeParameters
. If you want to assign some values to
its variables, see substituteVariables
.
Examples
library(symbolicQspray)
f <- function(a, X, Y) {
a^2 / (a + 1) * X^2*Y + (3*a - 2) / a * Y^2
}
a <- qlone(1)
X <- Qlone(1)
Y <- Qlone(2)
Qspray <- f(a, X, Y)
U <- X + a
V <- Y + a
changeVariables(Qspray, list(U, V)) == f(a, U, V) # should be TRUE