In[]:=
Wed 17 May 2023 17:09:21
Cleaned-up results for solving differential equations of the form f’(i, t)=a h(i)f(i, t) + b h(i)<h(i), f(i, t)>Forum posts:- DPR1 (separable + localized) mathematica.SE post with Ulrich’s numerical solution math.SE post with DinasaurEgg symbolic solution (but missing inverse transform) unanswered follow-up post on mathematica.SE (tricky inverse Laplace transform problem)- rank1 (separable): mathematica.SE post with yarchik’s analytical solution Notebooks:- checking Ulich solution: forum-ulrich-solution.nb- older version with back-substitution checking: forum-integro-differential.nb- berthier-formulas.nb has derivation of decay formula- asymptotic Laplace inversion - https://www.wolframcloud.com/obj/yaroslavvb/nn-linear/forum-asymptotic-laplace.nb
t
Headers
Headers
p - power law decay
t - time (step count)
s - Laplace dimension variable
d -- dimensions
maxSteps -- number of steps to run for
h -- form of h
h$ -- discretized version
t - time (step count)
s - Laplace dimension variable
d -- dimensions
maxSteps -- number of steps to run for
h -- form of h
h$ -- discretized version
In[]:=
getTrueLosses[h_,p_,d_,maxSteps_]:=Module[{steps,h$,traj,discretize,xvals,yvals},discretize[expr_]:=Table[N@expr,{i,0,d-1}];h$=discretize[h];steps=Table[t,{t,0,maxSteps}];traj=NestList[#-#*h$&,discretize[1],maxSteps];{steps,h$.&/@traj}]getTrueLosses[p_,d_,z_,maxSteps_]:=Module[{steps,h$,traj,discretize,xvals,yvals},discretize[expr_]:=Table[N@expr,{i,0,d-1}];h$=discretize[/z];steps=Table[t,{t,0,maxSteps}];traj=NestList[#-#*h$&,discretize[1],maxSteps];{steps,h$.&/@traj}];getTrueLoss[h_,d_,s_]:=Module[{steps,h$,traj,discretize,xvals,yvals},discretize[expr_]:=Table[N@expr,{i,0,d-1}];h$=discretize[h];error=Nest[#-#*h$&,discretize[1],s];h$.]
2
#
-p
(1+i)
2
#
2
error
Formulas
Formulas
Exhaustive asymptotics
Exhaustive asymptotics
s must be after d0, otherwise growth hits finite dimensional effect, no singularities at 0 but instead at
s must be after d0, otherwise growth hits finite dimensional effect, no singularities at 0 but instead at
lambda
min
In[]:=
ClearAll["Global`*"];SF=StringForm;nf[e_]:=NumberForm[e,{3,3}];slim[expr_]:=Asymptotic[expr,s0];slim2[expr_]:=Normal@Series[expr,{s,0,1}];tlim[expr_]:=Asymptotic[expr,t->∞];dlim[expr_]:=Asymptotic[expr,d->∞];dlim0[expr_]:=Limit[expr,d->∞];lap[expr_]:=LaplaceTransform[expr,t,s];ilap[expr_]:=InverseLaplaceTransform[expr,s,t];$Assumptions={d>1,t>0,s>0,1<p<=2};Off[Limit::alimv];Clear[d,t,s];getTrueLoss[h_,d_,t_]:=Module[{steps,h$,traj,discretize,xvals,yvals},discretize[expr_]:=Table[N@expr,{i,0,d-1}];h$=discretize[h];error=Nest[#-#*h$&,discretize[1],t];h$.error]z=1;p=2;h=;(*derivedinformulas/automaticformuladerivations*)loss=-ExpIntegralE,2t+ExpIntegralE,2t;d0=100;t0=3;loss0=getTrueLoss[h,d0,t0];Print[SF["d0=``, t0=``, loss0=``",d0,t0,nf@loss0]];process0[expr_,letter_]:=Module[{},Switch[letter,"t",tlim@expr,"s",ilap@slim@lap@expr,"s2",ilap@slim2@lap@expr,"d",dlim@expr,"d0",dlim0@expr]];process[expr0_,combination_]:=Module[{expr},expr=expr0;For[i=1,i<=Length[combination],i+=1,expr=process0[expr,combination[[i]]];];expr];SF=StringForm;nf[expr_]:=NumberForm[N@expr,{4,4}];Print["true: ",nf@loss0];combinations={{},{"d0"},{"t"},{"t","d"},{"d","t"}};results={};For[ii=1,ii<=Length@combinations,ii+=1,comb=combinations[[ii]];expr=TimeConstrained[process[loss,comb],3600,"timeout"];mismatch=If[expr==="timeout",-∞,(expr/.{t->t0,d->d0})-loss0];Print[SF["``, ``, ``,``",ii,comb,expr,nf@mismatch]];AppendTo[results,{comb,expr,mismatch}]]
-p
(1+i)
-1/p
z
1
p
1-p
(1+d)
1
p
-p
(1+d)
p
d0=100, t0=3, loss0=0.436
true: 0.4360
1, {}, -ExpIntegralE,2t+,-0.0843
1
2
1
2
ExpIntegralE,
1
2
2t
2
(1+d)
1+d
2, {d0}, -ExpIntegralE,2t,-0.0744
1
2
π
2
t
1
2
3, {t}, +,7.9760
-
2t
2
(1+d)
4t
d
-
2t
2
(1+d)
4t
4, {t,d}, ,7.8970
d
4t
Exhaustive Solutions
Exhaustive Solutions
Source code for deriving original formulas.
Code for integration in both original and transformed domain
Also in exhaustive-solutions-scratch.
Code for integration in both original and transformed domain
Also in exhaustive-solutions-scratch.
Integrate step
Integrate step
Laplace then integrate
Laplace then integrate
Integrate then Laplace
Integrate then Laplace
Inverse Laplace is broken. Hacked Laplace trick only works for p=2 case