Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello

we have a matrix A (s.p.d) and b where LDL^t=A is the cholesky decompositon.

Why is the commands output

LUDecomposition(A, method = 'Cholesky', output = ['L', 'U']);

different from the output described in books or wikipedia.

To be exact:

L, the lower triangular matrix, is not normalized (the diagonal entries should be 1, they are not!)
L^t (upper triangular matrix) too.
D is not available for Cholesky at all.

 

If we calculate it with GaussianElimination

LUDecomposition(A, output = ['L', 'U'])

L is the wanted normalized lower triangular matrix, but its not normalized with cholesky.

And the DIAGONAL enntries are the wanted diagonal matrix D with cholesky.

 

This output is very confusing. Please can someone explain how to use/get the correct decomposition?

A example worksheet is attached.

Thank you :)!


 

with(LinearAlgebra)

[`&x`, Add, Adjoint, BackwardSubstitute, BandMatrix, Basis, BezoutMatrix, BidiagonalForm, BilinearForm, CARE, CharacteristicMatrix, CharacteristicPolynomial, Column, ColumnDimension, ColumnOperation, ColumnSpace, CompanionMatrix, CompressedSparseForm, ConditionNumber, ConstantMatrix, ConstantVector, Copy, CreatePermutation, CrossProduct, DARE, DeleteColumn, DeleteRow, Determinant, Diagonal, DiagonalMatrix, Dimension, Dimensions, DotProduct, EigenConditionNumbers, Eigenvalues, Eigenvectors, Equal, ForwardSubstitute, FrobeniusForm, FromCompressedSparseForm, FromSplitForm, GaussianElimination, GenerateEquations, GenerateMatrix, Generic, GetResultDataType, GetResultShape, GivensRotationMatrix, GramSchmidt, HankelMatrix, HermiteForm, HermitianTranspose, HessenbergForm, HilbertMatrix, HouseholderMatrix, IdentityMatrix, IntersectionBasis, IsDefinite, IsOrthogonal, IsSimilar, IsUnitary, JordanBlockMatrix, JordanForm, KroneckerProduct, LA_Main, LUDecomposition, LeastSquares, LinearSolve, LyapunovSolve, Map, Map2, MatrixAdd, MatrixExponential, MatrixFunction, MatrixInverse, MatrixMatrixMultiply, MatrixNorm, MatrixPower, MatrixScalarMultiply, MatrixVectorMultiply, MinimalPolynomial, Minor, Modular, Multiply, NoUserValue, Norm, Normalize, NullSpace, OuterProductMatrix, Permanent, Pivot, PopovForm, ProjectionMatrix, QRDecomposition, RandomMatrix, RandomVector, Rank, RationalCanonicalForm, ReducedRowEchelonForm, Row, RowDimension, RowOperation, RowSpace, ScalarMatrix, ScalarMultiply, ScalarVector, SchurForm, SingularValues, SmithForm, SplitForm, StronglyConnectedBlocks, SubMatrix, SubVector, SumBasis, SylvesterMatrix, SylvesterSolve, ToeplitzMatrix, Trace, Transpose, TridiagonalForm, UnitVector, VandermondeMatrix, VectorAdd, VectorAngle, VectorMatrixMultiply, VectorNorm, VectorScalarMultiply, ZeroMatrix, ZeroVector, Zip]

(1)

b := `<,>`(1, 2, 2)

Vector[column](%id = 18446744078207759414)

(2)

A := Matrix(3, 3, {(1, 1) = 4, (1, 2) = 6, (1, 3) = 2, (2, 1) = 6, (2, 2) = 10, (2, 3) = 8, (3, 1) = 2, (3, 2) = 8, (3, 3) = 30})

Matrix(%id = 18446744078207760614)

(3)

LUDecomposition(A, method = 'Cholesky', output = ['L', 'U'])

Matrix(%id = 18446744078207732662), Matrix(%id = 18446744078207732422)

(4)

LUDecomposition(A, output = ['L', 'U'])

Matrix(%id = 18446744078207771822), Matrix(%id = 18446744078207772062)

(5)

``


 

Download dasfindetnichtmalpeterlustig.mw

 

dasfindetnichtmalpeterlustig.mw

 

How do i change keyboard shortcuts, E.g one of my keyboard keys are broken or have stopped working. How do i redirect my shortcut to another keyboard combination or another hotkey simply.

Hello, is it possible to have a document synchronized in the same way as Onenote? We're a group of engieneer students wanting to share documents, however the only way we can figure out a way to do it. Is uploading to maplecloud groups, sharing a "base" document, and everytime someone "updates" the document you save a new one. So it kind of defeats the purpose of making it a smart idea of collaborating on one document, am i missing something or is this really how oldschool it works?

Hello,

     I'm trying to simplify an expression involving signum and sqrt using assumptions:

assumptions := { A>0,psi::real,1+A*cos(psi)<sqrt(1+sin(psi)),1+sin(psi)>0 }:
signum(1+A*cos(psi)-sqrt(1+sin(psi))):
simplify(%) assuming op(assumptions);

It seems to me that, given these assumptions, we can safely conclude that the result should be -1. However, I can't get Maple to show this. Interestingly, setting A=1 does allow maple to simplify the result to -1. Is there something I'm missing?


Thanks!

I recently corresponded with maplesoft on whether the program Groebner:-Basis always produces reduced Groebner bases or not. They say it does. This mw appears to show it producing a non reduced Groebner Basis for a set of polynomials.

More specifically, the coefficient of the lead term of the first polynomial generated is not 1.

I'd like to be shown wrong here, but I am struggling to see what i could be doing wrong.


 

restart:

alias(epsilon = e, omega = w, omega[0] = w0, t[1] = t1, t[2] = t2, alpha[1] = a1, alpha[2] = a2, alpha[3] = a3); e := proc (t1, t2) options operator, arrow; e end proc; w0 := proc (t1, t2) options operator, arrow; w0 end proc; f := proc (t1, t2) options operator, arrow; f end proc; mu := proc (t1, t2) options operator, arrow; mu end proc

ode := (D@@2)(u)+u+e*a1*D(u)+e*a2*u^3-f0*cos(omega*t) = 0

(D@@2)(u)+u+epsilon*alpha[1]*D(u)+epsilon*alpha[2]*u^3-f0*cos(omega*t) = 0

(1)

e_oredr := 1:

ode := subs(D = sum('e^(i-1)*D[i]', 'i' = 1 .. e_oredr+1), ode);

((epsilon*D[2]+D[1])@@2)(u)+u+epsilon*alpha[1]*(epsilon*D[2]+D[1])(u)+epsilon*alpha[2]*u^3-f0*cos(omega*t) = 0

(2)

u := sum('q[i]*e^i', 'i' = 0 .. e_oredr);

q[1]*epsilon+q[0]

(3)

ode := collect(ode, e):

 

 

ode:=simplify(%,{e^3=0,e^2=0});

-f0*cos(omega*t)+D[1, 1](q[1])*epsilon+D[1, 1](q[0])+2*D[1, 2](q[0])*epsilon+D[1](q[0])*alpha[1]*epsilon+(alpha[2]*q[0]^3+q[1])*epsilon+q[0] = 0

(4)

 

 

 

for i from 0 to e_oredr do eq[i] := coeff(lhs(ode), e, i) = 0 end do;

-f0*cos(omega*t)+D[1, 1](q[0])+q[0] = 0

 

alpha[2]*q[0]^3+alpha[1]*D[1](q[0])+2*D[1, 2](q[0])+D[1, 1](q[1])+q[1] = 0

(5)

 

eq[1]:=convert(eq[1](t1, t2), diff);

alpha[2](t[1], t[2])*q[0](t[1], t[2])^3+alpha[1](t[1], t[2])*(diff(q[0](t[1], t[2]), t[1]))+2*(diff(diff(q[0](t[1], t[2]), t[1]), t[2]))+diff(diff(q[1](t[1], t[2]), t[1]), t[1])+q[1](t[1], t[2]) = 0

(6)

 

q[0] :=A(t2)*exp(I*t1)+b*exp(I*w*t1)+conjugate(A)(t2)*exp(-I*t1)+b*exp(-I*w*t1); convert(%, 'exp'); q[0] := unapply(%, (t1, t2)):  # Chage the value 

A(t[2])*exp(I*t[1])+b*exp(I*omega*t[1])+(conjugate(A))(t[2])*exp(-I*t[1])+b*exp(-I*omega*t[1])

 

A(t[2])*exp(I*t[1])+b*exp(I*omega*t[1])+(conjugate(A))(t[2])*exp(-I*t[1])+b*exp(-I*omega*t[1])

(7)

 

expand(lhs(eq[1])):

eq:=combine(%, exp):

eq:=simplify(%, power):  

eq:=combine(subs(w=1/3+e*sigma,%),exp):   ## substituting the detuning parameter

expand(%):

eq:=algsubs(t1*e=t2,%):

 

eq:=collect(%, exp(I*t1)):

 

coeff(%, exp(I*t1),1):

simplify(combine(%,exp));

exp((3*I)*sigma*t[2])*alpha[2](t[1], t[2])*b^3+3*alpha[2](t[1], t[2])*A(t[2])^2*(conjugate(A))(t[2])+6*alpha[2](t[1], t[2])*b^2*A(t[2])+I*A(t[2])*alpha[1](t[1], t[2])+(2*I)*(diff(A(t[2]), t[2]))

(8)

subs({A(t2)=a(t2)*exp(I*beta(t2))/2,conjugate(A)(t2)=a(t2)*exp(-I*beta(t2))/2},%);

exp((3*I)*sigma*t[2])*alpha[2](t[1], t[2])*b^3+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3*(exp(I*beta(t[2])))^2*exp(-I*beta(t[2]))+3*alpha[2](t[1], t[2])*b^2*a(t[2])*exp(I*beta(t[2]))+((1/2)*I)*a(t[2])*exp(I*beta(t[2]))*alpha[1](t[1], t[2])+(2*I)*(diff((1/2)*a(t[2])*exp(I*beta(t[2])), t[2]))

(9)

combine(%,exp);

exp((3*I)*sigma*t[2])*alpha[2](t[1], t[2])*b^3+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3*exp(I*beta(t[2]))+3*alpha[2](t[1], t[2])*b^2*a(t[2])*exp(I*beta(t[2]))+((1/2)*I)*a(t[2])*exp(I*beta(t[2]))*alpha[1](t[1], t[2])+(2*I)*((1/2)*(diff(a(t[2]), t[2]))*exp(I*beta(t[2]))+((1/2)*I)*a(t[2])*(diff(beta(t[2]), t[2]))*exp(I*beta(t[2])))

(10)

map(x->x*exp(-I*beta(t2)),%);

exp((3*I)*sigma*t[2])*alpha[2](t[1], t[2])*b^3*exp(-I*beta(t[2]))+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3*exp(I*beta(t[2]))*exp(-I*beta(t[2]))+3*alpha[2](t[1], t[2])*b^2*a(t[2])*exp(I*beta(t[2]))*exp(-I*beta(t[2]))+((1/2)*I)*a(t[2])*exp(I*beta(t[2]))*alpha[1](t[1], t[2])*exp(-I*beta(t[2]))+(2*I)*((1/2)*(diff(a(t[2]), t[2]))*exp(I*beta(t[2]))+((1/2)*I)*a(t[2])*(diff(beta(t[2]), t[2]))*exp(I*beta(t[2])))*exp(-I*beta(t[2]))

(11)

simplify(%,exp);

alpha[2](t[1], t[2])*b^3*exp(-I*(-3*sigma*t[2]+beta(t[2])))+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3-a(t[2])*(diff(beta(t[2]), t[2]))+3*alpha[2](t[1], t[2])*b^2*a(t[2])+((1/2)*I)*a(t[2])*alpha[1](t[1], t[2])+I*(diff(a(t[2]), t[2]))

(12)

subs({3*sigma*t2-beta(t2)=C(t2),beta(t2)=3*sigma*t2-C(t2)},%);

alpha[2](t[1], t[2])*b^3*exp(I*C(t[2]))+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3-a(t[2])*(diff(3*sigma*t[2]-C(t[2]), t[2]))+3*alpha[2](t[1], t[2])*b^2*a(t[2])+((1/2)*I)*a(t[2])*alpha[1](t[1], t[2])+I*(diff(a(t[2]), t[2]))

(13)

convert(%,trig);

alpha[2](t[1], t[2])*b^3*(cos(C(t[2]))+I*sin(C(t[2])))+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3-a(t[2])*(3*sigma-(diff(C(t[2]), t[2])))+3*alpha[2](t[1], t[2])*b^2*a(t[2])+((1/2)*I)*a(t[2])*alpha[1](t[1], t[2])+I*(diff(a(t[2]), t[2]))

(14)

 

 

 

 

 

 

 

 

 

 

cond1 := collect(coeff(%, I, 0), [diff(C(t2), t2), cos(C(t2))]);

a(t[2])*(diff(C(t[2]), t[2]))+alpha[2](t[1], t[2])*b^3*cos(C(t[2]))+(3/8)*alpha[2](t[1], t[2])*a(t[2])^3-3*a(t[2])*sigma+3*alpha[2](t[1], t[2])*b^2*a(t[2])

(15)

cond2 := collect(coeff(%%, I, 1), [diff(A(t2), t2), sin(C(t2))]);

alpha[2](t[1], t[2])*b^3*sin(C(t[2]))+(1/2)*a(t[2])*alpha[1](t[1], t[2])+diff(a(t[2]), t[2])

(16)

a(t2):= a; C(t2):=C; cond1 = 0; cond2 =0;

a

 

C

 

alpha[2](t[1], t[2])*b^3*cos(C)+(3/8)*alpha[2](t[1], t[2])*a^3-3*a*sigma+3*alpha[2](t[1], t[2])*b^2*a = 0

 

alpha[2](t[1], t[2])*b^3*sin(C)+(1/2)*a*alpha[1](t[1], t[2]) = 0

(17)

alpha[1]:=unapply(alpha[1],[t1,t2]);alpha[2]:=unapply(alpha[2],[t1,t2]);

proc (t1, t2) options operator, arrow; alpha[1] end proc

 

proc (t1, t2) options operator, arrow; alpha[2] end proc

(18)

remove(has, cond1, cos)^2+remove(has, cond2, sin)^2 = select(has, cond1, cos)^2+select(has, cond2, sin)^2;

((3/8)*alpha[2]*a^3-3*a*sigma+3*alpha[2]*b^2*a)^2+(1/4)*a^2*alpha[1]^2 = alpha[2]^2*b^6*cos(C)^2+alpha[2]^2*b^6*sin(C)^2

(19)

simplify(%,'trig');   

(9/64)*a^2*(a^2*alpha[2]+8*alpha[2]*b^2-8*sigma)^2+(1/4)*a^2*alpha[1]^2 = alpha[2]^2*b^6

(20)

 

af_eq:=%;

(9/64)*a^2*(a^2*alpha[2]+8*alpha[2]*b^2-8*sigma)^2+(1/4)*a^2*alpha[1]^2 = alpha[2]^2*b^6

(21)

##

 

 

##

b:=0.5*f0/(1-(1/3)^2);

.5625000000*f0

(22)

with(plots, implicitplot):

 f0 :=1; alpha[1]:=0.0087;alpha[2]:=2.5871;   b:=0.5*f0/(1-(1/3)^2);#change the value 

1

 

0.87e-2

 

2.5871

 

.5625000000

(23)

af_eq;
curve1,curve2:=solve(af_eq, sigma):

A0:=2:

(9/64)*a^2*(2.5871*a^2-8*sigma+6.548596875)^2+0.1892250000e-4*a^2 = .2120125612

(24)

``

 

 

``

 

``

pu1:=implicitplot([sigma=curve2,sigma=curve1],sigma =-5..20, a = 0 .. A0,  numpoints = 200000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, a], labelfont = [SYMBOL, 16],color="red",tickmarks=[9,12],thickness=3,'view' = [-5 .. 20, 0 .. 6]):
pu2:=implicitplot([sigma=curve2,sigma=curve1],sigma =-5..20, a = A0 .. 10,linestyle=[1,3],  numpoints = 20000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, a], labelfont = [SYMBOL, 16],color="red",tickmarks=[9,12],thickness=3,'view' = [-5 .. 20, 0 .. 6]):

A0:=-2:

pu3:=implicitplot([sigma=curve2,sigma=curve1],sigma =-5..20, a = -10 .. A0, linestyle=[3,1], numpoints = 200000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, a], labelfont = [SYMBOL, 16],color="red",tickmarks=[9,12],thickness=3,'view' = [-5 .. 20, -6 .. 0]):
pu4:=implicitplot([sigma=curve2,sigma=curve1],sigma =-5..20, a = A0 .. 0,  numpoints = 20000, axes = box, axesfont=[SYMBOL, 14],labels = [sigma, a], labelfont = [SYMBOL, 16],color="red",tickmarks=[9,12],thickness=3,'view' = [-5 .. 20, -6 .. 0]):

pp1:=display([pu1,pu2,pu3,pu4]);

(25)

How can I merge these pictures into one

 

 

 

 

 


Like this one

Download merege_two_diagram.mw

I was wondering how Maple cope with piecewise functions during forward integration and if it's preferable to use dsolve events option in place of defining a piecewise discontinuos function.

As far as I understood dsolve/events halts the integration each time an event is triggered and subsequently restarts the integration using the pre-trigger outputs as new initial conditions. I suppose that by using a piecewise, if a discontinuity is detected, dsolve proceeds exactly in the same way halting and restarting the integration.

Here a toy example of a 2D rolling dice (idea of a rolling dice from the rolling cube by @one man :P ) in which the reaction forces of the floor can be seen as function of the compenetration dice/ground

Both the appraches (events and piecewise) give the same results

falling_dice.mw

First, I want to say thank you to all who contributed to previous questions. God bless you.

I need Maple code in solving first order differential equation using Langrange and Newton's Interpolation Method.

The aim is to compare these two numerical result with the exact in tabular form and also to plot the graph.

Some questions are attached.

ODE_Questions.pdf

I have to take limit of the HeunG function at infinity.

Here is what I tried

This is clearly not working. I have to take limit of a function which consist multiple HeunG functions at infinities.

Hi,

how do I make second power of integers in a list?

e. g.: L1:=[-3,-2,-1,0,1,2,3]

and i want

L2:=[9,4,1,0,1,4,9]

Thanks

I am trying to solve a second order differential equation but getting error. The differential equation valid for r>0.

 

Vr.mw

Hi, I'm quite a beginner in Maple.

Currently, I'm solving several complex ODE using maple. When I run the code, it gives me some results. However, when I re-run the code using exactly the same equations and parameter, I somehow got completely different results. Using the same input sometimes it gives float(undefined), complex number, or real number.

Could anyone explain what's happening here? Does it mean that my set of ODE is not independent of each other?

Any helps would be greatly appreciated.

Thanks!

I have two lists, A and B, with the same number of elements and I want A to be on the Y-axis and B on the X-axes and do a point plot

In this app you can visualize the location of the points in the different quadrants, also calculate the distance between two points. Finally the calculation of the coordinates of the midpoint. With these applications can be combined to study different cases between distance between two points and midpoint. Generated in Maple for students of secondary education and pre-calculation. In Spanish

Distance_between_two_points_and_midpoint.mw

Lenin Araujo Castillo

Ambassador of Maple

 

I am making calculations on a block matrix of the form Matrix([[A,B],[-B,-A]])

with A real and symmetric and B real and antisymmetric. (For the physics savvy, this is the Bogoliubov-de Gennes form of the coefficient matrix for doing calculations.)

But this says if I have an eigenvector of the form (u,v) with eigenvalue E, then there is another eigenvector (v,u) with eigenvalue -E.

Now, my problem.. I have a problem that has two zero eigenvalues, but the numerical solver is giving one as zero and one as just very small. This is problematic because my eigenvectors don't have the symmetry that they should. For the non-zero eigenvectors, the error is small and doesn't matter so much. But the eigenvector corresponding to the zero eigenvalues are not guaranteed to be close.

Is there a way to demand my eigenvalues come in pairs for my matrices? Something that dependings on A,B being even or odd dimensional is fine. I care more about the symmetry than even/oddness.

First 646 647 648 649 650 651 652 Last Page 648 of 2097