Skip to content
Prev 371440 / 398513 Next

symbolic computing example with Ryacas

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(-(x-x0)/C)))}
FirstDeriv <- deriv(my_func(x,U,x0,C), x)
PrettyForm(FirstDeriv)
#slope <- yacas("Subst(x,x0),deriv(my_func(x,U,x0,C), x)")
slope <- Subst(FirstDeriv,x,x0)
#PrettyForm(slope) - gives errors
PrettyForm(Simplify(slope))

I was confused by the references to the yacas command.  Now, I have chosen
to omit it. Then I get what I want.
Thanks,
Vivek

2017-09-19 16:04 GMT+02:00 Bert Gunter <bgunter.4567 at gmail.com>: