vv

13827 Reputation

20 Badges

9 years, 317 days

MaplePrimes Activity


These are answers submitted by vv

This solution is longer but seems to be easier to follow.

Area:=proc(rel::set(relation))
local x,y, xy:=indets(rel,name),S, ff, u;
if nops(xy)<>2 then error "Two vars only!" fi;
x,y:=xy[];
S:=remove(hastype, [solve(rel)],`=`);
ff:=proc(rel)
local t,ux,uy,x1:=NULL,x2:=NULL,y1:=NULL,y2:=NULL, r:=rel;
ux:=select(t -> (lhs(t)=x and not has(rhs(t),y)) or (rhs(t)=x and not has(lhs(t),y)), rel);
uy:=select(t -> (lhs(t)=y and not has(rhs(t),x)) or (rhs(t)=y and not has(lhs(t),x)), rel);
if nops(uy)=2 and nops(ux)=0 then 
   ux,uy:=uy,ux; ux:=subs([x=y,y=x],ux); uy:=subs([x=y,y=x],uy); r:=subs([x=y,y=x],rel) fi;
if nops(ux)=2 and nops(uy)=0 then
   uy:=r minus ux;  if nops(uy)<>2 then error "Unusual solve solution" fi; 
   if rhs(ux[1])=x then x1:=lhs(ux[1]) fi;
   if rhs(ux[2])=x then x1:=lhs(ux[2]) fi;
   if lhs(ux[1])=x then x2:=rhs(ux[1]) fi;
   if lhs(ux[2])=x then x2:=rhs(ux[2]) fi;
   if rhs(uy[1])=y then y1:=lhs(uy[1]) fi;
   if rhs(uy[2])=y then y1:=lhs(uy[2]) fi;
   if lhs(uy[1])=y then y2:=rhs(uy[1]) fi;
   if lhs(uy[2])=y then y2:=rhs(uy[2]) fi;
   if nops([x1,x2,y1,y2])<4 then error "xk or yk null" fi;
   return simplify(int(1,y=y1..y2,x=x1..x2));
else error "Unable to compute!";
fi;   
end:
add(ff(u), u=S);
end:

R:={abs(abs(x-y)-abs(x+y)) >= 2*y-x+1, (x+1)^2+(y+1)^2 <= 2}:
Area(R);

radnormal(%);

evalf(%);
    4.419820813

[I could not upload the worksheet.]

It is a typesetting bug.

- If you execute
eval(%);

the strange term disappears.

- If you set
interface(typesetting=standard);
and re-execute, ==>

Error, (in print/diff) unable to display this derivative. Would you please report the problem to support@maplesoft.com

 

Yes, it's a bug.

I have renamed the variables (see the attach) and I wrote the system in a matrix form.

read "EQX.txt":
V:=[indets(EQX)[]]:nops(V);

                              1020
with(LinearAlgebra):
A,b:=LinearAlgebra:-GenerateMatrix( EQX, V ):
Rank(A);

                              326

Rank(<A|b>);
                              327

So, the system is incompatible (normally, Maple cannot be wrong for this computation, but we never know ...).

EQX.txt

 


 

It is usually useful to have a global parametrization.
The surface can be then manipulated and the plot has a better quality.

restart;

R:=[z^2+y^2=1, x^2+y^2=1]:

sph:=[r*sin(u)*cos(v),r*sin(u)*sin(v), r*cos(u)]:

rr:=min(abs~(solve~(eval(R, [x,y,z]=~sph),r))):

param:=eval(sph,r=rr);

[min(1/abs(sin(v)^2*sin(u)^2-sin(u)^2+1)^(1/2), 1/abs(sin(u)))*sin(u)*cos(v), min(1/abs(sin(v)^2*sin(u)^2-sin(u)^2+1)^(1/2), 1/abs(sin(u)))*sin(u)*sin(v), min(1/abs(sin(v)^2*sin(u)^2-sin(u)^2+1)^(1/2), 1/abs(sin(u)))*cos(u)]

(1)

plot3d(param, u=0..2*Pi,v=0..Pi);

 

The algorithm is simple.

Let {[x_k, u_k] :  k=1..n} union {[x_k, v_k] :  k=1..n}
be the extreme points given by convexhull.
Here u_k <= v_k, equality being possible.
(Obviously there cannot be 3 points with the same abscissa)
Also x_k are all distinct; one may suppose x_1 < ... < x_n
(after a sort command).

1. Compute min {u_k : k=1..n} = u_p
If p is not unique, take the largest one.

2. The wanted points are {[x_k, u_k] : k=p..n}.

You cannot use infolevel because the algorithms have changed. It seems that using another method (see ?Basis) does not help.
But the problem can be solved:

F:=[f[1],f[2],f[3]]:
gb:=Basis(F,plex(c,x[1],x[2])):  # 
gbasis command is deprecated

factor~(gb);

From the last polynomial, it is clear that for c=3 we do not have a reduced basis.
So, if c is seen as a parameter, c=3 must be considered separately.

 

 

Y:=solve(sqrt(x^2+y^2)=(3-x)/2, y):
 X:=solve(Y[1]);

                           X := -3, 1
plots:-shadebetween(sqrt(x^2+y^2), (3-x)/2, x=X[1]..X[2], y=Y[1]..Y[2]);

Matrix(3, (i,j) -> Gradient~(V)[i][j]);

It will also work for non-cartesian coordinates.

I have included a transform for polylog not used by maple (it seems).

mypolylog:=proc(n,z)
local x:=argument(z)/(2*Pi);
if is(abs(z)<>1  or (not type(n,posint)) or z=1 or x<0) then return polylog(n,z) fi;
-(-1)^n*polylog(n,1/z) - (2*Pi*I)^n/n!*bernoulli(n,x)
end:

s:=sum((sin(k)/k)^7, k = 1 .. infinity);

r:=simplify(eval(%, polylog=mypolylog));

evalf([s,r]); # check

 

restart;

We'll  help Maple to compute the sum for k=1..infinity
(for k=0 the term is/should be 1)

S7:=Sum((sin(k)/k)^7, k = 1 .. infinity);  # = ?

Sum(sin(k)^7/k^7, k = 1 .. infinity)

(1)

Maple gives only:

S7=value(S7);

Sum(sin(k)^7/k^7, k = 1 .. infinity) = -((1/128)*I)*(-polylog(7, exp(7*I))+7*polylog(7, exp(5*I))-21*polylog(7, exp(3*I))+35*polylog(7, exp(I))-35*polylog(7, exp(-I))+21*polylog(7, exp(-3*I))-7*polylog(7, exp(-5*I))+polylog(7, exp(-7*I)))

(2)

Consider also

S1x:=Sum(sin(k*x)/k, k = 1 .. infinity);
S7x:=Sum((sin(k*x)/k)^7, k = 1 .. infinity);

Sum(sin(k*x)/k, k = 1 .. infinity)

 

Sum(sin(k*x)^7/k^7, k = 1 .. infinity)

(3)

C7x:=combine(S7x):  S7x = C7x;

Sum(sin(k*x)^7/k^7, k = 1 .. infinity) = Sum((1/64)*(-sin(7*k*x)+7*sin(5*k*x)-21*sin(3*k*x)+35*sin(k*x))/k^7, k = 1 .. infinity)

(4)

We shall use the following known equality

Z:=S1x - (Pi-x)/2: Z = 0;    # Z=0 for 0<x<Pi

Sum(sin(k*x)/k, k = 1 .. infinity)-(1/2)*Pi+(1/2)*x = 0

(5)

Integrate it 6 times.

ZZ:=value(int(Z, (x=0..x)$6));  # = 0

(1/10080)*x^7-(1/1440)*Pi*x^6-(1/540)*Pi^4*x^3+(1/720)*Pi^2*x^5+(1/945)*Pi^6*x+sum(-sin(k*x)/k^7, k = 1 .. infinity)

(6)

-isolate(ZZ=0,op(-1,ZZ)):simplify(%)

-(sum(-sin(k*x)/k^7, k = 1 .. infinity)) = (1/10080)*x^7-(1/1440)*Pi*x^6-(1/540)*Pi^4*x^3+(1/720)*Pi^2*x^5+(1/945)*Pi^6*x

(7)

f:=unapply(rhs(%),x); # 0 < x < Pi

proc (x) options operator, arrow; (1/10080)*x^7-(1/1440)*Pi*x^6-(1/540)*Pi^4*x^3+(1/720)*Pi^2*x^5+(1/945)*Pi^6*x end proc

(8)

# Denote by F the odd 2Pi-periodic extension of f

S7 = (-F(7)+7*F(5)-21*F(3)+35*F(1))/64;  # By (4) for x=1

Sum(sin(k)^7/k^7, k = 1 .. infinity) = -(1/64)*F(7)+(7/64)*F(5)-(21/64)*F(3)+(35/64)*F(1)

(9)

S7 = simplify((  -f(7-2*Pi)-7*f(-5+2*Pi)-21*f(3)+35*f(1)  )/64);

Sum(sin(k)^7/k^7, k = 1 .. infinity) = -1/2-(7/240)*Pi^6+(43141/15360)*Pi-(343/288)*Pi^4-(16807/3840)*Pi^2+(1/720)*Pi^7+(49/192)*Pi^5+(2401/768)*Pi^3

(10)

evalf(%);  #check

.3027243507 = .30272437

(11)

 

 

This is in the realm of Numerical Approximation, an important mathematical branch.
In Maple see ?numapprox
It is usually needed a careful study of the function to be approximated and an estimation of the error (absolute/relative).

I see two solutions:
1. Revise the automatic simplication for INTERVALs
2. Overload the `*` operator by the user (for the second issue).

To compute evalr(x*x) for
x:=INTERVAL(-1 .. 1);
one may use the ad-hoc
evalr('evalr'(x)*x);

BooleanSimplify returns a sum of products [sum=%or, product=%and].
Your expression is far from having a single term i.e. a product only. It is huge.
In order to obtain something you will have to fix some variables.

 

restart;

ee:=
((((((((((((((OD &and (NPi &or NEXTotp)) &and &not ((((((((POinoBlaze &and &not (OD &and ((POLYGi1 &and POBIASPdrawing2) &or  (POLYGi1 &and POBIASMdrawing2)))) &or (OD &and (spolyp2 &or spolym2))) &and &not (OD &and ((POLYGi2 &and POBIASPdrawing4) &or (POLYGi2 &and POBIASMdrawing4)))) &or (OD &and (spolyp4 &or spolym4))) &and &not (OD &and ((POLYGi3 &and POBIASPdrawing6) &or (POLYGi3 &and POBIASMdrawing6)))) &or (OD &and (spolyp6 &or spolym6))) &and &not BLACKBOXall) &and &not POLYACTsign)) &and (((BULK &and &not (SUBS1 &and &not MSUB0)) &and &not (NWELi &and &not MKRMSKREG)) &and &not PWbki)) &and &not ((NACTALL0 &and &not  NWRNW) &and &not  PWELL1)) &and &not OD225dg) &and &not OD218dg)  &and &not ((VNPNMSIPW &and &not EMPTY) &or (VNPNMSIPW25 &and &not EMPTY))) &and &not RPOi) &and &not ((NACTALL0 &and PWELL1)  &and  POi)) &and &not (((OD &and (PPi &and &not (SEALRINGi  &and &not PMDMY))) &and &not POi) &and PWELL1)) &and &not VTHNi) &and &not VTLNi) &and ((DCOng &or DCOmsk) &or DCOdg)) &and &not MKRHPA) &and &not EMPTY:
 

vars:=[indets(ee,name)[]]:

varsx:=[seq(x||n,n=1..nops(vars))];

[x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, x26, x27, x28, x29, x30, x31, x32, x33, x34, x35, x36, x37, x38, x39, x40, x41, x42, x43, x44, x45, x46]

(1)

ex:=eval(ee,vars =~ varsx);

`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(`&and`(x12, `&or`(x9, x8)), `&not`(`&and`(`&and`(`&or`(`&and`(`&or`(`&and`(`&or`(`&and`(x43, `&not`(`&and`(x12, `&or`(`&and`(x16, x39), `&and`(x16, x36))))), `&and`(x12, `&or`(x30, x27))), `&not`(`&and`(x12, `&or`(`&and`(x17, x40), `&and`(x17, x37))))), `&and`(x12, `&or`(x31, x28))), `&not`(`&and`(x12, `&or`(`&and`(x18, x41), `&and`(x18, x38))))), `&and`(x12, `&or`(x32, x29))), `&not`(x33)), `&not`(x42)))), `&and`(`&and`(`&and`(x1, `&not`(`&and`(x24, `&not`(x7)))), `&not`(`&and`(x10, `&not`(x34)))), `&not`(x22))), `&not`(`&and`(`&and`(x35, `&not`(x11)), `&not`(x21)))), `&not`(x14)), `&not`(x13)), `&not`(`&or`(`&and`(x45, `&not`(x5)), `&and`(x46, `&not`(x5))))), `&not`(x23)), `&not`(`&and`(`&and`(x35, x21), x19))), `&not`(`&and`(`&and`(`&and`(x12, `&and`(x20, `&not`(`&and`(x44, `&not`(x15))))), `&not`(x19)), x21))), `&not`(x25)), `&not`(x26)), `&or`(`&or`(x4, x3), x2)), `&not`(x6)), `&not`(x5))

(2)

with(Logic):

#BooleanSimplify(ex);

tf:=[true,false]:

r:=rand(1..2):

fex:=unapply(ex,varsx):

for k to 100000 do   # find an x for which ex=true
xxx:=[seq( tf[r()], i=1..46)]:
fex(xxx[]);
simp:=BooleanSimplify(%):
if(BooleanSimplify(%)) then print([k]); break fi;
od:
xxx;
simp;

[4648]

 

[true, false, true, true, false, false, true, true, false, false, true, true, false, false, false, false, true, true, false, true, false, false, false, false, false, false, false, true, true, true, true, false, false, false, false, false, false, true, false, false, true, true, true, false, false, false]

 

true

(3)

xx:=xxx:  # fix some xj  to be able to simplify
for j from 5 to 25 do xx[j]:=x||j od:
fex(xx[]):
simp:=BooleanSimplify(%);
'x'=xx;

Logic:-`&or`(Logic:-`&and`(x12, x19, x7, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x19, x7, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x19, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x19, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x7, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x20), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x7, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x21), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x7, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x20), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x7, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x21), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x20), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x8, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x21), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x20), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)), Logic:-`&and`(x12, x9, Logic:-`&not`(x10), Logic:-`&not`(x13), Logic:-`&not`(x14), Logic:-`&not`(x21), Logic:-`&not`(x22), Logic:-`&not`(x23), Logic:-`&not`(x24), Logic:-`&not`(x25), Logic:-`&not`(x5), Logic:-`&not`(x6)))

 

x = [true, false, true, true, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21, x22, x23, x24, x25, false, false, true, true, true, true, false, false, false, false, false, false, true, false, false, true, true, true, false, false, false]

(4)

 


 

Download boolean.mw

 


 

f(s) = min { (s*t)^((s*t)^(s*t))/t^(t^t):  t > 0 }

restart;

g :=(s,t)-> t^(s*t)*(ln(s)+ln(t))*s^(s*t)-t^t*ln(t):

dg:=unapply(simplify(diff(g(s,t),t)),[s,t]):

lnf:=proc(s)
local tmin:=fsolve(dg(s,t),t=0.5);
evalf(g(s,tmin))
end:

plot(lnf, 1..6, title="ln(f)");

 

plot(exp@lnf, 1..6, title="f");

 

 

z := proc (x) options operator, arrow; tan(alpha)*x-(1/2)*g*x^2/(u^2*cos(alpha)^2) end proc

proc (x) options operator, arrow; tan(alpha)*x-(1/2)*g*x^2/(u^2*cos(alpha)^2) end proc

(1)

cond:=z(a)=h:

u2:=rhs(isolate(cond,u^2));

-(1/2)*g*a^2/((h-tan(alpha)*a)*cos(alpha)^2)

(2)

#u2>0, --> min

u2t:=subs([tan(alpha)=t, cos(alpha)=sqrt(1/(1+t^2))], u2):

simplify(diff(u2t,t));

(1/2)*g*a^2*(a*t^2-2*h*t-a)/(a*t-h)^2

(3)

tmin:=select(s -> is(s>0),[solve(%,t)])[] assuming positive

(h+(a^2+h^2)^(1/2))/a

(4)

u__min:=radnormal(sqrt(eval(u2t,t=tmin)));

(g*(h+(a^2+h^2)^(1/2)))^(1/2)

(5)

alpha__u__min:=arctan(tmin);

arctan((h+(a^2+h^2)^(1/2))/a)

(6)

 


Download projectile.mw

First 82 83 84 85 86 87 88 Last Page 84 of 120