Skip to main content
Post Undeleted by Cesareo
deleted 113 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12

NOTE

Concerning the transformation to an ODE as

$$ e^{\beta t} \left(\beta ^2 \left(c_0-\epsilon (t)^3\right) \epsilon '(t)+\beta \left(\epsilon (t)^3-c_0\right) \epsilon ''(t)-\beta \left(4 \epsilon (t)^2-2 \epsilon (t)+1\right) \epsilon '(t)^2+2 \epsilon '(t)^3\right)=0 $$

and solving asAnd now follows with the initial conditions extracted from the previousa layman solution $\epsilon_2(t)]$(second order splines) to this problem.

ϵ0fl[a_, =b_, 0.2761;
dϵ0c_, =delta_, 0.3942`;

solt_, n_] := NDSolve[{(E^Sum[(tUnitStep[t β)- (β^2k (c0delta] - ϵ[t]^3)ϵ'[t]UnitStep[t - β (1 - 2 ϵ[t]k + 41) ϵ[t]^2delta]) ϵ'[t]^2(a[k] + 2b[k] ϵ'[t]^3(t - k delta) + βc[k] (-c0t +- ϵ[t]^3)k ϵ''[t]delta)/.parms^2), =={k, 0, ϵ[0]n}]

n === ϵ0,40;
tmax ϵ'[0]= ==10;
delta dϵ0= tmax/4}n;
fl0 = fl[a, ϵb, {tc, 0delta, 5}][[1]];t, n];
ϵtFor[k = Evaluate[ϵ[t]n /.- sol];1, k >= 0, k--,
ϵs  fl0 = ϵtfl0 /. {ta[k + 1] -> s};
gr2a[k] =+ Plot[ϵt,delta {t,b[k] 0,+ 5}delta^2 c[k], PlotStyleb[k + 1] -> b[k] + 2 delta c[k]}]
vars = Join[{Thicka[0], Blueb[0]}, PlotRangeTable[c[k], ->{k, All]0, n}]];

Note that the initial condition for $\epsilon'(0)$ was reduced to be solved.

enter image description here

This solution has an error regarding the integral equation shown as follows

dif2
Clear[ϵ]
ϵ[t_] := fl0;
dif = (β*Integrate[ϵsβ*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵs^2β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵt*Integrate[β*ϵ[t]*Integrate[(ϵs^2ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] - ϵ[t] + ϵt^2ϵ[t]^2 + c0;

parms = {c0 -> ϵt0.20, β -> 0.2};
dif0 = dif /. parms;
 
Plot[dif2points = Table[dif0, {t, 0, 5tmax, delta/2}];
npts = Length[points];
diag = Table[(npts - k + 1), PlotStyle{k, 1, npts}];
obj = points.DiagonalMatrix[diag].points;
sol = NMinimize[obj, vars, Method -> "DifferentialEvolution"];
sol[[1]]
et = fl0 /. sol[[2]];
Plot[et, {Thickt, Blue0, tmax}, PlotRange -> All]All, PlotStyle -> {Thick, Blue}]

enter image description hereenter image description here

NOTE

NOTE

Concerning the transformation to an ODE as

$$ e^{\beta t} \left(\beta ^2 \left(c_0-\epsilon (t)^3\right) \epsilon '(t)+\beta \left(\epsilon (t)^3-c_0\right) \epsilon ''(t)-\beta \left(4 \epsilon (t)^2-2 \epsilon (t)+1\right) \epsilon '(t)^2+2 \epsilon '(t)^3\right)=0 $$

and solving as follows with the initial conditions extracted from the previous solution $\epsilon_2(t)]$

ϵ0 = 0.2761;
dϵ0 = 0.3942`;

sol = NDSolve[{(E^(t β) (β^2 (c0 - ϵ[t]^3)ϵ'[t] - β (1 - 2 ϵ[t] + 4 ϵ[t]^2) ϵ'[t]^2 + 2 ϵ'[t]^3 + β (-c0 + ϵ[t]^3) ϵ''[t])/.parms) == 0, ϵ[0] == ϵ0, ϵ'[0] == dϵ0/4}, ϵ, {t, 0, 5}][[1]];
ϵt = Evaluate[ϵ[t] /. sol];
ϵs = ϵt /. {t -> s};
gr2 = Plot[ϵt, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]

Note that the initial condition for $\epsilon'(0)$ was reduced to be solved.

enter image description here

This solution has an error regarding the integral equation shown as follows

dif2 = (β*Integrate[ϵs/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵs^2/E^((t - s)*β), {s, 0, t}] - β*ϵt*Integrate[(ϵs^2)/E^((t- s)*β), {s, 0, t}] + ϵt^2 + c0 - ϵt /. parms;
 
Plot[dif2, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]

enter image description here

And now follows a layman solution (second order splines) to this problem.

fl[a_, b_, c_, delta_, t_, n_] := Sum[(UnitStep[t - k delta] - UnitStep[t - (k + 1) delta]) (a[k] + b[k] (t - k delta) + c[k] (t - k delta)^2), {k, 0, n}]

n = 40;
tmax = 10;
delta = tmax/n;
fl0 = fl[a, b, c, delta, t, n];
For[k = n - 1, k >= 0, k--,
  fl0 = fl0 /. {a[k + 1] -> a[k] + delta b[k] + delta^2 c[k], b[k + 1] -> b[k] + 2 delta c[k]}]
vars = Join[{a[0], b[0]}, Table[c[k], {k, 0, n}]];

Clear[ϵ]
ϵ[t_] := fl0;
dif = (β*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ[t]*Integrate[(ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] - ϵ[t] + ϵ[t]^2 + c0;

parms = {c0 -> 0.20, β -> 0.2};
dif0 = dif /. parms;
points = Table[dif0, {t, 0, tmax, delta/2}];
npts = Length[points];
diag = Table[(npts - k + 1), {k, 1, npts}];
obj = points.DiagonalMatrix[diag].points;
sol = NMinimize[obj, vars, Method -> "DifferentialEvolution"];
sol[[1]]
et = fl0 /. sol[[2]];
Plot[et, {t, 0, tmax}, PlotRange -> All, PlotStyle -> {Thick, Blue}]

enter image description here

NOTE

deleted 66 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
f = c0;
sols = {f}
n = 9;
For[k = 1, k <= n, k++,
 Clear[ϵ1, ϵ2];
 ϵ1[s_] := f;Clear[ϵ];
 ϵ2[t_]ϵ[t_] := f;
 f = (β*Integrate[ϵ1[s]β*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ1[s]^2β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ2[t]*Integrate[β*ϵ[t]*Integrate[(ϵ1[s]^2ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ2[t]^2ϵ[t]^2 + c0;
 AppendTo[sols, f]
]

parms = {c0 -> 0.2, β -> 1};
funcs = sols /. parms;
Plot[funcs, {t, 0, 5}]
ϵ1[s_] := funcs[[n+1]];
ϵ2[t_]ϵ[t_] := funcs[[n+1]];
dif = (β*Integrate[ϵ1[s]β*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ1[s]^2β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ2[t]*Integrate[β*ϵ[t]*Integrate[(ϵ1[s]^2ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ2[t]^2ϵ[t]^2 + c0 - ϵ2[t];ϵ[t];

Plot[dif, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]
f = c0;
sols = {f}
n = 9;
For[k = 1, k <= n, k++,
 Clear[ϵ1, ϵ2];
 ϵ1[s_] := f;
 ϵ2[t_] := f;
 f = (β*Integrate[ϵ1[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ1[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ2[t]*Integrate[(ϵ1[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ2[t]^2 + c0;
 AppendTo[sols, f]
]

parms = {c0 -> 0.2, β -> 1};
funcs = sols /. parms;
Plot[funcs, {t, 0, 5}]
ϵ1[s_] := funcs[[n+1]];
ϵ2[t_] := funcs[[n+1]];
dif = (β*Integrate[ϵ1[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ1[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ2[t]*Integrate[(ϵ1[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ2[t]^2 + c0 - ϵ2[t];

Plot[dif, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]
f = c0;
sols = {f}
n = 9;
For[k = 1, k <= n, k++,
 Clear[ϵ];
 ϵ[t_] := f;
 f = (β*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ[t]*Integrate[(ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ[t]^2 + c0;
 AppendTo[sols, f]
]

parms = {c0 -> 0.2, β -> 1};
funcs = sols /. parms;
Plot[funcs, {t, 0, 5}]
ϵ[t_] := funcs[[n+1]];
dif = (β*Integrate[ϵ[s]/E^((t - s)*β), {s, 0, t}]) - β*Integrate[ϵ[s]^2/E^((t - s)*β), {s, 0, t}] - β*ϵ[t]*Integrate[(ϵ[s]^2)/E^((t- s)*β), {s, 0, t}] + ϵ[t]^2 + c0 - ϵ[t];

Plot[dif, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]
Post Deleted by Cesareo
Post Undeleted by Cesareo
added 1109 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
ϵ0 = 0.2761;
dϵ0 = 0.3942`;

sol = NDSolve[{(E^(t β) (β^2 (c0 - ϵ[t]^3)ϵ'[t] - β (1 - 2 ϵ[t] + 4 ϵ[t]^2) ϵ'[t]^2 + 2 ϵ'[t]^3 + β (-c0 + ϵ[t]^3) ϵ''[t])/.parms) == 0, ϵ[0] == ϵ0, ϵ'[0] == dϵ0/4}, ϵ, {t, 0, 5}][[1]];
ϵt = Evaluate[ϵ[t] /. sol];
ϵs = ϵt /. {t -> s};
gr2 = Plot[ϵt, {t, 0, 5}, PlotRangePlotStyle -> All];
Show[gr2{Thick, Blue}, PlotRange -> All]

Note that the initial condition for $\epsilon'(0)$ was reduced to be solved.

enter image description here

This solution has an error regarding the integral equation shown as follows

AtAlso at $t=0$ we have

ϵ0 = 0.2761;
dϵ0 = 0.3942`;

sol = NDSolve[{(E^(t β) (β^2 (c0 - ϵ[t]^3)ϵ'[t] - β (1 - 2 ϵ[t] + 4 ϵ[t]^2) ϵ'[t]^2 + 2 ϵ'[t]^3 + β (-c0 + ϵ[t]^3) ϵ''[t])/.parms) == 0, ϵ[0] == ϵ0, ϵ'[0] == dϵ0/4}, ϵ, {t, 0, 5}][[1]];
ϵt = Evaluate[ϵ[t] /. sol];
ϵs = ϵt /. {t -> s};
gr2 = Plot[ϵt, {t, 0, 5}, PlotRange -> All];
Show[gr2, PlotRange -> All]

This solution has an error regarding the integral equation shown as follows

At $t=0$ we have

ϵ0 = 0.2761;
dϵ0 = 0.3942`;

sol = NDSolve[{(E^(t β) (β^2 (c0 - ϵ[t]^3)ϵ'[t] - β (1 - 2 ϵ[t] + 4 ϵ[t]^2) ϵ'[t]^2 + 2 ϵ'[t]^3 + β (-c0 + ϵ[t]^3) ϵ''[t])/.parms) == 0, ϵ[0] == ϵ0, ϵ'[0] == dϵ0/4}, ϵ, {t, 0, 5}][[1]];
ϵt = Evaluate[ϵ[t] /. sol];
ϵs = ϵt /. {t -> s};
gr2 = Plot[ϵt, {t, 0, 5}, PlotStyle -> {Thick, Blue}, PlotRange -> All]

Note that the initial condition for $\epsilon'(0)$ was reduced to be solved.

enter image description here

This solution has an error regarding the integral equation shown as follows

Also at $t=0$ we have

added 1109 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
added 1109 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
added 28 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
added 28 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
Post Deleted by Cesareo
added 14 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
added 403 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
added 157 characters in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
edited body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
refine the code
Source Link
AsukaMinato
  • 10.4k
  • 1
  • 17
  • 44
Loading
deleted 1 character in body
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading
Source Link
Cesareo
  • 4k
  • 8
  • 12
Loading