Re: [R] symbolic computing example with Ryacas

2017-09-19 Thread Gabor Grothendieck
Here are some more examples: library(Ryacas) x <- Sym("x") yacas("x:=2") Eval(x*x) ## [1] 4 # vignette has similar example y <- Sym("y") Eval(Subst(y*y, y, 3)) ## [1] 9 # demo("Ryacas-Function") has similar example to this f <- function(z) {} body(f) <- yacas(expression(z*z))[[1]] f(4) ## [1] 1

Re: [R] symbolic computing example with Ryacas

2017-09-19 Thread Vivek Sutradhara
Thanks for the response. Yes, I did study the vignette but did not understand it fully. Anyway, I have tried once again now. I am happy to say that I have got what I wanted. library(Ryacas) x <- Sym("x");U <- Sym("U");x0 <- Sym("x0");C <- Sym("C") my_func <- function(x,U,x0,C) { return (U/(1+exp

Re: [R] symbolic computing example with Ryacas

2017-09-19 Thread Bert Gunter
Have you studied the "Introduction to Ryacas" vignette that come with the package? Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Sep 19, 2

[R] symbolic computing example with Ryacas

2017-09-19 Thread Vivek Sutradhara
Hi all, I am trying to implement the following matlab code with Ryacas : syms U x x0 C d1=diff(U/(1+exp(-(x-x0)/C)),x); pretty(d1) d2=diff(U/(1+exp(-(x-x0)/C)),x,2); pretty(d2) solx2 = solve(d2 == 0, x, 'Real', true) pretty(solx2) slope2=subs(d1,solx2) I have tried the following : librar