Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Here are the source codes for the paper  "Gaps Between Integers Having a Common Divisor with an Odd Semi-prime"


 

gg := proc (x, y) return abs(x-y)-1 end proc

proc (x, y) return abs(x-y)-1 end proc

(1)

CopyArrayElem := proc (x, n) local y, i; y := Array(1 .. n); for i to n do y(i) := x(i) end do; return y end proc

proc (x, n) local y, i; y := Array(1 .. n); for i to n do y(i) := x(i) end do; return y end proc

(2)

PrintArray := proc (x, n) local i; for i to n do printf("%d, ", x(i)); if i = (1/2)*n then printf("|,") end if end do; printf("\n") end proc

proc (x, n) local i; for i to n do printf("%d, ", x(i)); if i = (1/2)*n then printf("|,") end if end do; printf("
") end proc

(3)

GapArray := proc (x, n) local i, y; y := Array(1 .. n-1); for i to n-1 do y(i) := gg(x(i), x(i+1)) end do; return y end proc

proc (x, n) local i, y; y := Array(1 .. n-1); for i to n-1 do y(i) := gg(x(i), x(i+1)) end do; return y end proc

(4)

ShiftArrayElem := proc (x, n, d) local i, y; y := Array(1 .. n); for i to n do y(i) := x(i)+d end do; return y end proc

proc (x, n, d) local i, y; y := Array(1 .. n); for i to n do y(i) := x(i)+d end do; return y end proc

(5)

NULL

"chost:=proc(p,q) local i,j,m; local Hpq,hh;   Hpq:=Array(1..p+q-2);  hh:=Array(1..p+q-2);    for i from 1 to q-1 do   Hpq(i):=i*p;   od;      for j from 1 to p-1 do;   Hpq(i++):=j*q;   od;   hh:=sort(Hpq);    return hh;    end proc "

proc (p, q) local i, j, m, Hpq, hh; Hpq := Array(1 .. p+q-2); hh := Array(1 .. p+q-2); for i to q-1 do Hpq(i) := i*p end do; for j to p-1 do Hpq(`++`(i)) := j*q end do; hh := sort(Hpq); return hh end proc

(6)

nGroup := proc (p, m) local j, n, ar; ar := Array(1 .. m); for j from 0 to m-1 do n := ceil((j+1)*p/m)-floor(j*p/m)-1; ar(j+1) := n end do; return ar end proc

proc (p, m) local j, n, ar; ar := Array(1 .. m); for j from 0 to m-1 do n := ceil((j+1)*p/m)-floor(j*p/m)-1; ar(j+1) := n end do; return ar end proc

(7)

Position := proc (ary, k) local i, pos; pos := 0; for i to k-1 do pos := pos+ary(i) end do; pos := pos+1; return pos end proc

proc (ary, k) local i, pos; pos := 0; for i to k-1 do pos := pos+ary(i) end do; pos := pos+1; return pos end proc

(8)

groups := proc (p, q, lm, m) local k, j, x, r, ll, rr, ni, bl, br, i; i := 1; printf("______\n"); for k from 0 to m-2 do ll := floor(k*p/m); rr := floor((k+1)*p/m); ni := rr-ll; for j to ni do r := (j+ll)*m-k*p; printf("(%d: %d),", i, r); if j = ni then printf(" # %d p-hosts after q-host %d\n", lm+1, i*q) end if; i := i+1 end do; printf("\n") end do; ll := floor((m-1)*p/m); rr := p-1; ni := rr-ll; for j to ni do r := (j+ll)*m-k*p; printf("(%d: %d),", i, r); i := i+1 end do; printf("\n______\n") end proc

proc (p, q, lm, m) local k, j, x, r, ll, rr, ni, bl, br, i; i := 1; printf("______
"); for k from 0 to m-2 do ll := floor(k*p/m); rr := floor((k+1)*p/m); ni := rr-ll; for j to ni do r := (j+ll)*m-k*p; printf("(%d: %d),", i, r); if j = ni then printf(" # %d p-hosts after q-host %d
", lm+1, i*q) end if; i := i+1 end do; printf("
") end do; ll := floor((m-1)*p/m); rr := p-1; ni := rr-ll; for j to ni do r := (j+ll)*m-k*p; printf("(%d: %d),", i, r); i := i+1 end do; printf("
______
") end proc

(9)

idx := proc (p, m) local i, r, ri; for i to p-1 do r := i*m-floor(i*m/p)*p; if r = 1 or r = p-1 then ri := i end if; printf("%d, ", r) end do; printf("\n"); return ri end proc

proc (p, m) local i, r, ri; for i to p-1 do r := i*m-floor(i*m/p)*p; if r = 1 or r = p-1 then ri := i end if; printf("%d, ", r) end do; printf("
"); return ri end proc

(10)

DoTest := proc (p, q) local k, i, j, x, y, r, ni, lambda, n, g, xx, ll, rr, w, pos, nj, hh, grp; n := p+q-2; g := Array(1 .. n-1); hh := chost(p, q); printf("Hosts of p and q are:\n"); PrintArray(hh, n); lambda := floor(q/p); r := q-lambda*p; printf("Lambda=%d\nr=%d\n", lambda, r); printf("The %d elements in S(r,p) are:\n", p-1); for i to p-1 do printf("%d,", i*r) end do; printf("\n"); printf("The %d elements in rZ(r,p) are:\n", p-1); for j to p-1 do x := j*r-floor(j*r/p)*p; printf("%d,", x) end do; printf("\n"); printf("The %d subsets are as follows:\n", r); groups(p, q, lambda, r); printf("The maximum gap is: %d \n", p-1); g := q-p-1; printf("Total number of maximum gaps is:%d\n", g); g := GapArray(hh, n); xx := CopyArrayElem(hh, n-1); dataplot(xx, g) end proc

proc (p, q) local k, i, j, x, y, r, ni, lambda, n, g, xx, ll, rr, w, pos, nj, hh, grp; n := p+q-2; g := Array(1 .. n-1); hh := chost(p, q); printf("Hosts of p and q are:
"); PrintArray(hh, n); lambda := floor(q/p); r := q-lambda*p; printf("Lambda=%d
r=%d
", lambda, r); printf("The %d elements in S(r,p) are:
", p-1); for i to p-1 do printf("%d,", i*r) end do; printf("
"); printf("The %d elements in rZ(r,p) are:
", p-1); for j to p-1 do x := j*r-floor(j*r/p)*p; printf("%d,", x) end do; printf("
"); printf("The %d subsets are as follows:
", r); groups(p, q, lambda, r); printf("The maximum gap is: %d 
", p-1); g := q-p-1; printf("Total number of maximum gaps is:%d
", g); g := GapArray(hh, n); xx := CopyArrayElem(hh, n-1); dataplot(xx, g) end proc

(11)

``

DoTest(3, 5)

 

DoTest(5, 7)

 

 

 

 

NULL

DoTest(7, 9)

 

DoTest(11, 13)

 

DoTest(7, 11)

 

NULL

DoTest(5, 23)

 

DoTest(11, 47)

 

DoTest(13, 71)

 

DoTest(17, 29)

 

DoTest(23, 31)

 

DoTest(13, 23)

 

DoTest(11, 17)

 

 

DoTest(11, 29)

 

DoTest(13, 27)

 

DoTest(13, 79)

 

DoTest(11, 45)

 

DoTest(41, 71)

 

DoTest(47, 97)

 

DoTest(53, 103)

 

DoTest(101, 199)

 

DoTest(101, 205)

 

DoTest(23, 45)

 

DoTest(13, 25)

 

DoTest(13, 77)

 

DoTest(23, 93)

 

DoTest(23, 91)

 

DoTest(13, 25)

 

DoTest(13, 77)

 

DoTest(47, 91)

 

DoTest(53, 109)

 

NULL


 

Download Hosts.mw

I wanted to draw vertical line (as y axis) and add a solid disk at some y location (to indicate some point location). I used plottools:-disk  to make the small disk and used plottools:-line to make the y-axis then used plots:-display to combine them.

All is ok, except the disk is transparent. i.e. I can see the y-axis line below it. Is there a way to make it not transparent? i.e. solid color, so that the y-axis below it do not show?

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

#plot vertical line
L:=plottools:-line([0,0],[0,3],color="blue"):
c1:=plottools:-disk([0,1],.1,color="red"):
c2:=plottools:-disk([0,2],.1,color="green"):
plots:-display([L,c1,c2],scaling=constrained,axes=none)

 


i.e. 

Download plotools_nov_9_2024.mw

 About 2 years ago I asked this question Application of how to test types in a module? - MaplePrimes on type checking and @CarlLove provided a great answer for inputs to a procedure in that package.

In the package I have a procdure to plot/draw lines. They require sorting out when there is a list of them The procedure recognises the different possible input formats. Could the types be defined in the procdure body. It would make sorting out a lot easier. I could possibly add them to Module load at the start of the package.

restart

 

# Line type
#type _TNL1  expression type {`+`,`*`,`=`, `symbol`,procedure}                         2D line or any expression function equation

#type _TNL2  listlist [[a,b],[c,d]] or [[a,b,c],[d,e,f]]                               2D  line just draws a line between the 2 points

#type _TNL4  listlist [[a,b,c],[d,e,f]]                                                3D line just draws a line between the 2 points

#type _TNL4  list of list & vector 2D [[a,b],<c,d>]  or possibly  [<c,d>,[a,b]]        2D generates line A*x+B*y+C                        

#type _TNL5  list of list & vector 3D [[a,b,c],<d,e,f>] or possibly [<d,e,f>,[a,b,c]]  3D line <a+alpha*d, b+alpha*e, c+alpha*f>

#type _TNL6  vector 3D <a+alpha*d, b+alpha*e, c+alpha*f>                               3D line <a+alpha*d, b+alpha*e, c+alpha*f> checks indets to know

#type _TNL7  list of vector[row] and vector[row]  [<a|b|c>, <d|e|f>]                   projective points are converted to [a/c,b/c] and [d/f,e/f] and line drawn between the points

 

 

 

sorts:=proc(l1::{list,set,Vector[column],`+`,`*`,`=`, `symbol`,procedure},
{range::list:=[-5,5,-4,4]},
{vars::list:=[':-x',':-y']},
{rangep::list:=[-3,3]},
{plopts::list:=[':-colour'=':-blue,magenta']})

description " sort the list of line formats and converts to plotable format  ";

local i,n,Listsystem,subplt, subL, tmp, vv,ll,subpltemp;

      #single line;
if l1::{'Vector[column]',`+`,`*`,`=`, `symbol`,procedure} then
   n:=1;
   subplt:=[{}];
   if l1::'Vector[column]'(3) and indets(l1)={} then
      subL:=[l1[1]*vars[1]+l1[2]*vars[2]+l1[3]];
    else
      subL:=[l1];
   end if;
 elif l1::list and nops(l1)= 2 and not(hastype(l1,set))then
    #for j to 2 do
    #   if  l1[j][1]::listlist or l1[j][2]::listlist  then

                                                        # this section not finished supposed
                                                        # to detect is the list is two line without extra plopts, range, rangexy                                                  
   #   end if;
   # end do;
   n:=1;
   subplt:=[{}];
    #print("here now");
   if hastype(l1,'Vector[column]'(3)) and hastype(l1,list) then  
      #print("in  here");
      vv:=(select(type,l1,('Vector[column]'(3)))[]);
      ll:=select(type,l1,list)[];
      #print("vv " ,vv, "ll",ll);
      subL:=[ll+~alpha*vv];  
    elif hastype(l1,'Vector[column]'(2)) and hastype(l1,list)  then
      vv:=(select(type,l1,('Vector[column]'(2)))[]);
      ll:=select(type,l1,list)[];
      subL:=[ (ll[2] - vars[2])*vv[1] - vv[2]*(ll[1] - vars[1])];    
    else
      subL:=[l1];
  end if;
  
      #single line with own sub-options plopts range rangep bundled as a set
elif l1::set then
   n:=1;
   subpltemp,tmp:=selectremove(has,l1,{':-rangep',':-range',':-plopts',':-rangep'});
   #print("00",subpltemp,tmp);
   subplt:=`if`(has(subpltemp,{':-plopts',':-range',':-rangep'}),[subpltemp],[{}]);
   tmp:=op(tmp);
   #print("TMP ",tmp ,nops(tmp));
   if tmp::{'Vector[column]',`+`,`*`,`=`, `symbol`,procedure} then
  
     if tmp::'Vector[column]'(3) and indets(tmp)={} then
        subL:=[tmp[1]*vars[1]+tmp[2]*vars[2]+tmp[3]];
      elif hastype(tmp,'Vector[column]'(2)) and hastype(tmp,list)  then
        vv:=select(type,tmp,'Vector[column]'(2))[];
        ll:=select(type,tmp,list)[];
        subL:= [(ll[2] - vars[2])*vv[1] - vv[2]*(ll[1] - vars[1])];  
     else
       subL:=[tmp];
   end if;
 elif nops(tmp)= 2  then
   #print("0th nops(tmp)",nops(tmp),tmp);
   # print("here here now");
   if hastype(tmp,'Vector[column]'(3)) and hastype(tmp,list) then  
      #print("in  here here");
      vv:=(select(type,tmp,('Vector[column]'(3)))[]);
      ll:=select(type,tmp,list)[];
      #print("vv " ,vv, "ll",ll);
      subL:=[ll+~alpha*vv];
     elif hastype(tmp,'Vector[column]'(2)) and hastype(tmp,list)  then
      vv:=(select(type,tmp,('Vector[column]'(2)))[]);
      ll:=select(type,tmp,list)[];
      subL:=[ (ll[2] - vars[2])*vv[1] - vv[2]*(ll[1] - vars[1])];         
    else
      subL:=[tmp];
   end if;
   end if;

    #a list of lines with possible sub-options if
 else
   n:=nops(l1);
   subplt:=[];
   subL:=[];
   for i to n do
     subpltemp:=select(has,l1[i],{':-plopts',':-range',':-rangep'});
     #print("subpltemp",subpltemp);
     #print("subpltemp",has(subpltemp,{':-plopts',':-range',':-rangep'}));
     if has(subpltemp,{':-plopts',':-range',':-rangep'})then subplt:=  [subplt[],subpltemp]else subplt:=[subplt[],{}] end if;
     tmp:=select(not(has),l1[i],{':-plopts',':-range',':-rangep'});
     if type(tmp,set)then tmp:=op(tmp)end if;
     #print("TMP ",tmp ,nops(tmp));
     #print("1st nops(tmp)",nops(tmp),tmp);
     if tmp::{'Vector[column]',`+`,`*`,`=`, `symbol`,procedure} then
  
     if tmp::'Vector[column]'(3) and indets(tmp)={} then
        subL:=[subL[],tmp[1]*vars[1]+tmp[2]*vars[2]+tmp[3]];
      else
        subL:=[subL[],tmp];
     end if;
 elif nops(tmp)= 2  then
   #print("nops(tmp)",nops(tmp),tmp);
   #print("2nd here here now");
   if hastype(tmp,'Vector[column]'(3)) and hastype(tmp,list) then  
      #print("in  here here");
      vv:=(select(type,tmp,('Vector[column]'(3)))[]);
      ll:=select(type,tmp,list)[];
      #print(tmp,"vv " ,vv, "ll",ll);
      subL:=[subL[],ll+~alpha*vv];
    elif hastype(tmp,'Vector[column]'(2)) and hastype(tmp,list)  then
      vv:=(select(type,tmp,('Vector[column]'(2)))[]);
      ll:=select(type,tmp,list)[];
      #print(tmp,"vv " ,vv, "ll",ll);
      subL:= [subL[],(ll[2] - vars[2])*vv[1] - vv[2]*(ll[1] - vars[1])];           
    else
      subL:=[subL[],tmp];
  end if;
end if;
    
end do;
end if:
return subplt, subL, n
end proc:

 

L1:=2*x+3*y-4;
L1ext:={L1, range=[-5,2,-4,4],plopts=[colour=red ,linestyle=dot] };
L2:=<5,-1,3>:
L2ext:={L2,plopts=[linestyle=dash, thickness=4]}:
L3:=[[2,1],[4,-5]]:
L3ext:={L3,plopts=[color=red,thickness=1]}:
L4:=[[2,1,-3],[4,-5,-2]]:
L4ext:={L4,plopts=[color=green]}:
L5:=[[2,3],<-1,4>]:
L5ext:={L5,plopts=[color=green,thickness=2],range=[-6,6,-6,6]}:
L6:=[[1,2,-3],<-3,1,4>]:
L6ext:={L6,rangep=[-4,1],plopts[linestyle=dash]}:
L7:=<1+3*alpha,4-1*alpha,-1+2*alpha>:
L7ext:={L7,rangep=[-4,1],plopts=[colour=purlpe,thickness=3]}:
L8:=[<2|3|1>,<4|7|2>]:
L8ext:={L8,plopts=[colour=red]}:

2*x+3*y-4

 

{2*x+3*y-4, plopts = [colour = red, linestyle = dot], range = [-5, 2, -4, 4]}

(1)

 

Lst:=[L1,L1ext,L2,L2ext,L3,L3ext,x^2+2*y^2+3-4*x*y,L4,L4ext,L5,L5ext,L6,L6ext,L7,L7ext,L8,L8ext]:

A,B,c:=sorts(Lst):

for i to c do
print(i,"  A= ",A[i],"    B= ",B[i]);
end do

1, "  A= ", {}, "    B= ", 2*x+3*y-4

 

2, "  A= ", {plopts = [colour = red, linestyle = dot], range = [-5, 2, -4, 4]}, "    B= ", 2*x+3*y-4

 

3, "  A= ", {}, "    B= ", 5*x-y+3

 

4, "  A= ", {plopts = [linestyle = dash, thickness = 4]}, "    B= ", 5*x-y+3

 

5, "  A= ", {}, "    B= ", [[2, 1], [4, -5]]

 

6, "  A= ", {plopts = [color = red, thickness = 1]}, "    B= ", [[2, 1], [4, -5]]

 

7, "  A= ", {}, "    B= ", x^2-4*x*y+2*y^2+3

 

8, "  A= ", {}, "    B= ", [[2, 1, -3], [4, -5, -2]]

 

9, "  A= ", {plopts = [color = green]}, "    B= ", [[2, 1, -3], [4, -5, -2]]

 

10, "  A= ", {}, "    B= ", -11+y+4*x

 

11, "  A= ", {plopts = [color = green, thickness = 2], range = [-6, 6, -6, 6]}, "    B= ", -11+y+4*x

 

12, "  A= ", {}, "    B= ", Vector[column](%id = 36893490129638901388)

 

13, "  A= ", {plopts[linestyle = dash], rangep = [-4, 1]}, "    B= ", Vector[column](%id = 36893490129638901628)

 

14, "  A= ", {}, "    B= ", Vector[column](%id = 36893490129638901988)

 

15, "  A= ", {plopts = [colour = purlpe, thickness = 3], rangep = [-4, 1]}, "    B= ", Vector[column](%id = 36893490129661594308)

 

16, "  A= ", {}, "    B= ", [Vector[row](%id = 36893490129661594428), Vector[row](%id = 36893490129661594548)]

 

17, "  A= ", {plopts = [colour = red]}, "    B= ", [Vector[row](%id = 36893490129661594428), Vector[row](%id = 36893490129661594548)]

(2)
 

 

Download 2024-11-09_A_Line_Type.mw

In the publication
https://www.scirp.org/pdf/apm_2021062513594181.pdf
I read that Maple18 contains the "Adomian Decomposition". In "Help" of "Maple2024" I found no direct reference to this method. I would like to ask you to provide references in the help text to this method for solving differential equations.

The other night, first time using Maple in more than 20 years, I asked for the solution to this, looking for u1 in terms of u2:

equ := u2 - u1/(-u1^2 + 1)

solve(equ, [u1])

==> u1 = (-1 + sqrt(4*u2^2 + 1))/(2*u2)

But this is sheer nonsense. The correct solution should be:

u1 = (-1 + sqrt(u2^2 + 1))/u2   ;; note the lack of 4x scaling inside the Sqrt, nor the 2x in the denominator.

What the heck??

I want collect 1/G(xi) & G'(xi)/G(xi) also 1/G(xi)*G(xi)/G(xi)  when they have power ,and give me what i looking for, i can do by hand but it take time any one can do this by maple code? like this picture below, and if possible find some arbitrary parameter

collect.mw

After more than 25 years of leading research in areas such as differential equations, special functions, and computational physics, Edgardo's role with Maplesoft will shift at the end of 2024 as he returns to academic research. At Maplesoft, he will transition into the position of Research Fellow Emeritus. In this role, Edgardo will remain engaged with many of his cherished projects, though he will not have as much time to maintain the intense level of activity that characterized his work for so many years.

Many of you know Edgardo personally or have interacted with him here or on the Maple Beta Forum. I hope you'll join me in wishing him the very best as he begins this new chapter.

how this integro-differential equation can be solved?
any assumption or suggestion is appreciated. tnx in advance

restart

eq:=diff(y(x),x)=y(x)+exp(x)*exp(-3*x)/2+int(exp(x+t)*y(t),t=0..x);

IC:=y(0)=1;

diff(y(x), x) = y(x)+(1/2)*exp(x)*exp(-3*x)+int(exp(x+t)*y(t), t = 0 .. x)

 

y(0) = 1

(1)

eq2:=g(x)=int(exp(x+t)*y(t),t=0..x);

g(x) = int(exp(x+t)*y(t), t = 0 .. x)

(2)

IC_2:=eval(eq2,[x=0,y=1])

g(0) = 0

(3)

sys:={diff(eq2,x),subs(rhs(eq2)=lhs(eq2),eq)}

{diff(g(x), x) = int(exp(x+t)*y(t), t = 0 .. x)+exp(2*x)*y(x), diff(y(x), x) = y(x)+(1/2)*exp(x)*exp(-3*x)+g(x)}

(4)

dsolve(sys union {IC,IC_2},numeric)

Error, (in dsolve/numeric/process_input) input system must be an ODE system, got independent variables {t, x}

 

Download integro-diffrential_problem.mw

Hey all Maple experts.I could really use some help with  diff,D,Diff

restart

interface(version)

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

(1)

with(Physics[Vectors])

NULL

CompactDisplay(A_(x, y, z, t), `&varphi;`(x, y, z, t), v_(x, y, z, t), F_(x, y, z, t), v__x(x, y, z, t), v__y(x, y, z, t), v__z(x, y, z, t), A__x(x, y, z, t), A__y(x, y, z, t), A__z(x, y, z, t), quiet)

macro(Av = A_(x, y, z, t), `&vartheta;` = `&varphi;`(x, y, z, t), Vv = v_(x, y, z, t), Fv = F_(x, y, z, t))

show, ON, OFF, kd_, ep_, Av, vartheta, Vv, Fv

(2)

Fv = q*('-VectorCalculus[Nabla](`&vartheta;`)'-(diff(Av, t))+`&x`(Vv, `&x`(VectorCalculus[Nabla], Av)))

F_(x, y, z, t) = q*(-Physics:-Vectors:-Nabla(varphi(x, y, z, t))-(diff(A_(x, y, z, t), t))+Physics:-Vectors:-`&x`(v_(x, y, z, t), Physics:-Vectors:-Curl(A_(x, y, z, t))))

(3)

Av = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, Vv = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k

A_(x, y, z, t) = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, v_(x, y, z, t) = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k

(4)

subs[eval](A_(x, y, z, t) = A__x(x, y, z, t)*_i+A__y(x, y, z, t)*_j+A__z(x, y, z, t)*_k, v_(x, y, z, t) = v__x(x, y, z, t)*_i+v__y(x, y, z, t)*_j+v__z(x, y, z, t)*_k, F_(x, y, z, t) = F__x*_i+F__y*_j+F__z*_k, F_(x, y, z, t) = q*(-Physics[Vectors][Nabla](varphi(x, y, z, t))-(diff(A_(x, y, z, t), t))+Physics[Vectors][`&x`](v_(x, y, z, t), Physics[Vectors][Curl](A_(x, y, z, t)))))

F__x*_i+F__y*_j+F__z*_k = q*(-(diff(varphi(x, y, z, t), x))*_i-(diff(varphi(x, y, z, t), y))*_j-(diff(varphi(x, y, z, t), z))*_k-(diff(A__x(x, y, z, t), t))*_i-(diff(A__y(x, y, z, t), t))*_j-(diff(A__z(x, y, z, t), t))*_k+(-v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_i+(-v__z(x, y, z, t)*(diff(A__y(x, y, z, t), z))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), y))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__y(x, y, z, t), x)))*_j+(v__y(x, y, z, t)*(diff(A__y(x, y, z, t), z))-v__y(x, y, z, t)*(diff(A__z(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__z(x, y, z, t), x))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_k)

(5)

map(Component, F__x*_i+F__y*_j+F__z*_k = q*(-(diff(varphi(x, y, z, t), x))*_i-(diff(varphi(x, y, z, t), y))*_j-(diff(varphi(x, y, z, t), z))*_k-(diff(A__x(x, y, z, t), t))*_i-(diff(A__y(x, y, z, t), t))*_j-(diff(A__z(x, y, z, t), t))*_k+(-v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_i+(-v__z(x, y, z, t)*(diff(A__y(x, y, z, t), z))+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), y))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__y(x, y, z, t), x)))*_j+(v__y(x, y, z, t)*(diff(A__y(x, y, z, t), z))-v__y(x, y, z, t)*(diff(A__z(x, y, z, t), y))-v__x(x, y, z, t)*(diff(A__z(x, y, z, t), x))+v__x(x, y, z, t)*(diff(A__x(x, y, z, t), z)))*_k), 1)

F__x = -v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))*q+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))*q+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))*q-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z))*q-(diff(varphi(x, y, z, t), x))*q-(diff(A__x(x, y, z, t), t))*q

(6)

collect(F__x = -v__y(x, y, z, t)*(diff(A__x(x, y, z, t), y))*q+v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x))*q+v__z(x, y, z, t)*(diff(A__z(x, y, z, t), x))*q-v__z(x, y, z, t)*(diff(A__x(x, y, z, t), z))*q-(diff(varphi(x, y, z, t), x))*q-(diff(A__x(x, y, z, t), t))*q, [q, v__x(x, y, z, t), v__y(x, y, z, t), v__z(x, y, z, t)])

F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q

(7)

convert(F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q, Diff)

F__x = (v__y(x, y, z, t)*(Diff(A__y(x, y, z, t), x)-(Diff(A__x(x, y, z, t), y)))+(Diff(A__z(x, y, z, t), x)-(Diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(Diff(varphi(x, y, z, t), x))-(Diff(A__x(x, y, z, t), t)))*q

(8)

convert(F__x = (v__y(x, y, z, t)*(diff(A__y(x, y, z, t), x)-(diff(A__x(x, y, z, t), y)))+(diff(A__z(x, y, z, t), x)-(diff(A__x(x, y, z, t), z)))*v__z(x, y, z, t)-(diff(varphi(x, y, z, t), x))-(diff(A__x(x, y, z, t), t)))*q, D)

F__x = (v__y(x, y, z, t)*((D[1](A__y))(x, y, z, t)-(D[2](A__x))(x, y, z, t))+((D[1](A__z))(x, y, z, t)-(D[3](A__x))(x, y, z, t))*v__z(x, y, z, t)-(D[1](varphi))(x, y, z, t)-(D[4](A__x))(x, y, z, t))*q

(9)

 
Hello everyone, in the result of this command execution process, it appears that the symbols for partial derivatives and derivatives in equation (8) are displayed incorrectly. What should I do?

Download error_display.mw

I am trying to compute partial derivatives of some complicated expression which include summations. First, I noticed that sum behaves differently if I use 1D vs. 2D math. Why?

Questions:
  1. Partial derivative of a summation: why is it not just 2*X[i]?
  2. Partial derivative of a double summation: how to define the nested structure of a double summation with j<>i?
  3. System of n+1 equations: how to define and solve for it?

For 3., each i equation is the partial derivative of my complicated expression with summations with respect to X[i], where i ranges from 1 to n. The last equation is the partial derivative with respect to X_r (a fixed variable).

Thanks.

restart

A := sum(X[i]^2, i = 1 .. n); eq[1] := diff(A, X[i]) = 0

sum(X[i]^2, i = 1 .. n)

 

sum(2*X[i], i = 1 .. n) = 0

(1)

B__wrong := sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n); B__correct := 'sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)'

n^2*X__r^2*w^2+sum(sum(X__r*w*X[j]+X[i]*X[j], j = 1 .. n)+n*X__r*w*X[i], i = 1 .. n)

 

sum(sum((X__r*w+X[i])*(X__r*w+X[j]), j = 1 .. n), i = 1 .. n)

(2)

eqs := seq(eq[i], i = 1 .. n); vars := seq(X[i], i = 1 .. n)

Error, range bounds in seq must be numeric or character

 

Error, range bounds in seq must be numeric or character

 
 

NULL

Download equations_with_summations.mw

On some occasions I have seen output like this

where the user name is replaced by a placeholder.
How to achieve this?

Let P(u,v) = -u⁴+88u³v-146u²v²+88uv³-v⁴+2u²+40uv+2v²-1, with P(u,v)=0,

and u0 = sqrt(2)/6 i,  v0 = -sqrt(2)/6 i. We see that P(u0,v0)=0.

Direct substitution of implicitdiff(P(u,v),v,u) at u0, v0 leads to 0/0.

For obtaining the true value of dv/du at (u0,v0) we have written in Maple:

solve(limit(subs(v=v0+k*(u-u0), implicitdiff(P(u,v),v,u)), u=u0)-k, k);

There are two solutions: 49/113 - 72*sqrt(2)/113*I, and 49/113 + 72*sqrt(2)/113*I.

However we were unable to determine the true value of d²v/du² at (u0,v0).

QUESTION:  How to determine it?

Hi. I'm comparing two 7x3-man teams lists. I can see there are at least 2 teams that have common members, new[1] and past[4], new[4] and past[3]. There may be others but the chat gpt code below doesn't definitively find any of them.

common.mw

The company library with all the good stuff has passed a 100 Mb size, and I wonder if it is possible to find out, which parts of the library that use most of the storage space?

After exertion with ordinary differential equations now relaxation:

Determine the formation law, limit and sum limit for
u_n+3=(13/12)*u_n+2 - (3/8)*u_n+1 + (1/24)*u_n .
Starting values ​​u_1=0, u_2=1, u_3=1.

First 7 8 9 10 11 12 13 Last Page 9 of 2166