Carl Love

Carl Love

28130 Reputation

25 Badges

13 years, 312 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Vishal 

The case of letters (as in uppercase/lowercase) is very important in Maple. The variable's name is UseHardwareFloats; you have useHardwarefloats.

@Vishal 

Using the same commands works for me:

UseHardwareFloats:= false:
plots:-complexplot(G, xx= -1e-13..1e-13);

Can you show the commands that you're using that aren't working?

Jaynorms: I just added 12 notes to my Answer above to explain the Maple-specific parts of the code.

@vv 

Yeah, I posted that too quickly. Even if it worked it'd be very inefficient; the time complexity is O(nops(A)*nops(B)). I think it should be possible to write a procedure that is O(nops(A)+nops(B)) times some logarithmic factors. Here are two possibilities. Both work for an arbitrary number of lists.

MultisetIntersect1:= (M::seq(list))->                                                         
     (T-> [seq(_[]$min(map(`?[]`, T, _)), _= indices(T[1]))])
          ((curry(table, 'sparse')@Statistics:-Tally)~([M]))
;

MultisetIntersect2:= (M::seq(list))->
     select(
          `in`,
          [seq(`$`(op(_[1])), _= ListTools:-Classify(lhs, op~(Statistics:-Tally~({M}))))],
          `intersect`(seq({_[]}, _= M))
     )
;

Note that ListTools:-Classify is essentially linear in time (and it's a very short and beautiful procedure to read), and that set membership checks (as opposed to list membership check) are logarithmic in time because sets are stored sorted.

What's the longer, easy procedure that you has in mind?

@vv 

For common multiplicity, it'd be

L:= (A::list,B::list)-> select(`in`, B, select(`in`, A, B));

You have contradictory substitutions such as delta[1,1]= 1 and delta[1,1]^2= 0. You'll need to clarify what you mean by those. Such alternative arithmetic may be possible in Maple, but I want a clarification of your meaning before I delve into it.

Regarding the third exercise, it's a Pythagorean spiral, not an Archimedean spiral.

Take heart Jaynorms: The procedures for your exercises 1, 2, and 3 can be written in 1, 2, and 3 lines respectively (I just did it), although I don't recommend that you try to make them that short. So, they're not that hard. For exercises 2 and 3, all the math that you need is in the respective Wikipedia pages.

Regarding 3: I found this much easier to do in polar coordinates:

plot(..., coords= polar);

The first argument of plot can be a list of points (or a list of lists of points), each point being a list of two numbers. So,

  1. Compute the endpoints of the radial arms in polar coordinates. The endpoint of the nth arm can be computed directly in polar coordinates; it doesn't need to be done relative to the previous arm.
  2. Plot a list of points to connect the endpoints.
  3. Plot a list of lists of points to connect each endpoint to [0,0].

Don't try to plot the triangles separately; that's harder.

 

@asa12 

If you execute 

f := a*b*d - b;
subs(a=2,subs(b=n, subs(c=1, subs(d=0, f))));

then of course f = -n. Is that what your Question is about?

You can send me email by using the button "More" at the bottom of this Reply. Pull down the list and select "Contact Author."

@Preben Alsholm Thanks for the correction, Preben and Kitonum. Yes, the continuity of the parametrization is important. And so is having a sufficiently large enough number of points plotted.

My guess is that you want a cone with an elliptical base, the ellipse having a given center c and eccentricity e, and the vertex being c+v where is what you call the axis vector. Is that right? And, if so, do you want that ellipse to be in the xy-plane with its axes parallel to the coordinate axes? 

It doesn't seem possible, unless n = 0. Would you please post a worksheet where this happens?

@shadi1386 

Are your f(x) values in flist exact values, measured values, or approximations? If they're measured or approximate, do you have some general guess for the mathematical form of f(x), such as rational function, exponential, exponential with sinusoidal fluctuations, etc.? And is that guess based on theoretical considerations or just on eyeballing the scatter plot?

The only difference that I see between the two expressions in your original Question is that the latter has a "partial" d where the former has a regular d. Computationally, this makes not a whit of difference, and it boggles me that no one has pointed that out yet. Thus, I can only assume that your only issue is not computational, but rather formatting a document for display. Is that correct?

@Wadyan 

What you are calling an n-dimensional plot is ordinarily called an (n+1)-dimensional plot. I will continue to use the n+1 designation.

Note that the ways that you're animating the 2- and 3-D plots are not at all analogous. In the 2-D case, you're animating by increasing the domain of the independent variable from left to right. In the 3-D case, you're animating by scaling (rather than truncating) the dependent variable.

Both of my animations below are done by generating the final frame as static base plot and then generating each frame as a manipulation of that base plot.

U:= RandomTools:-Generate(float(method= uniform, range= 0..1), makeproc):

frames:= 2^5:
points:= 2^9:
P2:= plot(x-> abs(x)*U(), -5..5, adaptive= false, numpoints= points):
Pts:= plottools:-getdata(P2)[3]:
plots:-display(
     [seq(plot(Pts[..round(f*points/frames), ..]), f= 0..frames)],
     insequence, thickness= 0
);

frames:= 2^5:
points:= 2^7: #2^7 in each (x,y) dimension. Total points = 2^14.
P3:= plot3d((x,y)-> abs(x)*U()+abs(y)^2*U(), -5..5, -5..5, grid= [points$2]):
plots:-display(
     [seq(plottools:-scale(P3, 1, 1, f/frames), f= 0..frames)],
     insequence,
     shading= zhue, axes= frame, transparency= .5, style= wireframe, thickness= 0
);

In a worksheet, feel free to increase the FPS (Frames Per Second) for either of these.

@Spartan 

I already anticipated your most-recent followup question, and I was adding a paragraph about builtin commands to my most-recent Reply and you were writing it. So, go look at that Reply again.

While diff itself is builtin, the code which controls the differention of most functions isn't. See, for example,

showstat(`diff/sin`);

First 458 459 460 461 462 463 464 Last Page 460 of 711