Skip to content

Solve system of equations (nleqslv) only returns origin

3 messages · Alicia Ellis, Berend Hasselman

#
On 04-12-2012, at 17:06, Alicia Ellis wrote:

            
Are you trying to minimize a function by solving the first order condition?
If yes then you should try functions such optim, nlminb and there are many more.

See below for more comments.
what is this statement supposed to do?
You are actually returning the input.
And why like that?
Just x or return(x) is quite sufficient.

You should return the vector y i.e. function values.
But y has length 4 and x has length 4.

So where is the fifth value for y?
If you print fstart you will see that it is identical to Xstart.

You need to rethink you firstordercond() function.
It's not correct.

Berend
#
On 04-12-2012, at 18:50, Berend Hasselman wrote:

            
x has length 5 of course.

Berend