acer

17438 Reputation

29 Badges

14 years, 148 days

On google groups. (comp.soft-sys.math.maple and sci.math.symbolic)

On stackoverflow.

On math.stackexchange.com.

MaplePrimes Activity


These are replies submitted by acer

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  ?

@brian bovril You were having difficulty using the with command. In the 10th bullet point in the Description of the Help page for the with command, it says this:

Some package export names are identical to top-level names with
a global meaning. In addition, two or more packages may export
some of the same names. Provided that a package whose exports
have been bound by using the with command is implemented as a
module, global names are still fully accessible. To access the
global name foo after having bound a package that exports the
name foo, use the prefix form of the 
                              ":-"
 operator, as in  
                            ":-foo"
 .

That pertains to your difficulty in utilizing with on the Calendar package following loading the Finance package which has an export of the same name. But it would be better with an illustrative example.

Also, the 3rd bullet point on the with Help page states this:

The with command is effective only at the top level, and intended
primarily for interactive use. Because with operates by using
lexical scoping, it does not work inside the bodies of procedures,
module definitions, or within statements. See the Examples section.

That relates to your original difficulty in this Question thread. Unfortunately the Example section only shows how not to utilize with in a procedure. And it lacks a correction to utilize use or uses, and has a cross-reference only to the former.

Neither the User Manual (eg. Section 1.5 Commands) nor the Programming Guide (Names?) explains the :- colon-dash syntax well. The Help page for with does also have a cross-reference to the colondash Help page.

I will submit some bug reports against the documentation, for better examples, etc.

The Explore command may offer you a convenient way to study the effects of the parameters (including the possibility of splitting K and Q into real and imaginary components as additional variables or parameters).

But it might help if you could tell us whether you'd prefer 2D plots (including implicit plots in some cases), or 3D plots, or 3D plots with some parameter information encapsulated by color shading, etc.

@sand15 Yes, I see, thanks.

Somebody else clearly thought that this kind of thing was a good idea, since there is a command
   Student:-Statistics:-ExploreRV

But that command doesn't allow one to pass in parameter ranges at all, and only admits them via a Maplet pop-up. (It does offer some handy check-boxes for disabling individual plots on the fly, which might something be expensive.)

I won't pretend to know what might be a better way to get the parameter range details into the App. I was really just imagining how to avoid the reliance on global name x, which is likely over-severe since the Explore parameters already have to be accessed globally.

A tip: when I'm experimenting with an Explore on a complicated mechanism (such as an appliable module, or something where an error may cause problems) I first ensure that the embedded Sliders have the continuous-action Property toggled off (right-click on them, say). That helps prevent an avalanche of popup error boxes if there's a problem when I try and slide far the first tiem. I also Save the sheet before each run.

Best regards.

@brian bovril Since Calendar is both a submodule of Finance as well as a top-level package (in Maple 2019) then you'll have to account for that if you intend on loading both.

restart;

kernelopts(version);

`Maple 2019.1, X86 64 LINUX, May 21 2019, Build ID 1399874`

with(Finance):

DayCount("13/1/2019","1/1/2019");

-12

with(:-Calendar):

DateDifference(Date(2019,1,13),Date(2019,1,1),units=day);

-12*Units:-Unit(d)

convert(%,unit_free);

-12

 

Download datediff.mw

The with command brings some quick and easy convenience for off-the-cuff coding. But it's not the best tool for programming.

@Christopher2222 Sure, the (now deprecated) font tag is limited. But that's not specific to this use of it in Maple. I figured that you'd just research whatever HTML aspects you'd want to try.

Here is another variant on using the font-size style property.

SetProperty("Button0", ':-caption',
            "<html><p style=\"font-size:20px\">foo</p></html>",
            ':-refresh');
4 5 6 7 8 9 10 Last Page 6 of 400