MaplePrimes Commons General Technical Discussions

The primary forum for technical discussions.

The goal here is to produce plots for inclusion inside Worksheets or Documents of the Standard GUI at specific sizes.

[update: Maple 18 has this as a new feature for 2D plots. See the `size` option described on ?plot,options]

When manually resizing an existing plot, using the mouse pointer, there is no visual cue as to what pixel size has been attained. Hence any worksheet author who wishes to produce a plot of size 600x600 is presented with two barriers. The first is that resizing must be done manually, and the second is that there is no convenient mechanism showing the actual size attained.

The `Resize` package attempts to address these barriers by allowing construction of a plot, inside a worksheet, with programmatically specified width and height in pixels.

The default behaviour of the package is to produce the plot inside a new Worksheet, from whence it may be selected and copied. An optional behaviour is to show the constructed plot inside a Task Template (a form of help-page), where it may be previewed for correctness and inserted into the current Worksheet or Document at the press of a single button.

It appears to function for both 2D and 3D single plots.

It won't work for so-called Array plots, which are collections of multiple plots displayed side-by-side inside a worksheet table.

This first version is a bit rough. The plot is currently being inserted as input, which is why it isn't centered on the page. I suspect that it would be best to insert the first argument (eg. a `plot` call) as input to an execution group, and then have the plot be the output. That would look, and hopefully act, just as usual. And with the plot call inserted as input, the original `Resize` call could be neatly deleted if desired.

To install this thing, use the File->Open from the Standard GUI's menubar. Choose this .mla file as the thing to open. (You may have to slide a scrollbar, and select a view of "All Files", in order to see it in the pop-up File Manager.) Double-clicking on the file, to launch it, should ideally also open it but it looks like that functionality broke for Maple 15.

Resize_installer.mla

Alternatively, you could run the command,

march( 'open', "...full...path...to...Resize_installer.mla");

The attached .mla archive is a (graphically) self-unpacking installer, when opened in this way.

The bundled materials include a pre_built .mla containing the package itself, the source code and a worksheet that rebuilds it from source if desired, a short example worksheet, and a worksheet that rebuilds the whole installer (and re-bundles all those files into it). I used the `InstallerBuilder` to make the self-unpacking .mla installer, as I think it's a handy tool that is under-appreciated (and, alas, under documented!).

It's supposed to work without the usual hassle of having to set `libname`. This is an automatic consequence of the place in which it gets installed.

It seems to work in Maple 12, 14, and 15, on Windows 7. Let me know if you have problems with it.

acer

I have remarked on this ever since the launch of the second incarnation of mapleprimes. And I recall others expressing similar feelings.

  1. It should be possible to "vote" for comments in the same way as we can vote for "answers".
  2. The comments should be listed, right there next to Answers:

 

The MRB constant =    sum((-1)^n*(n^(1/n)-1), n = 1 .. infinity)

 

Concerning the following divergent and convergent series, we see that

sum((-1)^n*(n^(1/n)-x), n = 1 .. infinity)=

And so with this provocative title, "pushing dsolve to its limits" I want to share some difficulties I've been having in doing just that. I'm looking at a dynamic system of 3 ODEs. The system has a continuum of stationary points along a line. For each point on the line, there exist a stable (center) manifold, also a line, such that the point may be approached from both directions. However, simulating the converging trajectory has proven difficult.

I have simulated as...

I am on maple 12 and this is not working.

 

My programming skills are very limitied but now that I see roughly how to do this (thanks to everyone on here) I can try and tweak it in roder to make it work.

 

As for the sequence...it isnt as nice as it looks, the pattern doesnt continue.

It may be of interest to this community that the original Maple Project at the University of Waterloo was awarded the ACM SIGSAM Richard Dimick Jenks Memorial Prize in June, at the joint ISSAC/SNC 2011 conference (overlap with FCRC 2011).

See here for the announcement.

MapleSim has been delivering unique advantages in physical modeling and system simulation for many years. Today we release the latest iteration: MapleSim 5. Looking back at some of the earlier versions of our software, it is hard to believe that this is the same product; from the user interface to the component libraries to the simulation engine, every part of the system has experienced a striking evolution.

Like its predecessors, MapleSim 5 is based on the Maple mathematical...

The order of 1 in any finite field (that I tried) created by GF is NULL. For example,

F:=GF(3,2):
use F in order(one) end;

It should be 1.

Alec

 

Here is the progress made in the investigation of what I call the convergents constants:
https://oeis.org/wiki/Table_of_convergents_constants

I wonder if anyone would be interested in adding anything to it. I would like to see the convergents constants studied some in Maple to compare with my Mathematica results; my investigation is in dire need of some proof other than my...

A problem with convert,StandardFunctions

 

P := hypergeom([-k,1/2-k],[-2*k],1-z^2);

(1)

convert(P,StandardFunctions);
P1a:=subs(k=1,%);

 

(2)

P1:=subs(k=1,P);

(3)

plot({P1,P1a},z=-1..1,0..2);

 

convert(P,StandardFunctions) assuming k::posint;

(4)

 

 

Download hyp.mw

 

Hello all,

I've noticed that something has changed to the type of sqrt in Maple 15, which breaks backward compatibility...

In Maple 14, we have

> type(sqrt,procedure);          true
> type(sqrt,`module`); false
> eval(sqrt);          proc(x::algebraic, f::identical(symbolic))  ...  end proc

while in Maple 15, we have

> type(sqrt,procedure);          false
> type(sqrt,`module`); true

Although the source is very old (Maple 6) the topic is interesting.  Should one come across the webpage Analysis and Synthesis of digital sound samples with Maple 6 located here http://www.maplesoft.com/applications/view.aspx?SID=3940&view=html they may have a dissapointing maple browsing experience when 3 of the links they try to access are broken and not available.  

Inside a procedure, local variables are evaluated only one level. Of what good is this, one might ask?

Well, for one thing it allows you to do checks or manipulations of an unevaluated function call without having that function call be evaluated over again. I mean, for function calls to routines which don't happen to remember earlier results.

This is a revision of an Answer

There have been some recent posts about interpolating data.

Attached below is a worksheet that shows some possibilities, with the functionality centering on the CurveFitting:-ArrayInterpolation command.

This is quick summary of parts of a broader document which covers both 2-d and 3-d methods (for regular grids), where I've left out the higher-efficiency methods and instead roughed in some examples involving integration and differentiation.

I've elected not to follow the 3-d Example from the ArrayInterpolation command's help-page, although using a pre-formed grid is a very fast approach to obtain just an interpolated 3-d plot. I also prefer to use the plots:-surfdata command rather than the plots:-matrixplot command, since the former let's one get the axes' tickmarks correct for the x- and y-data ranges.

The scenario is that you have a grid of data points in two dimensions (x- and y, or P- and T-, or what have you).

For each point (ie, for each 2-d pair of values) you have an associated value (or height in z, say). Hence you actually have data points in 3-d space.

How you obtained the associated (z) values depends on your own particular data collection method, or your own program. How you got the data is irrelevant here. What matters is that you have the finite number of data values, and no other easy way to generate data values at more points (let alone data for arbitrary new points). Below, we'll just create the data (once, at the start) for this example using an entirely made-up formula.

The presumption is that you might wish to plot a smooth surface that connects the 3-d data.

But you might also wish to write some program which requires interpolated (z) values at some new (x,y) 2-d points.  And you do not yet know what these 2-d point pairs are. So a pre-formed Array of points  at which to interpolate may not suffice.

Instead of using a pre-formed Array of output points, we'll contruct a procedure named `B` which can be supplied with a new (x,y) 2-d output point and (if that point lies within the original range) return an interpolated (z) value.

This procedure `B` can also be plotted, using the usual `plot3d` comamnd. It won't plot quite as fast as would a pre-computed and pre-interpolated finer grid of (x,y) values, but it should plot nicely. And the surface can be made quite smooth, by merely increasing the number of plotted points using plot3d's usual numpoints option. (Maple does not currently do "adaptive" 3-d plotting, so there's also no advantage in that respect.) But `B` does solve the secondary task, of being able to compute for any subsequent (x,y) point.

We can even integrate and differentiate `B` numerically. Of course we should keep in mind that this is somewhat error prone, since on top of usual issues with numerical differentiation there is also fact that we make the choice of interpolation method! The entire interpolated surface will differ considerably according to whether a spline, cubic (or other) interpolating scheme is chosen!

We'll use P and T as the x- and y- grid points, below, since "a name is just a name" and our choice of variables is arbitarary.

plot_interp.mw

First 15 16 17 18 19 20 21 Last Page 17 of 80