0

I want to fit data with my custom function to calculate parameters of the model. Data of x and y are attached at the end. The custom function is:

y=a+(-((4/3)*3.14*((60e-10)^3-((60e-10)-x).^3).*b*(c-1096)/c+4*3.14*(60e-10)^2.*(d.*((60e-10)-x).^2/(60e-10)^2+e+(f-e-d.*((60e-10)-x).^2/(60e-10)^2).*exp(-x./g)))/(1e3*1.38e-23*1090))

and parameters have constraints and initials:

-inf<a<inf,    a=2e4
1e11<b<1e12,   b=7.8e11
1120<c<1300,   c=1200
70<d<130,      d=127
300<e<700,     e=680
400<f<900,     f=850
1e-10<g<3e-10, g=2.5e-10

However, I both tried matlab and rigin to fit data with the model, but they all failed to find a good fit. I am appreciate if you can provide any suggestions. In fact, I understand there are too many parameters, and I also tried to fix parameter b, d, e and g while free others, but still no good results.

x=[3.70400000000000e-10
    3.80400000000000e-10
    3.90400000000000e-10
    4.00400000000000e-10
    4.10400000000000e-10
    4.20400000000000e-10
    4.30400000000000e-10
    4.40400000000000e-10
    4.50400000000000e-10
    4.60400000000000e-10
    4.70400000000000e-10
    4.80400000000000e-10
    4.90400000000000e-10
    5.00400000000000e-10
    5.10400000000000e-10
    5.20400000000000e-10
    5.30400000000000e-10
    5.40400000000000e-10
    5.50400000000000e-10
    5.60400000000000e-10
    5.70400000000000e-10
    5.80400000000000e-10
    5.90400000000000e-10
    6.00400000000000e-10
    6.10400000000000e-10
    6.20400000000000e-10
    6.30400000000000e-10
    6.40400000000000e-10
    6.50400000000000e-10
    6.60400000000000e-10
    6.70400000000000e-10
    6.80400000000000e-10
    6.90400000000000e-10
    7.00400000000000e-10
    7.10400000000000e-10
    7.20400000000000e-10
    7.30400000000000e-10
    7.40400000000000e-10
    7.50400000000000e-10
    7.60400000000000e-10
    7.70400000000000e-10
    7.80400000000000e-10
    7.90400000000000e-10
    8.00400000000000e-10
    8.10400000000000e-10
    8.20400000000000e-10
    8.30400000000000e-10
    8.40400000000000e-10
    8.50400000000000e-10
    8.60400000000000e-10
    8.70400000000000e-10
    8.80400000000000e-10
    8.90400000000000e-10
    9.00400000000000e-10
    9.10400000000000e-10
    9.20400000000000e-10
    9.30400000000000e-10
    9.40400000000000e-10
    9.50400000000000e-10
    9.60400000000000e-10
    9.70400000000000e-10
    9.80400000000000e-10
    9.90400000000000e-10
    1.00040000000000e-09
    1.01040000000000e-09
    1.02040000000000e-09
    1.03040000000000e-09
    1.04040000000000e-09
    1.05040000000000e-09
    1.06040000000000e-09
    1.07040000000000e-09
    1.08040000000000e-09
    1.09040000000000e-09
    1.10040000000000e-09
    1.11040000000000e-09
    1.12040000000000e-09
    1.13040000000000e-09
    1.14040000000000e-09
    1.15040000000000e-09
    1.16040000000000e-09
    1.17040000000000e-09
    1.18040000000000e-09
    1.19040000000000e-09
    1.20040000000000e-09
    1.21040000000000e-09
    1.22040000000000e-09
    1.23040000000000e-09
    1.24040000000000e-09
    1.25040000000000e-09
    1.26040000000000e-09
    1.27040000000000e-09
    1.28040000000000e-09
    1.29040000000000e-09
    1.30040000000000e-09
    1.31040000000000e-09
    1.32040000000000e-09
    1.33040000000000e-09
    1.34040000000000e-09
    1.35040000000000e-09
    1.36040000000000e-09
    1.37040000000000e-09
    1.38040000000000e-09
    1.39040000000000e-09
    1.40040000000000e-09
    1.41040000000000e-09
    1.42040000000000e-09
    1.43040000000000e-09
    1.44040000000000e-09
    1.45040000000000e-09
    1.46040000000000e-09
    1.47040000000000e-09
    1.48040000000000e-09
    1.49040000000000e-09
    1.50040000000000e-09
    1.51040000000000e-09
    1.52040000000000e-09
    1.53040000000000e-09
    1.54040000000000e-09
    1.55040000000000e-09
    1.56040000000000e-09
    1.57040000000000e-09
    1.58040000000000e-09
    1.59040000000000e-09
    1.60040000000000e-09
    1.61040000000000e-09
    1.62040000000000e-09
    1.63040000000000e-09
    1.64040000000000e-09
    1.65040000000000e-09
    1.66040000000000e-09
    1.67040000000000e-09
    1.68040000000000e-09
    1.69040000000000e-09
    1.70040000000000e-09
    1.71040000000000e-09
    1.72040000000000e-09
    1.73040000000000e-09
    1.74040000000000e-09
    1.75040000000000e-09
    1.76040000000000e-09
    1.77040000000000e-09
    1.78040000000000e-09
    1.79040000000000e-09
    1.80040000000000e-09
    1.81040000000000e-09
    1.82040000000000e-09
    1.83040000000000e-09
    1.84040000000000e-09
    1.85040000000000e-09
    1.86040000000000e-09
    1.87040000000000e-09
    1.88040000000000e-09
    1.89040000000000e-09]
y=[-22.8405306447565
-22.2450287793417
-21.6577585104770
-21.0787198381626
-20.5079127623984
-19.9453372831843
-19.3909934005205
-18.8448811144068
-18.3070004248434
-17.7773513318301
-17.2559338353671
-16.7427479354542
-16.2377936320915
-15.7410709252790
-15.2525798150167
-14.7723203013046
-14.3002923841427
-13.8364960635310
-13.3809313394694
-12.9335982119581
-12.4944966809970
-12.0636267465860
-11.6409884087253
-11.2265816674147
-10.8204065226543
-10.4224629744442
-10.0327510227842
-9.65127066767441
-9.27802190911481
-8.91300474710541
-8.55621918164621
-8.20766521273719
-7.86734284037838
-7.53525206456975
-7.21139288531131
-6.89576530260307
-6.58836931644503
-6.28920492683717
-5.99827213377951
-5.71557093727205
-5.44110133731477
-5.17486333390769
-4.91685692705081
-4.66708211674411
-4.42553890298761
-4.19222728578130
-3.96714726512519
-3.75029884101927
-3.54168201346354
-3.34129678245801
-3.14914314800267
-2.96522111009752
-2.78953066874256
-2.62207182393780
-2.46284457568323
-2.31184892397886
-2.16908486882468
-2.03455241022069
-1.90825154816689
-1.79018228266329
-1.68034461370989
-1.57873854130667
-1.48536406545365
-1.40022118615082
-1.32330990339818
-1.25463021719574
-1.19418212754349
-1.14196563444144
-1.09798073788958
-1.06222743788791
-1.03470573443643
-1.01541562753515
-1.00435711718406
-1.00153020338316
-1.00693488613246
-1.02057116543195
-1.04243904128163
-1.07253851368151
-1.11086958263158
-1.15743224813184
-1.21222651018230
-1.27525236878295
-1.34650982393380
-1.42599887563483
-1.51371952388606
-1.60967176868748
-1.71385561003910
-1.82627104794091
-1.94691808239291
-2.07579671339511
-2.21290694094750
-2.35824876505008
-2.51182218570286
-2.67362720290583
-2.84366381665899
-3.02193202696235
-3.20843183381589
-3.40316323721964
-3.60612623717357
-3.81732083367770
-4.03674702673202
-4.26440481633653
-4.50029420249125
-4.74441518519615
-4.99676776445124
-5.25735194025653
-5.52616771261201
-5.80321508151769
-6.08849404697355
-6.38200460897961
-6.68374676753587
-6.99372052264231
-7.31192587429896
-7.63836282250579
-7.97303136726282
-8.31593150857004
-8.66706324642746
-9.02642658083506
-9.39402151179286
-9.76984803930086
-10.1539061633590
-10.5461958839674
-10.9467172011260
-11.3554701148348
-11.7724546250937
-12.1976707319029
-12.6311184352622
-13.0727977351718
-13.5227086316315
-13.9808511246414
-14.4472252142016
-14.9218309003119
-15.4046681829724
-15.8957370621831
-16.3950375379440
-16.9025696102550
-17.4183332791163
-17.9423285445278
-18.4745554064895
-19.0150138650013
-19.5637039200634
-20.1206255716756
-20.6857788198381
-21.2591636645507
-21.8407801058135
-22.4306281436265
-23.0287077779897
-23.6350190089032
-24.2495618363668
-24.8723362603805
-25.5033422809445
-26.1425798980587
-26.7900491117231]
Leo
  • 11
  • 5
  • 1
    you need to scale your data. you are working in a very high dynamic range with `x~1e-10` and `y~1e1`. try precomputing the constant elements in your function. – Shai Jul 07 '14 at 06:48
  • 1
    Can you post the code that you have tried? – Dan Jul 07 '14 at 08:25
  • When I scale the data of x, then the units of some parameters would also need to be changed and the their initial values (should be very close to the final value) would be around `1e-20`. @Shai – Leo Jul 07 '14 at 20:17
  • I am using cftool embedded by matlab (and I tried all available algorithms that it provided), and Origin software. @Dan – Leo Jul 07 '14 at 20:19

0 Answers0