Preben Alsholm

13663 Reputation

22 Badges

19 years, 315 days

MaplePrimes Activity


These are replies submitted by Preben Alsholm

@mmcdara To me it is obvious mathematically that any definite integral of 0 should return 0 pure and simple.
It is another question what happens when you first integrate a (symbolic) constant like C over an infinite range.
To answer your question:
 

z :=0:
i := +infinity:
z*i ;  # = ???

Maple 2023 returns undefined which is reasonable to me and I don't consider that inconsistent.
The same answer comes from direct input:
 

0*infinity;

Answer: undefined. Also fine!

In Maple 2023 the two integrals return 0 whether in 1D or 2D.
Not so in Maple 2021 and Maple 2022. I don't have Maple 2019 nor 2020 on this machine.
The help page does mention the syntax for the ranges as required to be in a list. It seems not to make a difference in any case.
 

@Dkunb You are using the the same initial conditions as in the first round. So in order to pass over to the interval 1.1..2.5 the integration must pass the obvious singularity at R=1.
So where do you want to start on the other side of 1 and in case of T with which value?

@Brian Hanley Try your code without using the ColorTools package, but using [gray,gray] instead.
 

restart;

with(plots):
#with(ColorTools);
#cGr4s := Color([0.50, 0.50, 0.50]);

contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, color = black, thickness = 3, coloring = [gray, gray], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);

contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = false, color = black, thickness = 3, coloring = [gray, gray], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);

contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = true, color = black, thickness = 3, coloring = [gray,gray], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);


For the first two of the contourplot3d commands I get the error:

Error, (in plot3d) unexpected option: coloring = [gray, gray]

The last command works fine.
 
Thus I can't see that the ColorTools package has anything to do with this behavior.

You are assuming that d is nonnegative:
Executing the following doesn't give degrees, minutes, and seconds:
 

dms(-45.2365);

Maybe this would help, it seems so:
 

restart;
dms := proc(d, m := 0, s := 0)
 local con, d1, d2, d3; 
if 0 <> frac(d) then 
   d1 := floor(d); 
   d2 := floor(60*frac(d)); 
   d3 := 60*frac(60*frac(d)); 
   con := cat(d1, `° `, d2, `' `, d3, `"`); 
else 
con := d + m/60 + s/3600; 
end if; 
cat(con,`° `); 
end proc;

 

@Brian Hanley The error I get from your first two commands is:

Error, (in plot3d) unexpected option: coloring = [ColorTools:-Color("RGB",[.50, .50, .50]), ColorTools:-Color("RGB",[.50, .50, .50])]

whereas the error I get from your comment example is:


Error, (in plot3d/options3d) unexpected option: `filledregions=true, coloring` = [cGr1s, cGr1s]

which is quite understandable since   `filledregions=true, coloring`  is a name!

Note. The code for contourplot3d can be seen here:

showstat(`plots/contplot3d`);

and is quite short piggybagging (as you said) on plot3d.
I'm using Maple 2022 as you are.

@acer I find the same error in Maple 2022.2:

Download Maple2022_2_simplify.mw

@mmcdara The error occurs also in Maple 2022.2, but NOT in Maple 2021.2.
Even in Maple 12 there is no problem although the denominator is slightly larger than the one in 2021.2.

@QM I deleted your answer as I deemed it quite inappropriate. You were "answering" your own question, which is OK in itself, but the content wasn't relevant to your own question to put it mildly.
Incidentally, I think this is the first time I have seen somebody select his own answer as the best.

@acer Thanks for pointing out my confusion. Thinking about limit and maximize at the same time must have confused me.

I ran your worksheet in Maple 2023.0.
I was puzzled by the output from the first example's convert/Diff that on my computer doesn't join the Diffs.
and therefore looks weird.
The same happened with the other convert/Diff examples.
Replacing all the Diff's in the worksheet with diff made the results look nice as it apparently does in your version of Maple.
############
This problem is also present in Maple 2022.2, but not in Maple 2021.2.
I shall submit an SCR.

@mmcdara Using your example we see another failure of maximize here:
NB: Forget about this, please. My mistake!

restart;
u := (1 + 20230321)*x*y - (x^2 + y^2)/2;
v := collect(eval(u, [x=lambda*cos(t), y=lambda*sin(t)]), lambda);
v:=combine(v);
vt:=eval(v,lambda=t);
limit(vt,t=infinity); # OK: undefined
maximize(vt); # OK: Returns unevaluated
maximize(v);  # Not OK: Returns infinity
#####
debug(minimize); # maximize(v) is basically defined as -minimize(-v)
maximize(v);

 

I have set default zoom at 125%.
To do that go to Tools/Options/Interface/Default zoom and choose the zoom percentage you prefer.
Press the button Apply Globally below. You can always change it if you don't like what you have chosen.

@QM DirectSearch:-GlobalOptima does fine. It is a numerical program though.
 

restart;
with(DirectSearch);
u:=20230322*x*y - 1/2*x^2 - 1/2*y^2;
GlobalOptima(u,maximize);

DirectSearch is available from the Maple Application Center for free.

Adding ranges helps.
 

maximize(u, x=-1..1, y=-1..1, location);

Obviously, the unrestricted u has no finite maximum:

eval(u,y=x) = 20230321*x^2.

 

First 10 11 12 13 14 15 16 Last Page 12 of 229