Carl Love

Carl Love

28050 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@panke As I pointed out above, what you've written is not an equation; it's an assignment. If you want an equation, use =, and there'll be no error message.

@panke Yeah, I understand perfectly what the cause of your error is. But the problem is that what you're trying to do makes no sense mathematically. 

@ismonder Thanks. Hopefully this will help someone figure out what the problem is. For the sake of completeness, you should probably upload (as an attached file rather than as a screen shot) whatever part of the worksheet that you were able to save.

Also (and this may not matter), you still haven't followed the simple instructions that I gave. AFTER the command or commands that don't work, please put a command that does work, like 2+3. I repeat: This is just to obtain diagnostic information. I don't need to see more commands that don't work.

When you say "I press enter, and nothing happens", do you mean 

  1. the cursor doesn't move at all, or
  2. the cursor moves to the next line (where on the next line?), or
  3. you get a new command prompt, and the cursor is next to it, or
  4. something else?

@ismonder Can you please post a screenshot of these things, in this order, all on one screen:

  1. A command that DOES work, such as 2+3;
  2. Its output; FOLLOWED BY,
  3. A command that doesn't work, such as that plot command;
  4. (This one may not be possible) Another command that DOES work;
  5. Its output.

If 4 & 5 are not possible, then what happens if you press Control-J? Do you get a new command prompt? If so, try entering another command that DOES work at the new prompt.

This is only to obtain diagnostic information that may help in solving your problem. I'm not saying that any of the above will, by itself, solve your problem.

@Stretto If you use Iterator:-Permute([a, b, c, d, e]), then the order of the results will depend on the lexicographic ordering of the list entries rather than the order that they appear in your original list. In other words, the result of the above is exactly the same, and in exactly the same order, as Iterator:-Permute([e, d, c, a, b]). If that's okay for you, that's great, go ahead and use it. I was simply a bit hesitant to recommend it to you because you said "deterministically", and it seems to me like that makes it not 100% deterministic because it depends on Maple's somewhat-idiosyncratic lexicographic ordering.

If the original-list order does matter to you, then use

A:= Array([a,b,c,d,e]): # Array of elements to permute
for p in Iterator:-Permute(numelems(A)) do
    printf("%{}a\n", A(p));    # print (replace with something useful)
end do:

The code immediately above is only correct if the list has no repeated entries! If you want to work with repeated entries, and the original-list order matters to you, then let me know.

By default, Iterators from this package are converted to C and compiled. That compilation takes about 0.2 to 0.3 seconds (on my computer). This is not worth it for an iterator that only has a small number of iterations (such as the above). In that case, use option compile= false on the Iterator command. 

@tomleslie The last valid value used for the independent variable and the corresponding values of the dependent variables can be retrieved by sol('last'), where sol is the solution procedure returned by dsolve. This may be more convenient than sol([lastexception][3]).

If you can't save a worksheet (from File => Save menu) to upload, can you send us a screenshot showing a command that works, its output, a command that doesn't work, its lack of output, then another that works and its output?

 

Just curiosity here: What's the purpose of the second column of your Matrix points, the one with the 10s and 30s? It seems to play no role in this.

Do not make followups by erasing your original Question and replacing it with the followup!! Put back your original Question. You've been on MaplePrimes for 9 years; one would think that you'd know better than to do something so uncouth.

@jan.droesler I'd be happy to continue to help you if you post your followup question here. If you post a followup as a new Question, it'll get deleted.

@tomleslie Oh, it's unquestionably a bug. I'm sorry that I didn't make that clear.

It looks like D has been extended in Maple 2019 to work on list-valued functions. So, for earlier Maple, change my tangent line definition from D(r)(a)*~(t-a)+~r(a) to

eval(diff(r(t),t), t=a)*~(t-a)+~r(a)

 

@Kitonum What part of it would you expect not to work? Here it is in use:

restart:
r:= t-> [t, t^2, t^3]:  (a,b):= (1,2):
 plots:-display(
    plots:-spacecurve~(
       [r(t), r(t), D(r)(a)*~(t-a)+~r(a)], t=~ [a..b, 2*a-b..a, 2*a-b..b], 
       color=~ [red, red, blue], linestyle=~ [1,2,1]
    ),
    thickness= 4, projection= 2/3, labels= [':-x',':-y',':-z'],
    tickmarks= [4$3], orientation= [76, 84, -23] 
);

@Carl Love I've corrected the Answer above. In the previous version, while I was formatting the session transcript in the MaplePrimes editor, a few lines were transcribed out of order, making the logical flow of my expository comments difficult to follow. If you read that Answer, then please reread the above. This time, I just uploaded my worksheet rather than trying to neatly format it into color-coded plaintext.

@Maximity Sorry, I forgot something: You need to include evalf, like this:

for i from 0 to evalf(Pi) by evalf(Pi/1000) do

But, this many points (21,021 = 1001 i x 21 j) is very slow to process. Here's an alternative that works from the plot.

Create a plot3d from the pdsolve(..., numeric) solution and save it to a variable:

P:= HS:-plot3d(u(x,t), t= 0..2, x= 0..Pi, grid= [50,50]);

The grid option specifies the number of evaluation points in the t dimension by the number in the x dimension.

Then use this procedure, which finds the maximum difference between this plot and the equivalent plot of the analytic solution.

PlotCompare:= proc(
    P1::specfunc(PLOT3D),
    Ana::procedure
)
local 
    G:= indets(P1, specfunc(GRID))[],
    P1data:= op(3,G),
    P2:= plot3d(Ana, op(1..2, G), grid= [upperbound(P1data)]),
    P2data:= op(3, indets(P2, specfunc(GRID))[])
;
    print(plots:-display(<P1 | P2>));
    max(abs~(P1data-P2data))
end proc
:
PlotCompare(P, Ana);

      0.00135289691747364


 

 

First 221 222 223 224 225 226 227 Last Page 223 of 709