Once you figure out how to decipher the output, you realise that it actually
does give you all 4 roots, including the two real ones:
...
> a <- .Last.value
> complex_cartesian <- function(x,y) x+(0+1i)*y
> eval(a$text[[1]][[2]][[3]])
[1] -1.00028+0.988174i
> eval(a$text[[1]][[3]][[3]])
[1] -1.000
Yes, it works for me.
Eik Vettorazzi , 21 Kas 2018 Çar, 00:19 tarihinde şunu
yazdı:
> How about this:
>
> library(rootSolve)
> f1<-function(x)5/((1+x)^1) + 5/((1+x)^2) + 5/((1+x)^3) + 105/((1+x)^4) -105
> uniroot.all( f1,c(-1e6,1e6))
>
> [1] -1.9881665 0.0363435
>
> Cheers
>
>
> Am 20.11.2018 um
How about this:
library(rootSolve)
f1<-function(x)5/((1+x)^1) + 5/((1+x)^2) + 5/((1+x)^3) + 105/((1+x)^4) -105
uniroot.all( f1,c(-1e6,1e6))
[1] -1.9881665 0.0363435
Cheers
Am 20.11.2018 um 13:09 schrieb Engin Yılmaz:
Dea(R)
I try to solve one equation but this program did not give me real r
A bit pedestrian, but you might try
pf <- function(x){5/((1+x)^1) + 5/((1+x)^2) + 5/((1+x)^3) + 105/((1+x)^4) -105}
uniroot(pf,c(-10,10))
curve(pf, c(-10,10))
require(pracma)
tryn <- newton(pf, 0)
tryn
pf(0)
pf(0.03634399)
yc <- c(-105, 5,5,5,105)
rooty <- polyroot(yc)
rooty
rootx <- 1/rooty - 1
r
Dea(R)
I try to solve one equation but this program did not give me real roots
for example
yacas("Solve( 5/((1+x)^1) + 5/((1+x)^2) + 5/((1+x)^3) + 105/((1+x)^4) -105
==0, x)")
gave me following results
How can I find real roots?
expression(list(x == complex_cartesian((1/42 - ((1/63 -
((root(733945
Thanks a lot!
Berend Hasselman , 20 Kas 2018 Sal, 12:02 tarihinde şunu
yazdı:
>
>
> R package Ryacas may be what you want.
>
> Berend
>
>
> > On 20 Nov 2018, at 09:42, Engin Yılmaz wrote:
> >
> > Dea(R)
> >
> > Do you know any system solver in R ?
> >
> > For example, in matlab, is very easy
> >
R package Ryacas may be what you want.
Berend
> On 20 Nov 2018, at 09:42, Engin Yılmaz wrote:
>
> Dea(R)
>
> Do you know any system solver in R ?
>
> For example, in matlab, is very easy
>
> syms a b c x eqn = a*x^2 + b*x + c == 0; sol = solve(eqn)
>
> How can I find this type code in
Dea(R)
Do you know any system solver in R ?
For example, in matlab, is very easy
syms a b c x eqn = a*x^2 + b*x + c == 0; sol = solve(eqn)
How can I find this type code in R (or directly solver)?
*Since(R)ely*
Engin YILMAZ
[[alternative HTML version deleted]]
___
8 matches
Mail list logo