Joe Riel

9660 Reputation

23 Badges

20 years, 3 days

MaplePrimes Activity


These are replies submitted by Joe Riel

@rquirt The help for the ports (click the help icon on the Configuration header, and then the Ports header) just mentions that the name of a custom port has to be entered.  It really should also mention that the fully qualified name can be used for any port defined in an accessible Modelica library.  I'll add that to the description.

@tomleslie In 2018 Satisfy was upgraded to use MapleSAT (naturally), an external SAT-solver based, at least originally, on miniSAT. This has made it significantly more effective.  I agree, the examples on the Satisfy help page don't give one the impression that it can do much.

Just noticed that the given solution contains no 1 or 2 and 2 81's  Must have missed a necessary condition.  Will investigate tomorrow.

Follow up The fix was to add a rule requiring that the number 1 appears on some cell.

   one := &or(seq(seq(x[i,j,1], i=1..n), j=1..n)):

The adjacency rule than ensures that all other numbers appear.  I uploaded the corrected worksheet but left the post alone.

Later Realized that the actual error was in the formulation of allvals. The simple fix was to remove it completely, with the one rule it (or the corrected version) is not needed.  Uploaded a new mw file.

@Carl Love Yes, I started to reply to the OP, then noted the bug.  Have a fix for it, but that won't help now.

@Carl Love Alas, that doesn't give a solution, at least not with the defining boundary and initial conditions:

eq1 := diff(u1(x, t), x, x) = k1*(diff(u1(x, t), t));
eq2 := diff(u2(x, t), x, x) = k2*(diff(u2(x, t), t));
bc1 := u1(0, t) = v1;
bc12 := u1(L,t) = u2(L,t), k1*D[1](u1)(L,t) = k2*D[1](u2)(L,t);
bc2 := u2(2*L, t) = v2;
ic1 := u1(x,0) = 0;
ic2 := u2(x,0) = 0;

sys := {eq1,eq2,bc1,bc2,bc12,ic1,ic2}:
sysnum := subs({L = 10, v1 = 20, v2 = 10, k1 = 10, k2 = 20}, sys);
sol := pdsolve(sysnum, [u1,u2](x,t) );

I don't use pdsolve enough to know whether that should work, but it can handle the simpler

pdsolve({eq1,bc1,u1(L,t)=v2,ic1},[u1](x,t));

Note that bc1 and bc2 conflict with ic1 and ic2 at x=0 and x=2*L, however, I assume that isn't a problem; it wasn't for the simpler case.

@Christopher2222 The Maple macro command isn't all that useful for its intended purpose, which, as mentioned in the first sentence of the help page, is to be "a simple abbreviation facility to be used when writing Maple functions and library code."  While it may have been used for that many releases ago, when Maple library procedures were table-based and hence globally assigned, the transition to modules makes it almost pointless.  The reason is that the call to macro must be at the global level; that doesn't work well when the source for a procedure in which you want to define and use a macro is located in a separate file that is at a lower part of module hierarchy. Maple's preprocessor macros are better suited for this purpose as they can be locally defined and undefined. 

@Christopher2222 Converting to a string and parsing is going to ensure the names are globals.

 

While you should first try with the correct format, it is possible that the Maple server has been configured to restrict the ability to write to external files.

@acer If the assignment operator could be overloaded (it currently cannot---a good thing) it could be made to do something, though without some other mechanism it isn't clear what. There are a few assignments that use a special syntax on the lhs: directly assigning to a remember table and assigning content of an rtable are two examples.

@acer Nice options.  The third can be slightly simplified by dropping the i in the seq: [seq(4..1,-1)].

@Carl Love The answer is that I wasn't thinking about thread-safety. It's good that you brought that up.

Be sure to define and check the corner cases.  Specifically, what do you want for, say, [1,1,2,2].  Is 1 or 2 the second-highest element?  What about [1,1,1,1]?  Or for the empty list (Maple's max returns -infinity).

@Carl Love Nice explanation and example. A nit---probably best ignored---is that Maple error messages generally start with a lower case letter, they look better that way as the usual output is "Error, <the error message>".

You could use two prismatic joints to enforce a planar motion.  The planar joint could also be used.  A different approach would be to use the sphere-rectangle contact, though that would allow motion off the surface (bouncing).

@a_simsim It helps to know why two backslashes are required, in a Maple string, to represent a Windows directory separator. The backslash is used as an escape character, to permit entering special characters (new-lines, tabs, arbitrary ascii). As such, to enter the escape character itself, you need two of them, the first "escapes" the second.

First 18 19 20 21 22 23 24 Last Page 20 of 195