Jean-Claude Arbaut

Mr. Jean-Claude Arbaut

72 Reputation

One Badge

3 years, 314 days
I used briefly Maple in the late 90s during my undergraduate studies. Back then it was Maple V r4 if I remember correctly, and a few years later Maple 6. I use again Maple since around 2018.

MaplePrimes Activity

These are questions asked by Jean-Claude Arbaut

Here is what I'm trying to do. Say I have a Digraph G1 defined by:


I would like to produce the undirected graph G2, with the same weights:


After looking in the GraphTheory package, I found UnderlyingGraph, which seems to do what I want.



I had a first problem: there is a bug in the documentation, as the option is 'weights' in the documentation, whereas the source code shows it must be 'weighted'.


But then I had another problem, but maybe I didn't understand the purpose of UnderlyingGraph: apparently, I don't get G2. For instance:


            [[[a], 0], [[a, b], 2], [[a, b, c], 5]]

              [[[a], 0], [[a, b], 2], [[a, c], 4]]

            [[[a], 0], [[a, c, b], 0], [[a, c], 0]]

The problem seems to come from the weight matrix, which is not symmetric (it is for G2):

                           [0  2  0]
                           [       ]
                           [0  0  3]
                           [       ]
                           [4  0  0]


{[{a, b}, 0], [{a, b}, 2], [{a, c}, 0], [{a, c}, 4], [{b, c}, 0], [{b, c}, 3]}


However, G3 is undirected:



So, the graph is undirected, but it has different weights for a-b and b-a. Weird.

Now, I am wondering what UnderlyingGraph is supposed to return. After looking at the source code, it seems the statement EW := EW0 + LinearAlgebra:-Transpose(EW0) builds a symmetric weight matrix, but for some reason it's not what is returned.

Is this a bug in the function? Or did I do something wrong? Is there a better way to achieve what I wanted?


Is there a way to tell Maple to compute an integral over a domain defined by an implicit condition?

A trivial example would be: integrate 1 over the 2D domain defined by x^2+y^2<=1.

I know it's possible to write the explicit double integral


Or even as a single integral:


However, it's not always possible to do this explicitly, depending on the form of the relation f(x,y)=0 defining the domain.


My idea was:


But Maple returns 0. However, evalf/Int returns the correct numerical value of Pi.



While computing a simple sequence of numbers, I remarked a small difference between the result obtained with $ and with seq.

u:=proc(n) evalf(((n+1)/n)^(n+1)) end proc:


The result is:


[0., 0., -4.*10^(-19), 0., 0., 6.*10^(-19), -9.*10^(-19), 0., -3.*10^(-19), 0.]

I have no idea why there are nonzero values in the output. Does anyone have an explanation?


It seems I get the correct values if I quote the expression before $:


However, it's not clear to me why this makes a difference in evalf.

Page 1 of 1