Please, can you help me I have a equation to solve by newton method but I can
not do it
for example
f<-function(x) {
2+X2-X3=0}
this equation have un solution in [1,2]
is there a function in R for solve it or i have to programme it
[[alternative HTML version deleted]]
Look at the rootSolve package[1] for what you need. Hope it helps... -- H On Sat, 2 Feb 2019 at 06:46, malika yassa via R-help <r-help at r-project.org> wrote:> Please, can you help me I have a equation to solve by newton method but I > can not do it > for example > > f<-function(x) { > > > 2+X2-X3=0} > this equation have un solution in [1,2] > is there a function in R for solve it or i have to programme it > > > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >-- OpenPGP: https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1 If you wish to request my time, please do so using *bit.ly/hd1AppointmentRequest <http://bit.ly/hd1AppointmentRequest>*. Si vous voudrais faire connnaisance, allez a *bit.ly/hd1AppointmentRequest <http://bit.ly/hd1AppointmentRequest>*. <https://sks-keyservers.net/pks/lookup?op=get&search=0xFEBAD7FFD041BBA1>Sent from my mobile device Envoye de mon portable [[alternative HTML version deleted]]
> On 1 Feb 2019, at 12:41, malika yassa via R-help <r-help at r-project.org> wrote: > > Please, can you help me I have a equation to solve by newton method but I can not do it > for example > > f<-function(x) { > > > 2+X2-X3=0} > this equation have un solution in [1,2] > is there a function in R for solve it or i have to programme it >What is the relation between the function argument x and variables X2 and X3? As it stands this is incomprehensible. The function argument x is not used anywhere in the function body. Berend Hasselman> > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
On 2/2/19 12:41 AM, malika yassa via R-help wrote:> Please, can you help me I have a equation to solve by newton method but I can not do it > for example > > f<-function(x) { > > > 2+X2-X3=0} > this equation have un solution in [1,2] > is there a function in R for solve it or i have to programme it(a) Read the posting guide. (b) This looks like homework (perhaps a homework question that you have completely misunderstood) and this list has a no-homework policy. (c) As Berend Hasselman has pointed out, your question makes no real sense anyway. cheers, Rolf Turner -- Honorary Research Fellow Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276
Hello,
It is just a guess but I bet that what the OP means is
f <- function(x) {
2 + x^2 - x^3
}
uniroot(f, lower = 1, upper = 2)
To the OP: please learn how to write math in R *before* trying to solve
problems.
Hope this helps,
Rui Barradas
?s 16:07 de 02/02/2019, Berend Hasselman escreveu:>
>
>> On 1 Feb 2019, at 12:41, malika yassa via R-help <r-help at
r-project.org> wrote:
>>
>> Please, can you help me I have a equation to solve by newton method but
I can not do it
>> for example
>>
>> f<-function(x) {
>>
>>
>> 2+X2-X3=0}
>> this equation have un solution in [1,2]
>> is there a function in R for solve it or i have to programme it
>>
>
> What is the relation between the function argument x and variables X2 and
X3?
>
> As it stands this is incomprehensible. The function argument x is not used
anywhere in the function body.
>
> Berend Hasselman
>
>>
>>
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>