acer

32822 Reputation

29 Badges

20 years, 134 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@das1404 Does this work in your Maple 7?

restart;

with(plottools):

makeA:=proc()
  local opts;
  opts:=style=patchnogrid,color=gray;
  plots[display](
    plots[polygonplot]([[0,0],[1,0],[4,8],[3,8]],opts),
    plots[polygonplot]([[3,8],[4,8],[7,0],[6,0]],opts),
    plots[polygonplot]([[2,4],[5,4],[5,3],[2,3]],opts),
  scaling=constrained);
end proc:

P1:=makeA():

P1;

plottools[rotate](P1, 2*Pi/3);

@das1404 You can delete the "uses" line inside the proc, and change each polygon to plots[polygon] instead.

But do keep using procedures, to organize your jobs. Write a procedure to create the plot of the capital "D".

Like all your previous queries, I converted this from a Post to a Question.

 

 

Are you saying that you want the different branches of the piecewise to be visually distinct? If so, then how do you want them to differ visually? With different colors? Or different styles for the lines?

Do you also want the different contour values to be distinct from each other, say by some graded shading?

If you want the piecewise branches to have distinct colors, and also the contour values to have graded shading, then perhaps you could suggest what colors and gradients you'd like.

Use the green up-arrow in the editor here to upload your actual worksheet or document.

It's unclear exactly what commands you've executed, otherwise.

@assma You should be able to use the ExportMatrix command with that numeric Matrix.

@Preben Alsholm That is weird. It seems to have changed between Maple 12.02 and Maple 13.00. (Report submitted)

@Joe Riel Hi Joe. I didn't mean that it's tough in principal. I meant that it's awkward and tough for most users to do by hand.

After all, calling if...then with is in the conditional is clearly tough for many users to figure out, since it is a faq.

This thread strikes me as being in the classic theme of technical correctness versus practicality. A didactic view is to restrict attempts to only classes of problem for which results may be guaranteed, etc. But that approach would never have given us the awesome usefulness of the simplify command.

Is the pattern that `max` and `sort` are still using evalb for relation testing? Maybe it's time to consider promoting `is` to a new job.

For `sort` you can supply your own comparator (as I know you're aware) but there's still an argument to made for having it be more automatic. For `max` it's tougher to do it efficiently.

The generated 3D globe plot consists of POLYGONS with many (approx. 30-40k) elements, CURVES for the borders, and a MESH for the sphere/ocean. Those main substructires can all be manipulated separately, even obtaining a few customizations not easy (or possible) directly from the original command.

globe_fun.zip

@Preben Alsholm 

I'm not sure I understand why evalf/Int isn't succeeding (and quickly) by splitting the integral at x=1 the point of discontinuity in the given range x=0..5.

restart;
g:=sqrt(1/(1-x^2)):
CodeTools:-Usage(evalf(int(g, x = 0 .. 5)));
memory used=52.37MiB, alloc change=34.00MiB, cpu time=502.00ms, real time=502.00ms, gc time=39.53ms
                  1.570796327 + 2.292431670 I
restart;
g:=sqrt(1/(1-x^2)):
CodeTools:-Usage(evalf(IntegrationTools:-Split(Int(g,x=0..5),
                          select(x->x>=0 and x<=5,[op(discont(g,x))]))));
memory used=20.81MiB, alloc change=67.01MiB, cpu time=216.00ms, real time=216.00ms, gc time=15.67ms
                  1.570796327 + 2.292431670 I
restart;
g:=sqrt(1/(1-x^2)):
CodeTools:-Usage(evalf(Int(Re(g), x = 0 .. 5))
                 +evalf(Int(Im(g), x = 0 .. 5))*I);
memory used=6.15MiB, alloc change=33.00MiB, cpu time=67.00ms, real time=66.00ms, gc time=5.67ms
                  1.570796327 + 2.292431670 I

Everything has the same sign, approaching the discontinuity at x=1 from both sides.

plot([Re,Im](g),x=0..5,view=0..5,thickness=4,filled,color=[green,red]);

@Samir Khan Yes. I was supposing that the country data or its processing might confused about that disputed region. (I wrote lake in a dry attempt at humour)

@Samir Khan Is that a large lake along the border of Western Sahara and Mauritania?!

@assma My first suggestion (if diff can handle what you call the "known functions" but which you resist showing us in full) is,

w2:=unapply(diff(v2(x,y),x)-diff(u2(x,y),y), [x,y]):

For some strange reason you changed that to the following, which I did not recommend at all,

w2:=proc(x, y) options operator, arrow; unapply(diff(v2(x, y), x)-(diff(u2(x, y), y))) end proc;

@assma No, I did not suggest putting a call to unapply within the body of w2. Yes, what you've done does solve your original runtime error, but it is as bad for performance as calling diff within w2. That's exactly what I suggested not to do.

First 268 269 270 271 272 273 274 Last Page 270 of 601