f



Maple's Matlab link messes up my Matlab symbolic toolbox, any cure?

Hi there,

The Maple 11's Matlab link toolbox is not compatible with the Matlab(2007a) 
's Symbolic toolbox at all.

I previously had a code using Symbolic toolbox and it gave correct results, 
but now after upgrade it to Maple 11's Matlab link toolbox the results got 
completely wrong.

I have a feeling that in order to speed up calculation, the Maple 11 Matlab 
link toolbox does not use a full internal precision as before. Thus it 
achieves speed up than the previous versions. However this cutting corner 
doesn't do a correct job for my problem, in which I have to use the full 
symbolic precision in order not to overflow, or underflow, or numerical 
cancel, etc. And that's the reason I need to call symbolic toolbox in 
Matlab.

Can you imagine that a previously working code fails to work all of a 
sudden?

And then when I uninstall the Maple's Matlab link, after rebooting, I 
couldn't use Matlab's original symbolic toolbox.

It cannot find "maple.dll":

-----------

error_msg :
??? Maple initialization failed.


Error in ==> mapleinit at 52
maplemex(maplelib,0);

Error in ==> maple at 113
[result,status] = maplemex(statement);

---------------

My questions are:

1. Is there a way to increase the Maple 11's Matlab link toolbox's internal 
precision to make it fully and truly symbolic, not cutting the corners?

2. If 1 doesnot work, I have to uninstall the fancy toolbox, is there a way 
for my original Matlab's symbolic toolbox to work? (I don't have my original 
Matlab installer files with me currently so I cannot reinstall Matlab)...



0
7/23/2007 4:24:32 AM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
962 Views

Similar Articles

[PageSpeed] 24

I replied earlier in another post where I receive the same error message when trying to compile symbolic expressions on MatLab 7.4.0 version. It tells me that it could not find the correct module for mex32??


If I can add  a question to this post, would it be feasible to copy paste the old version of mex32, maplemex from MatLab 6 into the newer version of MatLab, in order to avoid these problems?


I have an urgent need to remedy this situation, any help would be appreciated. thank you.


Pascal




"Gino Victor" <gino_victor@hotmail.com> wrote in message <f81alv$hte$1@news.Stanford.EDU>...
> Hi there,
> 
> The Maple 11's Matlab link toolbox is not compatible with the Matlab(2007a) 
> 's Symbolic toolbox at all.
> 
> I previously had a code using Symbolic toolbox and it gave correct results, 
> but now after upgrade it to Maple 11's Matlab link toolbox the results got 
> completely wrong.
> 
> I have a feeling that in order to speed up calculation, the Maple 11 Matlab 
> link toolbox does not use a full internal precision as before. Thus it 
> achieves speed up than the previous versions. However this cutting corner 
> doesn't do a correct job for my problem, in which I have to use the full 
> symbolic precision in order not to overflow, or underflow, or numerical 
> cancel, etc. And that's the reason I need to call symbolic toolbox in 
> Matlab.
> 
> Can you imagine that a previously working code fails to work all of a 
> sudden?
> 
> And then when I uninstall the Maple's Matlab link, after rebooting, I 
> couldn't use Matlab's original symbolic toolbox.
> 
> It cannot find "maple.dll":
> 
> -----------
> 
> error_msg :
> ??? Maple initialization failed.
> 
> 
> Error in ==> mapleinit at 52
> maplemex(maplelib,0);
> 
> Error in ==> maple at 113
> [result,status] = maplemex(statement);
> 
> ---------------
> 
> My questions are:
> 
> 1. Is there a way to increase the Maple 11's Matlab link toolbox's internal 
> precision to make it fully and truly symbolic, not cutting the corners?
> 
> 2. If 1 doesnot work, I have to uninstall the fancy toolbox, is there a way 
> for my original Matlab's symbolic toolbox to work? (I don't have my original 
> Matlab installer files with me currently so I cannot reinstall Matlab)...
> 
> 
> 

0
7/31/2007 12:08:28 PM
On Jul 23, 12:24 am, "Gino Victor" <gino_vic...@hotmail.com> wrote:

>
> 1. Is there a way to increase the Maple 11's Matlab link toolbox's internal
> precision to make it fully and truly symbolic, not cutting the corners?
>

The 'doc compatibility' page in Matlab talks about this:

" The Maple environment variable, Digits, controls the number of
digits that
  Maple uses when calculating with software floating-point numbers.
The normal
  Maple default is to compute results at 10 digits precision. This can
be modified
  by using the digits command. The Maple Toolbox for MATLAB
  uses digits(32) by default."

That last line should be "The Symbolic Math Toolbox uses digits(32) by
default".  Put the command digits(32) in your toolbox/maple/
mapleinit.m file to always have it initialized to 32 digits.


0
pdemarco (1)
7/31/2007 10:12:43 PM
In article <f81alv$hte$1@news.Stanford.EDU>,
Gino Victor <gino_victor@hotmail.com> wrote:

>1. Is there a way to increase the Maple 11's Matlab link toolbox's internal 
>precision to make it fully and truly symbolic, not cutting the corners?

Another poster already indicated how to increase Digits.
A couple of notes about this:

A) In Maple, Digits is the working precision, -not- the "target"
precision. It does not mean "work in as many digits of precision
as you need in order to make the answer significant to +/- 1/2 in
the Digits'th place": it means "work in Digits' worth of precision
throughout, possibly producing a final answer with noticably fewer
significant digits."


B) When working with floating point numbers, Maple assumes that
associativity and commutitivity work, and will, to the extent
practical in the expression, combine the floating point numbers
into a single number. For example,

> 3.5 + 11/2 * b + 8.9;
                                 12.4 + 11/2 b

This might not be what is desired from a numerical analysis
point of view -- one might, for example, know that the 11/2*b
nearly cancels out the 3.5, so proceeding from left to right
might have produced a different answer than combining the terms.

This difficulty is not encountered for whole numbers and rationals:

> 35/10 + 11/2 * b + 89/10;
                                 62/5 + 11/2 b


C) Digits applies only to floating point calculations:

> 323430204302403204320032432423432432 + 0;
                     323430204302403204320032432423432432
> 323430204302403204320032432423432432. + 0;
                                             36
                               .3234302043 10

D) When floating point numbers exist in the calculation,
Maple will sometimes combine them with rationals, losing
precision along the way:

> 3.5 + 323430204302403204320032432423432432 * b;
                 3.5 + 323430204302403204320032432423432432 b

> factor(%);
                                     36
                       .3234302043 10   b + 3.500000001


The summary of this is that as soon as you introduce floating
point numbers, Digits starts becoming important even for
expressions that were written in whole numbers and rationals;
even a single floating point number potentially "pollutes" the expression.
If you wish to be "fully and truly symbolic", then don't use any
floating point numbers; then Digits won't apply at all.

If you import Matlab values over into a symbolic expression being
handled by the Maple toolbox, then note that the default data type
for Matlab is double (a floating point type), so if you want to
avoid this floating-point pollution, then to the extent possible,
use Matlab's integer data types in what you pass in to the
symbolic toolbox, or use round() or floor() or ceil() within
the symbolic expression to force the conversion within
the maple engine.
-- 
  "law -- it's a commodity"
                         -- Andrew Ryan (The Globe and Mail, 2005/11/26)
0
roberson2 (8602)
7/31/2007 10:56:58 PM
Reply: