 |
|
List Archives > 
Mathcad List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MATHCAD] Recursion in MC8Pro
| [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
|
|
|