acer

32822 Reputation

29 Badges

20 years, 133 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Couldn't you coordinate with your fellow student so that you only ask any of your coursework questions onlt once?

See here for the duplicate of this one.

This is not the first time you've both asked the same question.

 

@radaar 

Your problems seem to be more about how to use a Linux commandline terminal for text-driven applications in general, not just Maple. Perhaps you'd be better off learning first how to use commandline Linux, rather than focusing on Maple.

None of this is especially related to data science. That's a pretty big area. Why can't you be more specific?

@radaar If you follow that terminal command with an ampersand then the Linux terminal shell's command prompt should once again be available. So you can run more than one such job in the same terminal.  Eg,

./maple filename1 > output1.txt &

./maple filename2 > output2.txt &

./maple filename3 > output3.txt &

If your calculations involve many internal garbage collections then the output file may contain extra lines like this:

memory used=27.5MB, alloc=107.3MB, time=0.42
memory used=1089.1MB, alloc=208.3MB, time=11.58
memory used=1285.5MB, alloc=216.5MB, time=13.42

If you find those unhelpful then you can suppress that by beginning the input files with the Maple command,

kernelopts(printbytes=false):

Even while the computations are running you can see the output in several ways. Eg, try one of these,

cat output1.txt

tail -20 output1.txt

more output1.txt

You don't have to be in the same directory as the maple script in order to run it. Simply call it using its fullly qualified location (as I suggested in my Answer), wherever that may be.

It's not a good idea to output those files to the same directory in which Maple's executables reside. Better would be to redirect to a file under your home directory. Eg, notice the tilde here,

./maple filename1 > ~/output1.txt &

That would create the output files under your home directory (whose name I do not know, but something like /home/radaar  or what have you).

You should probably read up on the basics on Linux terminal shell commands. You may find top , ps , and kill worth learning.

@radaar Only you can tell us the location of your Maple installation.

@Carl Love Thanks, Carl.

I'm going to try again to push for contourplot and listcontplot to get augmented with most of the useful functionality we've discussed. (I've submitted several requests, and now I may have to send some reminders. Plotting is so important!)

I think that it's important to offer the following bits of functionality, preferably within one single command such as plots:-contourplot. I'd like it if attaining the variants didn't require users' having to strip out CURVES with subsindets or any other fancy techniques.

1) One related thing I've noticed with contourplot is that the filled regions' boundaries can really benefit visually from a boundary curve, so that the edges don't appear jagged. Some people want black or other monochromatic contour curves between shaded regions. But some people might want the boundaries to simply match one neighboring region along the boundary. Both could be readily available.

2) Some people will prefer a smooth gradient, as densityplot supplies. And some might prefer discretely shaded regions such as are shown in the Answer above.

3) The colorscheme option would allow for more control of the variation in the contours and the shaded regions, as shown above.

4) I'd like to see legends on 2D contour plots, with the same flexibility as the hover-over contour labels have. (And why not legends for 3D curves or surfaces that have a single color or style? That could be useful for 3D contour plots.)

I'll leave aside color-bars for now, as constructing them for all manner of custom colorings and shading schemes, for both 3D and 2D, can get quite involved. (There are many relevent posts that could be linked for this. But also, this is relevent to more than just contour plots.)

I'm torn about inlined text labels on contour lines. This post shows that it can look very impressive, and it's a popular request. But I suspect that the ideal solution is to have the contour values be stored (like the hover-over values) in a new substructure on the CURVES. That way the GUI could, dynamically, both place and render them best, as plots are zoomed or magnified. And those aspects can be trickier still if gaps in the curves are desired for spots for the text labels.

And of course there may be things to fix. I've reported the following densityplot flip more than once (it was fixed only for colorscheme, but not for colorstyle).

plots:-densityplot(x,x=0..1,y=0..1,colorstyle=HUE,style=surface);
plots:-densityplot(x,x=0..1,y=0..1,colorstyle=HUE,style=surface,restricttoranges);

And I'm not sure why the following currently shades the same way as "ygradient" (it's shaded by z-value in Maple 18.02),

L:=[seq([i,1,evalf(sin(Pi*i))],i=0.0..1.0,0.05)]:
plots:-pointplot3d(A, symbolsize=20, symbol=solidsphere,
                   colorscheme=["zgradient",["Red","Yellow","Blue"]],
                   labels=[x,y,z], orientation=[-1,90,-1]);

 

@phiost And you're not going to mention which version you're using?!

Also, do you want hue apread such as in a rainbow, or the ability to get exactly that one given colorscheme, or the ability to match any colorscheme, or...?

I edited my Answer to work in versions back to Maple 18.02. (I only tested the latest point-release for each major version. There is some funny business in changes to the color Arrays generated, and your mileage may vary with other point-releases...)

@phiost But you have only mentioned that you want a 2D plot. You have left other important details unspecified.

note: I should add that I submitted a Software Change Request two years ago for the plots:-contourplot command to offer the full colorscheme functionality. (I also submitted a few other suggestions related to coloring and contourplot and listcontplot . They have not yet been implemented.)

You have posted what, now, three or four Questions about either colored contour plots and/or paremetric or implicit plots of a certain system? It is counter-productive and unhelpful to not state what you really want up front.

In this last question you don't even bother to tell us whether you want a 2D or 3D result, what or how many contour values, whether it should allow for `filledregions`, and whether you intend on apply some technique to an explicit expression as above or some other parametric or implicit plot.

I don't necessarily have the spare time to try and produce what you want in many separate steps. If you update this Question with a Comment that contains what you're really after, as the final kind of plotting result, then I may find spare time to provide an answer.

@phiost Your transformation is producing floats with 0.0*I artefacts.

You could have discovered this by trying it out for a few values. Eg,

evalf( eval([x,t],[X=-2,t=4]) );
                    [2.805755396 + 0. I, 4.]

You could try this,

P2D1 :=plots:-display(
  plottools:-transform((a,b)->eval([Re(evalf(x)),t],[X=a,t=b]))(Pft),
  labels=["x","t"]
);

phiost_2.mw

@saemi123 Why didn't you provide your example when you first asked the Question!?!?

More importantly what you show is ambiguous 2D Input. Either upload the example in an attached .mw worksheet or show it as unambiguous 1D plaintext code.

ps. you might just utilize yhe `unapply` command to define X, instead of that ambiguous 2D Input assignment.

@phiost Yes.

Suppose you have any 2D plot assigned to the name P.

Then the following will turn it into a 3D plot in the level plane z=17. (And of course you can use z=-1 or any other value for z.)

plottools:-transform((x,y)->[x,y,17])(P);

And you can use plots:-display to combine multiple 3D plots.

Here is a zip file of a .mw file example,  contour_labels_transformed_B.zip . It creates all the plots below. If you want some other variant on these effects then please just describe it in full detail.

The first plot below has the contour labels at the same z-value as the level curves, which are placed slightly above the level surface. The text is hard to see unless the surface has a transparency, but that make it look washed out compared to the 3D surface above it. The 3D surface doesn't have the contour-lines style that the other two plots below have, but that can be changed.

And here it is in 3D without the contour labels.

It seems that for 3D a better effect can be obtained by raising the contour labels (text) above both the level curves and the corresponding level surface.I think this looks best, although you might experiment with a color other than red for the text (contour labels).

The plots:-shadebetween command was introduced in Maple 2015 and not Maple 15 (released 2011), and so will not be present in Maple 18 (released 2014).

The naming scheme changed in the year 2015, with versions since then named according to the year in which they were released.

Try this attachment in your Maple 18 ,

between_18.mw

 

Since not everyone has an updated Physics package that can handle this example could you please show the result of applying lprint to sol?

I suspect that sol is a call something like `&where(foo, bar) and if so then you should be able to evaluate (or otherwise substitute) the equations in bar into the expression foo.

And while evalf(Int(..., n=1..infinity)) can sometimes be handled numerically, if may not always converge fast enough. In that case you could make a very targeted substitution of a number for infinity using subsindets which would be safer than a blanket substitution.

@nm I suspect that Joe intended an effect something more like that of the following:

if op([5,1],ToInert(eval(`latex/int`)))
     = _Inert_IF(_Inert_CONDPAIR(
                  _Inert_INEQUAT(_Inert_NARGS(),_Inert_INTPOS(2)),
                   _Inert_STATSEQ(_Inert_ERROR(_Inert_STRING("invalid arguments"))))) then
  `latex/int`:=FromInert(subsop([5,1]=NULL,ToInert(eval(`latex/int`))));
end if:

Did you consider that the plot of Im(z) versus s might depend on Re(z)?

First 222 223 224 225 226 227 228 Last Page 224 of 601