cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

adaptive quadrature using Mathcad programs Simpson and adapt.xmcd

Joeboy
12-Amethyst

adaptive quadrature using Mathcad programs Simpson and adapt.xmcd

I need someone to explain to me how adapt works, seems like it should go into an endless loop if I-I2 never gets less than tolernce value. 

5 REPLIES 5
Fred_Kohlhepp
23-Emerald I
(To:Joeboy)

Each time the Adapt(f,a,b) function does not return an answer within tolerance it subdivides the interval and applies itself to each half.  This process continues (reoccurs) until the desired criteria are met.  So a process mght look like:

                                                                 fail    

                              fail                                                                 fail

          fail                              pass                              fail                              fail

pass               pass                                             fail               pass          pass     pass

                                                                      pass     pass

The answer would come back as the sum of the passes.

Joeboy
12-Amethyst
(To:Joeboy)

Thank you for the help Fred.  How does the program exit the loop ? Is there a maximum number of passes it can make ?

Fred_Kohlhepp
23-Emerald I
(To:Joeboy)

The idea of recursion is that the program will call itself over and over, as many times as it needs to.  So each time the test of criteria are not met two more instances of the program are launched.

When the criteria are met, the answer (correct to the specified accuracy) is retruned. In the small example above, fifteen different cases of Adapt were launched.

Joeboy
12-Amethyst
(To:Joeboy)

Fred, I don't see the small example you refer to

Fred_Kohlhepp
23-Emerald I
(To:Joeboy)

The first comment:

   

                                                                 fail    

                              fail                                                                 fail

          fail                              pass                              fail                              fail

pass               pass                                             fail               pass          pass     pass

                                                                      pass     pass

(Might make this a discussion rather than a document--it's easier to see revisions/ comments.)

Top Tags