What is causing the NMinimize error in my Mathematica calculation?

  • Context: Graduate 
  • Thread starter Thread starter gaby287
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary

Discussion Overview

The discussion revolves around an error encountered in a Mathematica calculation using the NMinimize function. Participants explore the nature of the error and the variables involved in the calculation, focusing on the function definition and the input data.

Discussion Character

  • Technical explanation

Main Points Raised

  • One participant reports an error message from NMinimize indicating that the function value is not a number at specific input values.
  • The same participant shares their code for the function XDDO154, which involves a summation of squared differences and uses several input tables.
  • Another participant asks for clarification on the contents of the tables DDO154vobs, DDO154pc, and DDO154err.
  • The original poster responds that the tables consist of one column with numerical values representing velocity, distance, and errors.
  • The original poster later indicates that the issue was due to a problem with their table, suggesting that the error was resolved.

Areas of Agreement / Disagreement

The discussion appears to be resolved as the original poster identifies the source of the error in their data tables, indicating a lack of ongoing disagreement.

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
What do DDO154vobs, DDO154pc, and DDO154err look like?
 
They are tables of one column with numbers, like velocity, distance and errors.
 
Forget it¡ Something was wrong with my table. Thanks¡
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 55 ·
2
Replies
55
Views
8K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K