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

If you gave an example, it would make it a lot easier to answer your question. This is usually a trivial tree-traversal problem, which is easy in Maple.
If you are using the networks package, then use networks[spantree] on all the nodes of indegree 0. If for any of them you get a spanning tree which is identical to your graph, then your graph is a rooted tree. I am sure there are better ways to do this - and I don't have GraphTheory on this computer right now, so I don't know about it.
The Compiler uses CodeGeneration for its internal processsing. And CodeGeneration:-C works just fine on your function. So this appears to be a local weakness of the compiler, and I don't know what to suggest to get around it (short of trying with global variables).
There are no multi-line comment characters for the Maple language. If you are using the new GUI, there might be ways to fool around with Document Blocks to do this. If you are using the command-line, then you can use #ifdef blocks to ``comment out'' code.
Your problem may be written down in terms of linear algebra, but it involves some serious non-linearities, as you have xj and xa showing up inside and outside of exponentials. That makes the problem very very hard. The answer seems to involve the LambertW function. If I were to attack this problem, I would first try to convert the problem to a differential equation (by differentiating with respect to a parameter and recombining), and then using Maple's strong DE solver. You should expect to get a DAE of some kind.
I don't have the time to delve into this today, probably not until next week (remind me?). But I would guess that some symbolic processing is happening that didn't use to -- and on this example, goes crazy. With a little time, I can find out for sure.
Here are two ways of doing it, one relatively simple, and one that scales nicely:
 > (A,B,C) := ({1,3,4,8}, {5,6,9}, {2,0,7}):
> T := combinat[cartprod]([A,B,C]):
> S := table(): 
> for i from 1 while not T[finished] do S[i] := T[nextvalue]() end do:
> res := [seq(S[j],j=1..i-1)]:
and now 'res' is a list of lists exactly as you ask above. The more complicated way is via combstruct:
 > with(combstruct):
# create a structure
> P := {Z=Prod( Union(a[1],a[3],a[4],a[8]), Union(a[5],a[6],a[9]), Union(a[2],a[0],a[7])) , seq(a[i]=Atom,i=0..9)}:
# enumerate them all
> res := allstructs([Z,P,unlabelled],size=3):
# make the results pretty
> rr := eval(res, Prod=((a,b,c)->[op(1,a),op(1,b),op(1,c)]));

  rr := [[8, 6, 0], [3, 6, 7], [1, 5, 2], [4, 6, 0], [1, 9, 2],

        [8, 9, 2], [8, 9, 0], [4, 6, 7], [8, 6, 2], [8, 5, 7],

        [3, 5, 2], [1, 9, 7], [3, 5, 0], [4, 5, 0], [1, 9, 0],

        [1, 6, 7], [1, 6, 2], [1, 6, 0], [4, 5, 2], [3, 9, 0],

        [8, 5, 2], [3, 9, 7], [1, 5, 0], [4, 9, 7], [8, 6, 7],

        [8, 9, 7], [3, 6, 0], [3, 9, 2], [4, 9, 0], [8, 5, 0],

        [3, 5, 7], [4, 5, 7], [1, 5, 7], [4, 6, 2], [4, 9, 2],

        [3, 6, 2]]

> 
Which of your variables are real? Which are positive? What about n-k (is that an integer?) ? All these matter a lot. The method you are using is correct -- but you'll need to adjust the notation a little bit for Maple's sake. For example, changing in to inp say. And do you really have that many ``variables'' (like Mu[M] and Mu[m] and Mu[D], etc)?
I think you are looking for evalc. Note that evalc assumes that all symbols in the input are real. If some of your symbols denote complex variables, you need to either use assume to force them to be complex, or split them up manually into 2 variables that represent the real and imaginary parts (respectively).
You seemed to have posted twice. Also, you are using a raw < in your post (which truncates it) -- use &lt; to get a lessthan sign.
Personally I have Maple 8, 9, 9.5, 10 and 11 installed. I should actually like to go back and install some earlier versions too (they are sometimes useful for certain kinds of comparisons). They all work in parallel no problem.
datatype=float[8] declares that you want to store your numbers in IEEE-754 format. This involves a conversion from a ``exact'' number in a decimal representation to its closest approximation as a binary number. What you see above is the ``exact'' decimal representation of the underlying binary number. Note that this is the same thing you would get in Java, C, C++, etc whenever using the ``double'' type. You need to use software floats if you want to keep all your digits. But software floats are (considerably) slower, which is why people still use hardware floats.
First, to attack the problem head-on (to get a ``solution'' rather then a triagular matrix), the sledgehammer here is PDEtools[casesplit] which does a rather good job:
 PDEtools[casesplit](convert(des2,list), {u,v,w});

            /d      \ /d      \                                2
            |-- U(y)| |-- w(y)| + alpha w(y) omega U(y) + alpha  w(y)
            \dy     / \dy     /
  [u(y) = - ---------------------------------------------------------
                      2     2            2
             rho omega  U(y)  + rho alpha  + 2 rho alpha omega U(y)

                        /d      \
                        |-- w(y)| I           2
                        \dy     /            d          /
        , v(y) = --------------------------, --- w(y) = |
                 rho alpha + rho omega U(y)    2        \
                                             dy

            2           2
        -3 M  w(y) alpha  rho omega U(y)

              2                     2     2
         - 3 M  w(y) alpha rho omega  U(y)

                 /d      \ /d      \   /d      \       /d      \
         + alpha |-- U(y)| |-- w(y)| + |-- w(y)| omega |-- U(y)|
                 \dy     / \dy     /   \dy     /       \dy     /

            2           3     3        2           3
         - M  w(y) omega  U(y)  rho - M  w(y) alpha  rho

                3             2                \
         + alpha  w(y) + alpha  w(y) omega U(y)|/(alpha + omega U(y))
                                               /

                  d
        ] &where [-- w(y) <> 0, alpha + omega U(y) <> 0],
                  dy

                /d      \
                |-- v(y)| I
                \dy     /                       alpha
        [u(y) = -----------, w(y) = 0, U(y) = - -----] &where
                   alpha                        omega

                                                                 2
        [v(y) <> 0], [u(y) = 0, v(y) = 0, w(y) = 0] &where [alpha

            2          2      2
         - M  rho alpha  - 2 M  alpha rho omega U(y)

            2      2     2
         - M  omega  U(y)  rho <> 0], [

                  2               2
                 M  w(y) alpha + M  w(y) omega U(y)
        u(y) = - ----------------------------------, v(y) = 0,
                               alpha

        d
        -- w(y) = 0,
        dy

                     2    2          2      2
            2   alpha  - M  rho alpha  - 2 M  alpha rho omega U(y)
        U(y)  = --------------------------------------------------]
                                   2      2
                                  M  omega  rho

        &where []

where des2 is the system of DEs (see J. Tarr's post). Second, I have to admit that I erred in a previous post: Ore_algebra cannot deal with this (directly) as it is about a single ``function'' which can satisfy multiple equations, unlike the case here which deals with 3 functions. This is essentially obtained via rifsimp as
> DEtools[rifsimp](convert(des2,list), [u,v,w]);
  table([Case = [[rho (alpha + omega U(y)) <> 0, u(y)]],

        Pivots = [rho <> 0, alpha + omega U(y) <> 0],

                  d         /          /d      \                  2
        Solved = [-- v(y) = |alpha rho |-- U(y)| v(y) + w(y) alpha  I
                  dy        \          \dy     /

            2           2              2
         - M  w(y) alpha  rho I - 2 I M  w(y) alpha rho omega U(y)

            2           2     2      \
         - M  w(y) omega  U(y)  rho I|/(rho (alpha + omega U(y))),
                                     /

        d
        -- w(y) = -rho v(y) alpha I - rho v(y) omega U(y) I,
        dy

                    /d      \
               -rho |-- U(y)| v(y) - alpha w(y) I
                    \dy     /
        u(y) = ----------------------------------]
                 rho alpha I + rho omega U(y) I

        ])
The package diffalg can also be used to similar effect. Unfortunately, there are no tools (exposed) to do just a Gaussian Elimination on a (linear) system of DEs to get it into triangular operator form. Or at least, if there is, I have not found it.
Maple 11 is so new, other than the books by Maplesoft itself, no author would have had the time to write a book about Maple 11's new features! I am not even sure there are so many books out there on Maple 10 (and its new features). Maplesoft is not as big as Microsoft(!) and so does not have the resources to ensure that third-party authors have enough access to (stable!) versions of its software so that books can come out within weeks of launch of a new version.
It looks like there are too many choices for ``dependent variables'' in the way you have set up your system, so that pdsolve cannot correctly guess. But without details, we can't help!
First 15 16 17 18 19 20 21 Page 17 of 23