Joe Riel

7864 Reputation

22 Badges

14 years, 257 days

MaplePrimes Activity

These are replies submitted by Joe Riel

It's not clear to me that your example makes sense.  As I expect, F1 is a vector field with components functions of the two coordinates, x1 and x2 (p1 and p2 are fixed parameters).  F2 is only a function of p1 and p2; as such it is a constant vector field. Is that what you want?

A StepResponsePlot method could be useful; I'll look into adding one.  In the meantime, creating the step response for a discrete system is easy enough:


Inspecting it reveals the issue with this system; the system has no DC component, i.e. the step response's final value (total step) is 0. The various computations of StepProperties are normalized to that magnitude, so they all become undefined.

@Anthrazit Property is the sole export of the module.  AISCTable is a local variable to the module. The way I discovered that was by interactively debugging the Property procedure:

stopat(Property): # instrument Property procedure to launch debugger when called
Property("W8X21","W"); # this should invoke the debugger

With the debugger started, execute a few into commands to step into a nested conditional. You'll then see the Maple statement


From that you can determine that AISCTable is a local variable assigned a table (possibly a record, but in fact is a table). It's entries are also tables, hence the second index.

Possibly easier is to just print and inspect the Property procedure

AISCShapes:-Property := proc(requiredMember::string, requiredPar::string)
local parPos, memberPos;
   1*  if _npassed = 2 then
   2       if requiredMember in AISCShapes:-memberNames and requiredPar
             in AISCShapes:-parNames then
   3           AISCShapes:-AISCTable[requiredMember][requiredPar]
   4           if not (requiredMember in AISCShapes:-memberNames or 
                 requiredPar in AISCShapes:-parNames) then
   5               error "Member and parameter not found"
               elif not requiredMember in AISCShapes:-memberNames then
   6               error "Member not found"
               elif not requiredPar in AISCShapes:-parNames then
   7               error "Parameter not found"
               end if
           end if
       elif _npassed = 3 and _passed[3] = "metadata" then
   8       parPos := ListTools:-Search(requiredPar,AISCShapes:-parNames);
   9       return AISCMetadata[parPos+1,5]
       elif _npassed = 1 and _passed[1] = "allmembers" then
  10       return AISCShapes:-memberNames
       end if
end proc

Apologies for the typo in the original response, it happens.

@Kitonum If you don't mind reverse lexicographic order, there is an iterator for that

P := Interator:-Partition(5):
for p in P do printf("%{}d\n", p[1..length(P)]); end do:
4 1
3 2
3 1 1
2 2 1
2 1 1 1
1 1 1 1 1

Will look into adding an option to reverse the order

Note that the first statement in acer's response assigns the list of items that appear in the listbox.  The next statement selects one of those items; that is, it must be an item in the list already stored in the listbox.

*Followup* this more or less precludes storing the same item twice in a listbox.

@dingtianlidi You might try upgrading your MapleSim; it appears to be 2019.1. The 2019.2.1 update is available for all users. I don't know that it will resolve this, but I haven't been able to reproduce it in 2019.2.

I have seen the issue with the repeated Re in the probe window; it goes away if the probe is deleted and added.  I'll file a bug report for that.

I haven't been able to reproduce that, neither by using the msim you uploaded nor by opening the example for the Users Guide.  The msim that you uploaded appears to differ slightly from the one whose image you display in that the quantities selected in Probe1 are not the same.  Could you try resaving the msim (that fails) and reuploading it?  Thanks.

@Kitonum A minor point.  A more efficient way to do the sort is to use the key option to sort.

sort(L, 'key' = evalf):

@Carl Love That's because Permute first sorts the list; that was done to more easily handle the case where the list contains repeated items, however, I should probably modify that to avoid sorting unless there are repeated items.  Or eliminate it altogether.  So far as efficiency goes, some small testing indicates that there may not be a benefit to doing the "transfer" I had previously mentioned.

@Carl Love I believe that your method will allocate more memory as a separate Array must be generated for each permutation (even though it is ultimately discarded). That shouldn't be the case when using an assignment with empty brackets on the left hand side (Maple will realize that it should do a transfer, not an allocation).

Note that I updated my response, above.  I had forgotten that Permute can already handle an arbitrary list of expressions, so neither method is necessary.

Also, rtable indexing by an rtable only works with programmer's indices (parentheses, not brackets).

@Carl Love Thanks for the response. There is a more efficient technique to transfer the permutation output of the Permute iterator to a given Array of arbitrary expressions. As with the Iterator design, it reuses an Array to minimize memory allocation.  I'll add this as an example to the Permute help page.

A := Array(1..5,[a,b,c,d,e]): # Array of elements to permute.
B := Array(1..5):             # output Array
P := Iterator:-Permute(5):
for p in P do
    B[] := A(p);              # permute A according to p and store result in B 
    printf("%{}a\n", B);      # print (replace with something useful)
end do:

Followup I had forgotten that Permute already can do this automatically, just pass in the list of expressions:

P := Iterator:-Permute([a,b,c,d,e]):
for p in P do printf("%{}a\n",p); end do:

@Carl Love Another alternative, if you have access to the source code, is to insert a call to  DEBUG() at the point you want to stop at.

@Carl Love Keyword parameters can match more than one keyword, by enclosing the keywords in a list; the first element in the list is used internally.  So for the OP's purpose, a nice way to extend this is the following

PlotGraph:= proc(func::anything
                 , {[view,zoom] :: list({range(realcons), identical(DEFAULT)}) := [DEFAULT$2]}

    plot(func, _options['view'], _rest)
end proc:

Now you call PlotGraph with either the view or zoom option, they do the same thing.

data := ExcelTools:-Import("rr.xlsx"):
amp := data[..,2]:
fsamp := 1/data[2,1];
Periodogram(amp, 'samplerate'=fsamp, 'powerscale'="absolute");

Note that the frequency scale is linear, not log, as yours is. I couldn't find an option to use a log scale with the Peridogram function, however, you can always right click on the plot, select axes > properties and set the horizontal scale to log mode. Also note that your plot has a maximum frequency of 50 Hz, which is strange because the sampling frequency is 50 Hz, so the Nyquist limit is 25 Hz.

@kambiz1199 What is the first column?  Time in seconds?

1 2 3 4 5 6 7 Last Page 2 of 180