按理说g[0]应该等于0,可是两种取g[0]的答案有一些不一致,不知道为什么
fy = 235;
Es = 210*10^3;
\[CurlyEpsilon]e = 0.8 (235*10^6)/(210*10^9) // N;
\[CurlyEpsilon]e1 = 1.5 \[CurlyEpsilon]e;
\[CurlyEpsilon]e2 = 10 \[CurlyEpsilon]e1;
\[CurlyEpsilon]e3 = 100 \[CurlyEpsilon]e1;
A = 0.2*fy/(\[CurlyEpsilon]e1 - \[CurlyEpsilon]e)^2;
B = 2 A \[CurlyEpsilon]e1;
CC = 0.8*fy + A (\[CurlyEpsilon]e)^2 - B \[CurlyEpsilon]e;
Plot[Piecewise[{{210*10^3 x,
0 < x < \[CurlyEpsilon]e}, {-A x^2 + B x + CC, \[CurlyEpsilon]e <=
x < \[CurlyEpsilon]e1}, {235, \[CurlyEpsilon]e1 <=
x < \[CurlyEpsilon]e2}, {235 (1 +
0.6 (x - \[CurlyEpsilon]e2 )/(\[CurlyEpsilon]e3 - \
\[CurlyEpsilon]e2)), \[CurlyEpsilon]e2 <=
x < \[CurlyEpsilon]e3}, {376, x >= \[CurlyEpsilon]e3}}], {x, 0,
0.2}, PlotRange -> All, PlotPoints -> 500]
f[x_] := Piecewise[{{210*10^3 x,
0 < x < \[CurlyEpsilon]e}, {-A x^2 + B x + CC, \[CurlyEpsilon]e <=
x < \[CurlyEpsilon]e1}, {235, \[CurlyEpsilon]e1 <=
x < \[CurlyEpsilon]e2}, {235 (1 +
0.6 (
x - \[CurlyEpsilon]e2 )/(\[CurlyEpsilon]e3 - \
\[CurlyEpsilon]e2)), \[CurlyEpsilon]e2 <=
x < \[CurlyEpsilon]e3}, {376, x >= \[CurlyEpsilon]e3}}]
g[x_] := x - f[x + \[CurlyEpsilon]e]/Es + \[CurlyEpsilon]e
g[x] /. x -> 0
g[0]