Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Buy Mathcad Now
• View Mathcad Pricing
• Request a Demo
• Download a Brochure
• Find out about Training
• Sign up for a Webinar
• Meet Our Team
• Read our RSS Feeds

Learn More

Mathcad Home
What can Mathcad do?
Version Comparison Chart
Mathcad for Education
Add-ons
Rave Reviews

System Requirements

Latest Information

New Features in Mathcad 14
Using Mathcad and Excel
Engineering Application
Packs

Return on Investment

Service & Support

Patches & Downloads
Chemical & Process
Engineering with Mathcad

Frequently Asked Questions
Search the Knowledge Base
Join the Discussion List
Search the List Archive
Mathcad Library

List Archives >  Mathcad List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MATHCAD] Recursion in MC8Pro

Search email archive for  

[MATHCAD] Recursion in MC8Pro
Author: Yblee    Posted: Fri, 9 Apr 1999 04:50:43 +0100 (
Posted from http://lists.adeptscience.co.uk/postmsg.phtml

Hi,

I found that recursive function definition is broken in MC8Pro2B. Just use the Index in Help to open the QuickSheet on recursion and you'll see. Is this a known bug or just my copy?

I also found that if you define functions in terms of other functions, and if the call to the other functions unfortunately have missing parameters somewhere up in the call chain, then the error is displayed only at the last function of the chain. I need to trace through all the way up the call chain to fix such errors. Terrible. (This does not occur in MC7Pro.)

Lastly, anyone know how to get around the 171! (factorial) limitation? I keep hitting this limit in combinatorics. Is there similar restriction in other packages like mathlab? Thanks!

Frankly, I'm getting more and more upset from using MathCAD. I started out with V6, then upgraded to V7. Bugs, bugs, bugs. I even send email to MathSoft to report bugs and suggest new features. No response. Then I upgraded to V8. Even more bugs. I again send bug report to MathSoft, again no response, not even an ACK! I feel like an idiot paying for the two upgrades.

Regards,
Jack


To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

[MATHCAD] Re: Recursion in MC8Pro
Author: Ray Girvan    Posted: Fri, 9 Apr 1999 12:29:30 +0100
"yblee" writes:

> Lastly, anyone know how to get around the 171! (factorial) limitation?
> I keep hitting this limit in combinatorics.

Depends how accurate you want it. I've occasionally dealt with big
factorials by taking log_10 of Stirling's formula.

> Is there similar restriction in other packages like mathlab?

You could try Derive; it can manage very big numbers, though the
interface and other facilities aren't up to Mathcad. How big a
factorial do you need?

Ray

--
"ray.girvan" +++ Technical Author +++ Topsham, Devon, UK
http://www.users.zetnet.co.uk/rgirvan/ +++ The Apothecary's Drawer


To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

Re: [MATHCAD] Re: Recursion in MC8Pro
Author: Jack Lee    Posted: Sat, 10 Apr 1999 01:21:51

At 12:29 PM 4/9/99 +0100, you wrote:
>Depends how accurate you want it. I've occasionally dealt with big
>factorials by taking log_10 of Stirling's formula.

I tried this as well but the accuracy is not good enough. The results are
way off.

>You could try Derive; it can manage very big numbers, though the
>interface and other facilities aren't up to Mathcad.

Hmmm...that's too bad. It's really the interface that kept me using MathCAD.

>How big a factorial do you need?

I have models that need 1000! upwards. It's really a fraction having many
factorials on the numerator as well as the denominator. The end result is
still within 10^307 though.

Thanks for your suggestions.

Regards,
Jack

To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

RE: [MATHCAD] Re: Recursion in MC8Pro
Author: Boris Pevzner    Posted: Fri, 9 Apr 1999 13:39:36 -0400
Jack - This factorial limitation is inherent in how numerical calculations
are handled on a 32-bit processor, so any 32-bit numerical software package
will have this or a similar limitation. Having said this, there are at least
two ways to perform the calculations that you want in Mathcad:

(1) Use Mathcad's symbolic processor for arbitrary-precision
arithmetics. Try typing "200!/190![Ctrl]." for example.

(2) Use the two new numerical combinatorics functions
(combin and permut) that we introduced in Mathcad 8
to address precisely the kinds of issues that
you've come up against.

Hope this helps,

Boris Pevzner
"bpevzner"


>From: "owner-mathcad"
> "mailto:owner-mathcad" Behalf Of Jack Lee
>Sent: Saturday, April 10, 1999 1:22 AM
>To: "mathcad"
>Subject: Re: [MATHCAD] Re: Recursion in MC8Pro
>
>At 12:29 PM 4/9/99 +0100, you wrote:
>>Depends how accurate you want it. I've occasionally dealt with big
>>factorials by taking log_10 of Stirling's formula.
>
>I tried this as well but the accuracy is not good enough. The results are
>way off.
>
>>You could try Derive; it can manage very big numbers, though the
>>interface and other facilities aren't up to Mathcad.
>
>Hmmm...that's too bad. It's really the interface that kept me
>using MathCAD.
>
>>How big a factorial do you need?
>
>I have models that need 1000! upwards. It's really a fraction having many
>factorials on the numerator as well as the denominator. The end result is
>still within 10^307 though.
>
>Thanks for your suggestions.
>
>Regards,
>Jack
>
> Contributions: "mathcad"
>To unsubscribe: Send in the body: unsubscribe mathcad
> To: "majordomo"
> Hosted by: Adept Scientific http://www.adeptscience.com
> List Archive: http://lists.adeptscience.co.uk/
>

To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

[MATHCAD] Re: Recursion in MC8Pro
Author: Ray Girvan    Posted: Fri, 9 Apr 1999 19:27:47 +0100
Jack Lee "yblee" writes:

> I tried [Sterling's formula] as well but the accuracy is not good
> enough. The results are way off.

Which version? There is a refined version (I only have the gamma
form here) which gives better accuracy by adding the polynomial for
the asymptotic term:

Gamma(n) apprx= SQRT(2*pi) * e^(-n) * n^(n-0.5) * (1 + delta_n)
where delta_n = 1/(12*n) + 1/(288*n^2) - 139/(51840*n^3) + ... etc

See http://www.lassp.cornell.edu/sethna/Cracks/Stirling.html

Ray

--
"ray.girvan" +++ Technical Author +++ Topsham, Devon, UK
http://www.users.zetnet.co.uk/rgirvan/ +++ The Apothecary's Drawer


To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

[MATHCAD] Re: Recursion in MC8Pro
Author: Ray Girvan    Posted: Fri, 9 Apr 1999 19:54:28 +0100
"bpevzner" (Boris Pevzner) writes:

> (1) Use Mathcad's symbolic processor for arbitrary-precision
> (2) Use the two new numerical combinatorics functions ...

What are the limits on these? Both will manage some expressions
containing n! where n > 170. but can they handle ones of the size
Jack was talking about? For instance:

2000! / 1500! [Ctrl]. and combin(2000,1500)

both fail with my copy of Mathcad 8. The first one says the variable
is too long to display, the second hits the usual 10^307 magnitude limit.

Jack - could you post a typical expression of the kind you need to solve?

Ray

--
"ray.girvan" +++ Technical Author +++ Topsham, Devon, UK
http://www.users.zetnet.co.uk/rgirvan/ +++ The Apothecary's Drawer


To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

Re: [MATHCAD] Re: Recursion in MC8Pro
Author: Jack Lee    Posted: Sat, 10 Apr 1999 16:13:00

>Jack - could you post a typical expression of the kind you need to solve?

Sure. Attached the Erlang-C formula which hits the limit for large m. The
recursively defined version extends the limit a bit but still not good enough.

Regards,
Jack

 Attachments:
 erlang_c.mcd


[MATHCAD] Re: Recursion in MC8Pro
Author: Ray Girvan    Posted: Sat, 10 Apr 1999 20:10:38 +0100
Jack Lee "yblee" writes:

> Attached the Erlang-C formula ..
> name="erlang_c.mcd"

OK; I *think* I have an answer. Essentially it uses the
high-precision polynomial Stirling approximation for n! to define a
function for ln(n!), then does all the factorial work in the
logarithmic domain to keep the magnitudes safe for Mathcad. I've
e-mailed it to you direct; but will repost it here if you find it works!

Ray

--
"ray.girvan" +++ Technical Author +++ Topsham, Devon, UK
http://www.users.zetnet.co.uk/rgirvan/ +++ The Apothecary's Drawer


To unsubscribe: Send in the body: unsubscribe mathcad
To: "majordomo"

Previous by date: Re: [MATHCAD] Plotting Multiple Data Sets,  Russ Roberts
Next by date: [MATHCAD] Re: Recursion in MC8Pro, Ray Girvan
Previous thread: [MATHCAD] Changing Default Symbolics Evaluation Style,  Alexander, Rob
Next thread: [MATHCAD] Recursion in MC8Pro, Yblee



Ready to buy?

Mathcad: single user licence
Add to shopping basket
$ 1,195.00
Upgrade to Mathcad 14 from version 12 or 13
Add to shopping basket
$ 325.00
Upgrade to Mathcad 14 from version 11, 2001i, 2001 or 2000
Add to shopping basket
$ 425.00

Featured Downloads

Mathcad 14 demo
Mathcad 14 Brochure
Mathcad or Excel?
Mathcad Customer Story: Man B&W Diesel
Mathcad Customer Story: Stork Fokker Aerospace
Mathcad White Paper - Moving beyond the limitations of spreadsheets

Product Reviews

"Our work ranges from complex medical imaging research to large-scale mapping and diagrams and we need a tool that is able to handle anything we investigate. With Mathcad, we are able to manipulate and analyse our data quickly while at the same time documenting our work, for sharing and publication. We also use it for pilot studies conducted in support of research grant applications. It is an end-to-end tool for research and development."
Dr. Kenneth Castleman, President of Advanced Digital Imaging Research (ADIR), Houston, Texas

"Mathcad is an integral product for my work... With Mathcad, itís easy to disseminate design calculations because the documents look like real math. Thereís very little I canít do in Mathcad. The main benefits come from the format, which resemble a typed set of calculations. These programs are easier to develop by engineers and easier for others to follow and review since the logic is expressed in a familiar manner. The format is what places Mathcad head and shoulders above other programs of a similar function."
Andre Pavlov, Structural Engineer, Florida Department of Transportation
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055