acer

32333 Reputation

29 Badges

19 years, 323 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@arashghgood Yes, I was able to produce a number of plots.

But I'm going to wait until you answer all my queries for specific details thoroughly and properly.

@Carl Love In some cases Optimization can automatically differentiate a procedure form of the objective. I suspect that might work for your example above, say if the userinfo is replaced by a suitable printf call.

Or, perhaps, if the order of objective calls is not required then one might use a remember table on the objective procedure.

Or the corresponding gradient procedure could be supplied explicitly to the Minimize command.

The above are a few ways in which one might show (or possibly retain) the objective evaluations which are not used merely for numeric approximation of the gradient derivatives.

 

What kind of optimization problem are you doing?

The concept of "iteration" depends on the method.

Do you want to see the result attained for each "major iteration" step (whatever that might mean), or each and every functional evaluation?

Note also that some methods might attempt to approximate derivatives or bounds numerically (which requires functional evaluations of the original objective).

If you want to record or see each and every functional evaluation of the objective then you could construct an objective procedure which does that.

I forgot to mention that the second and first approaches which I described above (which have since been shown explicitly in the Answers of vv and Kitonum) were also possible ten years ago. In fact such functionality has been possible for much longer than that.

The OP has not included any direct link to the earlier Question thread, which so helpful; that does not allow us to tell how much general functionality was wanted earlier. The present example's formulation can be easily (manually) solved for variable end-points or recast in polar form, etc, but that it not the case for more general problems of this type.

I know three ways to get a reasonably smooth surface without having ramp up the grid resolution (so high that GUI responsiveness to rotation becomes very sluggish).

One is to use polar coordinates (and parametric calling sequence). That's not possible and easy for all examples.

Another is to use formulaic boundaries for the end points of one of the variable's range. This requires that the domain is convex in one direction.

Another way is to write code that adapts the points in a MESH plotting structure to the boundary at which the surface formula   becomes nonreal. (I have a few schemes that implement this...)

I'll write more later, when I have better than a cellphone.

[While I was typing this the member `vv` has given an Answer with the second approach I've mentioned.]

Note that none of these will do the task of figuring out the calling sequence (of the plot3d command) from a set of inequalities, in the way that Mma command does.

I agree with vv, that the matter of obtaining a target accuracy is key here. In my opinion it is the central distinction between the models of numeric computation of Maple and Mathematica.

I was shying off this conversation until now because I'm on holiday, and because the focus was more on the easier issue of final rounding( and/or significant figures).

I have previously (three separate times) implemented a mechanism as vv describes, using shake and evalr. Naturally such approaches will always be slower than necessary because they are not kernel builtin.

The question of how to specify the "known" accuracy/precision of all numeric inputs is another detail.

In at least one of my implementations I made my `feval` procedure have special evaluation rules, and also to emulate 2-argument eval (substitution).

Naturally, these mechanisms hinged on evalr estimate the error and then recompute. Estimating the working precision to obtain a target accuracy -- with no duplicated effort -- I call the inverse interval computation, and is more involved.

@Carl Love You seem to be mixing up hyperthreading with multithreading.

His machine has 4 physical cores, with 8 virtual cores if hyperthreading is enabled.

Any ratio greater than 1 shows an improvement due to *multithreading*.

A ratio greater than 4 would show an improvement that could be ascribed to *hyperthreading*, on his machine. (Tom's machine showed it. The OP's did not. Their chipsets both have a similar number of physical and virtual cores.)

It's true that we do not know whether the hosts were otherwise idle, or even whether the OP has hyperthreading enabled. But it seems doubtful that he would post all this and not have that set.

@Scot Gould I don't recall. (There have also been several posts on here - over the years - about `frem` functionality. It might be searchable on this site.)

Upload your Document as an attachment here, using the green up-arrow in the Mapleprimes editor.

This will allow us to detect what's going on with your context-menu execution, amongst other things.

Making us guess, by attaching merely an inlined image, is not helpful.

@mmcdara 

with(DocumentTools):
with(DocumentTools:-Layout):
F:=Font("Normal", size=12, color=blue, style=:-Hyperlink):
H:=DocumentTools:-Layout:-Hyperlink(F,linktarget="Help:Statistics,Distributions,Normal"):
InsertContent(Worksheet(Group(Input(Textfield("Here is line to the ",H," help page."))))):

You might also reduce the up-front memory allocation by using Explore to display it frame by frame. It is also ready to play almost immediately, as opposed to waiting for a minute or two for the whole sequence of frames to be created. And you can also increase the number of frames.

(On my machine the creation of each frame on the fly is fast enough that the animation still seems smooth with the call below. The speed at which it plays will depend on how fast each frame is computed on the fly.)

For example, replace the final plots:-display call with something like,

   Explore(frame(t), t=0.0..tmax, animate, size=[750,200], numframes=125);

Another variant, for amusement, might be

for ii from 0.0 to 40.0 by 0.25 do
  DocumentTools:-Tabulate([plots:-display(frame(ii), size=[750,200])]):
end do:

Both of those also allow for storing the frames as they are created (Explore has an option for it), so that following the first run the stored frames could be played like a regular animation using insequence.

@Kitonum Yes, thanks. I had deliberately separated them to show the output of how the first had worked.

Do you really not understand why using subtle spacing difference for separation (and to remove ambiguity of meaning) is much, much inferior to using brackets, as input for an automated visual parsing of the mathematical expression?

Post your followup details on this here, instead of in a separate Question.

Do you intend  ln(x*BesselJ(1,x))/x  or  ln(x)*BesselJ(1,x)/x  ?

First 194 195 196 197 198 199 200 Last Page 196 of 591