Joe Riel

9660 Reputation

23 Badges

20 years, 10 days

MaplePrimes Activity


These are replies submitted by Joe Riel

It replaces the n in k3:

                 /                       1              \      2
                 |phi + ln(- --------------------------)| sigma
                 \           -exp(phi) + exp(phi) p - p /
               - -----------------------------------------------
                                 phi p (-1 + p)

Just sum the appropriate column.  For example

indegree := proc(A,i)
local k;
    add(k, k in A[..,i]);
end proc:

To get all at once, you could do

ArrayTools:-AddAlongDimension(A, 1);

That will return a Vector with each element corresponding to the indegree of the adjacency matrix A.  Use AddAlongDimension(A,2) to get the outdegrees.

Note that indegree above is not particularly efficient in that it internally creates a Vector (A[..,i]).  Better would be to extract the row dimension:

indegree := proc(A,i)
local m,k;
    m := op([1,1],A);
    add(A[k,i], k=1..m);
end proc:

Just sum the appropriate column.  For example

indegree := proc(A,i)
local k;
    add(k, k in A[..,i]);
end proc:

To get all at once, you could do

ArrayTools:-AddAlongDimension(A, 1);

That will return a Vector with each element corresponding to the indegree of the adjacency matrix A.  Use AddAlongDimension(A,2) to get the outdegrees.

Note that indegree above is not particularly efficient in that it internally creates a Vector (A[..,i]).  Better would be to extract the row dimension:

indegree := proc(A,i)
local m,k;
    m := op([1,1],A);
    add(A[k,i], k=1..m);
end proc:

Try

 Maple_floats(MAX_EXP);
                              9223372036854775806

That returns the maximum exponent of a floating point number.  On a 32-bit linux box it is 2147483646.

Try

 Maple_floats(MAX_EXP);
                              9223372036854775806

That returns the maximum exponent of a floating point number.  On a 32-bit linux box it is 2147483646.

You might try something like

expr:=a*f(x[0],x[2]-x[1]/r) + b*f(x[1],Pi*x[2]+x[0]) + c*f(x[2],w*x[2]^2):

coeff_farg := proc(expr, x)
local term;
    term := indets(expr, And('specfunc(anything,f)', 'patfunc'(identical(x), anything)));
    if term = {} then
        return 0;
    elif nops(term) = 1 then
        coeff(expr,term[]);
    else
        error "too many matching terms";
    end if;
end proc:

coeff_farg(expr, x[0]);
                                        a

You might try something like

expr:=a*f(x[0],x[2]-x[1]/r) + b*f(x[1],Pi*x[2]+x[0]) + c*f(x[2],w*x[2]^2):

coeff_farg := proc(expr, x)
local term;
    term := indets(expr, And('specfunc(anything,f)', 'patfunc'(identical(x), anything)));
    if term = {} then
        return 0;
    elif nops(term) = 1 then
        coeff(expr,term[]);
    else
        error "too many matching terms";
    end if;
end proc:

coeff_farg(expr, x[0]);
                                        a

You can use the multiline comment for that, at least if you're not using 2D input.  "Multiline" is a bit of a misnomer, "block comments" is the better term. You can do

y := 23 * v (* velocity *) + L (* initial position *) ;
                         y := 23*v + L

You can use the multiline comment for that, at least if you're not using 2D input.  "Multiline" is a bit of a misnomer, "block comments" is the better term. You can do

y := 23 * v (* velocity *) + L (* initial position *) ;
                         y := 23*v + L

I use an external editor and preprocessor macros ($ifdef ...  $endif) to selectively disable large sections of code.

While I doubt it is very practical, you could try selecting the input and then using the context menu (right click) to convert it to plain text. To activate, reselect and convert to maple input.  I'd be sure to save the worksheet before trying that. This doesn't work so well if text regions are intermixed with the input.

I use an external editor and preprocessor macros ($ifdef ...  $endif) to selectively disable large sections of code.

While I doubt it is very practical, you could try selecting the input and then using the context menu (right click) to convert it to plain text. To activate, reselect and convert to maple input.  I'd be sure to save the worksheet before trying that. This doesn't work so well if text regions are intermixed with the input.

What version of Maple do you have?  It was introduced in either Maple12 or 13, I'm not sure which

What version of Maple do you have?  It was introduced in either Maple12 or 13, I'm not sure which

I don't have Maple 10 immediately available.  Both these run on Maple 13.

Another problem is that the module doesn't appear to export anything useful to execute, other than Print, which doesn't do any computations.  So you'll need to correct that. 

First 92 93 94 95 96 97 98 Last Page 94 of 195