Joe Riel

9590 Reputation

23 Badges

19 years, 132 days

MaplePrimes Activity


These are answers submitted by Joe Riel

StringTools:-Remove is not the procedure you want to use; it is for removing characters from a string.  What you want is probably
StringTools:-Subs(["\\begin{array}{ccc}" = ""], s);

The procedure CodeTools:-Profiling:-Profile can be used to record the number of times a procedure is called.

From the output I'll guess you are located fairly close to Maplesoft; there aren't many hops and they seem reasonably short. On my system there a few more hops, they are longer, and I can see the switch from the US sites to the Canadian sites.

See ?plot,details.  You can use the 'view' option or specify the y-range with an additional range.
plot(x, x=1..2, 'view'=[1..2, -1..2]);
plot(x, x=1..2, -1..2);

In module A, s has to be an export, not a local.

The call `<,>`(a,b,c) is somewhat equivalent to Vector[column]([a,b,c]) and `<|>`(a,b,c) to Vector[row]([a,b,c]). The actual procedures are mainly builtin, but you can inspect the non-builtin part by doing

interface('verboseproc'=3):
print(`<,>`):
print(`<|>`):

The help page for Vector describes the row and column options.

Pi/3 is not an integer (in the range 0..10), so fails in u[i,Pi/3]:=0;

CodeTools:-Profiling takes the procedure you want to profile as an argument. You are passing a call to PickAngles.  Try

with(CodeTools:-Profiling):
Profile(PickAngles):
PickAngles(...);  # appropriate call to exercise the procedure
PrintProfiles(PickAngles);

 

Not clear that this will help, but in the Logic package you can use &iff. To get the desired looking expression you could do

with(Logic):
(&not (P &or Q)) &iff ((&not P) &and (&not Q));

See the help page ?Logic,operators.

You could try using kernelopts('bytesused'). 

It wasn't designed to.  It could be extended but would it be useful?  You can use

Describe~([sin,cos,tan]):

Your example isn't ideal in that Describe(1) also fails, with a different error.

The debug button is only active when Maple is computing.  To test it, run the following code in a Maple worksheet.

proc()
    for local cnt do
       Threads:-Sleep(1);
       print(cnt);
    end do;
end proc();

While it's executing, the debug button should become active.  Press it. The interactive debugger will open.  Click the next button in the debugger a few times to step through the code, then click the quit button.

See the help page for StringTools:-Random.  For example,

Generate('variable("abc",length=10)');
                           cbbbcacbac

 

@Art Kalb You could achieve that with map(expand@expand, N^%H).  The double expansion is to work around the design of `expand/conjugate`.  A different approach is

distribconj := proc(x)
    subsindets(x, 'specfunc({`*`,`+`},conjugate)', c -> map(conjugate, op(c)));
end proc:

distribconj(N^%H);

 

Am not quite sure what you are looking for.  Here I find the value of t so that f(x=1) - f(x=0) = TOL.

tol := 1e-6:
g := exp(-t):
h := unapply((x^2-5*x^3+10*x^5+x+3+.5*x^4)+(1/2)*x^2*(x-1)+2*sin(x),x):
tsol := fsolve((h(1)-h(0))*g = tol, t);
             tsol := 16.03285819
1 2 3 4 5 6 7 Last Page 1 of 114