Carl Love

Carl Love

27353 Reputation

25 Badges

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

MaplePrimes Activity


These are questions asked by Carl Love

Suppose that a procedure is declared with option threadsafe and it has a local child procedure PC (possibly anonymous). Is their any benefit, or perhaps any detriment, to also declaring PC with option threadsafe? For example, is there any benefit or detriment to the yellow option threadsafe in this code below?:

P:= proc()
option threadsafe;
local PC:= proc()
option threadsafe; (* some code *) end proc;
    (* some code *)
    PC();
    (* some code *)

end proc;

What's going on in the following? Why can't I restore the default behavior of diff after using Physics:-diff or even just using with(Physics)? Is it because of Physics:-ModuleLoad()?

restart:

diff(conjugate(f(x)), x);

(diff(f(x), x))*(-conjugate(f(x))/f(x)+2*abs(1, f(x))/signum(f(x)))

Physics:-diff(conjugate(f(x)), x);

diff(conjugate(f(x)), x)

forget(.., conjugate(f(x)));

diff(conjugate(f(x)), x);

diff(conjugate(f(x)), x)

restart:

with(Physics):

:-diff(:-conjugate(f(x)), x);

diff(conjugate(f(x)), x)

 

Download PhysicsDiff.mw

I don't know why the prettyprinted output of my worksheet is shown the way that it is above. I didn't do anything differently than I usually do to upload a worksheet. Anyway, the output is simple enough that I think that my Question is still clear.

About a half hour ago, there was a Post titled "Read binary file" from a new user. I converted it to a Question. Now that I want to Answer the Question, I can't find it. If you are the author of that Question, and you still want an answer, please post it again, but put it in the Questions area.

(I think that there may be a bug in MaplePrimes that makes this happen. I've had it happen several times before.)

Anyway, please respond to this regardless of what you want regarding the Question. That'll help me figure out what went wrong.

The solution from LPSolve shown in the worksheet below is displayed very weirdly:

  1. The first element is rounded to 3 significant digits.
  2. The variable indices have decimal points.
  3. Zeros are displayed as just decimal points with no digit 0.

Closer inspection (with, say, lprint) will reveal that the weirdness is only with the prettyprinting; the actual entries are as expected.
 

restart:

<(kernelopts,interface)(version), interface~([prettyprint, typesetting])[]>;

Vector(4, {(1) = `Maple 2022.1, X86 64 WINDOWS, May 26 2022, Build ID 1619613`, (2) = `Standard Worksheet Interface, Maple 2022.1, Windows 10, May 26 2022 Build ID 1619613`, (3) = 2, (4) = extended})

(a,b,c):= (2,4,5):

X:= Matrix((a,b), symbol= x):
Y:= Matrix((b,c), symbol= y):
Z:= Matrix((a,c), symbol= z):

RegionC:= <5, 15, 8, 10, 15>:

RegionA:= <90, 75>:

RegionB:= <35, 20, 30, 15>:

Cost1:= <
    2, 1, 3/2,   3;
  5/2, 2, 7/2, 3/2
>:

Cost2:= <
    3/2, 4/5, 1/2, 3/2,   3;
      1, 1/2, 1/2,   1, 1/2;
      1, 3/2,   2,   2, 1/2;
    5/2, 3/2, 3/5, 3/2, 1/2
>:

Cost3:= <
    11/4, 7/2, 5/2, 3,   5/2;
       3, 7/2, 7/2, 5/2, 2
>:

Cost__Total:= (add@(add@`*`~)~)([Cost||(1..3)], [X,Y,Z]):

CapB:= add(X[i], i= 1..a) <=~ RegionB:

CapA:= add(<X|Z>[..,j], j= 1..b+c) <=~ RegionA:

ReqC:= add(<Y,Z>[i], i= 1..a+b) >=~ RegionC:

InEqOutB:= add(<X, -Y^%T>[i], i= 1..a+c) =~ 0:

Cons:= seq~({CapA, CapB, ReqC, InEqOutB}):

Sol:= Optimization:-LPSolve(Cost__Total, Cons, assume= nonnegative);

[103.800000000310, [x[1, 1] = HFloat(0.0), x[1, 2] = HFloat(20.000000000344205), x[1, 3] = HFloat(7.999999999311598), x[1, 4] = HFloat(0.0), x[2, 1] = HFloat(0.0), x[2, 2] = HFloat(0.0), x[2, 3] = HFloat(0.0), x[2, 4] = HFloat(15.000000000688408), y[1, 1] = HFloat(0.0), y[1, 2] = HFloat(0.0), y[1, 3] = HFloat(-1.7763568394002505e-15), y[1, 4] = HFloat(0.0), y[1, 5] = HFloat(0.0), y[2, 1] = HFloat(0.0), y[2, 2] = HFloat(15.0), y[2, 3] = HFloat(5.000000000344206), y[2, 4] = HFloat(0.0), y[2, 5] = HFloat(0.0), y[3, 1] = HFloat(5.000000000000002), y[3, 2] = HFloat(0.0), y[3, 3] = HFloat(0.0), y[3, 4] = HFloat(0.0), y[3, 5] = HFloat(2.9999999993115956), y[4, 1] = HFloat(0.0), y[4, 2] = HFloat(0.0), y[4, 3] = HFloat(2.9999999996557944), y[4, 4] = HFloat(0.0), y[4, 5] = HFloat(12.000000000688413), z[1, 1] = HFloat(0.0), z[1, 2] = HFloat(0.0), z[1, 3] = HFloat(0.0), z[1, 4] = HFloat(0.0), z[1, 5] = HFloat(0.0), z[2, 1] = HFloat(0.0), z[2, 2] = HFloat(0.0), z[2, 3] = HFloat(0.0), z[2, 4] = HFloat(10.0), z[2, 5] = HFloat(0.0)]]

 

 

Download BadLPSolveDisp.mw

The last several times that I've tried to use the Delete As Spam feature I've gotten an error message Error Generating Page, and the spam was not deleted. Anyone know what's happening? 

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