acer

32333 Reputation

29 Badges

19 years, 319 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@greatpet Perhaps some of the following might help with organization.

If you're open to using plaintext files, then you can keep each module local procedure's definition in its own text file. You can then use the $include directive to source those from a (now shorter) module definition.

You can even use a directory structure to mimic the code layout, if your modules have submodules, etc.

(If your projects are advanced you can even get busy with the $define and related directives, for source aliasing and conditional source loading and so on. If you're used to such things in C then you might find it convenient.)

It sounds as if this might suited for contacting Maplesoft's Technical Support.

They'll likely want to know your Operating System details, and whether you have a Language setting (other that English), using a Maple language pack, etc.

@anthonyfl Sorry, but I am not sure that I understand why planes are better than lines, for a 3D contour plot to look like a 2D contour plot.

If you have some other orientation or detail in mind then please be specific.

(If desired, the x-axis tickmarks could be specified to lie at exactly the same values for the 2D plots and the 3D plots.)

P1 := plots:-contourplot(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
                         thickness=2,
                         xtickmarks=piticks,
                         coloring=["Orange","Blue"],
                         labels=[``,``], axes=boxed, size=[300,300]):
P2 := plot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
             style=contour,
             thickness=2,
             orientation=[-90,0,0],
             colorscheme=["zgradient",["Orange","Blue"]],
             labels=[``,``,``], axes=boxed):
P3 := plots:-contourplot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
                           thickness=2,
                           orientation=[-90,0,0],
                           colorscheme=["zgradient",["Orange","Blue"]],
                           labels=[``,``,``], axes=boxed):

P1; P2; P3;

P4 := plots:-contourplot(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
                         thickness=1, filled,
                         xtickmarks=piticks,
                         coloring=["Orange","Blue"],
                         labels=[``,``], axes=boxed, size=[300,300]):
P5 := plot3d(sin(x)*y^2, x=-Pi..Pi, y=-1..1,
             style=surfacecontour,
             thickness=3, lightmodel=none,
             orientation=[-90,0,0],
             colorscheme=["zgradient",["Orange","Blue"]],
             labels=[``,``,``], axes=boxed):

P4; P5;

 



contours_2D_3D.mw

@anthonyfl If you plot a 3D surface then the surface can have contour lines. Are you asking how to get level sufaces (planes) instead of (or as well as) contour lines?

You should ask that in a separate Question, I think.

Do you want a re-usable procedure for it?

I can think of a few reasonably straightforward ways to accomplish that (and I'm sure that others can too). I expect you'd get a reasonable answer quickly.

Be sure to specify how much functionality you need. Do you need to be able to specify the degree of transparency, gray/color shading, and style easily for the planes? Does it need to support specifying those separately for each level surface, or can they be all the same? Etc.

@anthonyfl I did not notice earlier for which version your Question might have been tagged.

The support for contourvalue in the legend option is new for Maple 2020. That functionality was not present in Maple 2019.

Here is a link to the "What's New" pages for Maple 2020 which mentions this functionality.

Note that there are no examples such as you showed in the Maple 2019 Help page for Topic contourplot.

Here is that example, working in Maple 2020.1, with the spelling of typeset corrected (which is necessary). I changed from default coloring to make the contours more visually distinguishable to me.

with(plots)

contourplot(4*x^2+9*y^2, x = -10 .. 10, y = -10 .. 10, coloring = ["Orange", "Blue"], legend = typeset("the circle", 4*x^2+9*y^2, "=", contourvalue))

 

Download contourvalue.mw

 

If you really need this kind of functionality in Maple 2019 then you could try the rough code I put in this old Post.

@rlopez That works if the focus was already on an Execution Group.

But simply typing the Enter or Return key is not enough for my Maple 18 or Maple 2020.1, Linux, if the pointer focus is inside a Text paragraph within the Section, or on its title as Text, or within a Document Block (paragraph) of a Document. In those cases I can still use the main menubar's item. For example, following selection of the whole Section, in Maple 18 I can still use Edit->Execute-Selection from the menubar.

It seems that the pointer focus has to be within an Execution Group, for Enter or Return to cause execution of all the whole selected Section.

In modern Maple versions (eg. Maple 2020.1) Ctl-= works for me in all cases I've tried (following selection of the whole Section, naturally). Unfortunately, there is no such keystroke acceleration in my Maple 18.

It's usually a good idea to upload and attach your Worksheet/Document, if you have already tried something and obtained a suprising or undesired result. That way we can pinpoint the problem and, hopefully, explain it better.

@Yiannis Galidakis Sorry, I had forgotten that you were using Maple 18.

In that version the plots:-conformal command expects a list of two colors in order to override both its default colors.

Here is an adjustment, for Maple 18.

conformalfun_Maple1802.mw

You can of course adjust the way the hue is set. I used complex argument, via the arctan command, and you could compare with the coloring scheme on that 3rd party site.

It would also be straightforward to adjust the intensity component of the "HSV" Color call, say by the taking complex modulus of the value via the abs command.

It is not clear to me what you are trying to ask.

Could you upload a text file of the comma-separated data, and a .mw worksheet that contains your failed attempt(s)?

@dianam8 Show us what you've achieved so far, and tell us explicitly how you'd like to continue and what you hope to achieve.

You can use the green up-arrow in the Mapleprimes editor to upload a .mw worksheet, and attach it to a Reply.

Perhaps it's time to program efffectively with procedures.

It's probably much easier to call a Maple command to compute the y-value for exactly x=2, than it is to use something as crude as a point-probe.

Show us your example.

I was talking only about dense, hardware float[8] linear algebra, called properly.

Sparse linear algebra is another story. If you want to ask a specific question you should branch it off this thread.

@itsme I having been doing performance testing of the key computations of dense numeric Linear Algebra, Mma vs Maple, for years, on multicore hardware.  I have also used (close) revisions of the scripts for it obtained from the Wolfram site mentioned. For datatype=float[8] Matrices, properly done, I consistently see almost no significant difference between the products across a wide range of sizes, getting both to their MKL as fast as reasonably possible. I have found this to hold, for 64bit Linux/OSX/Windows, since at least Maple 2015. 

The results cited by that Wolfram document (which is usually revised yearly), reports slower timings than I obtain, often by a factor of about 3-4, each year.  I suspect the discrepency  is due to incompetence at best, disingenuousness at worst. The performance factor discrepency (between what they claim and what I see) is usually off by an amount similar to the gain I see due to parallelism -- I try a few different quad-core CPUs on each of the three named platforms.

Perhaps they have found some CPU for which the parallel MKL isn't kicking in properly. But for hardware float[8] LU decomposition, linear solving, symmetric and nonsymmetric eigensolving, svd , QR decomposition, matrix multiplucation done *properly*, I almost always see a very close match.

@manon22lr Ok, thanks for the definition of tensdBe.

You wrote, "I tried something with "proc", I found on Maple Help Page." And you define Be11Num as a procedure.

But you misuse it, since you only use Be11Num as a parameter(!) name in the fitted objective. And even if Be11Num were to be called with values it is not written to call ode_sol at all. So the ODE parameter values are not being altered, and the Be11 values from the numeric ODE solution are not being used. So this needs rewriting.

You need objective PK to depend on ODE parameters a and eta, by virtue or their explicit presence in the PK expression. You need PK to contain calls to Be11Num as a function of a, eta, and t, and you need those calls to return unevaluated if its arguments are not numeric. It's a moderately advanced Maple programming task.

I already have a revision that does the above. And it can be done in such a way that (internally stored) dsolve,numeric structures/info are not thrown away each time the ODE parameters a and eta get set (ie. when re-set to the very same previous values).

And it can be used with (local optimization) NonlinearFit command or the routines from the (global optimization) DirectSearch package.

But it would be much better if you could state reasonable numeric ranges for the parameters, especially a and eta.

First 156 157 158 159 160 161 162 Last Page 158 of 591