Joe Riel

9660 Reputation

23 Badges

20 years, 4 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@Kitonum Yes, Equate is nicer still.

@Kitonum Nice solution. The siderels can be more easily entered as convert(A.B-C,set).

@Carl Love Very nice, Carl. For those not aware, the sparse indexing function means any unassigned entries map to 0.

@md7007 Interesting; I had the same issue with the file you uploaded. I emailed you the file.

@md7007 Apologies for the delay. I created a really simple model and attached two templates. One is the LinearAnalysis template; it can be used directly because the model is already linear.  The worksheet template shows how you can use the API:-Linearize command to linearize a subsystem.  I used MapleSim 6.4 because I didn't have 6.2 handy, I think these will work there.

 NaturalFrequenc.msim

What version of MapleSim do you have?

@Carl Love I'm still trying to see how that would be useful, particularly for one of the supplied dictionaries.  It sort of makes sense if I use Create to create a small dictionary, but even then the typical use case is more like a grep, in which you want to use regular expressions. I don't see a real-world use for this.  

I just thought it might be applicable for creating an index, but no, that doesn't work.  Search returns the location in the dictionary, not the text.  I don't get it. Why would I ever want to search a large amount of text and be given locations in a dictionary of words in the text?  

This is a bit off-topic, though related. What is the purpose of StringTools:-PatternDictionary?  How would it ever be useful?  In the application for which it is being used here it is quite inefficient. I must be missing something obvious.

 

See the responses to your other post concerning returning multiple results.  Here, nothing past the first return statement will be executed.

@casperyc If you use a Vector, rather than a list, you could do

printf("%{s}d\n", <0,0,1,1>):
0011

See the help page rtable_printf. You could create the Vector on the fly, though that is a bit inefficient (probably not a concern):

val := [0,1,0,1]:
printf("%{s}d\n", <val>):
0101

 Hmm. Simpler might be

printf(cat("",op(val),"\n")):
0101

 

I checked the file, there is nothiing salvageable in it, just standard header stuff.  

The if statement is incomplete, it is missing a then clause.  The condition is suspect; you probably want to test using <= rather than =. Consider

if errorrRK3[N] <= 0.001 then break; end if;

 

@Markiyan Hirnyk That may fail if the members of d are not unique. That is, it might return an index that wasn't a member of F.

In order to be inline, a procedure must, among other things, have no local variables.  That is the case here, however, it should have local variables, i and j. As it is, they are globals.  Because they are global, the procedure will fail if either i or j is protected. While it is unlikely anyone would protect i or j, it's best not to depend on that.

This was supposed to be a response to Carl's post, sorry for putting it in the wrong location.

@Carl Love Your observation is correct.  The Iterator:-CartesianProduct is hampered because it works with lists as inputs, so it needlessy transforms its output. A better iterator to use, for this particular application, is MixedRadixTuples.  If your K was then [10$6] it is faster (and uses significantly less memory). 

First 45 46 47 48 49 50 51 Last Page 47 of 195