Carl Love

Carl Love

28045 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

  1. Why do you want the result specifically to be a Matrix? You have the rows indexed by time and the columns indexed by frequency. Using a Matrix forces the number of entries to be (1 + number of times) x (1 + number of frequencies). By using a table instead of a Matrix, you wouldn't be restricted to the rectangular format; you could have separate times for each frequency.
  2. The way that you defined S3, it is an expression, not a procedure. Yet in the Matrix command you invoke S3(k) as if it were a procedure. Consequently, the current Matrix is filled with garbage, as you'll see if you inspect a few random entries.
  3. How would you do it in Matlab? It may be worthwhile us to directly translate some Matlab code.
  4. All you're doing is numerically evaluating S3 and different values of t of k. So why isn't having a procedure S3 of parameters t and k good enough? Why do you need a huge file of numeric evaluations of that procedure? It's not as if the procedure would take any significant amount of time to evaluate---it's quite a simple procedure.

@tsunamiBTP I might give a thumbs up to a Question that I recognize deserves further attention from someone else and that has sufficient richness and complexity, but for which I currently don't have an Answer.

I can't run your code because I don't have the module action1.

@tomleslie Your Answer doesn't take into account that the final product is supposed to be an animation of two frames.

@Jason Lee For the new problem, you should have

b:= A[.., 7];
C:= A[.., [1..6, 8..11]];

Is that what you have? The indexing for C can also be abbreviated to A[.., [..6, 8..]].

@qyyj

faultcom={};

should be changed to

faultcom:= {};

and likewise for the following line.

 

@juju1234 After you change a cell value, try pressing Ctrl-Shift-Enter. This'll re-execute everything. Changing something on the screen, such as a cell value in B, doesn't change what's stored in Maple's computational memory (aka the kernel). That B stored in memory won't change until you press Enter on the line (or execution group) with the updated cell. Ctrl-Shift-Enter is like pressing Enter on every line (or execution group) that contains code.

@Volker Lehner I thought that it'd be important to re-emphasize this for a new user: To enter a new line in a block of code (a procedure or whatever), you must use Shift-Enter, not Enter. Using Enter makes the cursor "jump out" as you say. It also causes the code to be syntax checked and evaluated.

@Rouben Rostamian  In order to use arguments that are passed in square brackets immediately to the right of the procedure's name, the procedure must access those arguments via the construct op(procname). If this isn't done, then those arguments are completely ignored, which is what's happening in your g[12](5) example.

By tracing the execution by using high settings of printlevel, I see that is(ex, rational) and is(ex, irrational) (for symbolic constant expressions ex) uses a lot of decimal approximations. This suggests that the setting of Digits might affect the outcome.

Surely either you have transcribed the problem incorrectly or your copy has a typo. Let f(k) = 2*k/(2*k+3), and consider the limit

L:= limit(n^p*sum(f(k), k= 1..n), n= infinity)

for a fixed real parameter p. It is easy to prove (and I'll prove it if you want) that L = 0 if p < -1, L = 1 if p = -1, and L = infinity if p > -1. One doesn't even need to know a closed form for the sum to prove this.

@_Maxim_ Yes, I see that 'type' now; I missed it last night. I was thrown off by the And(complexcons, Not(infinity)). That's already a valid type, so why does it get special mention? Perhaps infinity wasn't a type when the code was written.

The age of the code is also shown by map(type, {op(e)}, 'property') = {true} . In modern Maple, this could (and should) be replaced by andmap(type, e, 'property').

I didn't disagree with Acer about a type being usable anywhere that a property was. I merely said that if it isn't also specifically coded as a property (e.g., by being listed in `property/ParentTable`), then there was nothing interesting that is could do with it. I mean, yes, you can use is as a replacement for a dedicated type checker, but I don't think that it's wise to do so.

@vv It was mostly wishful thinking on my part. Upon delving into the code, I think that is is a huge mess, and that a lot of what I wrote above is wrong. Since is is fundamental to Maple, and the person who wrote it (Gaston Gonnet, I believe) is not maintaining/updating it, perhaps Maplesoft is afraid to touch it for fear of breaking something.

Regarding "Of course, any type is a property": Read the very simple procedure `type/property`. That'll tell you exactly which types are properties. It'll also help you distinguish the proper properties: those that have a definition other than as types.

@Ramakrishnan You need to enclose the SetProperty commands inside of print commands, like this: print(SetProperty(  whatever ));

It makes no difference whether you end the commands inside the loop with colons or semicolons.

Are you going to post your algorithm?

First 352 353 354 355 356 357 358 Last Page 354 of 709