eclark

261 Reputation

8 Badges

21 years, 187 days

MaplePrimes Activity


These are replies submitted by eclark

I think that will do nicely if I can get it to work. Thanks for the suggestion!  --Edwin

Thanks, I was able to delect the animation from the cloud. 

@acer  Thanks for the suggestion. I tried uploading the animation with everything but the animation stripped away. When I attempt to up load to the cloud I get "Document too large". It is 157,804 KB. Is there a remedy for this. I tried twice. Maybe it could be zipped and uploaded or something like that?  --Edwin

@vv   This way doesn't give the desired output, namely something of the form a..b.

Namely I want something acceptable in a statement  plot(p,theta = a..b). You cannot replace a..b by RealRange(a..b).

@tomleslie  I am sorry to have annoyed you. Actually I had not thought of infinities or symbols as endpoints when I originally stated my question. This only arose later in the course of discussion when Kitonum showed it was possible.

Actually according to my original question, namely,

Is there a comand to convert something like {theta <=b, a < theta} to
a..b (assuming a and b are real numbers in some form)?  I can think of a rather complicated procedure to do it, but there should be something simpler.

 I did not intend to ask for a procedure to perform this task, I knew that was possible. Rather I wondered if there is a simple builtin conversion to perform this task? Apparently not.  It might be a good idea for the developers to add a command convert/range to the many other possibilies at ?convert.  They do have a command convert/RealRange but that does something different. I am still not sure it is not there somewhere and I have just failed to find it.

 

 

 

@tomleslie   I like the idea of avoiding min and max, but you have some more fiddling to do. Note the failure in this case:

>S:=solve(t < b, t);
                            {t < b}
>f(S,t);
      Error, (in f) improper op or subscript selector

It should give -infinity..b 
 

@Kitonum  Very nice solution. I forgot about the infinities. That may be useful sometime. So far all my intervals have been finite. But one never can tell. Thanks, Edwin.

I may as well add my way to skin this cat.

ConvertToRange:=proc(L)
local t,LL,W,a,b,v;
W:=map(t->op([lhs(t),rhs(t)]),L);
v:=indets(L);
LL:=remove(t->evalb(t in v),W);
b:=max(LL);
a:=min(LL);
a..b;
end proc:

L:={theta <= Pi-arccos(-3/4+(1/4)*sqrt(13+16*sqrt(2))), arccos(3/4) < theta}:
ConvertToRange(L);
            arccos(3/4) .. Pi-arccos(-3/4+(1/4)*sqrt(13+16*sqrt(2)))

Thanks for the clarifications.  I had looked at the help page for arctan(y,x). But I had not evaluated the values of y and x. I see that x = y = 0 when theta = Pi. I also see that maximize does not necessarily return the maximum, rather the supremum and a point at which the supremum is attained or approached.

The thing that annoys me is that p was given to me by solve and I know that when theta = Pi my solution should be a non-zero value for p  (namely, the value 4*Pi/5 given by maximize.)  Now this would be correct if arctan(0,0) = argument(0) were undefined. The the formula could not be said to be incorrect. But by giving 0 for theta = Pi, it gives a misleading solution. 


Help says, "For real arguments x, y, the two-argument function arctan(y, x), computes the principal value of the argument of the complex number x + I y"

Perhaps it would be best if argument(0) were set to undefined?  According to https://en.wikipedia.org/wiki/Argument_(complex_analysis)#Computation the principal value of the argument of 0 is undefined. So I would think that arctan(0,0) = argument(0) should be changed to "undefined".

 

@Scott03 

Is it possible to make such choices in View>Show/Hide Contents global or

somehow set things so that one gets automatically the same setting for

each new worksheet?

 

Edwin

@Markiyan Hirnyk  I don't know what you mean by, "Can you base these words". Yes, I know that Factor and Factors are  different. However Factors(p) mod 2 is more convenient if one want to access the actual factors. Here's my previous procedure using Factors:

You will agree that the new one using Gcd and Divide is better:

 

simp:=proc(p)
local q1,q2,q11,q22,num,r,j,den,r1,r2,f;
global x,y;
q1:=Factors(numer(p)) mod 2;
q2:=Factors(denom(p)) mod 2;
q11:=q1[2];
q22:=q2[2];
num:=1;
for f in q11 do
for j from 1 to f[2] do
num:=f[1]*num;
od;
od;
den:=1;
for f in q22 do
for j from 1 to f[2] do
den:=f[1]*den;
od;
od;
r:=num/den;
r1:=expand(numer(r)) mod 2;
r2:=expand(denom(r)) mod 2;
r1/r2;
end proc:

@Markiyan Hirnyk

 

By the way I am more interested in rational functions in several variables than

I am polynomials. And I have to do a lot of simplifying and comparison of rational

functions in fields like F(x,y), F = Z/(2).

--Edwin

@Markiyan Hirnyk  After seeing your Divide suggestion I thought of a simpler way to write

my procedure---using Divide and Gcd without using Factor. This is more natural and less messy than

using Factors  mod 2.

Simp:=proc(r2)
local r,p,q,d,P,Q;
global x,y;
r:=simplify(r2);
p:=numer(r);
q:=denom(r);
d:=Gcd(p,q) mod 2;
Divide(p,d,'P') mod 2;
Divide(q,d,'Q') mod 2;
return P/Q;
end proc:

 

@Markiyan Hirnyk 

 

That's fine if you know the factors of the numerator and denominator of r(x,y)

but suppose r(x,y) = p(x,y)/q(x,y) where p(x,y) and q(x,y) have no rational factors

in common, but

                      p(x,y) = a(x,y)b(x,y)c(x,y) (mod 2)

and

                      q(x,y) = d(x,y)e(x,y)b(x,y) (mod 2)

then I want r(x,y) = (a(x,y)c(x,y))/(d(x,y)e(x,y)) where

numerator and denominator are expanded.  As I said I have a procedure (somewhat messy)

that does this but I'm asking it there is a simple Maple command to do this simplification mod 2.

 

---Edwin

 

Here's an example that shows how to plot the points in the orbit produced by the procedure Orbits:

By the way I should have named that procedure Orbit since it produces a single orbit.

 

with(plots):
A:=Matrix([[cos(Pi/50),-sin(Pi/50)],[sin(Pi/50),cos(Pi/50)]]):
pointplot(Orbits(A,[1,1],50),style=point,symbol=circle,color=red);

1 2 3 Page 1 of 3