JacquesC

Prof. Jacques Carette

2401 Reputation

17 Badges

20 years, 77 days
McMaster University
Professor or university staff
Hamilton, Ontario, Canada

Social Networks and Content at Maplesoft.com

From a Maple perspective: I first started using it in 1985 (it was Maple 4.0, but I still have a Maple 3.3 manual!). Worked as a Maple tutor in 1987. Joined the company in 1991 as the sole GUI developer and wrote the first Windows version of Maple (for Windows 3.0). Founded the Math group in 1992. Worked remotely from France (still in Math, hosted by the ALGO project) from fall 1993 to summer 1996 where I did my PhD in complex dynamics in Orsay. Soon after I returned to Ontario, I became the Manager of the Math Group, which I grew from 2 people to 12 in 2.5 years. Got "promoted" into project management (for Maple 6, the last of the releases which allowed a lot of backward incompatibilities, aka the last time that design mistakes from the past were allowed to be fixed), and then moved on to an ill-fated web project (it was 1999 after all). After that, worked on coordinating the output from the (many!) research labs Maplesoft then worked with, as well as some Maple design and coding (inert form, the box model for Maplets, some aspects of MathML, context menus, a prototype compiler, and more), as well as some of the initial work on MapleNet. In 2002, an opportunity came up for a faculty position, which I took. After many years of being confronted with Maple weaknesses, I got a number of ideas of how I would go about 'doing better' -- but these ideas required a radical change of architecture, which I could not do within Maplesoft. I have been working on producing a 'better' system ever since.

MaplePrimes Activity


These are answers submitted by JacquesC

Quick reply for now - look at unapply, codegen[makeproc], CompSeq, and in general take a good look at what is in codegen. Note: for translating Maple to other languages, CodeGeneration is highly preferred. For manipulating simple maple procedures (like what you have above), codegen is the only package that offers good tools.
The options T and Z need to refer to the global names, not the local ones. The way to do that is to use output=[':-T',':-Z'] instead. This works on all versions of Maple since Maple 6. This really ought to be in an FAQ somewhere, as I think this is the fourth or fifth time this question has come up on primes!
The better way to use evalhf() is
tp3 := proc ()
local i, j, k, m, total, Temp3, Temp1, Temp2, Temp;
total := 0;
for i from 1 to 100 do
    Temp1 := i*i;
    for j from 1 to 100 do
        Temp2 := Temp1+j*j;
        for k from 1 to 100 do
            Temp3 := sqrt(Temp2+k*k);
            if Temp3 < 100.0 then
               total := total+1
            end if
        end do
    end do
end do;
total/0.1e6
end proc;
testproc3 := proc() evalhf(tp3()) end;
This should be closer to competitive with VB. On the other hand, Maple's interpreter is not particularly fast. That's because it has to implement so many funky features, and unfortunately the cost of those funky features are borne by the whole system, rather than being localized to those features. Contrast this to Chez Scheme, where the advanced features can be a little slower than Maple, but the core system is a lot faster - different systems, different compromises.
The eigenvalues returned are complex. For theta real, cos(theta)^2-1 is negative, so its square root is usually complex. The Eigenvectors are quite complicated, since they depend on whether sin(theta)
For complex historical reason, the ASCII representation of pi in Maple is 'Pi'. 'pi' does not mean anything to Maple. From the GUI, the 'pi' symbol is translated to Pi when it is sent to the Maple kernel (behind the scenes). This is both quite helpful of it, and the source of your confusion, all at once.

> restart;

> assume(n>0,B>=1, A1::real, Vp::real, A2::real, C::real);

> de := (diff(V(t),t))^n*(V(t)+Vp)+(diff(V(t),t))^(n+B)*(V(t)*A1+Vp*A2)=C;

Maple Equation

> dsolve({de, V(0)=0}, V(t));

Maple Equation

>

This post was generated using the MaplePrimes File Manager

View 130_primes1.mw on MapleNet or Download 130_primes1.mw
View file details

What you show above has a syntax error (in the definition of mk) as well as an undefined term (plot2). The error message in your title makes me think that your problem is not mathematics-related, but rather in the GUI - are you perhaps working in Standard using 2D input?
collect(e2, X) would do what you want. But you can spice things up too, by doing things like collect(e2,X,factor). This applies 'factor' to each of the coefficients of the polynomial. Of course, any function can be used instead, even an inline proc.
Interactively, using : is simplest. For programming, and longer interactive sessions, take a look at the 'echo' option in ?interface. That lets you control what Maple echoes back. Beware: I know this works in the TTY and 'Classic', but many old tricks are broken in the so-called 'Standard' GUI, so you'll have to test it to see if that (still) works.
As tobybailey pointed out, you cannot do this directly. However, the commands content and primpart will let you get at these quantities.
Assuming the above does indeed work, I really dislike seeing
if t=`a` then true else false end if
when simply
evalb(t=`a`)
does the same. And once you get there, then you see that this type is in fact identical('`a`'), which is much faster than any user-defined type.
For one, what you posted was not syntactically valid... and another, the first bound is it El or EL? If I assume it is EL, then Maple can get a closed-form (in terms of Mu, KT, EL and EU) for your equation as follows
> restart;
> assume(EL < EU, KT>0, Mu>0);  _EnvAllSolutions := true;

                       _EnvAllSolutions := true

> eq:=int(E^2/(exp((E-Mu)/KT)-1), E=EL..EU)
> -int(E^2/exp((E/KT)-1), E=EL..EU)=0;
where the result is large, but prints out to -1/3*EU^3+KT*ln(1-exp(-(-EU+Mu)/KT))*EU^2- KT*ln(1-exp(-(-EU+Mu)/KT))*Mu^2+ 2*KT^2*polylog(2,exp(-(-EU+Mu)/KT))*EU -2*KT^3*polylog(3,exp(-(-EU+Mu)/KT)) +Mu^2*KT*ln(-1+exp(-(-EU+Mu)/KT)) +1/3*EL^3-KT*ln(1-exp(-(Mu-EL)/KT))*EL^2 +KT*ln(1-exp(-(Mu-EL)/KT))*Mu^2 -2*KT^2*polylog(2,exp(-(Mu-EL)/KT))*EL +2*KT^3*polylog(3,exp(-(Mu-EL)/KT)) -Mu^2*KT*ln(-1+exp(-(Mu-EL)/KT)) -KT*exp(-(EU-KT+EL)/KT)*(-2*exp(1/KT*EL)*KT^2 -exp(1/KT*EL)*EU^2-2*exp(1/KT*EL)*KT*EU +2*exp(1/KT*EU)*KT^2+exp(1/KT*EU)*EL^2 +2*exp(1/KT*EU)*KT*EL) What values are you trying to solve for (there are 4 parameters!)?
The way they are marketed is different. AFAIK, that's it.
When encountering either a difference or a recurrence equation, the first tool is rsolve. Unfortunately, this is a non-linear recurrence, so rather predictably, Maple can't solve it - these are quite hard indeed. For any given integer T, it might be possible to explicit unwind the recurrence, but it is unclear if that would lead to a closed form. What I can think of is to turn the recurrence around by making the transformation t = T-s-1, and consider the recurrence in s, more specifically for w(s) = z(T-s).
> assume(x::real,y::real):
> z := x+I*y:
> eq := 3*Im(z)^2-1 <= -abs(conjugate(z))^2;

                              2           2     2
                    eq := 3 y~  - 1 <= -x~  - y~

> (lhs-rhs)(eq) <= 0;

                               2     2
                           4 y~  + x~  <= 1
which is naturally equivalent to what was posted previously, just more explicit.
First 19 20 21 22 23 Page 21 of 23