Mathematica Products
-----
 /
Mathematica
*Fast Dense Numerical Linear Algebra
*High-Speed Sparse Linear Algebra
*Large-Scale Linear Systems
*Big-Number Arithmetic
*64-Bit Platform Support
*Faster MathLink
*Numerical Solving of Differential Equations
*Numerical Equation Solving
*Fitting Data
*Numeric Optimization
*DSolve
*RSolve
*Reduce
*Resolve
*FindInstance
*Symbolic Global Optimization
*Wider Support For Domain Specifications
*Connection Technology
*Importing and Exporting
*Statistical Plots
<Collecting Expressions During Evaluation
*New Linear Algebra Functions
*Algebraic Number Objects
*Authoring and Presentation
*Summary of New Features
*Ask about this page

Collecting Expressions During Evaluation

See What's New in Wolfram Mathematica 6

The new functions Sow and Reap can be used to accumulate lists of intermediate results in an evaluation. This allows users to monitor and keep track of intermediate values of computations.





More Details PreviousNext

Example: Displaying Intermediate Results

Example: StepMonitor

Sow and Reap are used to generate a list of the steps taken during the solution of an initial value problem.

Reap[NDSolve[{y''[t] + y[t]^2 == t, y[0] == 0, y '[0] == 1}, y, {t, 0, 6}, StepMonitor :-> Sow[t]]] ;

Visualizing every other step shows how NDSolve automatically adjusts the step size throughout the computation to maintain appropriate accuracy.

Graph: NDSolve adjusts step size throughout a computation

(Note that the plot shows every second step of the solution.)


Related Links


Documentation from The Mathematica Book Documentation from The Mathematica Book
Collecting Expressions During Evaluation
  
Documentation from the Reference Guide Documentation from the Reference Guide
Sow
Reap
StepMonitor



Back to Top PreviousNext



 © 2008 Wolfram Research, Inc.  Terms of Use  Privacy Policy | [ja]