acer

32490 Reputation

29 Badges

20 years, 9 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

I have seen it done on the same host, using the commandline interface. That is, starting the kernel and the client (interface) separately.

I don't know whether it could be done across a network. I'll give it a try (later, sorry).

By "X-window interface" I presume that you mean the Classic GUI. If anything, I would expect that the Standard (Java) GUI would be more difficult than Classic here, as far as accepting parameters when launched and not automatically firing up its own kernel.

acer

I found an ubuntu 12.04 machine and reproduced the problem in the commandline interface. I will look harder, and submit a bug report. You don't need to fiddle with libname and other stuff that I suggested earlier (now deleted).

%maple15.01 -s
    |\^/|     Maple 15 (X86 64 LINUX)
._|\|   |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2011
 \  MAPLE  /  All rights reserved. Maple is a trademark of
   Waterloo Maple Inc.
      |       Type ? for help.

> kernelopts(version);           
            Maple 15.01, X86 64 LINUX, Jun 1 2011, Build ID 635833

> ssystem(`more /etc/*release*`);
[0, "DISTRIB_ID=Ubuntu
    DISTRIB_RELEASE=12.04
    DISTRIB_CODENAME=precise
    DISTRIB_DESCRIPTION="Ubuntu 12.04 LTS"

    "]

> int(x^n, x=2..3);
                                     3
                                    /
                                   |    n
                                   |   x  dx
                                   |
                                  /
                                    2

I strongly suspect that the underlyng problem is another issue which has been previously reported. On that same system,

> log[2](8);
Error, (in iroot) powering may produce overflow

It's quite plausible that `int` is generating that error internally, but catching and suppressing it, with the end result being that it returns unevaluated.

Here is a comment to a previous report, suggesting that you contact Maplesoft's Tech Support ( support@maplesoft.com )

Also, the example succeeds in 64bit Maple 16.00 on that same machine.

acer

M:=LinearAlgebra:-RandomMatrix(5,generator=0..2);

                                 [0  0  1  1  1]
                                 [             ]
                                 [2  0  1  0  0]
                                 [             ]
                            M := [2  1  2  2  0]
                                 [             ]
                                 [1  0  2  0  2]
                                 [             ]
                                 [0  1  0  0  1]

rtable_num_elems(M,'NonZero');

                                     14

add(`if`(x<>0,1,0),x=M);

                                     14

You can subtract the above numbers from the total number of entries (the product of dimensions, 5*5 or 18*18, etc) to get the number of zeros.

acer

This is not short and pretty,

> expr := -2*Pi*sin(Pi*a)/(-1+cos(2*Pi*a)):

> combine(simplify(convert(convert(expand(expr),tan),sincos)));

                                      Pi
                                   ---------
                                   sin(Pi a)

acer

You can plot anything you want. Whether it is "correct" depends on what you are trying to represent.

The fourier transform takes the representation in the time domain of some signal and represents it instead in the frequency domain. The frequency domain representation consists of amplitude and phase, which are the real and imaginary parts respectively. One reason that (Re(f)^2+Im(f)^2) is often considered is that it is equal to f*conjugate(f). These quantities have special names (such as spectral density) and are directly related to the power of the signal.

There are lots of wikipedia pages for this kind of thing. You could look at spectral density, for example. Then maybe move back to the simpler frequency spectrum and frequency domain.

Don't confuse amplitude with magnitude.

acer

You have a space (blank character) between the Im and the (b[i]) in your conditional test. You are using 2D Math input and so the subexpression containing that extra space gets interpreted as an implicit multiplication. So, after parsing, part of the conditional is the test Im*b[i] <> 0 which is true for all your data. If it weren't for this syntax mistake then your code might do what you want.

When you write "row" in your question, it seems that you mean column. No problem.

Your method is not very efficient, since insertion into lists by assigning to specific list entries is not efficient. (It recreates whole new lists, as lists are really a mutable data structure in Maple -- they are just faked to appear so, when of length less than 100.) You could also accomplish the task by building up the new lists in one go, using the seq command. But for only small amounts of data perhaps you don't need to be so concerned with the efficiency.

acer

You can create your own procedure to put this information into a format that you might find useful.

As just one example (of many possible),

query:=proc(z::rtable)
          op(0,z), [op(`if`(op(0,z)=Array,2,1),z)];
       end proc:

M:=Matrix(3,4):

V:=Vector[column](5):

A:=Array(1..2,-1..1):

t,d := query(M);

                                  t, d := Matrix, [3, 4]

t,d := query(V);

                               t, d := Vector[column], [5]

t,d := query(A);

                            t, d := Array, [1 .. 2, -1 .. 1]

acer

You could look at Parabolic Reflectors and the Ideal Flashlight.

He compares a parabola with a circle, as reflectors. You could try and extend to 3D.

acer

If you execute the Maple command,

libname;

then you should be able to figure out where the `lib` folder resides.

If you don't want to mess around with the folder belonging to your installed Maple then you could try placing them in a folder which you place as follows: First, find out what Maple considers to be your home folder, by executing the Maple command,

kernelopts(homedir);

Append the result of that with something like /maple/toolbox/Trig/lib" and create those folders (relative to whatever kernelopts(homedir) reported, naturally).

In any case, once the two files are copied into location, close and relaunch Maple.

You would need both of your files Trig.lib and Trig.ind as they form a Maple archive together. (In modern Maple such an archive would usually created as a single file named Trig.mla but whoever wrote your pair is doing it the old way.)

acer

A simple way (though likely not the most efficient, if you want to do it thousands of times),

A:=<2,3>;

                                       [2]
                                  A := [ ]
                                       [3]

A . <1,1>;

                                      5

acer

Try changing the call to dsolve(...,numeric) to be,

sol1 := dsolve({DE1, DE2, ICs, a(t) = diff(x(t), t, t)}, numeric, range = 0 .. 3);

Then, your last plot could be produced using,

odeplot(sol1, [t, a(t)], 0 .. N);

That could be a way to get better results, numerically. It makes dsolve(...,numeric) compute a(t) itself. By instead using D(v)(t) then when that gets evalf'd Maple will internally call fdiff() to compute a derivative numerically using a multi-point difference scheme. I would expect dsolve(...,numeric) to be able to compute a(t) more robustly than that, in general if not specifically.

acer

Please check whether these results are plausible and accurate enough, etc.

dsparint2.mw

This revision of code as attached worksheet, including plots out to t=48, takes approximately 61 sec in 64bit Maple 15 on Windows 7 running on an Intel i7 930.

The call to forget(`evalf/int`) is necessary when using operator form for the integrand passed to evalf(Int(..)), if that integrand evaluates according to some hidden quality such as the setting of earlier dsolve/numeric parameters.  

I believe that the call to forget(evalf) may not be necessary and so I removed it. That brought a big performance change (if accompanied by the other edits). I don't know for sure that evalf is not storing any results mistakenly (by ignoring the hidden depencies upon the parameters of the earlier dsolve/numeric output procs). I didn't have the patience to wait the long time to get final results using your posted code.

I changed it to use evalf(Int(...)) instead of evalf(int(...)). But to do that, with the forced method=_d01ajc, I had to workaround what appears to be a bug in evalf/Int. It looks like an internal evalf/Int routine might be unprepared to catch & handle a particular error coming out of evalhf when trying to run the earlier dsolve/numeric stuff during evaluation of the integrand. And so it doesn't seem able to gracefully fall back to regular evalf mode. I (believe) that I worked around this by the unusual maneouver of turning the integrand into a procedure which is deliberately non-evalhf'able (viz. it creates an empty list) and which would throw a different but recognized evalhf error. Blech.

And I made a few adjustments to try and tone down some of the accuracy tolerances.

nb. I only changed Po2m to something usable, since Pco2m doesn't seem needed by the final dsolve.

The final plot of O2r looks a bit different in Maple 16 than it does in Maple 15, especially in the key t=15..25 range. The other four plotted functions of t looked pretty much the same in both versions. But in Maple 16 O2r doesn't really fall below 0.00004 whereas in Maple 15 it gets down to -0.0004 or so. I didn't try another solver for dsolve/numeric. But this discrepency seems to persist even if I adjust the final dsolve relerr to be 1e-9 and the evalf/Int epsilon to be 1e-11.

acer

w:=-t*sin(x*Pi): # or what have you...

A:=plots:-animate(w, x=0..1, t=0..0.1, frames=50, numpoints=100,
                  color=red, thickness=3, view=[0..1,-1..1]):

plots:-display(A, view=[0..1,-1..1], insequence=true);

plots:-display(plottools:-transform((x,y)->[y,x])(A),
               view=[-1..1,0..1], insequence=true);

acer

See the help-page evalf,Int which is also cross-referenced from the 5th bullet point in the Description section of the help-page for int.

For some other  examples you could look again at a response to your question from last week.

acer

In Maple 16.00 running on Windows 7 with 6GB RAM available, I get results as follows from kernelopts(bytesalloc),  for a single set of attempts.

32bit Maple: n=100  171MB

64bit Maple: n=100  264MB

acer

First 266 267 268 269 270 271 272 Last Page 268 of 337