## First exploration of phase transitions: Fake transitions due to the binning.

I study the specific heat without doing the simulated annealing. I just assume one state per bin, and compute the probability as exp(-cost/temperature) for each state. Then the specific heat is the variance of the cost divided by the square of the temperature.

It seems that the binning may produce fake phase transitions near zero temperature, when the cost is narrow near the minimum:

Quadratic cost, and no fake phase transition despite the coarse binning:

>> x=-1:.01:1;
>> coste=(abs(x)).^2;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 1],1);

Linear cost, and the fake phase transition appears:

>> coste=(abs(x)).^1;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

Much more evident for sublinear cost:

>> coste=(abs(x)).^.5;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);

If I make a tighter binning, the maximum changes a lot (it even disappears if the binning is tight enough):

>> x=-1:.00001:1;
>> coste=(abs(x)).^.5;
>> [calorespecifico,T,costemedio,varianza]=coste2calorespecifico(coste,[0 .5],1);