## 17073 Reputation

14 years, 74 days

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

On stackoverflow.

On math.stackexchange.com.

## axis bars, or tickmarks?...

Are you asking for axis labels and axis bars but with no axis tickmarks?

Or are you asking for axis labels with neither axis tickmarks nor axis bars? That is not possible in the strict sense, since the labels are part of the axes (as a whole, to the GUI renderer) and there is no syntax for omitting only the axis bars.

While you may not be able to get rid of the axis bars themselves while retaining axis labels, but you can make the axis bars thin and white and less apparent under no light model.

Persoanlly I don't see much point to having axis labels without any axis bars, since visually it's unclear where they lie spatially, upon rotation. Without the axis bars there's little visual cue (apart from what the surface might convey...)

 > restart;
 > plot3d(sin(x)*y, x = -2*Pi .. 2*Pi, y = -2*Pi .. 2*Pi,        axis=[tickmarks=[],location=low],        axes=normal, lightmodel=none,        labels=[X,Y,Z]);

 > plot3d(sin(x)*y, x = -2*Pi .. 2*Pi, y = -2*Pi .. 2*Pi,        axis=[color=white, thickness=0.001, tickmarks=[],location=low],        axes=normal, lightmodel=none,        labels=[`#mi("X",mathcolor="black")`,                `#mi("Y",mathcolor="black")`,                `#mi("Z",mathcolor="black")`]);

 >

Alternatively you could give up on axis labels and get rid of the axes bars altogether. But if you instead utilize textplot to mimic labels then they won't always jump to the fore (as axis labels do) upon rotation. I haven't shown this.

## how...

Below I am talking about the dimensions of the inlined plotting window in which the plot appears (who's borders one can drag manually with the mouse pointer, to resize).

In unmodified Maple 2019 and earlier it cannot be done using the size option directly (in 3d plotting commands).

But it can be applied to the plot after the fact. For example,

```restart;
setsize:=proc(P,sz::[posint,posint])
op(0,P)(remove(type,[op(P)],'specfunc(ROOT)')[],
ROOT(BOUNDS_X(0),BOUNDS_Y(0),
BOUNDS_WIDTH(sz[1]),BOUNDS_HEIGHT(sz[2])));
end proc:

foo := plot3d(cos(x/10+y/10));

setsize(foo, [600,600]);
```

Is that good enough? An alternatve is a code snippet that could go in your personal initialization file, the effect of which is that the option size might be used directly from within plot3d, plots:-display for 3d plot, etc. (I recently figured a small number of modifications that might allow this...)

 Another variant on the above code snippet might be,

```setsize:=proc(P,sz::[posint,posint])
op(0,P)(op(subsindets(P,'specfunc(ROOT)',()->NULL)),
ROOT(BOUNDS_X(0),BOUNDS_Y(0),
BOUNDS_WIDTH(sz[1]),BOUNDS_HEIGHT(sz[2])));
end proc:
```

One could also qualify the parameter P of that procedure with a type, eg. specfunc({PLOT,PLOT3D,_PLOTARRAY})

## simple clock...

You won't be able to do another computation in this same worksheet while this clock code is running.

 > restart;

The code utilizes this functionality from Maple 2019.

 > Calendar:-Format(Calendar:-Today(),"hh:mm:ss a");

First execute this code. (Or stick it in the Startup Code region, or whatever.)

 > Start:=proc()   local status,T;   uses DocumentTools;   status:=parse(GetProperty("StartStop",value));   if status=false then     SetProperty("StartStop",':-caption',"start",':-refresh');     return;   elif status = true then     while parse(GetProperty("StartStop",value))=true do       Threads:-Sleep(1.0);       T := Calendar:-Format(Calendar:-Today(),"hh:mm:ss a");       SetProperty("StartStop",':-caption',T,':-refresh');     end do:   end if; end proc:
 >

Click on the Button to start the clock. Click on it again to stop it.

 >
 >

## eval...

Use the so-called 2-argument calling sequence of the eval command.

The purpose of that functionality is to allow you to evaluate a formula (in your case, simply L) at the values denoted by the equations.

```eq := L = 2/3:
eval(L, eq);

2/3

eqs := {L = 2/3, x1=blah, x2=foo, x3=bar}):
eval(L, eqs);

2/3

eval(x1, eqs);
blah

eval([L,x1,x2,x3], eqs);

[2/3, blah, foo, bar]

eval((L+x1)/x2, eqs);

2/3 + blah
----------
foo
```

This is a common programmatic operation and, as you've noted, an important one.

This is superior to calling assign on eqs (which assigns the values to the names but prevents immediate, subsequent use of those names as unassigned parameters unless you subsequently unassign them).

This use of eval is also superior to picking off the right-hand side of any of the equations in a set by its position (which can change if you choose different names for the variables). Ie,

```op(1,eqs);

L = 2/3
rhs(op(1,eqs));

2/3
```

## images on surfaces...

You can plot a surface with an image on it, which is the closest to "texture mapping" for Maple of which I'm aware.

In recent versions you can, for example, use the image option on a plotting call like plot3d.

In some versions for which the image option is not yet available, you can do this sort of thing manually. (The implementation in that old Post are very similar to what the image option does, in essence. There are several links there to yet more old Posts, on related topics. The newer colorscheme option's implementation is also related.)

I do not know the specifics of how the Standard GUI renders plots (jogl, opengl, etc) so I cannot state specifics about "texture mapping" technically.

(As an example, this site had this recent post on the image option.)

## one way...

Your problematic example with discont was fixed in Maple 2018.0.

 > restart;
 > kernelopts(version);

 > f := x -> piecewise(x>10,undefined,x):
 > plots:-polarplot(f(3/(1-1.5*sin(theta))),                  coordinateview = [0 .. 10, 0 .. 2*Pi]);

 >

## yes...

These are both names, and can be assigned to, etc.

Note that the H and O are italic in the first, and upright in the second.

 > `#mrow(msub(mi("H"),mn("2")),msub(mi("O"),mn("2")))`;

 > `#mrow(msub(mo("H"),mn("2")),msub(mo("O"),mn("2")))`;

 >

## file type?...

You wrote "text file" (twice), as wells as "mws". What does that mean?

A plaintext file of only Maple language statements can be run automatically from within a GUI session by using the read command. Often people name these files with mpl as the file-name extension.

A worksheet file of Maple's Standard Java GUI can be opened and have some contents automatically executed if they are within blocks that are toggled "autoexecute" (eg, by right-click menu in the left-side border). See the Help page with worksheet,documenting,setautoexec as its topic. You can suppress any need for clicking on intermediary acceptance buttons (that page calls them "warning levels"). This is available from at least Maple 16 onwards and I suspect that Maple 12 also supports this feature, although I cannot check this at the moment. These files have mw as the file-name extension, and while their contents are XML readable with a text-editor the contents are not simply Maple language statements.

The file-name extension mws is used by the Maple GUI for saving worksheets in an older "Classic" format. Such files are readable by a text-editor (ie, ASCII) but their format is marked up and not simply Maple language statements. There is no mechanism for marking regions as auto-execute, excepting re-saving in mw format.

## one way...

 > restart;
 > sol := {diff(y(t), t, t) + 2*diff(y(t), t) + 4*y(t) = 0.9*sin(9*t), y(0) = 0, D(y)(0) = 0}:
 > so := dsolve(sol, numeric, method = rkf45, output=listprocedure);

 > plots:-odeplot(so, [t, y(t)], t = 0 .. 4);

 > Y := eval(y(t),so);

 > plot(Y, 0..4);

 > R := Optimization:-Maximize(x->Y(x), 0..4, method=branchandbound);

 > R[1];

 > R[2][1];

 >

 The purpose of specifying the method=branchandbound option to the Maximize command is to reduce the chance of finding a local maximum which is not maximal over the given domain. That applies whether working with the symbolic or numeric DE solution.

## kernelopts...

That call to kernelopts, which sets numcpus, will return the previous value of the setting.

Eg,

```restart;
kernelopts(numcpus);
4

kernelopts(numcpus=6);
4

kernelopts(numcpus);
6
```

## some ideas...

Here are some ideas to get you going.

You can use _rest in order to allow forcing the size or the view (or any other valid display option).

 > restart;
 > AreaBetween := proc(fnc::{list}, a::anything, b::anything, col::list)   plots:-display(     plottools:-transform(unapply([x, y + fnc[2]], x, y))(plot([fnc[1]] + [-fnc[2]],         x = a .. b, color = [col[2], col[3]], gridlines,         thickness = 3, filled = [color = col[1]])),                  size = [600, 600], _rest); end proc:
 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue]);

 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue],             size=[400,200]);

 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue],             size=[400,200], view=[-10..10,default]);

 >

And here is the other curve, using col[3].

 > restart;
 > AreaBetween := proc(fnc::{list}, a::anything, b::anything, col::list)   plots:-display(     plottools:-transform(unapply([x, y + fnc[2]], [x, y]))(plot([fnc[1] - fnc[2], fnc[2]],         x = a .. b, color = [col[2], col[3]], gridlines,         thickness = 3, filled = [color = col[1]])),                  size = [600, 600], _rest); end proc:
 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue]);

 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue],             size=[400,200]);

 > AreaBetween([sin(x),x^2],-Pi, Pi, [red,green,blue],             size=[400,200], view=[-10..10,default]);

 >

I corrected the original mistake, using col = [...] instead of color = [...]. I got rid of the overload, which is unproductive here.

## application...

One of the difficulties you're having with your supplied code is that the procedure E calls itself with argument f(x) which is a procedure call rather than a procedure per se. But that contradicts your apparent intention for E to accept an appliable procedure as its first parameter.

You've muddled up two different ways of calling E.

Note that (accidentally, in your code) Maple can apply an expression or even a function call as well as a name or procedure. It will let you form f(x) (whether f is assigned of not), and then apply that to say u to get f(x)(u), and then apply that to say z to get f(x)(u)(z).

Perhaps this will help you understand what is going on with the code you posted.

 > restart;
 > # A numeric value can be applied, but the # result is just the numeric value itself.
 > 2(x);

 > (y*x)(t);

 > (2*x)(t);

 > (2*x)(x);

 > E := proc(f, depth)     if depth <= 0 then return f; fi:      E(f(x), depth-1); end proc:
 > E(K, 1);

 > E(x->2*x, 1);

 > (x->2*x)(x);

 >
 > E(x->2*x, 2);

 > E(x->2*x, 1)(x);

 >
 > E(x->2*x, 3);

 > E(x->2*x, 2)(x);

 >
 > E(x->2*x, 4);

 > E(x->2*x, 3)(x);

 >

Have you read the Programming Guide?

## something...

Several of the images and drawing canvases were corrupted. And there was a point past which the file contents became corrupted altogether.

I was able to recover this much. (It's possible that one or two more images near the end of this might be salvaged as well, I'm not sure.)

Eksamensopgaver_samlet_ac1.mw

## no, yes...

At present there is no released full version of Maple which supports the Arm CPU chipset.

Yes, all Maple versions are architecture dependent. (For some years now [2019] the only supported architectures of Maple have been x86-64 and x86.)

## plot inheritance, maybe...

There are a number of plotting qualities that the GUI treats specially, by design, in a mechanism cometimes called "plot inheritance" or "plot persistence". The special qualities are mostly the kinds of plotting attributes that one changes manually (axis labels, inline plotting window size, rotation, etc).

Have you ever noticed that when you manually rotate a 3D plot, and re-execute to get different plotted values say, the manually chosen orientation magically stays the same? That's plot inheritance by the GUI.

It looks like your example may have confused the GUI about utilizing the labels of the second plot within that whole Execution Group. My guess is that it has something to do with either plot inheritance, or the fact that you are printing a plot that is also an assignment, or a combination of both of those.

(note: Plot inheritance is tricky because it's intended to add convenience without anyone ever noticing... Combine that with "relatively new" functionality to actually display plots on the rhs of assignment statements, and newer functionality to display plot thumbnails within mixed expression sequences, and I wouldn't be surprised if it's difficult to keep the code sparkly clean.)

 1 2 3 4 5 6 7 Last Page 1 of 197
﻿