acer

32727 Reputation

29 Badges

20 years, 92 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Rather than tacking this idea on to an existing thread (you queried about it in a comment on another thread too, I believe) it might be more fruitful if you were to branch it off instead as an entirely new Question. I say that because it is a complicated and involved topic.

I'll try to list here a few suggestions for details that would help get somewhere with your question. I believe that these illustrate how complicated it can become in general.

Let's define terms, to avoid confusion. (Hopefully any new Question would do the same, or at least provide a very clear concrete motivational example.) Let's suppose you wish to find a root of all of the members of {F[1],F[2],..,F[n]} where each F[i] was a mathematical function of {y[1],[y[2],...,y[n]}.

Are you always starting with a (Vector-valued) procedure for F, whose procedure body contains the crucial formulae? Or would you sometimes begin with user-supplied multivariate expressions for all the F[i]?

Do you expect function evaluation of F to be by far the heaviest burden, compared to the cost of linear-solving (for a single Newton step)? If so then why is conjoined compilation so critical? Or do you expect the cost to be more even, where the performance difficulty is in performing a great many steps from a great many initial points, due say to high dimensionality? If you believe that the cost of dense linear solving is a bottleneck then are you sure that it is the cost of hardware double-precision lapack dgetrf/dgetrs or might it rather be the overhead of calling those from LinearSolve in the Maple Library?

What about the case where the F[i] are not compilable, nor even evalhf'able, or are susceptible to roundoff error at double precision? Do you want a mechanism that falls back to software float evaluation of the F[i] while retaining double-precision linear solving to Newton steps?

The issue of combining compilation of multiple procedures (or even of single procedures which are supposed to contain problem-dependent user-supplied formulae/expressions) is not simple. Sometimes multiple procedures can be compiled "together" is they are within a module. Or, I recall that worked at some date... Simple expressions can sometimes be substituted in for dummy placeholders in template procedures. (That's kind of what what goes on with module local Fractals:-EscapeTime:-setNewton). For simple F[i] one can sometimes get by using option inline although that too can require use of global names. There are plotting internal mechanisms which use FromInert/ToInert in order to try and shoehorn expressions into looping procedures.

...anyway, it's a very interesting topic. A concrete small example would be a decent place to start, in a new Question thread. (You could use the Branch button to create it from this Comment, perhaps.)

I am curious, why split the float[8] Matrix L0 into two columns, at all? Why not just pass L0 inself (instead of those first two arguments) as the first argument to plot?

acer

@bfathi Your followup code attempts to assign to the protected names sin and cos.

I don't understand why you can't make headway by yourself towards understanding the error messages. For example, you could try a help query of the keyword protected. You could also click through on the error message, which is a hyperlink to here.

I suggest that you just use some other names, like psin and pcos or whatever, instead of trying to assign to sin and cos. (The difficulties you've had with the very basics indicates that declaring local instances of those names would just lead you into greater difficulties.)

You also continue to use dsnumsort, which is incredibly poor, despite suggestions by myself and others.

I don't see that you're making significant effort on your own towards the purported university project. You don't even bother to describe the project to us in proper detail (...we're not all going to go buy that text book, you know).

@spark1631 Are you invoking Engine? If so then isn't its first argument a string of options similar to those of the commandline interface? And if so then could you try passing the -T option?

You might also try that in combination with passing the -Xss option when invoking java itself.

Just some ideas.

The hard limit (above which kernelopts(stacklimit) cannot be raised) depends on the Maple version and the platform.

acer

@Alejandro Jakubi I would like to see the help pages for topic=$ and topic=seq clearly describe when the repetition (or expression production) occurs, and when any evaluation occurs.

The following four cases are the kind of thing I feel would be generally useful, if properly annotated. (I believe that I understand what's going on in each case, and that people using seq and $ would benefit from having the full explanation readily available in the help system proper.)

restart:
f:=proc() global count;
     if not count::numeric then count:=1;
     else count:=count+1;
     end if;
   end proc:
seq('f'(),i=1..4);
                       f(), f(), f(), f()
count;
                             count

restart:
f:=proc() global count;
     if not count::numeric then count:=1;
     else count:=count+1;
     end if;
   end proc:
seq(f(),i=1..4);
                           1, 2, 3, 4
count;
                               4

restart:
f:=proc() global count;
     if not count::numeric then count:=1;
     else count:=count+1;
     end if;
   end proc:
'f'()$4;
                           1, 2, 3, 4
count;
                               4

restart:
f:=proc() global count;
     if not count::numeric then count:=1;
     else count:=count+1;
     end if;
   end proc:
f()$4;
                           1, 1, 1, 1
count;
                               1

@Athar Kharal I've been working on a tool for this, but it does yet support extraction of every kind of input, output, and other object. Is your file a Document or a Worksheet? 1D or 2D input? Does it have Sections? Are any of the inputs within GUI Tables? Is there code to extract from code edit regions

@Carl Love Something quite close is possible in Maple 2015, using the new programmatic content functionality.

(I didn't try a custom light source... Can one of the lights be a reflection of a point light source? The surface looks a bit glossier in my Maple GUI itself, when reexecuted.)

restart:

with(plottools): with(plots):

p1:=hemisphere([0,0,0],1.5,capped=false):

p2:=hemisphere([0,0,0],1.45,capped=false):

p3:=display(sector([0,0],1.45..1.5,0..Pi),
            sector([0,0],1.45..1.5,Pi..2*Pi)):

p3:=extrude(p3,-0.001..0.001):

P:=display(p1,p2,p3,scaling=constrained,style=surface,
           axes=none,color="#cc8800",orientation=[22,47,-31],
           glossiness=1.0,lightmodel=Light4):

DocumentTools:-Tabulate([P],fillcolor="black",widthmode=pixels,width=400);

with(DocumentTools:-Layout):

xml:=Worksheet(Table(alignment=center,widthmode=pixels,width=380,
                     Row(Cell(InlinePlot(P,scale=1.6,xtrans=2,ytrans=-3,
                                         height=330,width=380),fillcolor="black")))):

DocumentTools:-InsertContent(xml);

 

 

Download tabfun.mw

@Denni I don't have access to 64bit Linux with that particular CPU, on which to try with 64bit Maple 15.01. The Xeon's I can access apear to be quite a bit older.

I'm not sure whether it is related to the combination of Maple 15.01 and that Xeon, or the combination of Maple 15.01 and that OS, or all three.

It might be related to the 64bit Linux version of Maple 15.01 (2011) only being officially supported for Ubuntu 10.04 and 10.10. Your "Ubuntu 3.13.0-49-generic" is Ubuntu 14.04 (trusty, 2014) I believe.

As far as I know Maple 2015 (the current major release) is the first to officially support Ubuntu 14.04 LTS and 14.10. The previous major release Maple 18 states official 64bit Ubuntu support for only 12.04 LTS and 13.10.

Your minimal working example might possibly have a workaround by raising Digits > evalhf(Digits) to avoid evalhf. I don't recall that a customized NumericEventHandler to sidestep division-by-zero would work in Maple 15 under evalhf. But I suspect that you'd be better off with a correct solution with full functionality and not just a (possibly slow) workaround.

 

What kind of machine is the server? I mean, chipset and OS? And what do the commands kernelopts(version) and system(processor) report on it?

acer

@Alejandro Jakubi I have submitted a bug report.

@Markiyan Hirnyk I respectfully leave searching the help for yet another example up to you.

@Markiyan Hirnyk There is an example in the Maple 18 help page accessed via topic solve,details as the 1D Maple notation code,

solve( {x^2*y^2 = 0, x - y = 1, x <> 0} );

                         {x = 1, y = 0}

When viewed in 2D Input mode, that help page shows that example like x<>0 rather than the 1D Maple notation x<>0. But that's just a different display of the same expression.

@Carl Love The issue is not equality of Matrices. It is, rather, one of relative equality of Vectors, which can be considered as rows (or columns) of a Matrix. In that context the rank of the Matrix (of Vector rows) is germane.

@Carl Love It is quite standard (not just in Maple) to use svd to determine the rank of a floating-point Matrix. There are some rank-revealing qr decompositions, but svd is quite robust. The corner cases can be difficult.

Thanks for exapanding on the mutability thing. (It's been discussed on this site many times before. I'd guess that Alejandro has some reference links at his fingertips...)

First 342 343 344 345 346 347 348 Last Page 344 of 599