[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1497.0. "Differential to Difference equations?" by 3D::ASFOUR () Wed Oct 02 1991 13:38

	I need to program several differential equations. In particular I'm
very interested in programming first order differential equations of the form

	dx
        --  = Af(x(t)). 
        dt

	where f(x(t)) is a function of x(t). for example 
		
	f(x) = x^2 + x +a or f(x) = log(x), etc...

	I'm guessing I have to convert the equation to a difference equation,
but I'm not sure how. Any help or pointers to the different methods out there
and their properties would be a great help.


		thanks,
				yousif. 
T.RTitleUserPersonal
Name
DateLines
1497.1Just Say IntegrateKEBLER::J_MARSHSvelte & Petite-nosedWed Oct 02 1991 15:3730
    You can just integrate, can't you?  dx/dt = Af(x(t)) ==>
    
        /  1               /
       |  ---- dx   =   A | dt
       |  f(x)            |
      /                  /
    
    Integrate (make sure you do the right things with the limits of
    integration) and then you have t as a function of x.  Then all you
    have to do (this is usually the intractable part) is to turn that
    into x as a function of t.
    
    To choose a simple example let f(x) = x^2, then
    
          x                     t
         /   1                 /
         |-------- d(x')  =  A | d(t')
         | (x')^2              |
        /                     /
        x0                    0
    
    
        -(1/x) + (1/x0)  =  At
    
    
        x = x0 / (1 - Atx0)
    
    
    And you can always integrate numerically if need be.
                                                        
1497.2Runge-Kutta is one wayALLVAX::JROTHI know he moves along the piersWed Oct 02 1991 16:0217
    Have you considered just using something like a Runge Kutta algorithm?

    One popular form compares the result of a 4'th and 5'th order
    evaluation and adaptively sets the stepsize based on the difference.
    [The idea behind RK formulas is to make the divided difference
    estimates of the functional derivatives match the actual ones
    from your equations, to a certain degree; the trick behind RK4(5)
    and similar algorithms is to do this for two orders, minimizing
    wasted work, so as to get an error estimate.]

    As mentioned earlier, if your problem has special structure, the
    difference equation can be worked out in closed form.  There are many
    specialized algorithms for special problems.  For example Gauss-Jackson
    is well suited for orbital calculations, and can be amazingly accurate
    and fast.

    - Jim
1497.3classical approach to solving a DESTAR::ABBASIThu Oct 03 1991 13:148
    
        the classical approach to solve a differential equation is to 
        look at it long and deep enough and then guess the answer, verify 
        the answer aginst the DE, if your guess is wrong , guess again,
        eventually you'll zoom to the right function .
        no studies i know off has been done on the speed of this method.