MaplePrimes Questions

I am solving a very ill-conditioned generalised matrix eigenvalue problem which has the form (Apologies, the Maple Math input option is not working at all)

Av = aBv

Where A and B are matrices, a are the eigenvalues and v the eigenvectors.

Matrix, B, has a condition number of 1E40 which means Cholesky decomposition, Schur decompositions etc... are highly unstable. I have found that by transforming all the diagonal matrix elements of matrix B to one greatly reduces the condition number (down to 1E25).

To do this I divide the elements on each row by the row element which sits on the diagonal of the matrix, which is shown for a basic 3x3 example:

[1,2,3]
|4,5,6|
[7,8,9]

Becomes:

[1,2,3]
|4/5,1,6/5|
[7/9,8/9,1]

Is there a name for this particular matrix transformation? I also do the same operation to matrix A but using the diagonal elements of B.

Many thanks

-Yeti

We conjecture that the polynomial h(n) = n^2 + n + 41 is prime for an infinite number of values n.
We furthur conjecture that p(n) = n^2 + 1 is prime an infinite number of times.

I have shown that the set (x,y) with h(y) mod x is congruent to 0 can be written down.  It is p(x,y).  p(x,y) is the set of all divisors of h(n).  See

https://sites.google.com/site/primeproducingpolynomial/

landau.mw

Regards,

Matt

Am I applying improper syntax for the is command?  Out of the 5 attempts to equate X with the time derivative of S11 only the combine command yields the expected result.  If only combine works then why do the others not work?
 

Ck1 := sin(Pi*k)/(Pi*k); 1; Ck2 := (1-cos(Pi*k))/(Pi*k); 1; S11 := a[0]+int(sum(2*Ck2*Pi*k*cos(2*Pi*k*x/T)/T, k = 1 .. m), x = 0 .. t); -1; Q1 := 2*sin(alpha)*(diff(S11, t)); -1; Q3 := sum(2*Ck2*Pi*k*(sin(alpha+2*Pi*k*t/T)+sin(alpha-2*Pi*k*t/T))/T, k = 1 .. m); -1; is(Q1 = Q3)

true

(1)

sum1 := sum(2*Ck2*Pi*k*cos(2*Pi*k*x/T)/T, k = 1 .. m):

true

(2)

subs(x = t, simplify(expand(combine(2*sin(alpha)*sum1)))) = simplify(expand(combine(Q3)))"(->)"true

NULL

m := 2*n;

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))

(3)

is(`assuming`([X = diff(S11, t)], [n::integer])), is(`assuming`([expand(X = diff(S11, t))], [n::integer])), is(`assuming`([combine(X = diff(S11, t))], [n::integer])), is(`assuming`([eval(X = diff(S11, t))], [n::integer])), is(`assuming`([value(X = diff(S11, t))], [n::integer])), simplify(`assuming`([combine(X-(diff(S11, t)))], [n::integer]))

false, false, true, false, false, 0

(4)

X

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))

(5)

`assuming`([combine(X-(diff(S11, t)))], [n::integer])

0

(6)

`assuming`([X-combine(diff(S11, t))], [n::integer])

-4*sin(Pi*t/T)*sin(Pi*t*n/T)*cos(Pi*t*n/T)*(2*cos(Pi*t*n/T)^2-1)/(T*cos(Pi*t/T)*(-1+cos(Pi*t/T)^2))-(2*cos((-Pi*t+4*Pi*t*n)/T)-2*cos((Pi*t+4*Pi*t*n)/T))/(T*cos(Pi*t/T)-T*cos(3*Pi*t/T))

(7)

"(=)"

0

(8)

``


 

Download syntax_for_is.mw

 

I originally was trying to verify that the determinant of an nxn matrix of binomial coefficients is zero if n is a multiple of 6. A description of the coefficients is shown in my program below under Row 1, Row 2 etc, using the old fashioned notation for binomial coefficients nCr=n!/r!/(n-r)!    I came across this in the interesting book 'Single Digits: in praise of small numbers' by Marc Chamberland. page 167.

   My pathetic attempt is below.  I tried to create a 5 x 5 matrix of binomial coeffs.  There is a procedure shft which attempts to create the rows of the matrix: the rows are just shifted along.  I've been successful in obtaining two rows, then after that gave up:-(  Thinking I'd try something easier, I thought I'd find the determinant of the matrix using the determinant command in the linear algebra package - without success.

  Any help would be most appreciated. 

 

 restart:

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

# Matrix program - intro to learn matrices

# The proc shft shifts the elements of an array one to the right and the

# first becomes the last

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

with(plots):

with(plottools):

#with(linalg);

with(LinearAlgebra);

#a:=array([1, 2, 3, 4, 5]);

#Row 1   1 nC1  nC2  nC3…    …nC(n-1)

#Row 2   nC(n-1)  1  nC1…      …nC(n-2)

#Row 3  nC(n-2)  nC(n-1)  1…  …nC(n-3)

#...

#Row n  nC1  nC2 nC3…        …1

n:=5:

a:=array([seq(binomial(n,i), i=0..n-1)]);

acopy:=array([seq(binomial(n,i), i=0..n-1)]);

 

#shift := (f::procedure) -> ( x->f(x+1) ):

#shift(a[1]);

shft := proc(a::array)

local i, b::array:

global n:

#printf("n=%d\n",n);

for i from 1 to n do

#printf("n=%d\n",n);

b[i]:=a[i]:

end do:

#nn:=n-1:

for i from 1 to n-1 do

if i<>n-1 then

a[i+1]:=b[i]:

      else

a[1]:=a[5]:

a[n]:=b[n-1]:

end if:

printf("In loop a[%d}=%5.3f\n", i, a[i]);

end do:

end proc:

 

shft(a);

for i from 1 to n do

#printf("n=%d\n",n);

   bnew[i]:=a[i];

printf("bnew[%d]=%d\n",i,bnew[i]);

end do:

bmatrix:=array(1,n,[seq(bnew[i], i=1..n)]);

 

#for m from 2 to n do

   #shft([seq(bmatrix[1,kk], kk=1..m)],[seq(bmatrix[1, k], k=1..n-m)]);

    shft(bmatrix);

printf("In for loop:  bnew[%d}=%5.3f\n", m, bnew[m]);

#end do:

#s:={seq((1,j)=eval(A[1,j]), j=1..n), (2,2)=1,(3,3)=1,(4,4)=1, (5,5)=1}:

s:={(1,1)=1,(1,2)=5,(1,3)=10,(1,4)=10,(1,5)=5, (2,2)=1,(3,3)=1,(4,4)=1, (5,5)=1}:

 

SSs:=Matrix(5,5,s);

determinant(SSs);

simplify(evalf @(determinant(SSs)));

Determinant(SSs,method=float);

 

#A := Matrix(2,2,[[9,9],[1,2]]);

print(`Printing matrix`);

#A[3,3]:=1;

A := Matrix(m,5,[[seq(acopy[i], i=1..5)],[seq(bnew[j], j=1..5)]]);

#end do;

for i from 1 to n do

  printf("a[%d}=%5.3f\n", i, a[i]);

end do:

 

Need help understanding the following code fragment (skipping the implementation details of procedure A). I am a  student and program primarily in Java and I do not have Maple s/w. I browsed through Maple programming guide but have not yet deciphered the code. Any help will be greatly appreciated.

Thank you.

_____________________________________________________________________________

f:=proc(J)

L:=map((x)->[x[1], (x[2] + x[3] * I) / x[1] + 50 * (1+I) / abs(J[1][2])], J);

R:=Vector([L]);

T,r:=abs(L[1][3]),L[1][4];

A(L[1][5],L[2][6],L[3][7],L[1][8],L[2][9],L[3][10],R,T,r);

A(L[1][11],L[2][12],L[4][13],L[1][14],L[2][15],L[4][16],R,T,r);

A(L[1][17],L[3][18],L[4][19],L[1][20],L[3][21],L[4][22],R,T,r);

A(L[2][23],L[3][24],L[4][25],L[2][26],L[3][27],L[4][28],R,T,r);

plots[display](seq(plottools[circle]([Re(R[i][29]),Im(R[i][30])],abs(1/R[i][31])),i= 1..numelems(R))):

end proc:

_____________________________________________________________________________

Procedure is called as:

f([[-1, 0, 0], [2, 1, 0], [2, -1, 0], [3, 0, 2]]);

_____________________________________________________________________________

Hi

Please download and check the attached file.
It seems when you run the code more than one time, various results are obtained each time.

What is the reason? How it can be fixed?

Thanks


 

restart; Digits := 20; tm := time(); with(LinearAlgebra); m := 6; a := .1; b := 10*a; E := 1; h := 1; nu := .3; ur := -w*z+u0; u0 := 0; ut := add(add(T[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m); w := (r-b)^2*(r-a)^2*add(add(W[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m); er := diff(ur, r); et := ur/r+(diff(ut, t))/r; ert := 1/2*(diff(ut, r)-ut/r+(diff(ur, t))/r); u := -(1/2)*E*(2*er*et*nu+er^2+et^2)/(nu^2-1)+2*E*ert^2/(2+2*nu); N := sum(i+1, i = 0 .. m); PI := int(int(int(u*r, z = -(1/2)*h .. (1/2)*h), t = 0 .. 2*Pi), r = a .. b)-.5*P*(int(int(r*(diff(w, r))^2, r = a .. b), t = 0 .. 2*Pi)); s1 := seq(indets(add(add(T[n, i], n = 0 .. i), i = 0 .. m))[k] = c[k], k = 1 .. N); s2 := seq(indets(add(add(W[n, i], n = 0 .. i), i = 0 .. m))[k] = c[k+N], k = 1 .. N); PI := subs(s1, s2, PI); for k to 2*N do diff(PI, c[k]); if % = 0 then ex := `union`({}, {k}) else eq[k] := % end if end do; NE := seq(ex[j], j = 1 .. numelems(ex)); M := GenerateMatrix([`$`(eq[j], j = 1 .. 2*N)], [`$`(c[j], j = 1 .. 2*N)])[1]; M := DeleteColumn(DeleteRow(M, NE), NE); Determinant(M); 12*fsolve(%, P = 0 .. 1)*(-nu^2+1)*a^2/(E*h^3); Time = time()-tm

Time = 85.363

(1)

``


 

Download Stability.mw

Units seem to be interfering with elementwise square roots.  I have with(Units[Standard]): in my .mapleprofile since I frequently use units.  I am working on a document which uses units but also requires computing the elementwise square root of a 2x1 vector.

If I boil this down to the very simple document attached, you can see that the units package is somehow interfering with the square root of a vector of numbers without units, but doing an elementwise square root doesn't work either.  I have tried removing the with(Units[Standard]): line in the startup file for this document and recomputing, but nothing changes.

I don't see how to do elementwise square roots in this situation.  Is there a workaround, or am I missing something?

Thanks,

Gerrit

Elementwise_Square_Root.mw

Does anyone know how the sum command works? If I set

f:=proc(x) if x<=1 then 1 else 2

then compute

sum(f(i),i=1..10)

I get an error, as it tries to check "i<=0", for the symbol 'i'. Curiously if the comparison in 'f' is "x=1" it goes through fine. Another place this comes up is using "op" on lists. If I set

z:=[[1,2],[3,4],[5,6]]

then compute

sum(foldl((x,y)->x*vars[y],1,op(z[i])),i =1..3)

it doesn't give the desired answer. When i=1 for example, I think it computes op(z[i]) as op(z[i])->i->1, rather than op(z[i])->op(z[1])->op([1,2])->1,2.

Hello Guys,

Can maple derive Einstein field equations from Einstein-Hilbert action ?

 

Thx

hello guys, I can't take the real part of this formula that you can see in the picture that I upload for you.
please help me!!!!!!!!
sorry for uploading photo...so surry

I want to see that if parameter 'alpha' tends to the infinity amount of parameter 'p' how changes?

how I can see and do  this process?

thanks

_nahaii.mw
 

alfa*ba*che*taghiiri*roi*p*taghiir*mikonad

restart

E := 67*10^9:

``

h := 8*10^(-9):

l := 2.5*10^(-9):

f := 5:

L := 120*10^(-9):

``

b1 := -E*h*b:

b2 := -(1/4)*mu*h*b:

c1 := -(1/12)*(E*1)*b*h^3-2*mu*l^2*h*b-(2/25)*mu*l^2*h*b-(4/15)*mu*l^2*h*b-(32/15)*mu*l^2*h*b:

c2 := (18/5)*mu*l^2*i+(4/5)*mu*l^2*i:

c4 := (152/225)*mu*l^2*h*b:

NULL

a1 := -E*h*b:

a2 := 2*mu*l^2*h*b+(4/5)*mu*l^2*h*b+(8/5)*mu*l^2*h*b:

c5 := c1+c4-2*f^2*h*varepsilon0/(3*(alpha*varepsilon0+1))-2*f^2*h/(3*alpha*(alpha*varepsilon0+1)):

c6 := c4-2*f^2*h*varepsilon0/(3*(alpha*varepsilon0+1)):

c7 := (14/9)*f^2*h/alpha:

``

m := 2*3.14^2*c7^2+8*L^2*b2*c7-2*L^2*c5^2+2*L^2*c5*c6-L^2*c7:

n := 4*L^2*c6^2*c7^2*3.14^2+16*L^4*b2*c6^2*c7-4*L^4*b2*c5*c6*c7+L^4*c7^2:

q := (3.14^2*c7^2+4*L^2*b2*c7-L^2*c5^2)/b2:

p := -(1/2)*(m-sqrt(n))/q:

plot(p, alpha, alpha = 0.1e7 .. 0.1e8)

 

NULL


 

Download _nahaii.mw

 

Hi every body:

I want to solve these equations with maple, can everyone help me how to solve them?

eq1 := diff(u1(x), x, x)+diff(u2(x), x)+int(2*x*s*(u1(s)-3*u2(s)), s = 0 .. 1) = 6*x^2+3*x*(1/10)+8
eq2 := diff(u1(x), x)+diff(u2(x), x, x)+int((3*(s^2+2*x))*(u1(s)-2*u2(s)), s = 0 .. 1) = 21*x+4/5
bcs := u1(0)+(D(u1))(0) = 1, u2(0)+(D(u2))(0) = 1, u1(1)+(D(u1))(1) = 10, u2(1)+(D(u2))(1) = 7

with regards...

I want to plot these in one frame:

between [0, 0.2]

between [0.2, 0.4]

betwen [0.4,0.6]

between [0.6, 0.8]

I want to plot all these functions y[0], y[1], y[2], y[3] in one plot between the mentioned interval.

 

I am trying to find numerically eigevalues and eigenvectors of a 70x70 matrix. When I type

Eigenvalues(M70, output = 'list');

Maple returns the matrix M70 without processing it. I have also tried Determinant, Gaussian elimination and other - the same story. However, Maple has no problem inverting this matrix numerically. Everything also works well for 20x20 matrix but not for 70x70 one.  70x70 is not such a big matrix. It should be doable.

What is the solution? Do I do something wrong?

I've tried every which way to get the Bezier Curves task to work.  I have embedded it in an existing document and in a new one using Tools / Tasks / Bezier Curves, and it doesn't work at all for me.  Sometimes I get errors when I click Initialize (not always), and I never get any reaction from clicking or dragging in the plot.  Is this me or the task?

I also can't see any of the inner workings of the task.  I don't see how the slider connects to the n variable, or how the plot is generated, or where the plot points come from.  Therefore I can't see how to customize the task for my use.

I've seen other Maple documents like this in Help, too.  How do I see and modify the inner workings of these documents?

First 881 882 883 884 885 886 887 Last Page 883 of 2434