When solving a partial differential equation, I get
NDSolve::eerri: Warning: estimated initial error on the specified spatial grid in the direction of independent variable x exceeds prescribed error tolerance. And the equation cannot be solved.
My code:
ClearAll
l = 2.5
l0 = 1.5
Eb = 210*1000000000
rb = 10/1000
rhob = 7850
Eg = 35*1000000000
rg = 17.5/1000
vg = 0.25
varphi = 45/180*Pi
Cb = 2*Pi*rb
Ab = Pi*rb^2
R = 10*Eb*rb/((Eg + xE)/2)
Gg = Eg/(2*(1 + vg))
k = Gg*G/((G*Log[rg/rb] + Gg*Log[R/rb])*rb)
YiTa = Tan[varphi]
z1 = b
p[x_, t_] = FullSimplify[YiTa*Sigmaz[r0 + l - x, z1, t]]
PDE1 = D[u1[x, t], {x, 2}] ==
rhob*D[u1[x, t], {t, 2}]/Eb + k*Cb*u1[x, t]/(Eb*Ab) +
p[x, t]*Cb/(Eb*Ab)
initialCondition = {Derivative[0, 1][u1][x, 0] ==
Vr[r0 + l - x, z1, 0], u1[x, 0] == Ur[r0 + l - x, z1, 0]}
boundaryConditions = {u1[0, t] == Ur[l + r0, z1, t],
u1[l0, t] == Ur[r0 + l - l0, z1, t]}
sol = NDSolve[{PDE1, initialCondition, boundaryConditions},
u1, {x, 0, l0}, {t, 0, 0.001}, MaxStepSize -> 0.0000001]
Plot3D[Evaluate[u1[x, t] /. sol], {x, 0, l0}, {t, 0, 0.0001},
PlotRange -> All, AxesLabel -> {"x", "t", "u1(x,t)"}]
I tried running the code but got no results. I hope to get results that can be run and plotted.
Too long to put in a comment. As I earlier suggested, I replaced your
$MachinePrecisionconstants with exact rationals.Just before the step of doing the
NDSolvethat displays (roughly)Most of that looks reasonable, except for the E^(3999.99999...*t) terms and all "approximately 0*I" terms.
Can you work through the changes I made, see if I made any mistake doing this, and get rid of those terms that scare me?
I have not removed those, but I have tried the handful of tricks that I've used in the past and it either takes so much time or memory or bails out with the warning about the error being too large.
Is it possible to come up with a substantially simpler system that still correctly represents what you are trying to give
NDSolve? If you can do that then that might enable it to solve for you.