I am trying to make a calculation but I have a few bugs and I do not understand them/how to fix them. Below is my syntax, the output, and the error messages. I am trying to calculate the point in my plot (done successfully in another window) where the areas are equal. I appreciate any help/advice.
p[v_]:=(8*.95)/(3*v-1)-3/v^2
Plot[p[v],{v,.5,3},PlotRange->{{0,4},
{.5,1}},
AxesLabel->{"v","p"},
PlotLabel->"van der Waals Isotherm for T/T_c=0.95"]
g[v_]:=-(.95)Log[3v-1]+.95/(3v-1)-9/(4v)
ParametricPlot[{p[v],g[v]},{v,.5,2.5},
AxesLabel->{"p","G/NkT_c"},
PlotLabel->"Gibbs free energy"]
pInt[v_]:=(8/3)*.95*Log[3*v-1]+3/v;
AreaDiff[p0_,v1guess_,v2guess_]:=(v1=FindRoot[p[v]==p0,{v,v1guess}][[1,2]];
v2=FindRoot[p[v]==p0,{v,v2guess}][[1,2]];
pInt[v2]-pInt[v1]-p0*(v2-v1));
FindRoot[AreaDiff[p0,.7,2]==0,{p0,.8,.82}]


p0_?NumericQ. Seehttps://mathematica.stackexchange.com/questions/18393/what-are-the-most-common-pitfalls-awaiting-new-users/26037#26037 – Michael E2 Apr 04 '22 at 22:07p? – Bob Hanlon Apr 04 '22 at 22:21InputForm). Include all code necessary to produce results (i.e., include that definition of p`). – Bob Hanlon Apr 04 '22 at 23:10