Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I'm new to Maple.

My problem is that if I input the command sqrt(3.0), for example, I get this strange result:

1.81847767202745*10^(-58) + (7.53238114626421*10^(-59))*I

The results is the same, no matter the argument of sqrt.

Also, when using ln, I get this:

-265.745524189222 + 0.785398163397448*I

Again, no matter the argument of ln, the result is the same.

What is happening?

Dear maple user  any one suggest me how to solve  second order coupled differential equation using galerkin finite element method for 8 elements and 10 elements using maple codes

 

Hi, Is there a way in which i can solve the following optimal control problem numerically with Maple ??

where P(t)=N(t)+S(t)+A(t) and N(0)=0.4897, S(0)=0.4018, A(0)=0.1085.

μ=0.000833, d=0.000666, ε1=0.0020, ε2=0.000634, β1=0.002453, β2=0.25*0.02, γ1=0.0048, γ2=0.25*0.02+0.00013, k1=1, k2=0.001, k3=0.99.

 where 

p1,p2,p3 are transversality conditions 

p1(60)=0 
p2(60)=0 
p3(60)=0

Answers and advice are very appreciated. 

Thank you all for reading.

Benz.

Hi

I have an optimization problem subjects with a system of ordinary differential equations with initial conditions.

I would like to obtain u^star, x^star and y^star solution of my problem 

I prefer if possible we implement hamilton jacobi bellman if possible

 

Optimal_control_problem.mw

 

thanks

 

whats wrong with the codes while running the codes in maple 13 it will take memory and time as 41.80M, 9.29s while the same code is running in maple 18 it will take 1492.38M , 911.79s

Why the same codes take different time and memory. The codes are here

 

 

restart:
Digits:=15:
d1:=0.2:d2:=0.6:L1:=0.2:L2:=0.2:F:=0.3:Br:=0.3:
Gr:=0.2: Nb:=0.1:Nt:=0.3:B:=1:B1:=0.7:m:=1:k:=0.1:
Ro:=1:R1:=1:q:=1:alpha:=Pi/4:
h:=z->piecewise( z<=d1,    1,
                 z<=d1+L1,   1-(gamma1/(2*Ro))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))), 
                        z<=B1-L2/2,  1 ,          
                    z<=B1,  1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B1+L2/2,  R1-(gamma2/(2*Ro))*(1 + cos(2*(Pi/L2)*(z - B1))),
                 z<=B,    R1):
A:=(-m^2/4)-(1/4*k):
S1:=(h(z)^2)/4*A-ln(A*h(z)^2+1)*(1+h(z)^2)/4*A:
a2:=Int((1/S1),z=0..1):
b2:=Int((sin(alpha)/F),z=0..1):
c2:=(1/S1)*(-h(z)^6/(6912*A)-h(z)^4/(9216*A)+h(z)^2/(4608*A^3)+ln(1+A*h(z)^2)*(h(z)^6/(576*A)+h(z)^4/(512*A^2)-1/(4608*A^4))):
c3:=Int(c2,z=0..1):
c4:=2*Gr*(Nb-Nt)*c3:
e2:=(1/S1)*(-7*h(z)^4/(256*A)-h(z)^2/(128*A^2)+ln(1+A*h(z)^2)*(3*h(z)^4/(128*A)+h(z)^2/(32*A^2)+1/(128*A^3))):
e3:=Int(e2,z=0..1):
e4:=2*(Nt/Nb)*Br*e3:
l1:=-a2:
l2:=-b2-c4+e4:
Dp:=q*l1+l2:

igRe:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Re(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igRe,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Re(Dp)'],
     gridlines=false, axes=boxed);

igIm:=subsindets(Dp,specfunc(anything,Int),
                         u->Int(Im(op(1,u)),op(2,u),
                                   method=_d01ajc,epsilon=1e-6)):

plot([seq(eval(igIm,gamma2=j),j=[0,0.02,0.06])],gamma1=0.02..0.1,
     adaptive=false,
     legend = [gamma2 = 0.0,gamma2 = 0.02,gamma2 = 0.04],
     linestyle = [solid,dash,dot],
     color = [black,black,black],
     labels=[gamma1,'Im(Dp)'],
     gridlines=false, axes=boxed);
 

 

Dears, greeting for all

I have a problem, I try to explain it by a figure

This formula does not work.

I need to substitute n=0 to give G_n+1 as a function of the parameter s, then find the limit. 

.where G_n is a function in s.

this is the result

 

how to express eigenvector or eigenvalues in terms of fibonacci or lucas or golden ratio?

fibonacci ratio has many 

f(n)/f(n-1) , all eigenvector can not divided by any one of them

 

Hello!

I want to calculate Eigenvalues. Depending on values for digits and which datatype I choose Maple sometimes returns zero as Eigenvalues. Maybe there is a problem with the used routines: CLAPACK sw_dgeevx_, CLAPACK sw_zgeevx_.

Thank you for your suggestions!
 

``

 

Problems LinearAlgebra:-Eigenvalues, Digits, ':-datatype' = ':-sfloat', ':-datatype' = ':-complex'( ':-sfloat' )

 

restart;

interface( ':-displayprecision' = 5 ):
 

infolevel['LinearAlgebra'] := 5;
myPlatform := kernelopts( ':-platform' );
myVersion := kernelopts( ':-version' );

5

 

"windows"

 

`Maple 2018.2, X86 64 WINDOWS, Nov 16 2018, Build ID 1362973`

(1.1)

Example 1

 

A1 := Matrix( 5, 5, [[0, 1, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 0, 0, 0, 1], [-10201/1000, 30199/10000, -5049/250, 97/50, -48/5]] );

Matrix(5, 5, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 1, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 1, (5, 1) = -10201/1000, (5, 2) = 30199/10000, (5, 3) = -5049/250, (5, 4) = 97/50, (5, 5) = -48/5})

(1.1.1)

LinearAlgebra:-Eigenvalues( A1 );

CharacteristicPolynomial: working on determinant of minor 2
CharacteristicPolynomial: working on determinant of minor 3
CharacteristicPolynomial: working on determinant of minor 4
CharacteristicPolynomial: working on determinant of minor 5

 

Vector(5, {(1) = -10, (2) = 1/10+I, (3) = 1/10-I, (4) = 1/10+I, (5) = 1/10-I})

(1.1.2)

A11 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-sfloat' );

Matrix(5, 5, {(1, 1) = 0., (1, 2) = 1.00000, (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 1.00000, (2, 4) = 0., (2, 5) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0., (3, 4) = 1.00000, (3, 5) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 0., (4, 5) = 1.00000, (5, 1) = -10.20100, (5, 2) = 3.01990, (5, 3) = -20.19600, (5, 4) = 1.94000, (5, 5) = -9.60000})

(1.1.3)

Digits := 89;
LinearAlgebra:-Eigenvalues( A11 );

Digits := 89

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881249354686)

(1.1.4)

Digits := 90;
LinearAlgebra:-Eigenvalues( A11 );

Digits := 90

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881249352150)

(1.1.5)

A12 := Matrix( op( 1, A1 ),( i,j ) -> evalf( A1[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );

Matrix(5, 5, {(1, 1) = 0.+0.*I, (1, 2) = 1.00000+0.*I, (1, 3) = 0.+0.*I, (1, 4) = 0.+0.*I, (1, 5) = 0.+0.*I, (2, 1) = 0.+0.*I, (2, 2) = 0.+0.*I, (2, 3) = 1.00000+0.*I, (2, 4) = 0.+0.*I, (2, 5) = 0.+0.*I, (3, 1) = 0.+0.*I, (3, 2) = 0.+0.*I, (3, 3) = 0.+0.*I, (3, 4) = 1.00000+0.*I, (3, 5) = 0.+0.*I, (4, 1) = 0.+0.*I, (4, 2) = 0.+0.*I, (4, 3) = 0.+0.*I, (4, 4) = 0.+0.*I, (4, 5) = 1.00000+0.*I, (5, 1) = -10.20100+0.*I, (5, 2) = 3.01990+0.*I, (5, 3) = -20.19600+0.*I, (5, 4) = 1.94000+0.*I, (5, 5) = -9.60000+0.*I})

(1.1.6)

Digits := 100;
LinearAlgebra:-Eigenvalues( A12 );

Digits := 100

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881249345038)

(1.1.7)

Digits := 250;
LinearAlgebra:-Eigenvalues( A12 );

Digits := 250

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881342643606)

(1.1.8)

 

 

Example 2

 

A2 := Matrix(3, 3, [[0, 1, 0], [0, 0, 1], [3375, -675, 45]]);

Matrix(3, 3, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (3, 1) = 3375, (3, 2) = -675, (3, 3) = 45})

(1.2.1)

LinearAlgebra:-Eigenvalues( A2 );

IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 3 x 3 matrix

IntegerCharacteristicPolynomial: Using prime 33554393
IntegerCharacteristicPolynomial: Using prime 33554383
IntegerCharacteristicPolynomial: Used total of  2  prime(s)

 

Vector(3, {(1) = 15, (2) = 15, (3) = 15})

(1.2.2)

A21 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-sfloat' );

Matrix(3, 3, {(1, 1) = 0., (1, 2) = 1.00000, (1, 3) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 1.00000, (3, 1) = 3375.00000, (3, 2) = -675.00000, (3, 3) = 45.00000})

(1.2.3)

Digits := 77;
LinearAlgebra:-Eigenvalues( A21 );

Digits := 77

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881342621686)

(1.2.4)

Digits := 78;
LinearAlgebra:-Eigenvalues( A21 );

Digits := 78

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881342617230)

(1.2.5)

A22 := Matrix( op( 1, A2 ),( i,j ) -> evalf( A2[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );

Matrix(3, 3, {(1, 1) = 0.+0.*I, (1, 2) = 1.00000+0.*I, (1, 3) = 0.+0.*I, (2, 1) = 0.+0.*I, (2, 2) = 0.+0.*I, (2, 3) = 1.00000+0.*I, (3, 1) = 3375.00000+0.*I, (3, 2) = -675.00000+0.*I, (3, 3) = 45.00000+0.*I})

(1.2.6)

Digits := 58;
LinearAlgebra:-Eigenvalues( A22 );

Digits := 58

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881342614934)

(1.2.7)

Digits := 59;
LinearAlgebra:-Eigenvalues( A22 );

Digits := 59

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881325525942)

(1.2.8)

 

 

Example 3

 

A3 := Matrix(4, 4, [[0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1], [-48841, 8840, -842, 40]]);

Matrix(4, 4, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 1, (4, 1) = -48841, (4, 2) = 8840, (4, 3) = -842, (4, 4) = 40})

(1.3.1)

LinearAlgebra:-Eigenvalues( A3 );

IntegerCharacteristicPolynomial: Computing characteristic polynomial for a 4 x 4 matrix
IntegerCharacteristicPolynomial: Using prime 33554393

IntegerCharacteristicPolynomial: Using prime 33554383
IntegerCharacteristicPolynomial: Used total of  2  prime(s)

 

Vector(4, {(1) = 10+11*I, (2) = 10-11*I, (3) = 10+11*I, (4) = 10-11*I})

(1.3.2)

A31 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-sfloat' );

Matrix(4, 4, {(1, 1) = 0., (1, 2) = 1.00000, (1, 3) = 0., (1, 4) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 1.00000, (2, 4) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0., (3, 4) = 1.00000, (4, 1) = -48841.00000, (4, 2) = 8840.00000, (4, 3) = -842.00000, (4, 4) = 40.00000})

(1.3.3)

Digits := 75;
LinearAlgebra:-Eigenvalues( A31 );

Digits := 75

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881324662046)

(1.3.4)

Digits := 76;
LinearAlgebra:-Eigenvalues( A31 );

Digits := 76

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881324657710)

(1.3.5)

A32 := Matrix( op( 1, A3 ),( i,j ) -> evalf( A3[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );

Matrix(4, 4, {(1, 1) = 0.+0.*I, (1, 2) = 1.00000+0.*I, (1, 3) = 0.+0.*I, (1, 4) = 0.+0.*I, (2, 1) = 0.+0.*I, (2, 2) = 0.+0.*I, (2, 3) = 1.00000+0.*I, (2, 4) = 0.+0.*I, (3, 1) = 0.+0.*I, (3, 2) = 0.+0.*I, (3, 3) = 0.+0.*I, (3, 4) = 1.00000+0.*I, (4, 1) = -48841.00000+0.*I, (4, 2) = 8840.00000+0.*I, (4, 3) = -842.00000+0.*I, (4, 4) = 40.00000+0.*I})

(1.3.6)

Digits := 100;
LinearAlgebra:-Eigenvalues( A32 );

Digits := 100

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881324648198)

(1.3.7)

Digits := 250;
LinearAlgebra:-Eigenvalues( A32 );

Digits := 250

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881327288182)

(1.3.8)

 

 

Example 4

 

A4 := Matrix(8, 8, [[0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 1], [-1050625/20736, 529925/1296, -15417673/10368, 3622249/1296, -55468465/20736, 93265/108, -1345/8, 52/3]]);

Matrix(8, 8, {(1, 1) = 0, (1, 2) = 1, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (1, 6) = 0, (1, 7) = 0, (1, 8) = 0, (2, 1) = 0, (2, 2) = 0, (2, 3) = 1, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = 0, (2, 8) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 1, (3, 5) = 0, (3, 6) = 0, (3, 7) = 0, (3, 8) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 0, (4, 5) = 1, (4, 6) = 0, (4, 7) = 0, (4, 8) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 0, (5, 6) = 1, (5, 7) = 0, (5, 8) = 0, (6, 1) = 0, (6, 2) = 0, (6, 3) = 0, (6, 4) = 0, (6, 5) = 0, (6, 6) = 0, (6, 7) = 1, (6, 8) = 0, (7, 1) = 0, (7, 2) = 0, (7, 3) = 0, (7, 4) = 0, (7, 5) = 0, (7, 6) = 0, (7, 7) = 0, (7, 8) = 1, (8, 1) = -1050625/20736, (8, 2) = 529925/1296, (8, 3) = -15417673/10368, (8, 4) = 3622249/1296, (8, 5) = -55468465/20736, (8, 6) = 93265/108, (8, 7) = -1345/8, (8, 8) = 52/3})

(1.4.1)

LinearAlgebra:-Eigenvalues( A4 );

CharacteristicPolynomial: working on determinant of minor 2
CharacteristicPolynomial: working on determinant of minor 3

CharacteristicPolynomial: working on determinant of minor 4
CharacteristicPolynomial: working on determinant of minor 5
CharacteristicPolynomial: working on determinant of minor 6
CharacteristicPolynomial: working on determinant of minor 7
CharacteristicPolynomial: working on determinant of minor 8

 

Vector(8, {(1) = 1/3-(1/4)*I, (2) = 1/3+(1/4)*I, (3) = 4-5*I, (4) = 4+5*I, (5) = 1/3-(1/4)*I, (6) = 1/3+(1/4)*I, (7) = 4-5*I, (8) = 4+5*I})

(1.4.2)

A41 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-sfloat' );

Matrix(8, 8, {(1, 1) = 0., (1, 2) = 1.00000, (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (1, 6) = 0., (1, 7) = 0., (1, 8) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 1.00000, (2, 4) = 0., (2, 5) = 0., (2, 6) = 0., (2, 7) = 0., (2, 8) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0., (3, 4) = 1.00000, (3, 5) = 0., (3, 6) = 0., (3, 7) = 0., (3, 8) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 0., (4, 5) = 1.00000, (4, 6) = 0., (4, 7) = 0., (4, 8) = 0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 0., (5, 6) = 1.00000, (5, 7) = 0., (5, 8) = 0., (6, 1) = 0., (6, 2) = 0., (6, 3) = 0., (6, 4) = 0., (6, 5) = 0., (6, 6) = 0., (6, 7) = 1.00000, (6, 8) = 0., (7, 1) = 0., (7, 2) = 0., (7, 3) = 0., (7, 4) = 0., (7, 5) = 0., (7, 6) = 0., (7, 7) = 0., (7, 8) = 1.00000, (8, 1) = -50.66671, (8, 2) = 408.89275, (8, 3) = -1487.04408, (8, 4) = 2794.94522, (8, 5) = -2674.98384, (8, 6) = 863.56481, (8, 7) = -168.12500, (8, 8) = 17.33333})

(1.4.3)

Digits := 74;
LinearAlgebra:-Eigenvalues( A41 );

Digits := 74

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881317242630)

(1.4.4)

Digits := 75;
LinearAlgebra:-Eigenvalues( A41 );

Digits := 75

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_dgeevx_

 

Vector[column](%id = 18446745881317239134)

(1.4.5)

A42 := Matrix( op( 1, A4 ),( i,j ) -> evalf( A4[i,j] ), ':-datatype' = ':-complex'( ':-sfloat' ) );

Matrix(8, 8, {(1, 1) = 0.+0.*I, (1, 2) = 1.00000+0.*I, (1, 3) = 0.+0.*I, (1, 4) = 0.+0.*I, (1, 5) = 0.+0.*I, (1, 6) = 0.+0.*I, (1, 7) = 0.+0.*I, (1, 8) = 0.+0.*I, (2, 1) = 0.+0.*I, (2, 2) = 0.+0.*I, (2, 3) = 1.00000+0.*I, (2, 4) = 0.+0.*I, (2, 5) = 0.+0.*I, (2, 6) = 0.+0.*I, (2, 7) = 0.+0.*I, (2, 8) = 0.+0.*I, (3, 1) = 0.+0.*I, (3, 2) = 0.+0.*I, (3, 3) = 0.+0.*I, (3, 4) = 1.00000+0.*I, (3, 5) = 0.+0.*I, (3, 6) = 0.+0.*I, (3, 7) = 0.+0.*I, (3, 8) = 0.+0.*I, (4, 1) = 0.+0.*I, (4, 2) = 0.+0.*I, (4, 3) = 0.+0.*I, (4, 4) = 0.+0.*I, (4, 5) = 1.00000+0.*I, (4, 6) = 0.+0.*I, (4, 7) = 0.+0.*I, (4, 8) = 0.+0.*I, (5, 1) = 0.+0.*I, (5, 2) = 0.+0.*I, (5, 3) = 0.+0.*I, (5, 4) = 0.+0.*I, (5, 5) = 0.+0.*I, (5, 6) = 1.00000+0.*I, (5, 7) = 0.+0.*I, (5, 8) = 0.+0.*I, (6, 1) = 0.+0.*I, (6, 2) = 0.+0.*I, (6, 3) = 0.+0.*I, (6, 4) = 0.+0.*I, (6, 5) = 0.+0.*I, (6, 6) = 0.+0.*I, (6, 7) = 1.00000+0.*I, (6, 8) = 0.+0.*I, (7, 1) = 0.+0.*I, (7, 2) = 0.+0.*I, (7, 3) = 0.+0.*I, (7, 4) = 0.+0.*I, (7, 5) = 0.+0.*I, (7, 6) = 0.+0.*I, (7, 7) = 0.+0.*I, (7, 8) = 1.00000+0.*I, (8, 1) = -50.66671+0.*I, (8, 2) = 408.89275+0.*I, (8, 3) = -1487.04408+0.*I, (8, 4) = 2794.94522+0.*I, (8, 5) = -2674.98384+0.*I, (8, 6) = 863.56481+0.*I, (8, 7) = -168.12500+0.*I, (8, 8) = 17.33333+0.*I})

(1.4.6)

Digits := 100;
LinearAlgebra:-Eigenvalues( A42 );

Digits := 100

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881317227806)

(1.4.7)

Digits := 250;
LinearAlgebra:-Eigenvalues( A42 );

Digits := 250

 

Eigenvalues: calling external function
Eigenvalues: initializing the output object
Eigenvalues: using software external library
Eigenvalues: CLAPACK sw_zgeevx_

 

Vector[column](%id = 18446745881356880102)

(1.4.8)

 

 

 

 

 

 

 

 

 

 

``


 

Download Problems_LinearAlgebra_Eigenvalues.mw

How to get the functional form of interpolation in the given example below

 

GP.mw

Hi, 

The procedure Statistics:-ChiSquareSuitableModelTest returns wrong or stupid results in some situations.
The stupid answer can easily be avoided if the user is careful enough.
The wrong answer is more serious: the standard deviation (in the second case below) is not correctly estimated.

PS: the expression "CORRECT ANSWER" is a short for "POTENTIALLY CORRECT ANSWER" given that what ChiSquareSuitableModelTest really does is not documented
 

restart:

with(Statistics):

randomize():

N := 100:
S := Sample(Normal(0, 1), N):

infolevel[Statistics] := 1:

# 0 parameter to fit from the sample S  CORRECT ANSWER

ChiSquareSuitableModelTest(S, Normal(0, 1), level = 0.5e-1):
print():

Chi-Square Test for Suitable Probability Model
----------------------------------------------
Null Hypothesis:
Sample was drawn from specified probability distribution
Alt. Hypothesis:
Sample was not drawn from specified probability distribution
Bins:                    10
Degrees of freedom:      9
Distribution:            ChiSquare(9)
Computed statistic:      15.8
Computed pvalue:         0.0711774
Critical value:          16.9189774487099
Result: [Accepted]
This statistical test does not provide enough evidence to conclude that the null hypothesis is false

 

(1)

# 2 parameters (mean and standard deviation) to fit from the sample S  INCORRECT ANSWER

ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 2):


print():
# verification
m := Mean(S);
s := StandardDeviation(S);
t := sqrt(add((S-~m)^~2) / (N-1));

print():
error "the estimation of the StandardDeviation ChiSquareSuitableModelTest is not correct";
print():

Chi-Square Test for Suitable Probability Model

----------------------------------------------
Null Hypothesis:
Sample was drawn from specified probability distribution
Alt. Hypothesis:
Sample was not drawn from specified probability distribution
Model specialization:    [a = -.2143e-1, b = .8489]
Bins:                    10
Degrees of freedom:      7
Distribution:            ChiSquare(7)
Computed statistic:      3.8
Computed pvalue:         0.802504
Critical value:          14.0671405764057
Result: [Accepted]
This statistical test does not provide enough evidence to conclude that the null hypothesis is false

 

 

HFloat(-0.021425681632689854)

 

HFloat(0.8531979363682092)

 

HFloat(0.8531979363682094)

 

 

Error, the estimation of the StandardDeviation ChiSquareSuitableModelTest is not correct

 

(2)

# ONLY 1 parameter (mean OR standard deviation ?) to fit from the sample S  STUPID ANSWER
#
# A stupid answer: the parameter to fit not being declared, the procedure should return
# an error of the type "don(t know what is the paramater tio fit"
ChiSquareSuitableModelTest(S, Normal(a, b), level = 0.5e-1, fittedparameters = 1):


print():
WARNING("ChiSquareSuitableModelTest should return it can't fit a single parameter");
print():

Chi-Square Test for Suitable Probability Model

----------------------------------------------
Null Hypothesis:
Sample was drawn from specified probability distribution
Alt. Hypothesis:
Sample was not drawn from specified probability distribution
Model specialization:    [a = -.2143e-1, b = .8489]
Bins:                    10
Degrees of freedom:      8
Distribution:            ChiSquare(8)
Computed statistic:      3.8
Computed pvalue:         0.874702
Critical value:          15.5073130558655
Result: [Accepted]
This statistical test does not provide enough evidence to conclude that the null hypothesis is false

 

 

Warning, ChiSquareSuitableModelTest should return it can't fit a single parameter

 

(3)

ChiSquareSuitableModelTest(S, Normal(a, 1), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER
print():

# verification
m := Mean(S);
print():

Chi-Square Test for Suitable Probability Model

----------------------------------------------
Null Hypothesis:
Sample was drawn from specified probability distribution
Alt. Hypothesis:
Sample was not drawn from specified probability distribution
Model specialization:    [a = -.2143e-1]
Bins:                    10
Degrees of freedom:      8
Distribution:            ChiSquare(8)
Computed statistic:      16.4
Computed pvalue:         0.0369999
Critical value:          15.5073130558655
Result: [Rejected]
This statistical test provides evidence that the null hypothesis is false

 

 

HFloat(-0.021425681632689854)

 

(4)

ChiSquareSuitableModelTest(S, Normal(0, b), level = 0.5e-1, fittedparameters = 1):  #CORRECT ANSWER

print():
# verification
s := sqrt((add(S^~2) - 0^2) / N);
print():

Chi-Square Test for Suitable Probability Model

----------------------------------------------
Null Hypothesis:
Sample was drawn from specified probability distribution
Alt. Hypothesis:
Sample was not drawn from specified probability distribution
Model specialization:    [b = .8492]
Bins:                    10
Degrees of freedom:      8
Distribution:            ChiSquare(8)
Computed statistic:      6.4
Computed pvalue:         0.60252
Critical value:          15.5073130558655
Result: [Accepted]
This statistical test does not provide enough evidence to conclude that the null hypothesis is false

 

 

HFloat(0.8491915633531496)

 

(5)

 


 

Download ChiSquareSuitableModelTest.mw

Dear Users!

I have made a code using loops. But when I exceute it I go unwanted expression please see the files and try to fix it. I shall be very thankful. 

 

Help.mw

Special request to:

@acer @Kitonum @Preben Alsholm @Carl Love

Hi,

I seeking for informations on the Statistics:-ChiSquareSuitableModelTest procedure:

  1. Once you have choose the number of bins, what strategy does this procedure use to define the bins (equal width, equal probability, other one?).
     
  2. It seems the procedure accepts any value for this number of bins and that its correct use then is under the sole responsability of the user. Am I right?


In the book below (but I'm sure this can also be found on the web) there is a detailed discussion concerning "good practices" in using the Chi-Square goodness of fit test: does anyone known is something comparable is used in ChiSquareSuitableModelTest ?

Statistical methods in experimental physics, W.T.Eadie, D. Drijard, F.F.James, M. Roos, B. Sadoulet
North-Holland 1971
Paragraph 11.2.3 "choosing optimal bin size"


Thanks in advance

I am writing a maths books using maple now. It is fantastic to use maple for writing books in maths.
 

 

 

 in the polynomial x^3-3*x^2-33*x+35 This line is not copying in full line!!
Step 1: Find the sum of all the coefficients in the polynomial x^3-3*x^2-33*x+35 This line is copying in full!!
"= 1-3-33+35 = 0"
                                                 r x-1is a factor  ; 1 is a root of the polynomial.
In the next row, I copy pasted the lines above

 in the polynomial x^3-3*x^2-33*x+35 This line is not copying in full line!!

Step 1: Find the sum of all the coefficients in the polynomial x^3-3*x^2-33*x+35 This line is copying in full!!

"= 1-3-33+35 = 0"
                                                 r x-1is a factor  ; 1 is a root of the polynomial.
In the next row, I copy pasted the lines above

 

 

 

Can any one find the reason?

 

 

``


 

Download cannotCopyWhy.mw

I enclose a part of my document where in I made a particular line with text and maths formats combined.Then I made changes in the line. Now copy paste does work only for the later half (both text and maths formats). The corrected first part is not being copied.

How do I do the corrections properly so that copy paste is not a problem at laer stages.

Thanks for the answer.

Ramakrishnan V

Hello Anybody can help me to write codes for PDE to solve by Galerkin finite element method or any other methods can be able to gain results? parameter omega is unknown and should be determined.

I attached a pdf file for more .

Thanks so much

fem2
 

"restart:  rho:=7850:  E:=0.193e12:  n:=1:  AD:=10:  upsilon:=0.291:   mu:=E/(2*(1+upsilon)):  l:=0:  lambda:=E*upsilon/((1+upsilon)*(1-2*upsilon)):  R:=2.5:  ii:=2:  J:=2:       m:=1:       `u__theta`(r,theta,phi):= ( V(r,theta))*cos(m*phi):  `u__r`(r,theta,phi):= ( U(r,theta))*cos(m*phi): `u__phi`(r,theta,phi):= ( W(r,theta))*sin(m*phi):  :        eq1:=(r (R+r cos(theta))^2 (mu+lambda) (((&PartialD;)^2)/(&PartialD;r&PartialD;theta) `u__theta`(r,theta,phi))+2 r^2 (mu+lambda/2) (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__r`(r,theta,phi))+r^2 (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;r) `u__phi`(r,theta,phi))+mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__r`(r,theta,phi))+(((&PartialD;)^2)/(&PartialD;phi^2) `u__r`(r,theta,phi)) mu r^2-3 (R+r cos(theta))^2 (mu+lambda/3) ((&PartialD;)/(&PartialD;theta) `u__theta`(r,theta,phi))+2 r (mu+lambda/2) (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__r`(r,theta,phi))-r^2 sin(theta) (mu+lambda) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__theta`(r,theta,phi))-3 r^2 cos(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__phi`(r,theta,phi))-r mu sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__r`(r,theta,phi))-2 (mu+lambda/2) (2 (cos(theta))^2 r^2+2 cos(theta) R r+R^2) `u__r`(r,theta,phi)+r `u__theta`(r,theta,phi) sin(theta) (3 r (mu+lambda/3) cos(theta)+R mu))/(r^2 (R+r cos(theta))^2):  eq2:=(2 (mu+lambda/2) (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__theta`(r,theta,phi))+r (R+r cos(theta))^2 (mu+lambda) (((&PartialD;)^2)/(&PartialD;r&PartialD;theta) `u__r`(r,theta,phi))+r (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;theta) `u__phi`(r,theta,phi))+r^2 mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__theta`(r,theta,phi))+(((&PartialD;)^2)/(&PartialD;phi^2) `u__theta`(r,theta,phi)) mu r^2+3 (R+r cos(theta)) ((4 r (mu+lambda/2) cos(theta))/3+R (mu+lambda/3)) ((&PartialD;)/(&PartialD;theta) `u__r`(r,theta,phi))-2 r (mu+lambda/2) sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__theta`(r,theta,phi))+r mu (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__theta`(r,theta,phi))+3 r^2 sin(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__phi`(r,theta,phi))+(-3 r R (mu+lambda/3) cos(theta)+(-lambda-2 mu) r^2-R^2 mu) `u__theta`(r,theta,phi)-2 r (mu+lambda/2) sin(theta) R `u__r`(r,theta,phi))/(r^2 (R+r cos(theta))^2):  eq3:=(r (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;theta) `u__theta`(r,theta,phi))+r^2 (mu+lambda) (R+r cos(theta)) (((&PartialD;)^2)/(&PartialD;phi&PartialD;r) `u__r`(r,theta,phi))+mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;theta^2) `u__phi`(r,theta,phi))+r (r mu (R+r cos(theta))^2 (((&PartialD;)^2)/(&PartialD;r^2) `u__phi`(r,theta,phi))+2 r (mu+lambda/2) (((&PartialD;)^2)/(&PartialD;phi^2) `u__phi`(r,theta,phi))+(4 r (mu+lambda/2) cos(theta)+R (mu+lambda)) ((&PartialD;)/(&PartialD;phi) `u__r`(r,theta,phi))+mu (R+2 r cos(theta)) (R+r cos(theta)) ((&PartialD;)/(&PartialD;r) `u__phi`(r,theta,phi))-mu sin(theta) (R+r cos(theta)) ((&PartialD;)/(&PartialD;theta) `u__phi`(r,theta,phi))-r (3 sin(theta) (mu+lambda/3) ((&PartialD;)/(&PartialD;phi) `u__theta`(r,theta,phi))+`u__phi`(r,theta,phi) mu)))/(r^2 (R+r cos(theta))^2):  "

EQ1 := collect(eq1, cos(m*phi))/cos(m*phi)+rho*omega^2; EQ2 := collect(eq2, cos(m*phi))/cos(m*phi)+rho*omega^2; EQ3 := collect(eq3, sin(m*phi))/sin(m*phi)+rho*omega^2

(0.1788235818e12*r*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), r), theta))+0.2535718390e12*r^2*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), r), r))+0.1788235818e12*r^2*(2.5+r*cos(theta))*(diff(W(r, theta), r))+0.7474825716e11*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), theta), theta))-0.7474825716e11*U(r, theta)*r^2-0.3283200960e12*(2.5+r*cos(theta))^2*(diff(V(r, theta), theta))+0.2535718390e12*r*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(U(r, theta), r))-0.1788235818e12*r^2*sin(theta)*(2.5+r*cos(theta))*(diff(V(r, theta), r))-0.3283200960e12*r^2*cos(theta)*W(r, theta)-0.7474825716e11*r*sin(theta)*(2.5+r*cos(theta))*(diff(U(r, theta), theta))-0.2535718390e12*(2.*cos(theta)^2*r^2+5.0*r*cos(theta)+6.25)*U(r, theta)+r*V(r, theta)*sin(theta)*(0.3283200960e12*r*cos(theta)+0.1868706429e12))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

 

(0.2535718390e12*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), theta), theta))+0.1788235818e12*r*(2.5+r*cos(theta))^2*(diff(diff(U(r, theta), r), theta))+0.1788235818e12*r*(2.5+r*cos(theta))*(diff(W(r, theta), theta))+0.7474825716e11*r^2*(2.5+r*cos(theta))^2*(diff(diff(V(r, theta), r), r))-0.7474825716e11*V(r, theta)*r^2+3.*(2.5+r*cos(theta))*(0.1690478927e12*r*cos(theta)+0.2736000800e12)*(diff(U(r, theta), theta))-0.2535718390e12*r*sin(theta)*(2.5+r*cos(theta))*(diff(V(r, theta), theta))+0.7474825716e11*r*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(V(r, theta), r))+0.3283200960e12*r^2*sin(theta)*W(r, theta)+(-0.8208002400e12*r*cos(theta)-0.2535718389e12*r^2-0.4671766072e12)*V(r, theta)-0.6339295976e12*r*sin(theta)*U(r, theta))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

 

(-0.1788235818e12*r*(2.5+r*cos(theta))*(diff(V(r, theta), theta))-0.1788235818e12*r^2*(2.5+r*cos(theta))*(diff(U(r, theta), r))+0.7474825716e11*(2.5+r*cos(theta))^2*(diff(diff(W(r, theta), theta), theta))+r*(0.7474825716e11*r*(2.5+r*cos(theta))^2*(diff(diff(W(r, theta), r), r))-0.2535718390e12*r*W(r, theta)-1.*(0.5071436780e12*r*cos(theta)+0.4470589545e12)*U(r, theta)+0.7474825716e11*(2.5+2.*r*cos(theta))*(2.5+r*cos(theta))*(diff(W(r, theta), r))-0.7474825716e11*sin(theta)*(2.5+r*cos(theta))*(diff(W(r, theta), theta))-1.*r*(-0.3283200960e12*sin(theta)*V(r, theta)+0.7474825716e11*W(r, theta))))/(r^2*(2.5+r*cos(theta))^2)+7850*omega^2

(1)

#BCs can be from following
``
U(0, theta) = 0, (D[1](U))(0, theta) = 0, U(1, theta) = 0, (D[1](U))(1, theta) = 0

U(0, theta) = 0, (D[1](U))(0, theta) = 0, U(1, theta) = 0, (D[1](U))(1, theta) = 0

(2)

NULL
V(0, theta) = 0, (D[1](V))(0, theta) = 0, V(1, theta) = 0, (D[1](V))(1, theta) = 0
NULL
W(0, theta) = 0, (D[1](W))(0, theta) = 0, W(1, theta) = 0, (D[1](W))(1, theta) = 0
``

V(0, theta) = 0, (D[1](V))(0, theta) = 0, V(1, theta) = 0, (D[1](V))(1, theta) = 0

 

W(0, theta) = 0, (D[1](W))(0, theta) = 0, W(1, theta) = 0, (D[1](W))(1, theta) = 0

(3)

``


 

Download fem2

buchanan2005.pdf

 

 

I'm working towards creating a way to visualise real polynomial ideals! (or at least the solutions of the polynomials in the ideals) this code creates a plot showing the solutions to all the polynomials in the ideal generated by P1 and P2 (these are specified in the code)

with(plots);
P1 := x^2+2*y^2-3;
solve(P1, y);
Plot1 := plot([%], x = -2 .. 2);

P2 := -2*x^2+2*x*y+3*y^2+x-4;
solve(%, y);
Plot2 := plot([%], x = -4 .. 2);

P2*a+P1;
solve(%, y);
seq(plot([%], x = -4 .. 2), a = 0 .. 10, .1);
display(%, Plot1, Plot2)




This is because when you multiply two polynomials their set of solution curves is just the union of the sets of curves associated with the previous polynomials.

For the next step I'd like to create a graph of the solutions associated with an ideal with three generators. To stop this from being excessively messy I'd like to do it with the RGB value of the colour of a curve is determined by  a and b where the formula for a generic polynomial that we are solving and graphing is given by:

P1+a*P2+b*P3;

where P3 is given by

P3 := x*y-3

I've tried various ways to use cury to make this work (my intuition is cury is the right function to use here)  but got no where. Any ideas how to procede?

First 79 80 81 82 83 84 85 Last Page 81 of 2097