Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 362 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

Do you mean that you want to save a Maple worksheet, or part of a worksheet, as a video? If so, do you mean that you want to save an animated plot? Or do you mean that you want a video, like a Youtube video, that tells you how to save your Maple project?

@John Fredsted If one were to save all the variables to the same file, then they couldn't all be named a. So I can conceive of some reasons why one would want different files. Another reason is that they may not all be able to fit in memory at the same time. But, I think that you were right to inform the OP of the possibility in case they weren't aware of it.

That's very useful---to separately color the two sides of a surface. Your code is quite lengthy, and the resulting surface is so densely populated (by polygons, I think) that it is difficult to rotate. I don't know whether this is because of the complexity of the surface itself or because of your side-separation technique. Would it be possible to apply your technique to a simpler (but nontrivial) surface?

Note that for many surfaces it is trivial to achieve this by a lateral transformation, such as this plot of a hemisphere:

S1:= plot3d([1, theta, phi], theta= -Pi..0, phi= 0..Pi, coords= spherical):
S2:= plottools:-transform((x,y,z)-> [x, y + .01, z])(S1):
plots:-display(
   plots:-display(S1, color= red), plots:-display(S2, color= green), 
   scaling= constrained, orientation= [45,60,0]
);

Note that all plots are stored in Cartesian coordinates, so plottools:-transform always uses Cartesian coordinates, regardless of the coordinate system used by the original plot command. (I know that you already know that; this paragraph is intended for other readers.)

Results are nearly unsearchable on MaplePrimes! It's a pity that all that information is going to waste. If the search result is one of my Answers, then you'll need to work your way through a list of nearly 3000 Answers to find what you want. If the true answer appears not in the Answer itself but in a Reply to an Answer, then it's even worse: You won't find it unless you stumble upon it.

An Answer is a terrible thing to waste! I beg the MaplePrimes administrators to simply let Google index MaplePrimes. I've asked for this several times before, with no Reply, not a single word. As far as I know (and I'm definitely not sure about this), this would require almost no effort---you just ask Google to do it.

@John Fredsted Unfortunately my protocol doesn't work in this situation. You either need to wait for the out to display or kill the Java process.

This problem was already solved at the OS level on the first few computers that I ever worked on, 38 years ago (DEC-10 & PDP 11/70). One pressed Ctrl-O to stop seeing the output and Ctrl-O to start seeing it again. Whatever happened to that protocol?

@brian bovril Here's a corrected worksheet. The problem was not randomness but that one needs to call DrawGraph(..., style= spring) first in order to set the vertex positions for the GetVertexPositions command. Then one needs to call DrawGraph again to redo the graph using those positions and the more-elegant vertex labels. This is all to work around a bug.
 

restart:

dist:= Matrix(
   (7$2), shape= symmetric, scan= band[0,6],
   [[0$7],
    [7, 11, 7, 15, 14, 8],
        [4, 12, 16, 5, 6],
             [5, 5, 3, 9],
             [12, 14, 11],
                  [7, 11],
                     [14]
   ]
);

dist := Matrix(7, 7, {(1, 1) = 0, (1, 2) = 7, (1, 3) = 4, (1, 4) = 5, (1, 5) = 12, (1, 6) = 7, (1, 7) = 14, (2, 2) = 0, (2, 3) = 11, (2, 4) = 12, (2, 5) = 5, (2, 6) = 14, (2, 7) = 11, (3, 3) = 0, (3, 4) = 7, (3, 5) = 16, (3, 6) = 3, (3, 7) = 11, (4, 4) = 0, (4, 5) = 15, (4, 6) = 5, (4, 7) = 9, (5, 5) = 0, (5, 6) = 14, (5, 7) = 6, (6, 6) = 0, (6, 7) = 8, (7, 7) = 0}, storage = triangular[upper], shape = [symmetric])

demand:= <100, 200, 120, 45, 250, 80, 75>:

hubs:=[seq(parse(i), i = "A" .. "G")]:

seq(assign(Index(hubs[k])= k), k= 1..nops(hubs));

seq(assign(Vlabels(v)= sprintf("%a %d", v, round(demand[Index(v)]))), v= hubs);

edges:= {{A,C},{A,D},{C,D},{C,F},{D,F},{D,G},{G,E},{E,B},{B,A}}:

subsindets(edges, set(name), e-> [e, dist[Index~(e)[]]]);

{[{A, B}, 7], [{A, C}, 4], [{A, D}, 5], [{B, E}, 5], [{C, D}, 7], [{C, F}, 3], [{D, F}, 5], [{D, G}, 9], [{E, G}, 6]}

edgesL:= subsindets(%, name, Vlabels);

{[{"A 100", "B 200"}, 7], [{"A 100", "C 120"}, 4], [{"A 100", "D 45"}, 5], [{"B 200", "E 250"}, 5], [{"C 120", "D 45"}, 7], [{"C 120", "F 80"}, 3], [{"D 45", "F 80"}, 5], [{"D 45", "G 75"}, 9], [{"E 250", "G 75"}, 6]}

macro(GT= GraphTheory):

G:= GT:-Graph(edgesL);

GRAPHLN(undirected, weighted, ["A 100", "B 200", "C 120", "D 45", "E 250", "F 80", "G 75"], Array(%id = 18446744579093236182), `GRAPHLN/table/1`, Matrix(%id = 18446744579097074606))

These shenanigans with GetVertexPositions and SetVertexPositions are here to compensate for a bug in DrawGraph(..., style= spring). As you can see, the vertex labels are not printed as elegantly as they should be.

GT:-DrawGraph(G, style= spring);

GT:-SetVertexPositions(G, GT:-GetVertexPositions(G, style= spring));

GraphTheory:-DrawGraph(G, font= [HELVETICA,BOLD,10]);

``


 

Download DrawnGraph.mw

@brian bovril I'm sorry, Brian: There is some randomness in the style= spring algorithm that I failed to account for. I'm working on a solution. I don't think that this has anything to do with you using a different version of Maple.

@MDD The package was introduced in Maple 2015.

@MDD Sorry, but the package PolyhedralSets doesn't exist in Maple 15.

What makes you think that there is a solution in the cube (-1000..1000)^3? Indeed, your use of the imaginary I in all three equations leads me to doubt that there are any real solutions. fsolve immediately finds a solution in the complex cube (-1000-1000*I..1000+1000*I)^3.

@tomleslie If you have pressed the button, and the code is still executing (as opposed to simply scrolling spooled output), then the code will stop, eventually, when it returns to Maple-level code. Repressing the button has no effect.

@vv I caught the error and posted the correction while you were writing. But thanks anyway. And I added an expansion of that cryptic code at your suggestion.

@Axel Vogt Hmm. You save first, then kill; I kill first, then save. If you run into another situation where you can't save first, give my method a try. Anyway, I think that's it's faster in all cases, but especially if the mserver is consuming most of your memory.

@Markiyan Hirnyk I edited the Answer, including more explanation. It's very frustrating to me that people would risk losing their unsaved work by killing the Java process. That's totally unnecessary.

@alisha shaikh NB is a standard abbreviation for "note well". The letters come from the Latin phrase meaning the same thing.

If there's any place where f is negative, complex numbers will enter the solution due the fractional exponent of f. It might be beneficial to include an initial approximate solution with f nonnegative.

First 367 368 369 370 371 372 373 Last Page 369 of 709