help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get LSODE not to display ISTATE


From: Samuel H. Dupree, Jr.
Subject: Re: How to get LSODE not to display ISTATE
Date: Mon, 30 Mar 2009 03:45:38 -0400
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)

| On 28-Mar-2009, Samuel H. Dupree, Jr. wrote:
|
| | I'm running Octave version 3.0.3 on a Mac G4 PowerPC under Mac OS 10.4.11.
| |
| | I'm writing an application in Octave to numerically integrate the orbits
| | of the planets of the solar system, the moon's orbit, the moon's 
| | orientation (its Euler angles), and the sun's orbit about the solar
| | system barycenter; a total of 72 first order differential equations. In
| | using LSODE to solve the differential equations, it appears that the
| | value of ISTATE for each equation is output to stdout.
| |
| | My question is, how can I turn this display output off? I didn't see any
| | discussion concerning the display of ISTATE by LSODE in reviewing the
| | documentation (both the web version of the manual and the version 3
| | hardcopy).
| |
| | Any ideas?
|
| I don't see ISTATE when I call lsode with something like
|
|   function xdot = f (x, t)
|     xdot = 1 - x;
|   endfunction
|
|   [x, istate, msg] = lsode (@f, 0, 0:0.1:5);
|
| How are you calling lsode?
|
| jwe



The code extract below illustrates how I'm calling lode.


# ----------------------------------------------------------------------
#     set integration controls for lsode
# ----------------------------------------------------------------------

      lsode_options( 'maximum order'     , MaxOrder          );
      lsode_options( 'integration method', IntegrationMethod );

      lsode_options( 'initial step size' , InitStepSize      );
      lsode_options( 'minimum step size' , MinStepSize       );
      lsode_options( 'maximum step size' , MaxStepSize       );

      lsode_options( 'step limit'        , MaxNumberOfSteps  );

      lsode_options( 'absolute tolerance', abs_tol           );



# ----------------------------------------------------------------------

#     integrate the equations of motion and the Euler equation

# ----------------------------------------------------------------------

      t = tjd(2);
      no_of_points = 2;


      while    ( t < stop_time )

          Xout = zeros( no_of_points, neqs );

          time_grid = linspace( t, t+delta_t, no_of_points );
          [ Xout, ISTATE, MSG ] = lsode( 'SolarSystem_Perturbation', Xstate, time_grid );


          if( ISTATE == 2 )

             t      = t + delta_t;
             tjd(2) = t;

             Xstate = zeros( neqs, 1 );
             Xstate = Xout( 2, 1:neqs );

             Adjust_State_for_SolarSystem_GR_Barycenter;

             Output_Updated_State_Report;
             Write_to_Trajectory_Files;

             Write_to_Restart_File;

          else

             status = strcat( asctime(localtime(time())), ' - Error return from lsode: ', MSG );

             fprintf( report, "\n\n\n %s \n\n\n", status );
             fflush( report );

             fprintf( std_output, "\n\n\n %s \n\n\n", status );
             fflush( std_output );

             quit( ISTATE );

          endif

      endwhile




For this code fragment, tjd(1) contains the epoch time while tjd(2) contains the offset times that is the actual independent variable.

Sam Dupree.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]