Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14226 > unrolled thread

How to remove a singularity

Started byWilliam Duhe <williamduhe@hotmail.com>
First post2013-04-18 09:33 +0000
Last post2013-04-19 05:13 +0000
Articles 2 — 2 participants

Back to article view | Back to comp.soft-sys.math.mathematica


Contents

  How to remove a singularity William Duhe <williamduhe@hotmail.com> - 2013-04-18 09:33 +0000
    Re: How to remove a singularity Peter Pein <petsie@dordos.net> - 2013-04-19 05:13 +0000

#14226 — How to remove a singularity

FromWilliam Duhe <williamduhe@hotmail.com>
Date2013-04-18 09:33 +0000
SubjectHow to remove a singularity
Message-ID<kkoelp$gl3$1@smc.vnet.net>
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!

[toc] | [next] | [standalone]


#14227

FromPeter Pein <petsie@dordos.net>
Date2013-04-19 05:13 +0000
Message-ID<kkqjq8$nju$1@smc.vnet.net>
In reply to#14226
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web