## plotting – Fitting two convoluted peaks

If I have the following data:

https://pastebin.com/ya03z9bP

which plotted as:

``````ListLinePlot(datawithnoliquidline,
PlotStyle -> Directive(Thick, Black),
PlotRange -> {{40, 110}, {-0.02, All}}, Frame -> True,
FrameStyle -> 14, Axes -> False, GridLines -> Automatic,
GridLinesStyle -> Lighter(Gray, .8),
FrameTicks -> {Automatic, Automatic},
FrameLabel -> (Style(#, 20, Bold) & /@ {"T ((Degree)C)",
Row({"!(*SubscriptBox((C), (P)))", " (", " J/gK)"})}),
LabelStyle -> {Black, Bold, 14})
``````

gives two peaks as in the picture:

Questions:
1)How can I correctly fit these two peaks?
2) How can I calculate the areas of the two fitted peaks?

My approach, using gaussian fit (which doesn’t seem correct) is as follows:

``````ff2(x_, areaa1_, areaa3_, siga1_, siga3_, meda1_, meda3_) :=
areaa1 PDF(NormalDistribution(meda1, siga1), x) +
areaa3 PDF(NormalDistribution(meda3, siga3), x) ;

ma1guess = 6;
ma3guess = 1.3;
siga1guess = 4;
siga3guess = 3;
meda1guess = 82;
meda3guess = 97;

averagenematicarea = 1.2;(*Average nematic area from all three DSC
runs*)
STDnematicarea = 0.2; (*Standard deviation of nematic
area*)(*Aceptable shift above and below the nematic area where the
fits will be constraint (e.g if shift is 0.2 and area=1.2, then the
fits would be constraint between 1 J/g and 1.4 J/g)*)

averagesmecticarea = 1;(*Average smectic area from all three DSC runs*)

STDsmecticarea = 0.2; (*Standard deviation of smectic
area*)(*Aceptable shift above and below the nematic area where the
fits will be constraint (e.g if shift is 0.2 and area=1.2, then the
fits would be constraint between 1 J/g and 1.4 J/g)*)

averagenematiconset = 88.2;(*Average nematic onset from all three DSC
runs*)
STDnematiconset = 0.2; (*Standard deviation of nematic
onset*)(*Aceptable shift above and below the nematic onset where the
fits will be constraint (e.g if shift is 0.5 and onset=88, then the
fits would be constraint between 87.5C and 88.5C)*)

nlm3 = NonlinearModelFit(
datawithnoliquidline, {ff2(x, areaa1, areaa3, siga1, siga3, meda1,
meda3), areaa3 >= 0, areaa1 >= 0, 0 <= siga1 <= 20,
0 <= siga3 <= 20, 60 < meda1 < 85,
meda3 - 2*siga3 > 88.6}, {{areaa1, ma1guess}, {areaa3,
ma3guess}, {siga1, siga1guess}, {siga3, siga3guess}, {meda1,
meda1guess}, {meda3, meda3guess}}, x);

fp = nlm3("BestFitParameters");

p1 =(*Original data*)
ListLinePlot(datawithnoliquidline,
PlotStyle -> Directive(Thick, Black),
PlotRange -> {{40, 110}, {-0.02, All}}, Frame -> True,
FrameStyle -> 14, Axes -> False, GridLines -> Automatic,
GridLinesStyle -> Lighter(Gray, .8),
FrameTicks -> {Automatic, Automatic},
FrameLabel -> (Style(#, 20, Bold) & /@ {"T ((Degree)C)",
Row({"!(*SubscriptBox((C), (P)))", " (", " J/gK)"})}),
LabelStyle -> {Black, Bold, 14});
p2 = Plot({nlm3(x),
areaa3 PDF(NormalDistribution(meda3, siga3), x) /.
fp, +areaa1 PDF(NormalDistribution(meda1, siga1), x) /. fp}, {x,
40, 110},
PlotStyle -> {Directive(Red, Dashing({0.02, 0.04}),
AbsoluteThickness(5)), Directive(Green, AbsoluteThickness(2)),
Directive(Orange, AbsoluteThickness(2)),
Directive(Blue, AbsoluteThickness(2)), Directive(Pink, Dashed),
Directive(Cyan, Dashed)}, PlotRange -> All);

Show(p1, p2)
``````

which gives the following:

So, my problem is really fitting correctly the second peak, which I am not sure how to do.