Carl Love

Carl Love

28150 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@mmcdara 

I think that if acer were writing this in a worksheet, he'd put the pf:= 'pf' in the same execution group as the for loop. This is to initialize the table. Personally, I'd use pf:= table(). We don't usually show the execution group boundaries when transcribing code to plaintext. 

Here's why initialization matters: Suppose that the initialization were not used, and suppose that the loop has been executed once. Now suppose that the user makes a few changes---including lowering the value of N (to, say, N1)---and then re-executes the loop without doing the restart. Then the table will still have N, not N1, entries, erroneously. If you initialize the table within the loop's execution group, then it's impossible to make this error.

@annamiaswart 

Both of your problems come from using 2D Input. You may be using it simply because it's the out-of-box default and you weren't aware of the 1D-input alternative. Please download the following copy of the worksheet, which is done in 1D input, and also constructs the new final plot:

DsolveSave.mw

1D input is also called "Maple Input". In the above worksheet, note the different style of the executable code input: monospaced, bold, reddish-brown (these could be changed).

Now here are the specific reasons for those errors:

There have been a vast number of syntax additions and improvements made to the Maple language in the past 3 years. None of these additions work in 2D Input! I find that rather shocking. The fact that they don't work is even mentioned on their help pages.

One of those changes is that loops (such as for loops) can now be embedded in other expressions. I used this feature for the first plot, and I included an alternative that'll work in 2D Input.

There are two errors in the construction of the final function to plot, both related to 2D Input. The first is that there's no multiplication operator after the 3. To my knowledge, 2D Input is supposed to translate spaces to implied multiplication. I don't know why that didn't happen (and I don't really care because IMO 2D Input is utterly worthless).

The second error is some incorrectly placed parentheses. I blame this on 2D Input because it makes parentheses in particular very difficult to edit.

To set 1D input as your default input mode, do this:

  1. Go to the Tools => Options menu.
  2. Go to the Display tab.
  3. From the pull-down "Input display", select "Maple Notation".
  4. Go to the Interface tab.
  5. From the pull-down "Default format for new worksheets", select "Worksheet".
  6. Click the "Apply Globally" box at the bottom of the menu.

This doesn't change existing input. Rather, it sets the mode for new input.

 

@tomleslie You wrote:

  • Obviously the required output data can be obtained from these arrays, but I still think it is "simpler" to achieve the thing by using the output=Array() option in the dsolve() command.

Perhaps it is simpler. But consider this: Given any 2D plot of curves with multiple data arrays all of which have the same 1st column, the consolidated Array can be constructed by a one-liner. For example, using the first plot h1plot from my Answer below:

n:= 10: #n had already been set above.
h1data:= `<|>`(indets(h1plot, Array)[])[.., [1, 2*j+2 $ j= 0..n]];

@tomleslie You wrote:

  • Furthermore you cannot control which x-values will be used. 

That's not true. You can use plot option sample together with adaptive= false. See ?plot,options.

In the present case, however, simply using adaptive= false should be enough to guarantee that the same x-values are used in each plot.

@Rouben Rostamian  I promoted your Reply to an Answer and gave it a vote up. This is a perfect example of the type of rhetorical question that has high pedagogical value and deserves to be used more often as an Answer.

For your surface z, you've used r and phi as the independent variables in cylindrical coordinates. Okay, there's no problem with that. For your color function w, you've used x and theta as the independent variables. Maple has no problem with that, but to map this function onto your surface, I need to know how you interpret x and theta in cylindrical coordinates. Is x the cartesian-coordinate x, so that x = r*cos(phi)? Is theta the polar angle from spherical coordinates, so that theta = arctan(z/r), or is theta just the same as phi?

@ So far, this looks fairly easy, and the function F is not very complicated, but there are two problems:

  1. I assume that by ln, you mean the natural logarithm. The problem is that you've used is as if it were a variable rather than a function. Each use of ln needs to be followed by parentheses that enclose its argument. I can't figure out where they're supposed to go. For example, consider the subexpression ln*rho*(1-s). Do you mean ln(rho*(1-s)) or ln(rho)*(1-s)? Please correct each usage of ln and resubmit F.
  2. Why have you given a numeric value to s when the goal is to find s?

Unrelated tip: The ASCII keyboard symbol for "less than or equal to" is <=. This is very widely recognized by both human readers and computer languages. Likewise "greater than or equal to" is >=. In Maple, "does not equal" is <>. This one is not as widely recognized as the first two.

  1. Are x, r, and T fixed numeric values? 
  2. Is F relatively well behaved (differentiable in some neighborhood of the solution)? If not, is it at least continuous in some neighborhood of the solution?
  3. Is it guaranteed that a solution exists, and is it unique?
  4. Can F be specified as a single expression, however complicated, or is F specified by a numeric procedure? 
  5. Can you provide a Maple program for F, whether it be an expression or a procedure?

@acer Do you see any significance to the .lib vs .mla issue? In my initial reading of the Question (which was possibly based on a slightly different earlier wording), a distinction seemed to be made between having the stated problem with .lib files (or one particular ,lib file) and not having it with .mla files. I'm very unsure about that; it may have been simply my misinterpretation of the Question.

@emendes Great. I was unsure about that. Since you've now confirmed that it works, I've converted my Reply to an Answer.

To MaplePrimes administrators: I wanted to add "Maple Cloud" to the product specifications of this Question, but I see that that's not an option.

@vv That must be what the OP was referring to. I withdraw my comment about the behavior being the opposite of what was said.

I edited your Post such that now it is possible to click on the URL for the YouTube video. This is done by using the tool that looks like two links of chain on the editor toolbar.

I suggest that you change the title of this Post to reflect the mathematical and Maple-related content of your video. A title reflecting minutiae related to posting is likely to be overlooked.

@mapleatha If you construct a sum of n terms, and 1 of those terms automatically simplifies to 0, then the sum will have n-1 operands. If two of those terms cancel each other, then it will have n-2 operands. In either case, if the final result has only 1 term, then the meaning of "operand" as used by op changes. In other words, when terms become 0, they "leave no trace".

It is for reasons such as those that last week I told you that your usage of op to deconstruct differential operators expressed as polynomials in D was "very cruddy and prone to error." I meant nothing personal by that, and I wouldn't expect you or anyone to have known that already. In addition to the problems mentioned in the first paragraph, that particular usage of op had numerous other potential errors. IMO, these problems are beyond any possibility of repair; two-argument op applied to sums simply shouldn't be used for these purposes. I said that you mustn't do this or ask about it again because it'd be an utter waste of your time to try to fix something that can't be fixed. But if you want to discuss alternative methods for working with polynomials or differential operators, that's fine.

I made your question to acer regarding deleting bad characters from worksheets into a separate Question thread. It was not related to the subject of this thread. Threads are organized by the subject, not by the names of the correspondents. In other words, this is not a "chat room".

@nm My comment was directed at the OP, not at you. If it had been directed at you, it would've started with @nm . I agree with what you said about series.

First 135 136 137 138 139 140 141 Last Page 137 of 711