Carl Love

Carl Love

26488 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

I assume that GenerateBipartiteTournaments is a procedure that you wrote. The output that you show indicates that that procedure was not found. (Note a procedure not being found is not explicitly an error.) To diagnose further, I'd need to see where you think you defined that procedure. 

Your problem with WeightMatrix is that you spelled it lowercased, weightmatrix. However, correcting that won't do any good until the first-paragraph problem is solved. At this point, G is not recognized as a graph.

If my guess about the definition of bipartite tournament is correct, then for the case at hand there'd be 2^(4*4) = 65,000+ of them. While Maple can easily loop through that number of graphs, surely you don't want all the output displayed in your worksheet. The time and memory required for the display would be far more than that for the computation.

Your integrand contains three square roots. A simple plot shows that one of those square roots has a negative radicand:

plot(-4*E^2+r^2, r= abs(l-R)..l+R); #l is letter ell, as you used.

The help page ?applyrule states that the rules for constructing rules are explained on help page ?patmatch. That help page explains extremely clearly what is happening and how to fix it. You need to include the keyword nonunit.

the_rule:= A::nonunit(anything) + B::nonunit(anything) = A*B;
applyrule(the_rule, a+b);

You should be able to search through the whole folder with the standard Windows File Explorer.

I could easily (oh, say, 3 lines of Maple code) write for you an operator constructor such that P(2,1) would be an operator that switches the 1st and 2nd operands of its argument, the X(...), which needn't be specified until time-of-use. You'd be able to replace (2,1) with any permutation on any finite number of symbols using any of the standard list-of-(lists-of)-distinct-small-positive-integers syntaxes that are commonly used for permutations. The easiest-for-me-to-program end-use syntaxes could be either

  1. P(2,1, ...)(X(i, j, k, ...)), or
  2. P(2,1, ...) &* X(i, j, k, ...),

where I've used ... to indicate that there'd be no limits on the number of arguments, and &* could be replaced with nearly any operator symbol, provided it begins with &. In either case, the P(2, 1, ...can be preconstructed (independently of X) and assigned to a variable.

It'd also be possible to use the standard multiplication operator *, but it's significantly more work (rough estimate: 40 lines of code) to overload existing operators, especially when they're commutative and associative and already have default meaning for the given expressions.

So, would something from the 1st paragraph be sufficient for your purpose?

There is some bug with your Maple 2015 GUI display such that the prettyprinted GUI display (only) of the 2nd set in your list is not shown in the order that the set is actually stored. That bug has since been corrected. Once you realize that the bug is in the way that the 2nd set is prettyprinted, everything else you show is consistent. And, as you realize, the way to "see around" such prettyprinting bugs is to use lprint.

Regarding the set order: For some strange reason, Maple's set order places the 2nd derivative of g before the 1st, yet the 1st derivative of Theta before the 2nd (in both Maple 2015 and 2022). By "set order", I mean the order in which the elements are actually stored, regardless of display. This order can't be controlled.

Once a set is stored in a Maple session, its order will never change. I think that Tom's Answer may give the impression that it may change, but that's absolutely false.

The basic command to get numeric values is evalf. In this case, you can replace solve with fsolve or with (evalf@[solve]). The fsolve will return both roots because the equation is polynomial. The other method will work more generally, but requires that the equation can be symbolically solved (which, of course, is true in this case).

Unfortunately, the direction angles are measured in degrees.

Use e:= exp(1) somewhere in your code, preferably early. Otherwise, e is just an unassigned variable.

The generalized problem can be solved like this:

restart:
s:= {"a", "b", "c", "d", "e", "f"}:
B:= [3,3]: L:= ListTools:-PartialSums([0,B[]]): m:= nops(B):
{seq}(
    {seq}(s[[seq](j[1+L[k]..L[k+1]])], k= 1..m), 
    j= Iterator:-SetPartitionFixedSize(B)
); 
             {{{"a", "b", "c"}, {"d", "e", "f"}}, 
               {{"a", "b", "d"}, {"c", "e", "f"}}, 
               {{"a", "b", "e"}, {"c", "d", "f"}}, 
               {{"a", "b", "f"}, {"c", "d", "e"}}, 
               {{"a", "c", "d"}, {"b", "e", "f"}}, 
               {{"a", "c", "e"}, {"b", "d", "f"}}, 
               {{"a", "c", "f"}, {"b", "d", "e"}}, 
               {{"a", "d", "e"}, {"b", "c", "f"}}, 
               {{"a", "d", "f"}, {"b", "c", "e"}}, 
               {{"a", "e", "f"}, {"b", "c", "d"}}}

 

The names that you use for the coordinate variables (such as rthetaphi) are irrelevant; you can use any names. The important thing is to use coords= spherical

You should use the command CodeTools:-Test.

One, and perhaps both, of your procedures contains indirect references to the parameters NN and MM. A procedure created with proc or -> cannot use indirect references to its parameters. Such procedures should be created with unapply instead:

cstr8:= unapply(G1 - FS, [NN, MM]);

You might need to do this with ATS also. From what you posted, I can't tell whether it has indirect references.

It can be done like this:

C:= <
    1, -0.5, 0.125, -2.449863383, 4.256426329, -1.826788463, 1.38888888e-3, 
    1.984126984e-4, 2.48015873e-5, 2.292633427e-4, -3.43791062e-5, -6.80212248e-5,
    4.06878271e-5, -5.03107054e-5, 3.795993196e-5, -1.28793671e-5, 1.752215748e-6,
    -5.518698119e-12
>:
Y:= unapply(C^%T.x^~<seq(0..17)>, x):
Y~([seq](0.0..1.0, 0.1));
 [1., 0.9492075127, 0.8916268943, 0.8251427077, 0.7534730280, 
   0.6839803183, 0.6254839642, 0.5860748693, 0.5709325210, 
   0.5801448253, 0.6065306590]

Of course, that doesn't match any column of the tables that you showed. No more can be said about that without seeing the original problem.

There are several possible interpretations of your problem. You said "a bunch of (x,y) coordinates". The first distinction that must be made is whether "a bunch" is 4 or more than 4. Possibly a second distinction must be made between one degree-3 polynomial or multiple degree-3 polynomials. All of these situations can be handled by 1 or 2 short Maple commands.

The interpretations:

1. You have exactly 4 points. This is the situation hinted at by Rouben's Answer. There is a unique polynomial of degree at most three that passes exactly through those points. The polynomial's coefficients can be determined by the process outlined by Rouben, or you can simply use the Maple command CurveFitting:-PolynomialInterpolation.

2. You have more than 4 points, but you know that you want a single degree-3 polynomial that goes through them all. This can't necessarily be done, but you can easily check whether it can. If it can be done, any subset of 4 of the points will give the same result (allowing some reasonable bounds for round-off error). Pick any 4, apply case 1, and see if the rest of the points fit.

3. You have more than 4 points, and you want the degree-3 polynomial that "best fits" all of them. The polynomial will not necessarily go exactly through any of the points; indeed, it's likely to not go through any exactly. This is called linear regression; the Maple command is Statistics:-LinearFit.

4. You have more than 4 points, and you want a smooth piecewise curve that goes exactly through them such that each "piece" is a polynomial of degree at most 3. This is called cubic spline interpolation; the Maple command is CurveFitting:-Spline.

First 17 18 19 20 21 22 23 Last Page 19 of 382