What is causing the NMinimize error in my Mathematica calculation?

  • Context: Graduate 
  • Thread starter Thread starter gaby287
  • Start date Start date
  • Tags Tags
    Mathematica
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 2K views
gaby287
Messages
14
Reaction score
0
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)
 
Physics news on Phys.org
They are tables of one column with numbers, like velocity, distance and errors.
 
Forget it¡ Something was wrong with my table. Thanks¡