similar to: Solving equation

Displaying 20 results from an estimated 9000 matches similar to: "Solving equation"

2010 Jun 02
1
code for power and suffix for x,y labels in plot( ).
Hi I was trying to have a graph whose axes are X axis: m, Y axis: var[X ((a,b) in suffix, and (n,d) in the power)]. X ((a,b) in suffix, and (n,d) in the power)- X^(n,d) _ (a,b). Actually I require many plots involving different values of a,b,n,d, so need to keep this complicated notation. The expression() didn't work out for this case. Can anyone help me out. Thanks, in advance.
2012 Mar 24
1
Solving the equation using uniroot
Hello all, I was going to solve (n-m)! * (n-k)! = 0.5 *n! * (n-m-k)! for m when values of n and k are provided n1<-c(10,13,18,30,60,100,500)         # values of n kx<-seq(1,7,1);                               # values of k slv2<-lapply(n1,function(n){    slv1<-lapply(kx,function(k){              lhs<-function(m)              {                
2010 Sep 24
1
Solving equations involving gamma functions
Hi, I want to find a value of n1. I used the following code but I am getting the error - Error in as.vector(x, mode) : cannot coerce type 'closure' to vector of type 'any' n=10 a_g<-(1/(n*(n-1)))*((pi/3)*(n+1)+(2*sqrt(3)*(n-2))-4*n+6) a_s<-function(n1) { t1=(n1-1)/2; (t1*(gamma(t1)/gamma(n1/2))^2)/2-1-a_g } xm<-solve(a_s) Can anyone help me out. Thanks in
2011 Sep 11
3
(no subject)
Dear all, Can anyone take a look at my program below? There are two functions: f1 (lambda,z,p1) and f2(p1,cl, cu). I fixed p1=0.15 for both functions. For any fixed value of lambda (between 0.01 and 0.99), I solve f1(p1=0.15, lambda=lambda, z)=0 for the corresponding cl and cu values. Then I plug the calculated cl and cu back into the function f2. Eventually, I want to find the lambda value
2013 May 30
2
RFC: a "safe" uniroot() function for future R
With main R releases only happening yearly in spring, now is good time to consider *and* discuss new features for what we often call "R-devel" and more officially is R Under development (unstable) (.....) -- "Unsuffered Consequences" Here is one such example I hereby expose to public scrutiny: A few minutes ago, I've committed the following to R-devel (the
2011 Apr 03
1
How do I modify uniroot function to return .0001 if error ?
I am calling the uniroot function from inside another function using these lines (last two lines of the function) : d <- uniroot(k, c(.001, 250), tol=.05) return(d$root) The problem is that on occasion there's a problem with the values I'm passing to uniroot. In those instances uniroot stops and sends a message that it can't calculate the root because f.upper * f.lower is greater
2007 Mar 29
1
ansari.test.default: bug in call to uniroot?
A recent message on ansari.test() prompted me to play with the examples. This doesn't work for me in R version 2.4.1 R> ansari.test(rnorm(100), rnorm(100, 0, 2), conf.int = TRUE) Error in uniroot(ab, srange, tol = 1e-04, zq = qnorm(alpha/2, lower = FALSE)) : object "ab" not found It looks like there's a small typo in ccia() inside ansari.test.default() in which
2012 Oct 14
1
Finding root of quadratic equation
Dear R Helpers, I need to find the root of following equationy=x^2+3*x-1 by substitution a random number from less to more in the certain segment.I had tried using this codef <- function (x) x^2+x-12str(xmin <- uniroot(f, c(2, 4), tol = 0.0001)) but $ f.root : num -7.85e-07not 0, and so I'm not shure it's right code and satisfactory answer. Please guide. sveta -- View this
2020 Oct 06
0
Solving a simple linear equation using uniroot give error object 'x' not found
On 06/10/2020 11:00 a.m., Sorkin, John wrote: > Colleagues, > I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, > Error in yfu n(x,10,20) : object 'x' not found. > > I hope someone can tell we how I can fix
2011 Feb 21
1
question about solving equation using bisection method
Hi all, I have the following two function f1 and f2. f1 <- function(lambda,z,p1){ lambda*(p1*exp(-3*z-9/2)+(0.2-p1)*exp(4*z-8))-(1-lambda)*0.8} f2 <- function(p1,cl, cu){ 0.8*(pnorm(cl)+(1-pnorm(cu)))/(0.8*(pnorm(cl)+(1-pnorm(cu)))+p1*(pnorm(cl+3)+(1-pnorm(cu+3)))+(0.2-p1)*(pnorm(cl-4)+(1-pnorm(cu-4))))}-0.05 First fix p1 to be 0.15. (i) choose a lambda value, say lamda=0.6, (ii)
2011 May 06
1
Uniroot - error
Hi, I have tried to use uniroot to solve a value (value a in my function) that gives f=0, and I repeat this process for 10000 times(stimulations). However error occures from the 4625th stimulation - Error in uniroot(f, c(0, 2), maxiter = 1000, tol = 0.001) : f() values at end points not of opposite sign I have also tried interval of (lower=min(U), upper=max(U)) and it won't work as well.
2020 Oct 06
4
Solving a simple linear equation using uniroot give error object 'x' not found
Colleagues, I am trying to learn to use uniroot to solve a simple linear equation. I define the function, prove the function and a call to the function works. When I try to use uniroot to solve the equation I get an error message, Error in yfu n(x,10,20) : object 'x' not found. I hope someone can tell we how I can fix the problem
2008 Apr 12
1
R and Excel disagreement - Goal Seek versus uniroot
Dear friends - occurring in Windows R2.6.2 I am modeling physical chemistry in collaboration with a friend who has preferred working in Excel. I used uniroot, and find a solution to a two buffer problem in acid-base chemistry which I believe is physiologically sensible. Using "goal seek" in Excel my friend found another plausible root, quite close to zero, and a plot of the function
2011 Sep 03
3
question with uniroot function
Dear all, I have the following problem with the uniroot function. I want to find roots for the fucntion "Fp2" which is defined as below. Fz <- function(z){0.8*pnorm(z)+p1*pnorm(z-u1)+(0.2-p1)*pnorm(z-u2)} Fp <- function(t){(1-Fz(abs(qnorm(1-(t/2)))))+(Fz(-abs(qnorm(1-(t/2)))))} Fp2 <- function(t) {Fp(t)-0.8*t/alpha} th <- uniroot(Fp2, lower =0, upper =1,
2010 Jun 02
2
help in expression( )
Hi, I was trying to have a graph whose axes are of the following type: X axis: n and Y axis: var[U ((a,b) in suffix, and (n,d) in the power)]. U ((a,b) in suffix, and (n,d) in the power)- U^(n,d) _ (a,b). Actually I require many plots involving different values of a,b,n,d, so need to keep this complicated notation. The code I used: plot(n, hn$h_pg,
2012 Oct 22
1
Matlab code to R code
Dear r-users, I would like to convert my Matlab code to R-code, however it dies not work as expected.  Hope somebody can help me to match Matlab and r codes. R code: rr <- function(r,cxn) { tol <- 1E-4; for(i in 1:n) { t1 <- (1+(i-1)*r)*log((1+(i-1)*r)) t2 <- (i-1)*(1-r)*log(1-r) rri <- ((t1+t2)/i*log(i))-cxn rr <- rri > tol } round(rr,4) } rr1 <- rr(0.5,0.0242) ; rr1
2023 Feb 20
1
uniroot violates bounds?
Le 18/02/2023 ? 21:44, J C Nash a ?crit?: > I wrote first cut at unirootR for Martin M and he revised and put in > Rmpfr. > > The following extends Ben's example, but adds the unirootR with trace > output. > > c1 <- 4469.822 > c2 <- 572.3413 > f <- function(x) { c1/x - c2/(1-x) }; uniroot(f, c(1e-6, 1)) > uniroot(f, c(1e-6, 1)) > library(Rmpfr) >
2017 Dec 25
3
plot representation of calculated value known to be 7.4
Dear friends - merry Christmas and thanks a lot for much help during the year! In the example below I fail to understand how the calculated value pH is represented in a simple plot - also included. The calculations are useful in practice and likely to be right in principle but I cannot see how this occurs: why a calculated value of 7.4 known as numeric is not simply plotted as such. It
2009 Nov 04
2
solving a linear equation
Hi all, I've a linear equation of the form: 0.95=2 ( [3+ln(x/3)]^-13  + 4 [3+2ln(x/3)]^-13  + [3+4ln(x/3)]^-13 ) and I want to solve it for x, can I do this using R? Thanks in advance. Maram. [[alternative HTML version deleted]]
2009 Jun 09
1
Problem : solving a equation with R , fail with uniroot function
Hi , I would like to know if a R function have the same behaviour than the matlab solve function. I tried something with uniroot but I have some problems: The equation I need to solve is : exp(c0-r0)*(bb0+x)*(bb1-x)=(bb0+x+1)(bb1-x-1) So I tried this: STEP 1: my function test test <- function(x,bb0=-3,bb1=5,c0=2,r0=0) { + ((exp(c0-r0)*(bb0+x)*(bb1-x))/((bb0+x+1)(bb1-x-1))-1)} STEP 2: >