Re: How to remove a singularity
- To: mathgroup at smc.vnet.net
- Subject: [mg130523] Re: How to remove a singularity
- From: Peter Pein <petsie at dordos.net>
- Date: Fri, 19 Apr 2013 01:13:45 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
- References: <kkoelp$gl3$1@smc.vnet.net>
Am 18.04.2013 11:33, schrieb William Duhe: > Bellow I have a differential equation which hits a singularity at low values of t. What I want to do is somehow utilize the WhenEvent command in order to replace the last factor of the equation (2/t a'[t]) with 0 at low values of t in order to avoid getting errors. Is there a way to do this? > > Here is an example of the equation and how I attempted to use the Whenevent Command. > > q = NDSolve[{a''[t] == 1/2 a[t]^2 + 1/6 a[t]^6 - 1/4 a[t]^4 - 2/t a'[t], a[0] == 1, a'[0] == 0, WhenEvent[t < .1, a'[t] -> 0]}, a, {t, 0, 1}]; > > any help would be appreciated! > Hi, mathematically incorrect but working: In[1]:= With[{eps = SetPrecision[$MachineEpsilon, Infinity]}, soln = a /. NDSolve[{a''[t] == 1/2 a[t]^2 + 1/6 a[t]^6 - 1/4 a[t]^4 - 2/t a'[t], a[eps] == 1, a'[eps] == 0}, a, {t, eps, 1}, WorkingPrecision -> 16] // First ]; In[2]:= Abs[1 - soln[0]] Derivative[1][soln][0] soln[1] Out[2]= 0.*10^-16 Out[3]= 0.*10^-2 Out[4]= 1.073198752912019 Peter