Group Abstract Group Abstract

Message Boards Message Boards

Find fit parameters which will fit experimental data using a Hamiltonian?

Attachments:
POSTED BY: Robert Poenaru
4 Replies

Also, don't start variable or function names with capital letters

POSTED BY: Frank Kampas

I would recommend avoiding using subscript variable in evaluations. Just use simple notation like g3. Also avoid Greek and special notation when you can. All this makes code huge and unstable and hard to read.

POSTED BY: Sam Carrettie
Posted 9 years ago

There are some typos in the notebook:

(1) $\gamma_1 \gamma_2$ has no space between them in the following: Typo 1

(2) There's an extra "something" after $\gamma_1$:

Typo 2

POSTED BY: Jim Baldwin

As an experiment, I tried minimizing just the first term of your expression and got a useful error message

In[51]:= NMinimize[{(E1[6.5] - tsd1[[1]])^2, a > 10 && b > 20}, {a, b}]

During evaluation of In[51]:= NMinimize::nnum: The function value (96.4742 +Sqrt[86916. -Sqrt[7.55438*10^9+Times[<<2>>]]]/(2 Sqrt[2])+Sqrt[86916. +Sqrt[7.55438*10^9-3.97633*10^6 Plus[<<2>>]]]/(2 Sqrt[2]))^2 is not a number at {a,b} = {11.9186,21.6635}.

During evaluation of In[51]:= NMinimize::nnum: The function value (96.4742 +Sqrt[86916. -Sqrt[7.55438*10^9+Times[<<2>>]]]/(2 Sqrt[2])+Sqrt[86916. +Sqrt[7.55438*10^9-3.97633*10^6 Plus[<<2>>]]]/(2 Sqrt[2]))^2 is not a number at {a,b} = {11.9186,21.6635}.

During evaluation of In[51]:= NMinimize::nnum: The function value (96.4742 +Sqrt[86916. -Sqrt[7.55438*10^9+Times[<<2>>]]]/(2 Sqrt[2])+Sqrt[86916. +Sqrt[7.55438*10^9-3.97633*10^6 Plus[<<2>>]]]/(2 Sqrt[2]))^2 is not a number at {a,b} = {11.9186,21.6635}.

During evaluation of In[51]:= General::stop: Further output of NMinimize::nnum will be suppressed during this calculation.

Out[51]= NMinimize[{(-1739.3 + 
    a (179.376 - 8/5 b Cos[(43 \[Pi])/180]) + 
    1/(2 Sqrt[
      2]) (\[Sqrt](a^2 (222.029 + (7.51018 + 
               32/65 Sqrt[3] b Sin[(17 \[Pi])/180]) (12.1941 + 
               16/65 Sqrt[3]
                 b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                  Sin[(17 \[Pi])/
                   180]))) - \[Sqrt](a^4 (222.029 + (7.51018 + 
                  32/65 Sqrt[3] b Sin[(17 \[Pi])/180]) (12.1941 + 
                  16/65 Sqrt[3]
                    b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                    Sin[(17 \[Pi])/180])))^2 - 
            4 a^4 (-47.7013 + 
               7.51018 (7.51018 + 
                  32/65 Sqrt[3]
                    b Sin[(17 \[Pi])/180])) (-89.1844 + (12.1941 + 
                  16/65 Sqrt[3]
                    b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                    Sin[(17 \[Pi])/180])) (6.00082 + 13/(2 
\!\(\*SubscriptBox[\(17\), \(\[AliasDelimiter]\)]\))))))) + 
    1/(2 Sqrt[
      2]) (\[Sqrt](a^2 (222.029 + (7.51018 + 
               32/65 Sqrt[3] b Sin[(17 \[Pi])/180]) (12.1941 + 
               16/65 Sqrt[3]
                 b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                  Sin[(17 \[Pi])/
                   180]))) + \[Sqrt](a^4 (222.029 + (7.51018 + 
                  32/65 Sqrt[3] b Sin[(17 \[Pi])/180]) (12.1941 + 
                  16/65 Sqrt[3]

                    b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                    Sin[(17 \[Pi])/180])))^2 - 
            4 a^4 (-47.7013 + 
               7.51018 (7.51018 + 
                  32/65 Sqrt[3]
                    b Sin[(17 \[Pi])/180])) (-89.1844 + (12.1941 + 
                  16/65 Sqrt[3]
                    b (Sqrt[3] Cos[(17 \[Pi])/180] + 
                    Sin[(17 \[Pi])/180])) (6.00082 + 13/(2 
\!\(\*SubscriptBox[\(17\), \(\[AliasDelimiter]\)]\))))))))^2, 
  a > 10 && b > 20}, {a, b}]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard