vv

13877 Reputation

20 Badges

10 years, 0 days

MaplePrimes Activity


These are answers submitted by vv

evalf( Int(h, Omega, epsilon=1e-4, method=_CubaCuhre));

gives 4.12122491078804

(To have a probability you forgot probably to divide by (2*Pi)^3.)

You cannot write like this. diff(z, x)  simplifies to 0, because z is interpreted as an independent variable (just like x).
If z depends on x, you must write z(x)
In this case,
diff(w(x,y,t,z(x)), x); 
==>  D[1](w)(x, y, t, z(x)) + D[4](w)(x, y, t, z(x))*diff(z(x), x) 

You may use e.g.
alias(z=z(x));
so that the argument x is omitted, but you must be careful (I personally do not use this facility in such situations).

 

You have a small mistake. Use:

Note that here the origin is at the minimal point of the catenary.

restart;

DIV := diff(y(x), x, x) = a*sqrt(1 + diff(y(x), x)^2):
RV := y(0) = 0, D(y)(0) = 0:
dsolve({DIV, RV}, y(x));

y(x) = (-cosh(a*x)+1)/a, y(x) = (cosh(a*x)-1)/a

(1)

Y:=unapply(rhs(%[2]),x);
# Equation of the catenary, the origin in the minimal point

proc (x) options operator, arrow; (cosh(a*x)-1)/a end proc

(2)

Int(sqrt(1+(D(Y)(u))^2),u=0..x) assuming x>0,a>0

Int((1+sinh(a*u)^2)^(1/2), u = 0 .. x)

(3)

L:=unapply(value(%),x) assuming x>0,a>0;
#Length of the arc (0,0) .. (x,f(x))

proc (x) options operator, arrow; sinh(a*x)/a end proc

(4)

solve([L(x1)=60, Y(x1)=50]);

{a = 1/11, x1 = 11*ln(11)}

(5)

y(x)=eval(Y(x),%);

y(x) = 11*cosh((1/11)*x)-11

(6)

 

You have a linear ordinary differential equation of order 1. The solution contains an integral. This integral, in most cases, cannot be expressed in terms of elementary functions.
Note that in your example, if e.g. theta is a negative integer, the solution is elementary.

# You must provide correct assumptions
restart;
with(inttrans):
#with(gfun);
#assume(alpha + beta = 1):
f := a*t^(-alpha) + b*t^(-beta):
inttrans[laplace](f, t, s) assuming alpha<1,beta<1;

      

This cannot be simplified, even if alpha+beta=1

P:=proc(pmax::posint)
   local p,q,u,v,n,sn, U, R, nR:=0;
   for q to pmax-1 do for p from q+1 to pmax do
     n:=p!/q!; sn:=isqrt(n);
     U:=NumberTheory:-Divisors(n);
     for u in U while u<sn do
       v:=n/u;
       if issqr((v-u)/2) then  nR:=nR+1; R[nR]:=[p, q, (u+v)/2, isqrt((v-u)/2)] fi;
     od:
   od od;
  print('num'=nR);
  entries(R, nolist)
  end proc:

P(13);
                            num = 56
[4, 1, 5, 1], [5, 1, 11, 1], [7, 1, 71, 1], [8, 1, 524, 22],  [8, 1, 204, 6], [8, 1, 201, 3], [9, 1, 684, 18], 
[11, 1, 7911, 69], [10, 1, 2304, 36], [3, 2, 2, 1], [12, 1, 22716, 78], [6, 2, 19, 1], [6, 2, 21, 3], 
[7, 2, 51, 3], [7, 2, 131, 11], [5, 3, 6, 2], [6, 3, 11, 1], [10, 2, 1620, 30], [11, 2, 4905, 45], [10, 3, 916, 22], 
[11, 3, 2956, 38], [7, 3, 29, 1], [8, 3, 104, 8], [8, 4, 76, 8], [13, 3, 32444, 62], [12, 3, 8935, 5], 
[12, 3, 12060, 90], [9, 4, 209, 13], [9, 4, 284, 16], [8, 4, 41, 1], [8, 4, 44, 4], [11, 5, 601, 13], 
[12, 5, 2511, 39], [13, 5, 10449, 87], [10, 6, 71, 1], [9, 4, 124, 4], [12, 4, 4905, 45], [8, 5, 31, 5], 
[9, 5, 55, 1], [11, 6, 236, 4], [11, 6, 244, 8], [11, 7, 336, 18], [8, 7, 3, 1], [11, 6, 431, 19], 
[11, 6, 2316, 48], [11, 6, 249, 9], [11, 6, 276, 12], [13, 8, 659, 23], [12, 9, 61, 7], [9, 8, 5, 2], 
[12, 8, 109, 1], [11, 7, 89, 1], [13, 7, 1231, 23],  [11, 7, 191, 13], [11, 7, 96, 6], [13, 9, 131, 1]
 


 

restart;
Digits:=10:
eq1:=5*(2.477538002*10^(-6)*a^2*b + 1.238769001*10^(-6)*b^3 - 1.761804802*10^(-10)*b)*sin(Upsilon) + 4.081436800*10^(-9)*a - 0.00001717419154*a^3:
eq2:=((2.642707202*10^(-10)*a*sigma + 3.320825870*10^(-8)*a + 1.0*(-3.716307003*10^(-6)*a*sigma - 0.0004669911380*a)*b^2 - 1.858153501*10^(-6)*a^3*sigma - 0.0002334955689*a^3)*sin(Upsilon) + 1.280000000*10^(-12)*(5.026400000*a*sigma + 631.6174240*a)*cos(Upsilon) + 1.280000000*10^(-12)*(1.352400000*sigma^2 + 339.8851680*sigma + 21354.98511)*b + 1.280000000*10^(-12)*(-8.114400000*sigma^4 - 4078.62201638042*sigma^3 - 768779.463909262*sigma^2 - 6.440321829*10^7*sigma - 2.023227102*10^9)*b^3)*csgn(sigma + 125.6600000) - 7.680000000*10^(-13)*(sigma + 125.6600000)^2*b:
eq3:=((1.238769001*10^(-6)*sigma + 0.0001556637127)*b^4 + ((2.477538002*10^(-6)*sigma - 0.0001556637126)*a^2 - 1.761804802*10^(-10)*sigma - 2.213883913*10^(-8))*b^2 - 0.0002334955690*a^4 + 3.320825870*10^(-8)*a^2)*cos(Upsilon) - 8.084703030*10^(-10)*a^2*sin(Upsilon) + (-0.00007783185636 - 2.477538002*10^(-6)*sigma)*a*b^3 + ((0.0003113274252 - 1.238769001*10^(-6)*sigma)*a^3 + (-1.106941957*10^(-8) + 1.761804802*10^(-10)*sigma)*a)*b + (1.286758400*10^(-9)*sigma^2 + 1.616940605*10^(-7)*sigma)*a*b:
sys:=simplify(10^6*[eq1,eq2,eq3]):

nops(sys), indets(sys,name);

3, {Upsilon, a, b, sigma}

(1)

sysr:=convert(sys, rational):

sysr1:=[  eval(sysr,[cos(Upsilon)=c, sin(Upsilon)=d, sigma=1/2])[],c^2+d^2-1 ];

[((66014/5329)*a^2*b+(33007/5329)*b^3-(1303/1479165)*b)*d+(1446/354287)*a-(109932/6401)*a^3, (-(617200709/1316416)*b^2*a+(8637242633/259062403668)*a-(6236490737/26603392)*a^3)*d+(21748019689/26793596995347)*a*c-(469710676743047585773/178516074749979120)*b^3+(73542825103094222810181170291200379/4797756380074395585228714044250000000)*b, ((8927965739/57126880)*b^4+(-(3081170479/19952544)*a^2-8769913225/394562518493)*b^2-(342538/1467)*a^4+(3487/105004)*a^2)*c-(551/681534)*a^2*d-(312269509/3949248)*a*b^3+((8874890483/28563440)*a^3+(26777240151757673/381510694941406250)*a)*b, c^2+d^2-1]

(2)

G:=Groebner:-Basis(sysr1, plex(c,d,a,b)):

nops(G);

8

(3)

indets~(G);

[{b}, {a, b}, {a, b}, {a, b, d}, {a, b, d}, {a, b, c, d}, {a, b, c, d}, {c, d}]

(4)

ab:=solve(G[1..3],explicit):

nops([ab])

3

(5)

evalf([ab]);

[{a = 0., b = 0.}, {a = 0.1542081633e-1, b = 0.2577584543e-2}, {a = -0.1542081633e-1, b = 0.2577584543e-2}]

(6)

eval(G, ab[1]);  #  So,  a=0, b=0, Upsilon=arbitrary

[0, 0, 0, 0, 0, 0, 0, c^2+d^2-1]

(7)

############

Digits:=100;

100

(8)

d1:=fsolve(eval(G[4], ab[2]));

0.1767112612192714286343873125631522838139889970508087652450952127061611264592773044391689682794290833e-1

(9)

fsolve(eval(G[5], ab[2])); %-d1;

0.1767112612192714286343873125631522838139889970508087652450952127047025878451866467897520588192095984e-1

 

-0.14585386140906576494169094602194849e-66

(10)

c1:=fsolve(eval(G[6], [ab[2][], d=d1]));

.9998438534599204826860536133197415830743820837843582966483442787543887342444801865403482145379307231

(11)

fsolve(eval(G[7], [ab[2][], d=d1])); %-c1;

.9998438534599204826860536133197415830743820837843582966483442787543887437298044097515800626952324576

 

0.94853242232112318481573017345e-71

(12)

c1^2+d1^2;

.9999999999999999999999999999999999999999999999999999999999999999999999810143670507891071664311474276

(13)

u1:=arctan(d1,c1);

0.1767204594111244839467484124914988636253117448309960560467697561494599646479420221269303132916932161e-1

(14)

d2:=fsolve(eval(G[4], ab[3]));

-0.1767112612192714286343873125631522838139889970508087652450952127061611264592773044391689682794290833e-1

(15)

fsolve(eval(G[5], ab[3])); %-d2;

-0.1767112612192714286343873125631522838139889970508087652450952127047025878451866467897520588192095984e-1

 

0.14585386140906576494169094602194849e-66

(16)

c2:=fsolve(eval(G[6], [ab[3][], d=d2]));

-.9998438534599204826860536133197415830743820837843582966483442787543887342444801865403482145379307231

(17)

fsolve(eval(G[7], [ab[3][], d=d2])); %-c2;

-.9998438534599204826860536133197415830743820837843582966483442787543887437298044097515800626952324576

 

-0.94853242232112318481573017345e-71

(18)

c2^2+d2^2;

.9999999999999999999999999999999999999999999999999999999999999999999999810143670507891071664311474276

(19)

u2:=arctan(d2,c2);

-3.123920607648680790067968542030352997834638224892006215370267616692870409821414796415341794012947746

(20)

 

Digits:=15:

Conclusion. The solutions of the system are:

[a=0, b=0, Upsilon=any]; [evalf(ab[2])[], Upsilon=evalf(u1)]; [evalf(ab[3])[], Upsilon=evalf(u2)];

[a = 0, b = 0, Upsilon = any]

 

[a = 0.154276352360907e-1, b = 0.257758454297948e-2, Upsilon = 0.176720459411124e-1]

 

[a = -0.154276352360907e-1, b = 0.257758454297948e-2, Upsilon = -3.12392060764868]

(21)

 


Download sys1-vv.mw

H0:=x->piecewise(x<=0,0,x<1/2,1,x<1,-1,0):
H_:=(k,m,x)-> H0(2^k*x-m):
H:=(n,x)->`if`(n=1,1, H_(ilog2(n), n-2^ilog2(n),x)):
seq(plot(H(n,x),x=0..1, color=red),n=1..7);

f:=(x^2)-6*x+p+3: g:=4*x^2-(p-8)*x+7:
minimize(f, x) = minimize(g, x)  assuming p::real;

           -6 + p = 4*(p/8 - 1)^2 - (p - 8)*(p/8 - 1) + 7

solve(%, p);
                            12, -12

It is a surprising bug. Maplesoft should fix it as soon as possible. (It probably comes due to the changes in add in Maple 2021).

A workaround is to replace add(p[], p=P)  with `+`(seq(p[], p=P));
Note that just adding compile=false (tom's suggestion)  is not enough, because removing the seq,  another error appears.

P := CartesianProduct([1,2,3,4],[1,2,3,4], compile=false);
#  seq(p[], p=P);
   add(p[], p=P);  # ==> error

 

The library must exist, or create a new one.

restart;
MyPackage := module() export f1, f2; local loc1; option package; 
  f1 := proc() loc1 end proc; 
  f2 := proc( v ) loc1 := v end proc; 
  loc1 := 2; 
end module:
mylib:="C:/tmp/test.mla";
LibraryTools:-Create(mylib);

#                   mylib := "C:/tmp/test.mla"

LibraryTools:-Save(MyPackage, mylib);
LibraryTools:-ShowContents(mylib); # optional
#    [["MyPackage.m", [2021, 9, 15, 12, 20, 8], 41984, 126]]

restart;
libname:=libname, "C:/tmp/test.mla":
with(MyPackage);
#                            [f1, f2]

f1();
#                               2

f2(123);
#                              123

f1();
#                              123

 

restart;
nat_param:=proc(ff, xx ::(name=anything), yy::(name=anything), t::name)
  local K,xt,yt, ode;
  xt:= diff(ff, op(1,xx)); 
  yt:= diff(ff, op(1,yy));
  K := 1/sqrt(xt^2 + yt^2);
  ode := {'diff'( op(1,xx),t ) = -K*yt, 'diff'( op(1,yy),t ) = K*xt};
  ode := subs( [op(1,xx)=op(1,xx)(t), op(1,yy)=op(1,yy)(t) ], ode);
  dsolve(ode union {op(1,xx)(0)=op(2,xx), op(1,yy)(0)=op(2,yy)},numeric, output=listprocedure);
  eval([lhs(xx(t)),lhs(yy(t))],%)[]
end:

f:=x1^4 + x2^4 + 0.4*sin(7*x1) + 0.3*sin(4*Pi*x2) - 1: 
xx,yy:=nat_param(f, x1=0,x2=1, t):
L:=fsolve(xx(t)=xx(0),t=8..10): N:=6:
plots:-display(seq(plot([xx,yy,k*L/N..(k+1)*L/N],color=COLOR(HUE,k/(N+2))), k=0..N-1), thickness=6);

op(1, xLp_tmp)

 

It's a bug (but actually the generators are correct).

restart;
with(GroupTheory):
H:=PermutationGroup({[[2, 3], [4, 5]], [[2, 5], [3, 4]]}, degree = 5, supergroup = PermutationGroup({[[2, 3, 4]], [[1, 2], [4, 5]]}, degree = 5));
#                    H := ((23)(45)(25)(34))

MinPermRepDegree(H);
#"GENS" = [[Perm([[1, 2]])], [Perm([[3, 4]])]]

#Error, (in GroupTheory:-Subgroup) not all the provided generators belong to the group

Workaround:

GroupOrder(H);
 #                              4

H1:=DirectProduct(CyclicGroup(2)$2):
AreIsomorphic(H, H1);
#                              true

MinimumPermutationRepresentationDegree(H1);
#"GENS" = [[Perm([[1, 2]])], [Perm([[3, 4]])]]

#                               4

 

First 22 23 24 25 26 27 28 Last Page 24 of 120