0
$\begingroup$

I am stucking in fitting a dataset. I have an experimental dataset which I want to model to extract some parameters, But unable to do it. Here is my dataset:

\[Alpha]w = {{408.89473`, 1388.4913105131122`}, {406.96599`, 
   1383.2251117910585`}, {405.03723999999994`, 
   1377.6688258512638`}, {403.10848999999996`, 
   1371.3761646664366`}, {401.1797399999999`, 
   1365.0835034816091`}, {399.25099`, 
   1359.2148159227102`}, {397.32224`, 
   1353.502329173363`}, {395.39349`, 
   1347.5890128117346`}, {393.46474`, 
   1341.497181239189`}, {391.53599999999994`, 
   1335.2045200543616`}, {389.60725`, 1328.443256440877`}, {387.6785`,
    1321.8605080383093`}, {385.74975`, 1315.567846853482`}, {383.821`,
    1309.1636136618313`}, {381.89225`, 
   1302.6254940619933`}, {379.96349999999995`, 
   1296.6006056935414`}, {378.0347499999999`, 
   1290.7765469373717`}, {376.10601`, 
   1284.3053705416266`}, {374.17726`, 
   1277.5664213295072`}, {372.24851`, 
   1271.2514457433147`}, {370.31976`, 
   1264.4232389257363`}, {368.39100999999994`, 
   1256.568569645384`}, {366.46226`, 
   1248.7808435691263`}, {364.53351`, 
   1241.7518071392656`}, {362.60476`, 
   1234.5442554984886`}, {360.67602`, 
   1226.5333854085843`}, {358.74726999999996`, 
   1218.2547425023042`}, {356.8185199999999`, 
   1210.4447020246814`}, {354.88977`, 
   1202.8131767579757`}, {352.96102`, 
   1195.0477650830826`}, {351.03227`, 
   1187.4385542177417`}, {349.10351999999995`, 
   1180.431832189246`}, {347.17476999999997`, 
   1173.2242805484686`}, {345.24603`, 
   1165.1018384517413`}, {343.31728`, 
   1156.7785667427315`}, {341.38853`, 
   1149.102412673297`}, {339.45978`, 
   1141.1138569847574`}, {337.53103`, 
   1131.5856076020577`}, {335.60227999999995`, 
   1121.7226421988892`}, {333.67353`, 
   1112.997711265316`}, {331.74478`, 
   1104.6967539576715`}, {329.81604`, 
   1096.2619102418391`}, {327.88729`, 
   1087.8940097301006`}, {325.95853999999997`, 
   1079.4368516129032`}, {324.02978999999993`, 
   1070.9796934957062`}, {322.10104`, 
   1062.946509004437`}, {320.17229`, 
   1055.6273853568368`}, {318.24354`, 
   1047.8619736819437`}, {316.31479`, 
   1038.9138987347244`}, {314.38604999999995`, 
   1029.5418501615773`}, {312.4572999999999`, 
   1021.1739496498386`}, {310.52855`, 
   1013.6539963899563`}, {308.5998`, 
   1006.1563575314386`}, {306.67105`, 998.0562298360758`}, {304.7423`,
    989.7775869297958`}, {302.81354999999996`, 
   981.387372016693`}, {300.8847999999999`, 
   972.6847554844849`}, {298.95606`, 963.959824550912`}, {297.02731`, 
   956.0605264678306`}, {295.09856`, 949.3438916570751`}, {293.16981`,
    942.5156848394967`}, {291.24105999999995`, 
   934.8172163686972`}, {289.31231`, 927.1410622992624`}, {287.38356`,
    920.1120258694019`}, {285.45481`, 
   913.3953910586467`}, {283.52607`, 
   906.7680138533495`}, {281.59731999999997`, 
   900.5422958726164`}, {279.66856999999993`, 
   894.8967523273636`}, {277.73982`, 889.3404663875691`}, {275.81107`,
    883.8064948491394`}, {273.88232`, 
   878.6295537325437`}, {271.95357`, 873.8765862418761`}, {270.02482`,
    869.1905619553028`}, {268.0960799999999`, 
   864.5491664714582`}, {266.16733`, 859.729255776697`}, {264.23858`, 
   854.7308298710186`}, {262.30983`, 850.044805584445`}, {260.38108`, 
   846.2290429510921`}, {258.45232999999996`, 
   842.5248523245626`}, {256.5235799999999`, 
   838.4190024734695`}, {254.59483`, 834.6032398401172`}, {252.66609`,
    831.1891364313275`}, {250.73733999999996`, 
   827.9535482334553`}, {248.80859`, 
   825.0303616546879`}, {246.87983999999997`, 
   821.9956030690977`}, {244.95108999999997`, 
   818.6038140616728`}, {243.02234`, 815.8814570951873`}, {241.09359`,
    813.9624185778288`}, {239.16483999999997`, 
   812.0880088631992`}, {237.2361`, 
   810.1466559444757`}, {235.30734999999999`, 
   808.2722462298464`}, {233.3786`, 806.5986661274987`}, {231.44985`, 
   804.9474004265156`}, {229.5211`, 803.6754795487311`}, {227.59235`, 
   802.6713314873228`}, {225.6636`, 
   801.4663538136324`}, {223.73484999999997`, 
   800.1051753303898`}, {221.80611`, 798.5208528335004`}, {219.87736`,
    797.0481023434345`}, {217.94860999999997`, 
   796.5348711120479`}, {216.01986`, 797.1150455475283`}, {214.09111`,
    797.204303152987`}, {212.16235999999998`, 
   796.9365303366112`}, {210.23361`, 797.1596743502575`}, {208.30486`,
    797.94067839802`}, {206.37611999999996`, 
   798.5654816362297`}, {204.44737`, 
   798.364652023948`}, {202.51861999999997`, 
   798.6101104389588`}, {200.58986999999996`, 
   798.6547392416885`}, {198.66112`, 797.6729055816445`}, {196.73237`,
    796.0662686833904`}, {194.80361999999997`, 
   795.6646094588269`}, {192.87487`, 
   797.1819887516223`}, {190.94612999999998`, 
   799.3018568812629`}, {189.01738`, 800.7299785685992`}, {187.08863`,
    801.4440394122677`}, {185.15988`, 
   803.1176195146154`}, {183.23113`, 804.8804572224217`}, {181.30238`,
    805.058972433339`}, {179.37362999999996`, 
   804.1663963787533`}, {177.44488`, 802.7605890927812`}, {175.51614`,
    800.640720963141`}, {173.58738999999997`, 
   798.4985384321358`}, {171.65864`, 799.6365729017323`}, {169.72989`,
    800.6407209631408`}, {167.80113999999998`, 
   798.8109400512408`}, {165.87239`, 796.3563559011307`}, {163.94364`,
    794.7720334042416`}, {162.01488999999998`, 
   794.3480597783134`}, {160.08615`, 793.9687149551147`}, {158.1574`, 
   793.9910293564793`}, {156.22864999999996`, 
   792.3620780568609`}, {154.2999`, 790.9785851722534`}, {152.37115`, 
   790.9116419681598`}, {150.44239999999996`, 
   789.4388914780936`}, {148.51365`, 785.1098976133543`}, {146.5849`, 
   777.8130883671181`}, {144.65616`, 773.1493784819094`}, {142.72741`,
    771.2749687672798`}, {140.79865999999998`, 
   771.2303399645507`}, {138.86991`, 770.4493359167883`}, {136.94116`,
    767.7939221543968`}, {135.01241`, 
   763.5095570923863`}, {133.08366`, 755.9449750297749`}, {131.15491`,
    749.4291698313011`}, {129.22616999999997`, 
   742.1993037891591`}, {127.29742`, 
   737.8256811216903`}, {125.36866999999998`, 
   734.6793505292766`}, {123.43991999999999`, 
   727.985030119886`}, {121.51117`, 
   721.4469105200476`}, {119.58241999999998`, 
   715.6451661652421`}, {117.65366999999999`, 
   710.6913690622929`}, {115.72492`, 702.4573549587423`}, {113.79618`,
    698.172989896732`}, {111.86742999999998`, 
   695.3613753247881`}, {109.93868`, 691.4563550859766`}, {108.00993`,
    684.0702882342822`}, {106.08117999999999`, 
   668.3832640749431`}, {104.15243`, 655.7309985011944`}, {102.22368`,
    644.1051953902191`}, {100.29492999999998`, 
   638.6827958586124`}, {98.36618999999999`, 
   632.7917938983486`}, {96.43744`, 621.0321043791853`}}

\[Alpha]s = {{408.89473`, 1325.8763748050455`}, {406.96599`, 
   1320.4222059109632`}, {405.03723999999994`, 
   1315.1605370954949`}, {403.10848999999996`, 
   1309.642201508541`}, {401.1797399999999`, 
   1303.5677545833669`}, {399.25099`, 
   1297.3649742724492`}, {397.32224`, 
   1291.4830274258895`}, {395.39349`, 
   1285.9005251460633`}, {393.46474`, 
   1280.189689480495`}, {391.53599999999994`, 
   1274.478853814926`}, {389.60725`, 1268.5755180707424`}, {387.6785`,
    1262.3085710669534`}, {385.74975`, 
   1255.9988462679166`}, {383.821`, 1249.753288161752`}, {381.89225`, 
   1243.2296743864763`}, {379.96349999999995`, 
   1236.984116280311`}, {378.0347499999999`, 
   1231.1663361266228`}, {376.10601`, 
   1225.2843892800636`}, {374.17726`, 
   1219.1671645596412`}, {372.24851`, 
   1213.007162043972`}, {370.31976`, 
   1206.440770473449`}, {368.39100999999994`, 
   1199.5535454385677`}, {366.46226`, 
   1192.559375915568`}, {364.53351`, 
   1185.5224285973195`}, {362.60476`, 
   1178.357147893329`}, {360.67602`, 
   1170.9138115202281`}, {358.74726999999996`, 
   1163.04269719465`}, {356.8185199999999`, 
   1155.2785273571915`}, {354.88977`, 
   1147.9207465745856`}, {352.96102`, 
   1141.0549104373288`}, {351.03227`, 
   1134.1890743000718`}, {349.10351999999995`, 
   1127.152126981824`}, {347.17476999999997`, 
   1119.8585128920902`}, {345.24603`, 
   1111.9873985665122`}, {343.31728`, 
   1103.6671173908333`}, {341.38853`, 
   1095.667669679512`}, {339.45978`, 
   1087.4543329919522`}, {337.53103`, 
   1078.342662604191`}, {335.60227999999995`, 
   1069.6159923736586`}, {333.67353`, 
   1061.8732114338236`}, {331.74478`, 
   1054.4512639583465`}, {329.81604`, 
   1047.1790387662363`}, {327.88729`, 
   1039.949591369374`}, {325.95853999999997`, 
   1031.9501436580529`}, {324.02978999999993`, 
   1023.0523622465299`}, {322.10104`, 
   1013.8337473706492`}, {320.17229`, 
   1005.1284660377405`}, {318.24354`, 
   997.1504072240436`}, {316.31479`, 
   989.5359596699516`}, {314.38604999999995`, 
   981.8145676277406`}, {312.4572999999999`, 
   974.1145644831535`}, {310.52855`, 966.4359502361898`}, {308.5998`, 
   958.7787248868503`}, {306.67105`, 950.5867770969145`}, {304.7423`, 
   941.9456624568779`}, {302.81354999999996`, 
   933.7323257693183`}, {300.8847999999999`, 
   926.5028783724555`}, {298.95606`, 919.8937090066852`}, {297.02731`,
    913.0064839718041`}, {295.09856`, 
   905.8839810630612`}, {293.16981`, 
   898.8470337448133`}, {291.24105999999995`, 
   891.7245308360704`}, {289.31231`, 884.5164723368318`}, {287.38356`,
    877.7148028924464`}, {285.45481`, 
   871.1484113219234`}, {283.52607`, 
   864.9456310110057`}, {281.59731999999997`, 
   859.4272954240514`}, {279.66856999999993`, 
   854.0586821204645`}, {277.73982`, 848.326457557272`}, {275.81107`, 
   842.9578442536847`}, {273.88232`, 837.9528422097028`}, {271.95357`,
    833.3970070158223`}, {270.02482`, 
   829.3117275696662`}, {268.0960799999999`, 
   825.3761704068772`}, {266.16733`, 821.0128352916112`}, {264.23858`,
    816.7564446644644`}, {262.30983`, 
   812.7567208088038`}, {260.38108`, 
   808.5858857721522`}, {258.45232999999996`, 
   803.9658838854`}, {256.5235799999999`, 
   799.5169931796385`}, {254.59483`, 795.3675470406109`}, {252.66609`,
    791.6886566493082`}, {250.73733999999996`, 
   789.1006000368218`}, {248.80859`, 
   786.9403213768126`}, {246.87983999999997`, 
   784.3736536619505`}, {244.95108999999997`, 
   782.0208749233263`}, {243.02234`, 780.3097631134181`}, {241.09359`,
    778.4275401225192`}, {239.16483999999997`, 
   776.0533724862712`}, {237.2361`, 
   774.2139272906198`}, {235.30734999999999`, 
   772.887815637941`}, {233.3786`, 771.1339260327849`}, {231.44985`, 
   768.5886472155464`}, {229.5211`, 766.2144795792984`}, {227.59235`, 
   764.289478793152`}, {225.6636`, 
   763.0703116285924`}, {223.73484999999997`, 
   762.8992004476015`}, {221.80611`, 762.9847560380971`}, {219.87736`,
    762.8136448571058`}, {217.94860999999997`, 
   762.3644780070052`}, {216.01986`, 761.5089221020511`}, {214.09111`,
    759.8405880873904`}, {212.16235999999998`, 
   758.5358653323357`}, {210.23361`, 758.1508651751062`}, {208.30486`,
    758.3433652537209`}, {206.37611999999996`, 
   758.7283654109499`}, {204.44737`, 
   758.7711432061978`}, {202.51861999999997`, 
   759.3700323396656`}, {200.58986999999996`, 
   760.2469771422437`}, {198.66112`, 761.252255330565`}, {196.73237`, 
   762.3217002117573`}, {194.80361999999997`, 
   763.4553117858218`}, {192.87487`, 
   764.2680898955282`}, {190.94612999999998`, 
   764.3322565883996`}, {189.01738`, 764.6958678480052`}, {187.08863`,
    765.1236458004823`}, {185.15988`, 
   765.5728126505834`}, {183.23113`, 765.8508683196933`}, {181.30238`,
    765.9578128078126`}, {179.37362999999996`, 
   766.3642018626658`}, {177.44488`, 766.4283685555373`}, {175.51614`,
    765.7225349339503`}, {173.58738999999997`, 
   763.9472564311703`}, {171.65864`, 762.7280892666108`}, {169.72989`,
    761.6800332830416`}, {167.80113999999998`, 
   761.4447554091795`}, {165.87239`, 763.0061449357208`}, {163.94364`,
    765.6155904458309`}, {162.01488999999998`, 
   766.7705909175189`}, {160.08615`, 763.840311943051`}, {158.1574`, 
   761.0383663543263`}, {156.22864999999996`, 
   759.5411435206565`}, {154.2999`, 757.8514206083721`}, {152.37115`, 
   754.2794747051886`}, {150.44239999999996`, 
   750.3011397471518`}, {148.51365`, 748.7611391182345`}, {146.5849`, 
   746.0447491200052`}, {144.65616`, 741.0183581783998`}, {142.72741`,
    734.4947444031242`}, {140.79865999999998`, 
   732.3558546407387`}, {138.86991`, 732.7836325932161`}, {136.94116`,
    730.8158540118216`}, {135.01241`, 
   728.6341864541884`}, {133.08366`, 725.4044629129866`}, {131.15491`,
    721.5972391359408`}, {129.22616999999997`, 
   713.6191803222432`}, {127.29742`, 
   706.4111218230048`}, {125.36866999999998`, 
   701.3847308813993`}, {123.43991999999999`, 
   694.9038949013719`}, {121.51117`, 
   689.3641704167936`}, {119.58241999999998`, 
   685.4286132540046`}, {117.65366999999999`, 
   683.7175014440963`}, {115.72492`, 676.9372208973349`}, {113.79618`,
    671.2905519246376`}, {111.86742999999998`, 
   664.8952715351055`}, {109.93868`, 654.6072117780318`}, {108.00993`,
    644.7469299734356`}, {106.08117999999999`, 
   633.7958143900229`}, {104.15243`, 627.3363673076188`}, {102.22368`,
    621.9035873111602`}, {100.29492999999998`, 
   619.7219197535271`}, {98.36618999999999`, 
   612.877472513894`}, {96.43744`, 601.9477458281048`}}

ListLinePlot[{\[Alpha]w, \[Alpha]s}];

Here, the x axis (wavenumber) of both [Alpha]s and [Alpha]w are variable as one can see from the data. [Alpha]s and [Alpha]w correspond to wavenumber dependent absorption coefficient of solute and water respectively.

Now, I have the following model by which I can get the [Alpha]s value in term of [Alpha]w and some other parameter. [Alpha]s = [Alpha]w*(1 - [Phi]h - 0.0024) + [Alpha]h*[Phi]h

Here, [Alpha]s and [Alpha]w are experimentally obtained value, the paramaters to be adjusted here is [Phi]h and [Alpha]h. Again the boundary conditions for this are : 0<[Phi]h<1 and [Alpha]h>0 and [Alpha]h>0 should be parameter which vary with the change of x axis data i.e. teh value of [Alpha]h should be in such a way that the no of [Alpha]h array should be equal to the number of datpoints present in both [Alpha]s and [Alpha]w (no of datapoint present in both [Alpha]s and [Alpha]w=163), more specifically, the value of [Alpha]h should be wavenumber dependent i.e. for different value of x (wavenumber), we should get a different [Alpha]h like there will be different value of [Alpha]h at x=96.4374, x=98.3662, x=100.295.............x=408.895 (as one can see that there are data for [Alpha]s, [Alpha]w for those x values) i.e. [Alpha]s,[Alpha]w,[Alpha]h should have same datapoints. How can I get it?

Any help regarding this will be really helpful to me.

$\endgroup$
1
  • $\begingroup$ \[Alpha]s and \ [Alpha]w depend on the same independent variable? This variable should occur in your model too! $\endgroup$ Commented Nov 23, 2021 at 7:23

1 Answer 1

2
$\begingroup$

Assuming \[Alpha]s[x] ,\[Alpha]w[x] depend on the same variable x:

First interpolate the datasets

ip\[Alpha]w = Interpolation[ \[Alpha]w, InterpolationOrder -> 1]
ip\[Alpha]s = Interpolation[ \[Alpha]s, InterpolationOrder -> 1]

range of x

{xmin, xmax} = MinMax[\[Alpha]s[[All, 1]]]
(* {96.4374, 408.895} *)

model

` ip\[Alpha]s[x] ~ ip\[Alpha]w[x]*(1 - \[CurlyPhi]h - 0.0024) + x*\[CurlyPhi]h`

minimization

J = # . # &[Table[-ip\[Alpha]s[x] +ip\[Alpha]w[x]*(1 - \[CurlyPhi]h - 0.0024) + \[Alpha]h*\[CurlyPhi]h, {x, Subdivide[xmin, xmax, 50]}]];
sol = NMinimize[J, {  \[CurlyPhi]h}]
(*{902.843, {\[CurlyPhi]h -> 0.0589715}}*)

show fit

Plot[Evaluate[{ip\[Alpha]s[x], ip\[Alpha]w[x]*(1 - \[CurlyPhi]h - 0.0024) + x*\[CurlyPhi]h} /. sol[[2]]], {x, xmin, xmax}, PlotStyle -> {Blue, {Dashed, Red}}]

enter image description here

Hope it helps!

$\endgroup$
8
  • $\begingroup$ This is fine and your consideration is also in line to extract the parameters, [Alpha]h, [CurlyPhi]h, but teh value of [Alpha]h should be x axis dependent i.e. for different value of x, we should get a different [Alpha]h like there will be different value of [Alpha]h at x=96.4374, x=98.3662, x=100.295.............x=408.895. How can I get it? $\endgroup$
    – P Pyne
    Commented Nov 23, 2021 at 8:17
  • $\begingroup$ That's an important information, please modifiy your question! $\endgroup$ Commented Nov 23, 2021 at 8:19
  • $\begingroup$ I have updated the question as per your suggestion $\endgroup$
    – P Pyne
    Commented Nov 23, 2021 at 8:24
  • $\begingroup$ Ok, see my modified answer! There is only one parameter \[CurlyPhi]h left to fit! $\endgroup$ Commented Nov 23, 2021 at 8:24
  • $\begingroup$ ok, I get get the [CurlyPhi]h value from teh fit, but can you please let know how can I get the x dependent [Alpha]h value? $\endgroup$
    – P Pyne
    Commented Nov 23, 2021 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.