acer

32400 Reputation

29 Badges

19 years, 344 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Your procedure is very strangely written.

I can't tell whether you are trying to use function calls as if they were local variables (via remember tables), or whether you are using a nonstandard syntax for operator definition.

What do you think that call to d__plP is supposed to be, used on the left hand side of an assignment statement inside that procedure OptimizeSpring?

Whichever it is, you defined d__plP as having 4 parameters, but then only call it with 2 when using it on the right-hand side of the assignment to d__min(...). You make this same mistake in several places.

Since you didn't get get an error about insufficient arguments then we can see that Maple thinks that you've assigned to function calls (remember table assignments), rather than that you've defined operators.

Define operators like this:

d__lpP := (P__1x,P__1y,P__2x,P__2y) -> some_expression_like_you_have_above;

Note that it's not very efficient to have your procedure OptimizeSpring redefine the same operators each time it's called. It's not clear whether you really want and need operators, at this point. Please clarify as your your intent.

Or if you just wanted to use function calls as if you had local variables (which is not a very usual thing to do) then make sure that 1) you declare your locals, 2) you always make the number of arguments match across all instances of each. Even better would be to not use function calls like local variables unless you completely understand all these aspects of usage. Use simple names, or indexed names, if you're just trying to use local variables.

acer

@software_c This appears to be merely a non-general variant of Joe's Answer.

@Carl Love It's some mysterious part of the GUI plot renderer that figure out how to draw the surface, given an ISOSURFACE structure. I don't know what interpolating mechanism it uses. I have wondered, whether in principal it could be converted to some MESH.

There was another beast for which I have a recollection that transforming might not work. Hmm. I suspect it may have been 3D contour plot structures. I recall having difficulty in doing a 3D->2D projection transformation on such (and possibly also for getting at the data otherwise).

@Carl Love An interesting example of "any two- or three-dimensional plot" might be,

plots:-implicitplot3d(r=(1.3)^x*sin(y), r=0.1..5, x=-1..2*Pi, y=0..Pi, coords=spherical);

Why not upload the worksheet that contains the plot, and we could then see what might be possible?

acer

@nMaple In Maple 2015 you can programmatically embed an inlined plot with a given width, height, scale (zoom), and pan (x- or y-offset).

But you cannot subsequently adjust those qualities programmatically, after it gets embedded.

I have previously submitted a Software Change Request that the scale and pan (as well as the rotation angles and projection for 3D plots) become new properties of the PlotComponent.

@nMaple Using Embedded Components you can programmatically change the delay (in millisec) between frames.

There is no facility in Maple 17 to programmatically change the plot "scale" or "pan".

Attached is a worksheet that uses a command to set an animation playing in an Embedded Component. There are commands shown to change whether it loops, and to change the frame delay mentioned above.

There is also a Slider, the "action" code for which also sets the Plot component's animation delay value.

See the relevan help pages for more information on Embedded Components.

animobj.mw

Are you trying to export from a 3D plot with only orientation=[-90,0,0], or do you need some other orientation?

acer

@nMaple Yes, you could use N individual procedures P[i], as there are lots of ways to accomplish your task. I don't understand why you really want that, though.

But somehow you'll get to the value of i into the procedure(s).

You could burn the values of R1, R2, Z2, and Z2 into N different procedures. objvar1.mw

Or you could keep their references unresolved until the procedures are called. objvar2.mw

I can think of several other ways, as well. For example you could have a single procedure P that examing its own procname and pulled on whatever index value (for you, i) had been passed. I won't bother to code that up.

All of these seem more awkward to program, to me, or harder to explain to you, or wasteful of resources.

This isn't all about programming graphics in Maple. It's about programming in general. So you could try learning from the Programming Manual.

 

That reply I just made above, objnew.mw, will work. But it could be more efficient since the definition of procedure P can be outside the loop. And it needs to be, if the earlier remember table assignments are not to be clobbered.

This should be faster,

objnewer.mw

Notice also the I used the smaller `grid` values, as in my original Answer.

 

@bacalfa You have specified that Maple use those versions of `+`, etc, by loading that package.

And it does make a difference. With it loaded then expressions with mixed units will have them combined automatically when they are added together, etc.

If you did not discover this aspect of the behaviour then why do you insist on loading that package?

@nMaple I forgot that you were running Maple 17, sorry.

Change the appropriate line to,

h := Z->plots:-display(`if`(Z>10,fB(min(Z,20)),NULL),
                       `if`(Z>5,fC(min(Z,10)),NULL),
                       `if`(Z>0,fA(min(Z,5)),plot3d([[0,0,0]],h=0..1,phi=0..Pi)),
                       axes = normal, scaling = constrained):

@want to be a permanent vegan Use Comments on the original Question to add additional information, or else if the question point has not significantly changed then a new, duplicate Question may get flagged for removal (as a Duplicate).

Reposting because nobody's answered the original is just spamming.

@want to be a permanent vegan Why are you spamming this site with multiple posts on the same question?

First 316 317 318 319 320 321 322 Last Page 318 of 592