X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 16 Aug 2012 06:39 AM by  anon
how to use BROYDEN? prompt % BROYDEN: singular Jacobian in broydn.
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
16 Aug 2012 06:39 AM
    Hi, everyone I am try to solve the eqation with IDL, non linear equation. and I use the broyden ,now I have a question. the code is below: function test2, x return, [ 500 / (1+X[0] * EXP(-1*X[1])) - 3, $ 500 / (1+X[0] * EXP(-2*X[1])) - 13] end FUNCTION test, X return, [0.3 * X[0] / (!pi *(1-0.3 * X[1])) + X[2] - 121.362, $ 0.4 * X[0] / (!pi * (1-0.4 * X[1])) + X[2] - 156.77, $ 0.5 * X[0] / (!pi * (1-0.5 * X[1])) + X[2] - 193.081] END XX = [2.0,4.0] result2 = BROYDEN(XX, 'test2') prompt: % BROYDEN: singular Jacobian in broydn. X = [1000.0, 0.0, 21.0] result = BROYDEN(X, 'test') this could be ok to get the right value. while X = [100.0, 0.0, 21.0] result = BROYDEN(X, 'test') it prompt me that % BROYDEN: singular Jacobian in broydn. in the idl help, it said ;Provide an initial guess as the algorithm's starting point: how to get the proper initial guess?? or any other function could solve the non linear equation?? FUNCTION broyfunc, X RETURN, [3.0 * X[0] - COS(X[1]*X[2]) - 0.5,$ X[0]^2 - 81.0*(X[1] + 0.1)^2 + SIN(X[2]) + 1.06,$ EXP(-X[0]*X[1]) + 20.0 * X[2] + (10.0*!PI - 3.0)/3.0] END ;Provide an initial guess as the algorithm's starting point: X = [-1.0, 1.0, 2.0] ;Compute the solution: result = BROYDEN(X, 'BROYFUNC') ;Print the result: PRINT, result thank you in advance

    Deleted User



    New Member


    Posts:
    New Member


    --
    22 Aug 2012 04:04 PM
    Hi wxfei19, An initial guess will have to be related with the problem that you are trying to solve. If it is a physics problem then it will have to be some (educated) initial guess that reflects the state of the physical system where the solution will be used. That's why one initial guess works fine and another does not. cheers, fernando
    You are not authorized to post a reply.