acer

32358 Reputation

29 Badges

19 years, 331 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by 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.

Are you trying to get a pair of curves (X1 versus t, and X2 versus t) or a single parametric curve (X1 versus X2)?

acer

@griffith There have been quite a few posts on this site of involved numeric integrals, where the Questioners were able use the Answers to attain significantly better performance.

So, before parallelizing, might it not be worthwhile to see if the community could help you optimize the time and memory performance in the unparallelized case? Such benefits often migrate over to the parallelized case.

@TomM Good to hear that you've resolved the problem. As you've surmised, I had interpreted the problem as being one where you were trying to run the code in the worksheet that did not contain the components. But the situation is the reverse: you run the shared, defined procedures using the components.

Since your students "do not need to know anything about the programming on the `setup' worksheet" then your motivation for using two worksheets is that you don't like creating and editing the code in a code-edit region? Is that right?

Is it because of the lack of 2D Math in the code-edit region? Of the lack of Find/Replace? Or the lack of syntax-checking?  (The Startup-Code region does have Find/Replace and syntax checking.) Or tabbing and cursor movement? Or is it some other aspects of the editing? I'm just curious, thanks.

@Carl Love I suspect that we are agreement here. I am not a fan of the way that eval can act as temporary escape from evalhf mode, and am ambivalent about mentioning it.

I think that it was was a positive feature of evalhf, for the many Maple releases wherein it was not possible to create Vectors inside evalhf. Always having to pass Matrices/Vectors/Arrays in as arguments to evalhf'd procedures is conducive to lean and efficient programming, I think.

I think this goes for compiled code too.

Give people a chance to run up a huge amount of garbage collection overhead... and they will.

@Carl Love There are a few incorrect claims in your response (but which do not affect the code portion, which nevertheless addresses the posted Question).

In the following example the Vector V was not passed into procedure p. And running under evalhf the procedure p does indeed return a Vector.

restart;

p:=proc()
  local i,V;
  eval(assign('V',Vector(3,datatype=float[8])));
  if true=1 then # will only loop in evalhf mode!
    for i from 1 to 3 do
      V[i]:=i^2;
    end do;
  end if;V;
end proc:

p();

                                    [0.]
                                    [  ]
                                    [0.]
                                    [  ]
                                    [0.]

evalhf(p());

                                    [1.]
                                    [  ]
                                    [4.]
                                    [  ]
                                    [9.]

@yunlongwang If you find that Matrices of large size do not print in full (showing just a summary item) then adjust the rtablesize interface property.

Eg, to allow Matrices only up to size 20x20 to display in full, use the command,

interface(rtablesize=20):

That will affect both Matrices and Vectors. The default is rtablesize=10 in the Standard Java GUI.

@Mac Dude No, there are three possible settings: always use a new engine (mserver), never use a new one, and ask each time. The last one should bring with it a popup menu to select from running mserver instances, or a new mserver, each time File->New or the desktop launcher is used. And the OP has told us that the kernel computational part of this is working OK.

Having said, that, I am not sure whether or not the Maple 18 behaviour with respect to embedded components was correct. Why should embedded components be shared amongst worksheets/documents, just because the kernel engine is? It doesn't sound outrageous to me to consider that embedded components are individual to the sheet in which they are... embedded.

Or perhaps it is supposed to work, and it was broken by accident.

I suggest that you ask Maplesoft Tech Support ( support@maplesoft.com ) , @TomM , or submit a bug report.

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