tijgertron

3 years, 115 days


These are questions asked by tijgertron

I just copied this from the Maple 14 documentation

f := proc( { [color,colour]::symbol := RED } )
    sprintf("color=%a   colour=%a", color, colour)
end proc;

to get

"Error, invalid procedure parameters"

Anyone any ideas? It's the same in Maple 12 and 13.

Hello again!

I am writing a procedure of which the body is done, I "only" need to take care of the input in a clever way, which is where I'm stuck. I want to make it as simple as possible for the end user. The procedure has the following parameters:

- 2 matrices of type 'Matrix' [required], say A and B

- either a list L (default []) or a symbol S (but one of them is required)

- an optional symbol v::symbol:=t

What's the best way of handling these?

I have a matrix (M) and it has both 0 and 1 as entries. I want to have a sequence/list of all indices associated with the entries equal to one (the others are irrelevant to me). I can use a nested for loop with an if statement, but I find that the easy way out and not very pretty. Is there is more sophisticated way, hopefully faster way of achieving this (using sequences, attributes, select/remove)?

Example:

M:=Matrix([[1,1,0],[0,0,1],[1,0,1]]);

Hi there!

Suppose I have an expression

Expr:=a*f(x[0],...) + b*f(x[1],...) + c*f(x[2],...),  

where the ellipses represent (different) functions of x[0]..x[2]. I'd like to use frontend to get the coefficients a, b, c corresponding to x[0], x[1] and x[2]. If the function f only has one argument, that's peanuts:

Hi everyone!

Based on a recent post ( www.mapleprimes.com/forum/partialsubstitutionfrontendfreeze ) I have the following piece from a Maple worksheet, which I do not understand. First, I define A and B, where A is supposed to be substituted into B. If I have a "p" in A, then I get a "subs" as variable in B after frontend/curry with subs:

Hi, I'd like to substitute the expression A into B, where B is of the form

B:=a*x+b*y+c*z+D(f)(p*x+q*y*r*z),

where a,b,c,p,q,r, are constants. The problem is: I only want the substitutions to be done outside of the unknown function f. So, if

A:=x=4*u,

Hi!

 

I have an expression that involves an unknown function, say g:

expr:=a*x[1]+b*x[2]+cx[3]+g(x[1],x[2],x[3]);

where a, b and c are the coefficients I'm actually interested in. These coefficients are not constants but usually expressions in some constant parameters. The function g is an expression involving derivatives of some more fundamental function (in my problem).

Example:

expr:=(q/r-sqrt(2))*x[1] + x[2] - (w*r+4)*x[3] + D(G)(x[1]) - D(G)(x[3]);

Page 1 of 1