Hi and sorry for the strange headline, my problem is this:
data=[[0.78344E-02,0.15668E-01],[0.23501E-01,0.15664E-01],[0.39162E-01,0.15657E-01],[0.54813E-01,0.15645E-01],[0.70451E-01,0.15630E-01],[0.86071E-01,0.15611E-01],[0.10167E+00,0.15588E-01],[0.11725E+00,0.15561E-01],[0.13279E+00,0.15530E-01],[0.14830E+00,0.15496E-01],[0.16378E+00,0.15457E-01],[0.17922E+00,0.15415E-01],[0.19461E+00,0.15369E-01],[0.20995E+00,0.15320E-01],[0.22525E+00,0.15266E-01],[0.24049E+00,0.15209E-01],[0.25566E+00,0.15148E-01],[0.27078E+00,0.15083E-01],[0.28583E+00,0.15015E-01],[0.30081E+00,0.14943E-01],[0.31571E+00,0.14867E-01],[0.33054E+00,0.14788E-01],[0.34529E+00,0.14705E-01],[0.35995E+00,0.14618E-01],[0.37452E+00,0.14528E-01],[0.38901E+00,0.14434E-01],[0.40339E+00,0.14337E-01],[0.41768E+00,0.14236E-01],[0.43186E+00,0.14132E-01],[0.44594E+00,0.14024E-01],[0.45991E+00,0.13913E-01],[0.47377E+00,0.13799E-01],[0.48751E+00,0.13681E-01],[0.50113E+00,0.13559E-01],[0.51463E+00,0.13435E-01],[0.52800E+00,0.13306E-01],[0.54124E+00,0.13175E-01],[0.55435E+00,0.13041E-01],[0.56732E+00,0.12903E-01],[0.58015E+00,0.12762E-01],[0.59284E+00,0.12619E-01],[0.60539E+00,0.12471E-01],[0.61778E+00,0.12321E-01],[0.63003E+00,0.12168E-01],[0.64212E+00,0.12012E-01],[0.65405E+00,0.11852E-01],[0.66582E+00,0.11691E-01],[0.67743E+00,0.11525E-01],[0.68887E+00,0.11358E-01],[0.70015E+00,0.11187E-01],[0.71125E+00,0.11015E-01],[0.72217E+00,0.10838E-01],[0.73292E+00,0.10660E-01],[0.74349E+00,0.10478E-01],[0.75388E+00,0.10295E-01],[0.76408E+00,0.10108E-01],[0.77409E+00,0.99195E-02],[0.78392E+00,0.97277E-02],[0.79355E+00,0.95348E-02],[0.80299E+00,0.93382E-02],[0.81223E+00,0.91405E-02],[0.82127E+00,0.89392E-02],[0.83010E+00,0.87372E-02],[0.83874E+00,0.85317E-02],[0.84717E+00,0.83254E-02],[0.85539E+00,0.81160E-02],[0.86340E+00,0.79048E-02],[0.87120E+00,0.76925E-02],[0.87878E+00,0.74771E-02],[0.88615E+00,0.72611E-02],[0.89330E+00,0.70421E-02],[0.90024E+00,0.68223E-02],[0.90695E+00,0.66003E-02],[0.91344E+00,0.63765E-02],[0.91970E+00,0.61519E-02],[0.92574E+00,0.59252E-02],[0.93155E+00,0.56977E-02],[0.93713E+00,0.54676E-02],[0.94249E+00,0.52370E-02],[0.94761E+00,0.50054E-02],[0.95250E+00,0.47718E-02],[0.95715E+00,0.45371E-02],[0.96157E+00,0.43020E-02],[0.96575E+00,0.40653E-02],[0.96970E+00,0.38276E-02],[0.97341E+00,0.35894E-02],[0.97688E+00,0.33497E-02],[0.98011E+00,0.31091E-02],[0.98310E+00,0.28688E-02],[0.98584E+00,0.26270E-02],[0.98835E+00,0.23846E-02],[0.99061E+00,0.21412E-02],[0.99263E+00,0.18984E-02],[0.99441E+00,0.16541E-02],[0.99594E+00,0.14099E-02],[0.99723E+00,0.11651E-02],[0.99827E+00,0.91946E-03],[0.99907E+00,0.67542E-03],[0.99962E+00,0.42986E-03],[0.99993E+00,0.18442E-03]]
var('a,b,x')
model=sqrt(b*(1-a*x^2))
# model=sqrt(a*(1-b*x^2))
find_fit(data,model,variables=[x],initial_guess=(1,0.87))
If I use the first model I get (no comment sign)
[a == 1.000140012208137, b == 0.76066019997968737]
If I use the second (commented out) model (exchange a and b as parameters)
[a == nan, b == nan]
Any ideas? It's not urgent since it does work but it's weird. Thanks in advance.