## 130 Reputation

6 years, 116 days

## @sand15 Very well. But in my unders...

@sand15 Very well. But in my understanding V := (N, s) -> Vector[row](N, symbol=s) is a row vector (You wrote in CP_2 as column vector). And expressions for T[i] in (12) and (13) are different (see attached). Why do we need to perform the last step (i.e., (13))?

 > restart
 > with(LinearAlgebra):
 > V := (N, s) -> Vector[row](N, symbol=s); J := N -> IdentityMatrix(N);
 (1)
 > n   := 4; k   := lambda+m__0; M11 := I *~ ( DiagonalMatrix(  V(n, a) ) + k *~ IdentityMatrix(n) ); M12 := V(n, c); M21 := -M12^+; l1:=-2*I*lambda+I*k; M  := `<,>`( `<|>`(l1, M12), `<|>`(M21, M11) );
 (2)
 >
 >

A pretty formula for the characteristic polynomial

 > # Step 0: define X this way X := eta *~ IdentityMatrix(n+1) - eval(M, lambda=theta-m__0)
 (3)
 > # Step 1: write each diagonal element this way for i from 1 to n+1 do   X[i, i] := eta-u[i] end do: X;
 (4)
 > # Step 2: look to thexhape of the minots of W wrt to its rightmost column for i from 1 to n+1 do   Minor(X, i, n+1) * X[i, n+1] * (-1)^(i-1) end do;
 (5)
 > # Step 3: then the determinant of X writes det := add(Minor(X, i, n+1) * X[i, n+1] * (-1)^(i-1), i=1..n+1);
 (6)
 >
 (7)
 > # Step 4: simplify this expression bt setting Z[i] = eta-u[i] expand( eval(det, [seq(eta-u[i]=Z[i], i=1..n+1)]) / mul(Z[i], i=1..n+1) );
 (8)
 > # Step 5: Thus this representation of the characteristic polynomial as a rational fraction det := (-1)^'n' * Product(Z[k], k=1..'n'+1) * (1 + Sum(c[k]^2/Z[k]/Z[k+1], k=1..'n')); print(): k := 'k': reminder := Z[k] = eval(eta-u[k], u[k] = 'M[k, k]');
 (9)

A direct use of  CharacteristicPolynomial

 > # With CharacteristicPolynomial: CP := CharacteristicPolynomial(eval(X, eta=0), eta);
 (10)
 > # A more synthetic form with(LargeExpressions): Synthetic_form := collect(CP, eta, Veil[T]);
 (11)
 > # Where the coefficients are: Coefficients_are := [ seq(T[i] = Unveil[T](T[i]), i=1..LastUsed[T]) ]: print~(Coefficients_are):
 (12)

 > # In these expressions of T[i] we recognize: T[1] = Determinant(eval(X, eta=0)); T[2] = -Trace(eval(X, eta=0));; T[3] = - expand( 1/2*(Trace(eval(X, eta=0)^2) - Trace(eval(X, eta=0))^2) )
 (13)
 > # and so on, those are classical formulas.
 >

## @sand15 zero on the 2,2 is a vector...

@sand15 zero on the 2,2 is a vector i.e., Matrix([-Transpose(c), 0]). Also, see M_0 in the attached pic

## diag(-2*lambda,a)...

@sand15 Many thanks. It would be helpful for me.  But I have a question (see attached) about diag(-2*lambda,a). And M12 is a (1x3) row vector for n=3.

 >
 >
 >
 >
 (1)
 >
 >
 (2)

## @acer I double checked it. I didn&#...

@acer I double checked it. I didn't use lambda[1] in the entire worksheet.

## another determinant...

@dharr Thanks. But now I solved another determinant and this time Maple split 'lambda' into 'real' and 'imaginary' parts in some places and keep 'lambda' or 'conjugate(lambda)' remains same (look at (7)). How to fix it?

 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 >
 (6)
 >
 (7)
 >

## @rlopez because u, ub, and their de...

@rlopez because u, ub, and their derivatives are non-abelian i.e. their multiplication are non-commutative. That's why I used bold black dots.

## tried it...

@rlopez I try it as you suggested but got a '0' answer for all the coefficients.

 >
 >
 >
 (1)
 >
 >
 (2)
 >
 (3)
 >

## @mmcdara when we change "y1:=-...

@mmcdara when we change "y1:=-1*v^2+1/8*v^4" to "y1:=-1*v^2+1/4*v^4", it shows an error. How to remove it?

## @ecterrab I removed it. But still n...

@ecterrab I removed it. But still not working.

## @tomleslie Can we plot (4)? I tried...

@tomleslie Can we plot (4)? I tried it by putting "
plot(rhs(%), {_C1 = 1, c = 1, g = 1.5}, x = -10 .. 10);" just after (4). But encountered with "Error, invalid input: rhs received [w(x) = 2*JacobiSN((1/2)*(-2*c+2*(c^2+2*g)^(1/2))^(1/2)*x+_C1, ((c*(c^2+2*g)^(1/2)-c^2-g)*g)^(1/2)/(c*(c^2+2*g)^(1/2)-c^2-g))*g/(g*(-c+(c^2+2*g)^(1/2)))^(1/2)], which is not valid for its 1st argument, expr"

## @Rouben Rostamian  When I execute L...

@Rouben Rostamian  When I execute Lineaize.mw on my computer. Maple returns "Error, (in collect) cannot collect 0"

 >
 >
 >
 >
 >
 >
 (1)
 >
 >
 >
 >
 >
 (2)
 >
 (3)
 >
 (4)
 >
 (5)
 >
 (6)
 >
 (7)

In  replace  by the symbol , etc., linearize with respect to those symbols,

and then restore the symbols to their original meanings:

 >
 >

## @Rouben Rostamian  I got it. But wh...

@Rouben Rostamian  I got it. But when we use eq (5) into eq (4), maple gives eq (6) after simplification. How can we know the result (eq (6)) is correct?

## @Carl Love epsilon derivative ...

@Carl Love epsilon derivative raised to power 2 or higher can be removed.

## @Carl Love After doing mtaylor...

@Carl Love After doing mtaylor, no derivative involve in the final equation. See attachment (where I didn't use mtaylor), there are also derivative terms like diff(epsilon[2], t), etc in equation (6). But I am not clear whether the calculations are going in the right direction or not?

Calculation.mw

## @Carl Love as per your suggestion, ...

@Carl Love as per your suggestion, I got linearize equation. But epsilon[1] and epsilon[2] are functions of and t. How to do it with epsilon[1]=epsilon[1](x,t) and epsilon[2]=epsilon[2](x,t)?

 1 2 3 Page 1 of 3
﻿