acer

32343 Reputation

29 Badges

19 years, 328 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@vv I don't deny a problem in the symbolic summation here. But that route is unnecessary all the same.

Even if the symbolic summation worked (and produced some valid representation in terms of the unspecified symbolic name k) then I'd still recommend the direct addition for this particular example.

Here's an alternate that looks more like your followup image. Also in Maple 17.02.

restart;

kernelopts(version);

`Maple 17.02, X86 64 LINUX, Sep 5 2013, Build ID 872941`

(1)

#x:=[0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4]:

#y:=[0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4]:

z:=[0, 0, 0, 0, 0,
    0, .689376362, 1.378752724, 2.068129087, 2.757505449,
    0, 1.02920355, 2.0584071, 3.087610649, 4.116814199,
    0, 1.216469264, 2.432938529, 3.649407793, 4.865877057,
    0, 1.325720912, 2.651441823, 3.977162735, 5.302883646]:

interfunc:=subs(__M=Matrix(Matrix(5,5,z),datatype=float[8]),
                (x,y)->CurveFitting:-ArrayInterpolation([[0,1,2,3,4],
                                                         [0,1,2,3,4]],
                                                   __M,[[x],[y]],
                                                   method=cubic)[1,1]):

newz:=CurveFitting:-ArrayInterpolation([[0,1,2,3,4],[0,1,2,3,4]],
                                       Matrix(5,5,z),
                                       [[seq(0+(4-0)*(i-1)/(50-1),i=1..50)],
                                        [seq(0+(4-0)*(i-1)/(50-1),i=1..50)]],
                                                   method=cubic):

(nminz,nmaxz):=(min,max)(newz):

C:=0.666*(1-ImageTools:-FitIntensity(newz)):

PC:=PLOT(GRID(0..4,0..4,newz,COLOR(HUE,C)),STYLE(PATCHNOGRID)):

numcontours:=9:

(P->op(0,P)(op(P),
            ROOT(BOUNDS_X(0),BOUNDS_Y(0),
            BOUNDS_WIDTH(600),BOUNDS_HEIGHT(500))))(plots:-display(PC,
               plots:-contourplot(interfunc,0..4,0..4,thickness=0,
                                  contours=[seq(nminz
                                                +(nmaxz-nminz)*(i-1)/(numcontours+2-1),
                                                i=1..numcontours+2)]),
               seq(plot(z[1],nminz..nminz,
                        thickness=15,color=COLOR(HUE,0.666*(1-(i)/(numcontours+1))),
                        legend=sprintf(" %.3f",
                                       nminz+(nmaxz-nminz)*(i)/(numcontours+1))),
                   i=numcontours+1..0,-1),
               legendstyle=[location=right,font=[Helvetica,14]],
               font=[Helvetica,16],
               labelfont=[Helvetica,bold,16],
               labels=[eta,"X"],labeldirections=[horizontal,vertical]));

 

Download listcontdens2_M17.mw

@asaa Your Question's title has it as "xmaple 2020.2" but the body of your Question has it as "xmaple 2021.1". Which is it?

Maple comes bundled with a JRE, so why (and how) are you not using that? For Maple 2021.2 on Linux it is (IIRC) openjdk version "17" 2021-09-14 (build 17+35).

@jalal Explain how you want it animated. Provide that here.

Please don't submit a separate Question thread for this.

If this Post is supposed to serve as an example of good practice then the first example (A) would be better -- and also far more clear -- as,

restart;
with(ScientificConstants):

GetValue(Constant(g));

                       9.80665

instead of its current (and muddled) form, ie.

restart;
with(ScientificConstants):

ScientificConstants:-GetValue(Constant(g))

                       9.80665

Also, the Help page with Topic UsingPackages could be improved in several ways. It's an important usage page for new users, and ought to be a paragon of lucidity and helpfulness.

- It should utilize the colon-dash syntax, eg. P:-E, and not the square-bracketed, indexed syntax, P[E], in its early examples. The latter form is inferior because it can sometimes need the extra safety of having the index-name to be uneval-quoted like P['E'] (as mentioned later in that very page!). In fact the indexed form can sometimes need to be P[':-E'], which appears silly since P:-E is safer and simpler.

It's not helpful or sensible for that Help page to first describe examples using the inferior P[E] form, and only in a later paragraph mention that the P:-E form is more recommended.

The indexed form like P[E] should only appear in a very late paragraph on that Help page, on account of there being a relatively small number of old packages not converted to work with the recommended colon-dash P:-E form.

- That Help page is too verbose and abstract. A few sensible, concrete (actual) examples would be better and more understandable that all that abstract talk of some PackageName. New users shouldn't have to decode all that, including the abstract PackageName['command'](arguments).

- After the basic examples of short and long form have been demonstrated with nice clean, clear, and concrete examples then a couple of examples of the (underdocumented!) uses and use syntax would be relevant and completely apropos. For example,

restart;
use ScientificConstants in
  GetValue(Constant(g));
end use;
                    9.80665

restart;
G := proc()
  uses ScientificConstants;
  GetValue(Constant(g));
end proc:

G();
                    9.80665

And, to be helpful to the programmer:

restart;
use SC=ScientificConstants in
  SC:-GetValue(SC:-Constant(g));
end use;
                    9.80665

restart;
F := proc()
  uses SC=ScientificConstants;
  SC:-GetValue(SC:-Constant(g));
end proc:

F();
                    9.80665

How many roots do you need to find?

Please stop posting duplicates and close followups of this in separate Question threads.

Instead, please put your followup queries or additional details here.

@hisabt How is this any different from what Tom answered, earlier?

@Tamour_Zubair The problem with downloading is caused by the presence of the # special character in your file's name.

I fixed the link of such an example in another Question, yesterday. I don't want to make that a habit. Perhaps you could use another filename.

@tomleslie I've fixed the link.

I forgot to remove the WRAPPER keyword from the define_external calls in one of those attachments. Could you please remove it, or download the now-edited first attachment in this Answer?

But since Control & Info are not structs then the WRAPPER option is not needed, and may be removed. And wrapperless external-calling doesn't need to compile anything, so hopefully that fixes that worksheet for you.

Where did the attachment go?

It is poor etiquette to include only an image of your expression, so that others can only test by retyping the supposed expression.

Instead, please be polite and upload and attach your actual worksheet that contains the expression. You can use the green up-arrow in the Mapleprimes editor for that.

Ensure that all other parameters have numeric values. What is the numeric value of Ea? Of F? Of Rrt? Is "PI" a mispelling of "Pi"? etc.

Also, if you have candidate ranges for the solving-variables then now is a good time to share such information.

Please don't put followup queries for this example in separate Question threads. Instead, just add it here. Eg. what happens at (0,0)?

@ContrapuntoBrowniano You marked your Question as "Maple 2018", and that is not the same as Maple 18.

Maple 18 was released in the year 2014. The Maple version naming scheme changed in the year 2015, to have the version number match the release year.

First 105 106 107 108 109 110 111 Last Page 107 of 592