acer

32400 Reputation

29 Badges

19 years, 345 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

I forgot to mention the following:

You mentioned slow performance of plottools[rotate]. If you are in real need of speeding up rotation of 3D plots in particular then you might have a look at some older posts here and here. The notion of 3D plot rotation can mean a couple of different things, though. The comments in the second of those links also discusses the viewpoint option, which may or may not be the kind of rotation you mean.

More generally, it quite often is the case that code posted to this forum can be improved in performance, and the community is friendly and talented. So if you still find your code running too slow after your planned hardware upgrade then do consider asking.

@Carl Love I too delete a great many spam messages from this site.

I would like to see a filter+quarantine system be put in place. Given how many spam messages you, Preben and I are deleting collectively, I am sure that the members with adequate priviledges could deal with an expected small number of false positives in a timely many.

But I only know of one way to make such a policy be implemented by the administrators of this site: we members (who currently have the ability to do so) would all have to stop deleting the spam.

@Carl Love You wrote that `int8` is undefined. It is an export of the MTM package (which the OP was tring to utilize).

@Harry Garst you cannot utilize `with` inside a procedure.

Change remove the calls to with and replace by,

uses LinearAlgebra, MTM, StringTools;

 

 

@Harry Garst Can you append each row (string) with "\n" , using the cat command?

@Mac Dude Recreating the procedure trackElement (by invoking proc..end proc, or by sub'sing into an existing template) will usually both be less efficient than using a never changing module local instance of the desired procedure. By which I mean, if the body of trackElement doesn't ever have to change, then you don't need to recreate it by any means each time you call Track. Doing so generates garbage which has to be collected.

I saw nothing in what you originally wrote to indicate the you had any need to recreate trackElement upon each invocation of Track. I think tha Carl was explaining how Maple parses and instantiates rather than making a suggestion that subs would  solve some problem you had.

However, if trackElement does happen to depend on lexcial scoping to use some values from Track which cannot be used merely by being passed as arguments, and if all that precludes wrapping calls to trackElement in evalhf, then you may speed things up by sub'sing in as described. This is likely not the case, though, as the presence of uses LinearAlgebra withing trackElement suggests that you're not currently invoking trackElement under evalhf, because module member referencing is not supported under evalhf.

The problem of "premature evaluation" comes up enough -- with this particular kind of error message -- that it's got its own web-page. If you click on the pink error message in your Maple worksheet (and if Maple's configured to use your web browser) then your web browser should get to this page.

acer

@smith_alpha The FileTools[Text][Open] command accepts an append optional argument.

To get a 2D parameterized curve you can just use the plot command with a particular calling sequence. Eg,

plot( [cos(t), sin(t), t=1..5] );

You attempts to use the plots[spacecurve] and the Student[VectorCalculus][SpaceCurve] commands failed because you left out the 3rd component of, respectively, the list and vector argument.

acer

@Carl Love Part of the reason that he previously got as output just print BChange must have been an erroneous space between print and (BChange) for the input. In other words, this much have originally been coded as 2D Input, with the OP beeing caught out by implicit multiplication. The reported output would thus be a product of the two names, just like shown above. So that would be a syntactic mistake (even if it did not raise an error at runtime).

Since the OP's code actually ran for him then we can surmise that the operator union was quoted in the OP's actual sheet.

@Edo Karura You can use the alias command to make x(t) appear as just x in output, or to use just x instead in input.

You can also put the x above the crossbar in the differential.

That last aspect get lost in the 2D Output however (even with extended typesetting level, I believe). And there are also brackets. So if you want only that form then you'd have to use 2D Math as input inlined and centered in a paragraph (on which you could of course still use dsolve via context-menus).

The very last operation below (dsolve) is injected by doing a right-click context menu action on the inlined 2D Math in the paragraph right above it. I used Ctl-t to get a text paragraph and then Ctl-r to switch to inlined 2D Math within that.


restart

alias(x = x(t)):

m*(diff(x, t, t)) = -k*x-b*(diff(x, t))

m*(diff(diff(x, t), t)) = -k*x-b*(diff(x, t))

(1)

dsolve(%);

x = _C1*exp((1/2)*(-b+(b^2-4*k*m)^(1/2))*t/m)+_C2*exp(-(1/2)*(b+(b^2-4*k*m)^(1/2))*t/m)

(2)

 

This is my DE:

 

 

m*(diff(x, t, t)) = -k*x-b*(diff(x, t))

 

dsolve(m*(diff(x, t, t)) = -k*x-b*(diff(x, t)), {x})

x = _C1*exp((1/2)*(-b+(b^2-4*k*m)^(1/2))*t/m)+_C2*exp(-(1/2)*(b+(b^2-4*k*m)^(1/2))*t/m)

(3)

``


Download aliasde2.mw

@Markiyan Hirnyk I think that it would have to be up to the person who wants such a display to decide whether to dice & wrap, versus trying to display a very wide sheet (which might in any case hit worksheet limitations).

One of the central purposes of what I'm discussing is ease of viewing. At a large enough dimension there will be no convenient yet clear explicit display of all elements, using any mechanism. For numeric data one might switch over to 2D numeric Arrays as images. It's a broad topic.

@jens14 Sorry, but I am seeing only many null bytes is all these zipped files (which is why thy compress so small, I suppose), and nothing to recover.

Can anyone detect anything in the file apart from a great many null bytes?

That's all I see, even if I try and force the encoding while reloading it into vim. (I was trying to check whether perhaps just the byte-order mark were missing from the start of the file...)

It's possible that there is nothing to recover from what you've attached. You might try to upload a zipped copy of what you have, just to see whether the mapleprimes uploaded is adding to the difficulty of recovery.

Do you have a backup copy? Was this downloaded at some point from an email attachment? What encoding do your other .mw worksheets usually have (ie. first line, when viewed as plaintext XML)?

acer

@tomleslie 

The OP asked specifically for a way "to input it as 2-D."

Sure, it is fastest and simplest to do it with 1D Maple Notation. But that's not what was asked.

Two ways to get the prettyprinted derivatives as 2D Math for input include using the palettes (very slow, and awkward) and using command completion (not nearly as slow, but awkward). I mention command completion because it is relatively faster than the palette approach previously discussed.

Your comments appear quite supercilious and hostile, Tom. But your criticisms do not follow logically. A person may have a need or wish to author a document using 2D Math input, for a variety of valid reasons all their own. The question of how to go about that in the easiest or fastest way is still a sensible thing to consider.

Take another point: the OP originally shows using a nested differentation, for where the 2nd derivative is wanted. It's terser to adjust the power of the `d` in the operator, to read as d^2/dt^2 , than to use nesting. That works, and was part of the context-menu method I suggested. Given that the OP wants 2D Input it can still be worthwhile to point out ways to improve the workflow.

First 322 323 324 325 326 327 328 Last Page 324 of 592