Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Numerical solution ODE

  1. Nov 21, 2014 #1
    Hello,
    can someone advise me how to solve numerically ODE which consist of function with "critical point" (Im not sure if it is good definition)? I mean for example this one:
    [itex]y'(x)=\frac{\sin{x}}{x}[/itex], where in x=0 has function a "problem". I know that limit ->1 but in numerical solutions it blows up.
    I know that for example Mathematica can do that analytically but I would like to know general procedure for this issue.
    Thank you for your comments or advices.
     
  2. jcsd
  3. Nov 21, 2014 #2
    Writting polynomial expansion of sin x , than integrating term by term is one way.
     
  4. Nov 21, 2014 #3
    Ou, nice and easy idea :) Can you think of another way?
    I have system of two eq. and problem is coming from zero in denominator subtracting these unknowns... [itex]x'(r)=\frac{f(x(r),y(r),r)}{x(r)-y(r)}, y'(r)=\frac{g(x(r),y(r),r)}{x(r)-y(r)}[/itex]. Any idea? :)
    And thank you for reply ;)
     
  5. Nov 21, 2014 #4
    I'm affraid I don't understand meaning of notation you used here. Why don't you write instead of f(x(r),y(r),r) and g(x(r),y(r),r) just f(r) and g(r)?
     
  6. Nov 21, 2014 #5
    I wanted to emphasize that there are unknown functions and Im not able to carry any trick like expansion. Exact form of equation is here https://www.physicsforums.com/threa...umerical-solution-with-critical-point.783090/ but no comments. I wrote it probably in wrong way so Im trying step by step find how to solve it.
     
  7. Nov 21, 2014 #6
    The word you're are looking for is "singular point."

    The integrand [itex] \frac{\sin{x}}{x} [/itex] has a removable singularity. We can get around it by defining [itex] \frac{\sin{x}}{x} =1 [/itex] for x=0 . This insight comes from observing the limiting behavior for small [itex] x [/itex] . Integrating the Taylor series term by term works for small x but fails miserably for x>1.



    What are the functions [itex] f\left(x,y,r\right) [/itex] and [itex] g\left(x,y,r\right)[/itex]. There are a number of "tricks" that allow you to treat different kinds of singularities. But different tricks work for different kinds of singular points.
     
  8. Nov 21, 2014 #7
    Ah, yes it is clear. Thank you for a comment.

    [itex]u'=\frac{D_1}{D}[/itex]
    [itex]\rho'=\frac{D_2}{D}[/itex], where [itex]D_1=\frac{2a^2/r-\alpha/r^2}{\rho}[/itex], [itex]D_2=\frac{2u^2/r-\alpha/r^2}{u}[/itex] and [itex]D=\frac{u^2-a^2}{\rho u}[/itex], where [itex]a(r)=a_0\big(\frac{\rho(r)}{\rho_0}\big)^{(\Gamma-1)/2}[/itex], [itex]\rho(r)[/itex] and [itex]u(r)[/itex] are function of r and [itex]\Gamma, a_0, \rho_0, \alpha[/itex] are constant.[itex][/itex]

    This is the system. Here is described all this problem: https://www.physicsforums.com/threa...umerical-solution-with-critical-point.783090/
    Thank you again.
     
  9. Nov 22, 2014 #8
    Ok then. Without getting into mess of other thread, here is what I can say. This is a system of differential equation (generally, a nonlinear one):

    dx/dr = G(x,y,r)/z(x,y)
    dy/dr = F(x,y,r)/z(x,y)
    where z(x,y)= x-y

    For behaviour near singularity you must specify or explore what's going on when z(x,y) → 0. Also explore if there is a stability issue for solutions to the system ( for instance, check Lyapunov's criteria etc). And for z(x,y) ≠ 0 the system yields equation F(x,y,r)⋅dx - G(x,y,r)⋅dy = 0 which is a special case of well known Pfaff's PDE in 3D: P(x,y,z)⋅dx + Q(x,y,z)⋅dy +T(x,y,z)⋅dz =0

    Regards
     
    Last edited: Nov 22, 2014
  10. Nov 22, 2014 #9
    Ou thank you very much. And what about z(x,y)=0. What possibilities are? And could you give me a reference to literature which concern in this problems or something like that. Thank you very very much ;)
     
  11. Nov 22, 2014 #10
    For z(x,y)=0 you have to explore at line y=x : If G≠0,F≠0 than "asymptotic" cases. If G=0 or/and F=0 than "0/0" cases to check .
    Since you can't exactly solve your nonlinear system you should linearize it. Here is instructional video how to do it.
    And for probing system stability see this paper . Treating all the variables like they are independent (via Pfaffian) sometimes may help to explore behaviour of system too . Many things depend on form of the functions F, G.
     
  12. Nov 22, 2014 #11
    Thank you again, understand.
    Im looking for solution which is in "0/0". In my def. of function Im looking specially for case when "my" D=D1=D2=0 and (I mean) it is "smooth" solution.
    I check your links.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook