A74
==
Subject: Re: bugs in mma, censorship
And some (all?) of them appear to have been fixed in 5.0.1.
do you know how to get 5.01? I have bought 5.0 from our school
book store (i am a student) and now I'd like to upgrade it to
5.01 if it fixes some bugs, but went to mma web site and can not
see any mention of it or how to download it, it seems like the
mma company is hiding it for some reason :) I assume I could
download 5.01 upgrade for free.
===
Subject: Re: bugs in mma, censorship
> do you know how to get 5.01?
Sorry, I don't know. Mathematica updates seem generally to only be
available to people with annual service agreements. I've never had
a student version, so I don't know what provisions there might be
for getting updates. The web site suggests that you can get Premier
Service agreements for the student version (though it states that
the benefits differ slightly from the service for the full product).
If you're encountering a serious problem that's fixed in a minor
update release, maybe you can talk them out of an update.
===
Subject: Re: bugs in mma, censorship
>In Mathematica 4.1, these bugs have been reported to WRI.
> And some (all?) of them appear to have been fixed in 5.0.1.
Not really. The numerics have the same or worse problems. The symbolic
integral comes out better (not convergent) though.
===
Subject: branch cuts, how CAS systems handle it? Kahan test shown for maple
and mma
W.Kahan (april 1991) has this test as a challenge to CAS systems
R(z)=( z+(1/z) )/2
S(w)=w+Sqrt(w+1)*Sqrt(w-1)
Then S(R(z)) according to Kahan should produce
(z^2+1)/(2*z) +- (z+1)(z-1)/(2*z) (1)
Then the above last expression will simplify to
z (2) ------> this comes from the '+' branch
OR
1/z (3) ------> this is from the '-'
in each branch.
He calls S function a weak inverse function
So I tried the above test on mma and maple.
Both will give (1) with the + branch only. They do not even simplify
to the 'z' cut (2) , (which is what the '+' result should produce).
So I guess I have 2 questions:
1. How do CAS system handle branch cuts? They seem to pick the
principle branch and ignore the rest. This does not sound very good
way of handling mathematics. My teacher will not like it if I throw
away results like this on the exam :)
2. Specific to this problem, how to get (1) to reduce to (2) in either
maple or mma? with maple, using assume(z>0) got closer to (2) but not
quite, may be if I knew more about how to use assumptions in maple
I can get it to reduce (1) to (2). With mma, with its weak
typing/assumptions facility, I gave up trying.
btw, maple have the Branches command, which knows about few buildin
functions (but will not accept user defined functions).
fyi; Below are the outputs from maple and mma:
maple 9.03
> restart;
> r:= z-> (z+(1/z))/2;
> s:= w-> w+sqrt(w+1)*sqrt(w-1);
> s(r(z));
> simplify(%);
/ 21/2 / 21/2
2 |(z + 1) | |(z - 1) |
z + 1 + |--------| |--------| z
z / z /
--------------------------------------
2 z
mma 5.01
Out[1]= Out[0]
In[2]:= r[z_]:= ( z+(1/z)) /2;
In[3]:= s[w_]:=w+Sqrt[w+1]*Sqrt[w-1];
In[4]:= FullSimplify[s[r[z]]]
2 1 1
1 + z + z Sqrt[-2 + - + z] Sqrt[2 + - + z]
z z
Out[4]= -------------------------------------------
2 z
===
Subject: Re: branch cuts, how CAS systems handle it? Kahan test shown for
maple and mma
> 1. How do CAS system handle branch cuts? They seem to pick the
> principle branch and ignore the rest. This does not sound very good
> way of handling mathematics. My teacher will not like it if I throw
> away results like this on the exam :)
In a CAS, sqrt is typically considered a *function* and therefore
cannot be multi-valued. So sqrt(1)=1 is perfectly correct, although
solving x^2=1 for x gives two solutions, sqrt(1) and -sqrt(1).
Actually, when you do this consistently, it is a very reasonable way
of doing mathematics -- to avoid losing results, you have to make
sure you don't claim x=sqrt(1) was encompassing all the solutions.
> 2. Specific to this problem, how to get (1) to reduce to (2) in either
If sqrt is meant to be multivalued (as it seems to be), you'll
have to tell the system you want the other branch, i.e.:
>> s:= w-> w+sqrt(w+1)*sqrt(w-1);
Try s2 := w -> w-sqrt(w+1)*sqrt(w-1).
--
===
Subject: Re: branch cuts, how CAS systems handle it? Kahan test shown for
maple and mma
> W.Kahan (april 1991) has this test as a challenge to CAS systems
And I think that in the code I show below, Maple passes the challenge.
> 1. How do CAS system handle branch cuts? They seem to pick the
> principle branch and ignore the rest.
In Maple, sqrt refers to the principle branch. x^(1/3) also gives the
principle branch. RootOf specifies all branches simultaneously, and the
specific branches can be found with allvalues. Maple has a tremendous
amount of support for RootOf when it is used with polynomials.
> 2. Specific to this problem, how to get (1) to reduce to (2) in either
> maple or mma?
My version:
restart;
R:= z-> (z+1/z)/2:
Sqrt:= z-> RootOf(Z^2-z, Z):
S:= w-> w + Sqrt(w+1) * Sqrt(w-1):
radsimp([allvalues](S(R(z))));
[z, 1/z, 1/z, z]
===
Subject: Comparison of Mathematica on Various Computers
''Comparison of Mathematica on Various Computers''
is now on
(or )
Mathematica 5.0 benchmark on
http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/timings50.html
New results for Mathematica 5.0:
Pentium 4, 3.2 GHz, 2 GB, Win XP Pro
IBM ThinkPad T41, Pentium M 1.7 GHz, 2.0 GB, Win XP Pro
xp-2700, 2.17 GHz, 1 GB, win-xp-pro
xp-2500m, 1.86 GHz, 456 mb, XP-pro
Mac G5, 2GHz dual, 1.5GB, OS X 10.3
SGI Altix 3300, 1.3 GHz, 19 GB, Linux
Powerbook G4, 1.25 GHz, 512MB, Mac OSX 10.3.2
Opteron 244, 1,8 GHz, 2GB, SuSE Linux 9 Pro for i386
Opteron 244, 1,8 GHz, 2GB, Windows XP Pro SP1
iBook G4, 933MHz, 640MB, OS 10.3.2
Dell Precision 650, 4X3.06GHz Xeon, 512KB L2, 4GB, Win XP Pro V5.1
Athlon 64 3200+, Revision SH7-C0, 2.0 Ghz, 1MB L2, Windows
Athlon 64 3200+, Revision SH7-C0, 2.25 Ghz, 1MB L2, Windows
The new test notebook for Mathematica 5.0 is available at
http://www2.staff.fh-vorarlberg.ac.at/~ku/karl/math/MMA5.0-Test.nb
===
Subject: Re: Basic Algebra and Simplification
When I state ... C is an exceptionally well designed language. ... I
mean
the type of principles followed in C, without compromize. I will approve
(personally) of any computer language by the degree of it following these
types of principles.
For example, allthough Pascal might be relatively usefull (compared to C)
in
some occasions, C is still superior, and is also acctually prior to Pascal.
(See http://www.lysator.liu.se/c/bwk-on-pascal.html for more details on
Pascal vs C.)
I understand if C is seen just as another point on the line of evolving
programming languages, but C as an integrated whole, stand alone computer
language, has proven its worth and has a special status.
- Martin Johansen.
>No math package, to my knwoledge, can do this.
> [i.e. choose the admissible rules of simplification]
>But there is an experimental
>unreleased sumbolic package which can partially at this moment, it has
been
>http://www.denotesoftware.com/ether.htm
>the library is called Simplification by IR (dynamic) under
Analytic
>which I plan to release later this year.
Martin Johansen.
> I quote from the website which appears to be wrong in saying that C is
> an exceptionally well designed language.
> | The Elements of C:
> |
> | This is an experimental tutorial/reference to the C language written in
> | the same style as Euclid's classic 'The Elements' from 300 BC.
> |
> | This style of presentation is possible because C is an exceptionally
> | well designed language. It has an almost one to one correspondence with
> | human cognition, with the concept of denotation centralized.
> |
> | The work is half-way done with the outline and the first 4 books
> | completed, of about 8.
> |
> That's from this page: http://www.denotesoftware.com/elements.htm
> Here is an AT&T page on the design of C which explains that C is first
> of all, a derivative of BCPL. If you do not like BCPL then you might also
> not like C, etcetera:
> http://cm.bell-labs.com/cm/cs/who/dmr/chist.html
> The Development of the C Language*, Dennis M. Ritchie
> Craig Carey
> Ada for algebra: http://www.ada-auth.org/
===
Subject: Re: Basic Algebra and Simplification
This is not the right newsgroup to discuss the design merits or
failures in the C programming language. There are groups in the
comp.lang.* hierarchy where such discussions rage. My favorite
is comp.lang.lisp, where there is occasionally some crossover from the
newsgroup. However, to see why C is a bad
language, in my opinion, for building large reliable software systems,
see http://www.cs.berkeley.edu/~fateman/papers/software.pdf
> Hi.
When I state ... C is an exceptionally well designed language. ... I
mean
> the type of principles followed in C, without compromize. I will approve
> (personally) of any computer language by the degree of it following these
> types of principles.
===
Subject: Re: Basic Algebra and Simplification
> However, to see why C is a bad
> language, in my opinion, for building large reliable software systems,
> see http://www.cs.berkeley.edu/~fateman/papers/software.pdf
Ahh, but for programming hardware there is nothing better. Although
C++ might be good for that too.
===
Subject: Re: Problem with multinomial in a procedure?
> I am using Maple Version 9.
I have a procedure that uses that uses the Maple multinomial command
> within it to build an expression. Inside the procedure, I have
> with(combinat,multinomial) at the start of the procedure.
See ?with:
Because with operates by using lexical scoping, it does not work inside
the bodies of procedures, module definitions, or within statements.
You will have to rewrite your procedure, either using the long form
combinat[multinomial] or the use statement (see ?use for info).
> [...]
> I have saved all of my old Maple worksheets (which ran earlier
> versions of Maple) dealing with this particular problem, and
> previously these multinomials were being evaluated.
This is a side effect of the fact that the combinat package was not
module-based in earlier versions.
If you have a procedure p like this:
p:=proc()
with(combinat):
multinomial(5,3,2);
end proc;
then maplemint(p) will emit a hint on this issue.
BTW: the comp.soft-sys.math.maple newsgroup is more appropriate for
Maple specific questions.
--
http://www.scientific.de
===
Subject: Re: Problem with multinomial in a procedure?
diane.evans@rose-hulman.edu (Diane Evans):
> I am using Maple Version 9.
For questions specifically about Maple, the Maple-specific newsgroup
comp.soft-sys.math.maple would be preferable to sci.math.symbolic.
> I have a procedure that uses that uses the Maple multinomial command
> within it to build an expression. Inside the procedure, I have
> with(combinat,multinomial) at the start of the procedure.
The 'with' command does not work inside procedures, by design. Inside
a procedure, use combinat[multinomial] instead of simply multinomial.
===
Subject: Re: MuPAD: Problem with restarting kernel
> Whenever I restart kernel, I am afterwards unable to write 2^3, I
> mean, I am unable to write the ^. Is this a bug? If not, what should I
This is an interface issue, so please tell us
- are you using xmupad or the terminal version?
- what do you do exactly to restart the kernel? The menu entry
restart kernel or a reset()?
> do in order to be able to write the ^ again? (I am using MuPAD 2.5.3
Looks like a bug to me, but doesn't happen on my machine. Does
typing ^ work?
--
===
Subject: Mupad: type of returned value
example:
monic := proc(p:Type::PolyExpr(x,Type::Integer)) : DOM_POLY
local a, g, d;
begin
d := degree(p);
a := lcoeff(p);
g := evalp(p, x=x/a);
g := multcoeffs(g,a^(d-1));
g := coerce(g,DOM_POLY);
return(g);
end_proc;
It takes a polynomial with integer coefficients and the result is a
monic polynomial with integer coefficients whose factorization problem
is the same. I want that the output must be in the DOM_POLY domain.
It works.
The problem is that it doesn't work any longer if I delete the coerce
line, even if the provided p _is_ in DOM_POLY. Why? Is it necessary to
use coerce to have the correct output? I don't like this because one
problem of coerce is that it fails if the polynomial is of degree 0
(btw: why this?).
===
Subject: Re: Mupad: type of returned value
> example:
monic := proc(p:Type::PolyExpr(x,Type::Integer)) : DOM_POLY
> local a, g, d;
> begin
> d := degree(p);
> a := lcoeff(p);
> g := evalp(p, x=x/a);
> g := multcoeffs(g,a^(d-1));
> g := coerce(g,DOM_POLY);
> return(g);
> end_proc;
It takes a polynomial with integer coefficients and the result is a
> monic polynomial with integer coefficients whose factorization problem
> is the same. I want that the output must be in the DOM_POLY domain.
> It works.
> The problem is that it doesn't work any longer if I delete the coerce
> line, even if the provided p _is_ in DOM_POLY. Why?
evalp(p, x = C) evaluates p at the point C, which is understood to be an
element of the coefficient ring. The result is an element of the
coefficient ring (in your case, an arithmetical expression). It may be
confusing for you that x is both the indeterminate and an element of the
coefficient ring, but this may happen when you work with arithmetical
expressions. E.g. in evalp(p, x=x), the two x's have totally different
meanings: the left one is the indeterminate, and the right one represents a
complex number.
Is it necessary to
> use coerce to have the correct output? I don't like this because one
> problem of coerce is that it fails if the polynomial is of degree 0
> (btw: why this?).
>
because poly cannot guess which indeterminate you want to use.
Stefan
--
===
Subject: Re: Mupad: type of returned value
evalp(p, x = C) evaluates p at the point C, which is understood to be an
> element of the coefficient ring. The result is an element of the
> coefficient ring (in your case, an arithmetical expression). It may be
> confusing for you that x is both the indeterminate and an element of the
> coefficient ring, but this may happen when you work with arithmetical
> expressions. E.g. in evalp(p, x=x), the two x's have totally different
> meanings: the left one is the indeterminate, and the right one represents
a
> complex number.
>
Now the question is natural: what is the correct way to obtain what I
intended?
Do I need a for cycle and operate manually on every coefficient? Is
there a clever way? Can I get unpredictable results when using evalp as
I did?
===
Subject: Re: Mupad: type of returned value
>> evalp(p, x = C) evaluates p at the point C, which is understood to be an
>> element of the coefficient ring. The result is an element of the
>> coefficient ring (in your case, an arithmetical expression). It may be
>> confusing for you that x is both the indeterminate and an element of the
>> coefficient ring, but this may happen when you work with arithmetical
>> expressions. E.g. in evalp(p, x=x), the two x's have totally different
>> meanings: the left one is the indeterminate, and the right one
represents
>> a complex number.
>
> Now the question is natural: what is the correct way to obtain what I
> intended?
> Do I need a for cycle and operate manually on every coefficient? Is
> there a clever way? Can I get unpredictable results when using evalp as
> I did?
>
since you know what indeterminate you are using, nothing can go wrong.
Instead of using coerce(..., DOM_POLY), I would recommend poly(..., [x])
which settles the degree-0-problem.
===
Subject: should a CAS be strongly typed?
my 2 cents for the day follow.
I think computer algebra systems should be build from the ground up
with the idea of strong data typing.
What I mean is that one should declare the type of the variables being
used. A variable should not be assumed to be real or positive or
complex or integer or irrational or anything else without the user
telling the system.
In mathematics we always do this. right? Algebra will not be what it
is if all numbers were just reals.
Not only that, I want to be able to tell the system that a variable
is only defined over some range, so if the computation results in
some value outside this range, the system should detect this (run-time
checking).
Does such a CAS exist? i.e. a strongly typed one? Do you consider mma
less strongly typed than maple? Is pattern matching (mma strong point)
enough to base mathematics on with the missing ability of typing? look
how much problem one has becuase mma is missing a global 'assume'
facility in it.
I can't for example tell mma that a variable is complex
and defined over some restricted ring and have this knowlege carry
over as an attribute with this variable to any function that acts on this
variable.
===
Subject: Re: should a CAS be strongly typed?
I suggest you learn about the Axiom CAS which elaborates on the
notions of typing, domains, polymorphic functions. As for what
is done in mathematics it is hard to say what people always
do. But it seems that what you are proposing was done in Axiom.
RJF
> my 2 cents for the day follow.
I think computer algebra systems should be build from the ground up
> with the idea of strong data typing.
What I mean is that one should declare the type of the variables being
> used. A variable should not be assumed to be real or positive or
> complex or integer or irrational or anything else without the user
> telling the system.
In mathematics we always do this. right? Algebra will not be what it
> is if all numbers were just reals.
Not only that, I want to be able to tell the system that a variable
> is only defined over some range, so if the computation results in
> some value outside this range, the system should detect this (run-time
> checking).
Does such a CAS exist? i.e. a strongly typed one? Do you consider mma
> less strongly typed than maple? Is pattern matching (mma strong point)
> enough to base mathematics on with the missing ability of typing? look
> how much problem one has becuase mma is missing a global 'assume'
> facility in it.
I can't for example tell mma that a variable is complex
> and defined over some restricted ring and have this knowlege carry
> over as an attribute with this variable to any function that acts on this
variable.
===
Subject: Re: numeric integration/de solving in Mathematica, Maple, and/or
MATLAB
by support1.mathforum.org (8.11.6/8.11.6/The Math Forum, $Revision:
1.9 primary) id i37CjDf09023;
Why don't you try Matlab with
dblquad Numerically evaluate double integral
triplequad Numerically evaluate triple integral
>I have a problem that I'm trying to solve that comes down to solving
a
>system of 2nd order ODEs. The system involves some terms of the form
>int_0^a int_0^b f(r,s,y(t)) dr ds
>where a and b are constants and f is a known function. I can't
evaluate
>the integral (myself or with Mathematica or with Maple), so I want to
be
>able to numerically solve the system while numerically evaluating the
>integral. I haven't been able to figure out how to do this is Maple
>(which I'm not very experienced with) or Mathematica (which I am). I
also
>have MATLAB, which I can't figure out how to get to do multiple
>integrals. I'd prefer Mathematica, since I know it the best, but I
need
>help in figuring out how to deal.
>One more thing---how can I get Mathematica to just leave this as an
>integral and not try to evaluate it, but be able to manipulate it
>(substituting things on the inside, etc) and numerically evaluate it
when
>desired?
* fax: 914-437-7065
> Poughkeepsie, NY 12604-0349 *
>-------------------------------------------------------------------
> WWW: <http://math.vassar.
edu/faculty/lotto/lotto.html>
===
Subject: Find a Function
This is a very simple problem which I haven't been able to solve. I
need to find a function q=f(x,y) with x>0 and y>0 such that (1)
partial derivatives f1<0, f2>0 and f12<0, (2)for p=x*f(x,y), partial
derivatives p1=0, p11<0 and p12<0 and (3) q=f(x,y)=0 is well-defined
(with x>0 and y>0). The simplest function possible would be of
interest. Can anybody help?
Roger Clarke
===
Subject: Re: Find a Function
> This is a very simple problem which I haven't been able to solve. I
> need to find a function q=f(x,y) with x>0 and y>0 such that (1)
> partial derivatives f1<0, f2>0 and f12<0, (2)for p=x*f(x,y), partial
> derivatives p1=0, p11<0 and p12<0 and ....
^^^^^^^^^^^^^^^^^^^^^
If p1 = 0 everywhere, then p11 and p12 are 0 as well, so
can't be negative. Is there a typo?
Ken Pledger.
===
Subject: Re: OO in the design of computer algebra systems?
> It would not hurt to do a little more reading on the
> subject of object oriented computer algebra systems.
> ... computer algebra systems, but it is too late for current systems
> such as maple, mma, and others which was not designed on that basis
> to be changed.
> Since these systems claim to be, in part, object oriented, perhaps
> you are missing something here. Also see mupad, and axiom, and
> the underlying design of macsyma, which turns out to be
> object oriented even though it predates by decades the rise in
> popularity of the term.
I don't know about MAPLE but, sometimes when something wasn't
originally designed to be object oriented and the later modified so
that it can have object oriented like behavior, the object oriented
model is not that good.
> I think a computer algebra software designed based
> on an OO approach would be more elegant and simpler to work with.
> You might think so, but you would be oversimplifying the problem
> considerably.
In particular, for the above example, in an OO based CAS system,
> I would search for the object I want, and then find the interface
> the object supports, not as the case is with a procedural based
> system, where one searches for a function in an ocean of functions
> hoping to find one that accepts the correct parameters.
> Take an object like -1
> and an interface/method/operation/ like squareroot.
What should the method do on -1?
> Answer 1: error: sqrt of negative number
> Answer 2: i.
Which one? Either one might be right.
> What does this mean?
> An object paradigm doesn't do the job.
how about 1/sqrt(2) + 1/sqrt(2) ? do you
> give 2/sqrt(2) or sqrt(2) ?
I don't know. Maybe this could be an argument for an object oriented
model. Perhaps the algebraic objects being manipulated should have
various properties like, a preferred range when used in a function, a
preferred mode of display and a preferred value when evaluated. For
instance I may never want pi, to be displayed in floating point form
or in rational form. Maybe I want to tell the computer algebra system
that A is a 3x3 matrix.
> I think the reason this was not done so far is that mathematicians
> know math better than software design, and software people know
> software design better than math.
I know at some schools the math and computer science departments are
very integrated. For instance, Mount Allison University, Sackville,
New Brunswick Canada. These schools tend to teach a more theoretical
mathematical computer science degree. Of course there are many schools
whose undergraduate degrees, where the focus is more practice. These
schools teach data structures, algorithms, data bases, etc.. but with
more focus on how this makes good programs, and less generalization of
the mathematical concepts behind it. For instance UNB. Note, I've
taken nether of these programs, this is just my perception.
> But you were the first one to figure this out? Sorry to disappoint
> you. Probably the best place to look is the description of the
> Axiom system.
> RJF
>
Can you give a reference?
===
Subject: Re: OO in the design of computer algebra systems?
> What should the method do on -1?
> Answer 1: error: sqrt of negative number
> Answer 2: i.
Which one? Either one might be right.
> What does this mean?
> An object paradigm doesn't do the job.
how about 1/sqrt(2) + 1/sqrt(2) ? do you
> give 2/sqrt(2) or sqrt(2) ?
> I don't know. Maybe this could be an argument for an object oriented
> model. Perhaps the algebraic objects being manipulated should have
> various properties like, a preferred range when used in a function, a
> preferred mode of display and a preferred value when evaluated. For
> instance I may never want pi, to be displayed in floating point form
> or in rational form. Maybe I want to tell the computer algebra system
> that A is a 3x3 matrix.
Perhaps Mathematical realm is too sophisticated for primitive intelligence
of polymorphic method dispatch and hierarchical object type system? Is
everything is an object paradigm even coherent to everything is an
expression?