TransWikia.com

NDSolve - interpolation or machine precision problem

Mathematica Asked on January 28, 2021

For the following equations;
$$begin{align}
frac{partial text{NN}(t)}{partial t}&=-frac{(c timestext{Sigma})}{pitimes Ltimes text{Omega}^2} text{NN}(t) timestext{Phi}(t)-frac{text{NN}(t)}{text{Tau0}}+text{Wp}(t),
frac{partial text{Phi}(t)}{partial t}&=frac{(ctimes text{Sigma})}{pitimes Ltimes text{Omega}^2}text{NN}(t) times(text{Phi}(t)+1)-frac{text{Phi}(t)}{text{Tauph}}
end{align}$$

and.

$$
begin{align}
text{Wp}(t)=frac{(2 text{Ep})}{sqrt{2 pi }times htimes text{Nu}times text{Tauph}} (1-exp (-text{Alpha}times l)) exp left(-frac{2 t^2 log (2)}{text{T0}^2}right)
end{align}
$$

I have the code below,

Clear["Global`*"]
c = 3 10^8(*m/s*);
Sigma = 2.96 10^-23(*m^2*);(*2.96 10^-19cm^2*);
Omega = 1.4 10^-3(*m*);(*1.4 mm*);
L = 330 10^-3(*m*);(*330 mm*);
Tau0 = 3.2 10^-6(*s*);(*3.2 [Mu]s*);
Ep = 37 10^-3(*J*);(*37 mJ*);
h = 6.62607015 10^-34 (*J s*);
Nu = 10(*Hz*);
Alpha = 1 10^2(*m^-1*);(*1 cm^-1*);
l = 25.4 10^-3(*m*);(*25.4 mm*);
T0 = 11 10^-9(*s*);(*11 ns*);
Delta = 0.44;(*no unit*)
Tauph = L/(Delta c);
Wp[t_] := (2 Ep)/(Sqrt[2 Pi] Tauph h Nu) (1 - 
     Exp[-Alpha l]) Exp[(-2 Log[2] t^2)/T0^2];
slas = NDSolve[{D[NN[t], t] == 
     Wp[t] - (c Sigma)/(Pi Omega^2 L) NN[t] Phi[t] - NN[t]/Tau0, 
    D[Phi[t], t] == (c Sigma)/(Pi Omega^2 L) NN[t] (Phi[t] + 1) - 
      Phi[t]/Tauph, NN[0] == 0, Phi[0] == 0}, {NN, Phi}, {t, -1, 
    100}];
Plot[{Evaluate[NN[t] /. slas], Wp[t]}, {t, -50 10^-9, 100 10^-9}, 
 PlotRange -> All]

at the end I have the plot for $Wp(t)$ but $NN(t)$ gives the following errors such as:

NDSolve::nderr: Error test failure at t == 1.2601140976532838`*^-10; unable to continue.
InterpolatingFunction::dmval: Input value {-4.99969*10^-8} lies outside the range of data in the interpolating function. Extrapolation will be used.

I tried different methods for NDSolve, non-dimensionalizing $t$ variable such that I can get rid off $10^{-9}$‘s and see everything in terms of nanoseconds that didn’t worked either. (I don’t copy that code since it might overcrowd the question)

Is it about machine precision? Any ideas for what the problem is and how to solve it?

Note: I am trying to recreate a result from an article and NN(t) should give a gaussian.

Thank you for your time.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP