Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

NMinimize with Mathematica

  1. Sep 9, 2014 #1
    What wrong with my calculation.the problem is from the attachment.
    It keeps saying:
    NMinimize::nnum: "The function value {10721.1} is not a number at {rs,x} = {1.91862,1.66351}. "

    My code:

    XDDO154[x_, rs_] :=
    Sum[(DDO154vobs[] -
    Sqrt[(4 Pi*(43.040600502)*x*
    rs^(3)/(DDO154pc[]))*(-DDO154pc[]/(DDO154pc[] +
    rs) + Log[((DDO154pc[] + rs)/rs)])])^2/
    DDO154err[], {i, 1, 61}]

    NMinimize[{XDDO154[x, rs], 0 < x && 0 < rs}, {x, rs}, Method -> "DifferentialEvolution"]

    (DDO1254pc, DDO154err are tables)
     
  2. jcsd
  3. Sep 9, 2014 #2

    DrClaude

    User Avatar

    Staff: Mentor

    What do DDO154vobs, DDO154pc, and DDO154err look like?
     
  4. Sep 9, 2014 #3
    They are tables of one column with numbers, like velocity, distance and errors.
     
  5. Sep 9, 2014 #4
    Forget it¡ Something was wrong with my table. Thanks¡
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: NMinimize with Mathematica
  1. Principia mathematica (Replies: 11)

  2. Problem with Mathematica (Replies: 11)

Loading...