## differences between numerical and symbolic soluti...

Dear Maple experts,

I am struggling with a difference between the symbolic and numerical solution of an eigendecomposition of a symmetric positive definite matrix. Numerically the solution seems correct, but the symbolic solution puzzles me. In the symbolic solution the reconstructed matrix is different from the original matrix (although the difference between the original and the reconstructed matrix seems to be related to an unknown scalar multiplier.

restart;
with(LinearAlgebra);
Lambda := Matrix(5, 1, symbol = lambda);
Theta := Matrix(5, 5, shape = diagonal, symbol = theta);
#Ω is the matrix that will be diagonalized.
Omega := MatrixPower(Theta, -1/2) . Lambda . Lambda^%T . MatrixPower(Theta, -1/2);
#Ω is symmetric and in practice always positive definite, but I do not know how to specify the assumption of positivess definiteness in Maple
IsMatrixShape(Omega, symmetric);

# the matrix Omega is very simple and Maple finds a symbolic solution
E, V := Eigenvectors(Omega);

# this will not return the original matrix

simplify(V . DiagonalMatrix(E) . V^%T)

# check this numerically with the following values.

lambda[1, 1] := .9;lambda[2, 1] := .8;lambda[3, 1] := .7;lambda[4, 1] := .85;lambda[5, 1] := .7;
theta[1, 1] := .25;theta[2, 2] := .21;theta[3, 3] := .20;theta[4, 4] := .15;theta[5, 5] := .35;

The dotproduct is not always zero, although I thought that the eigenvectors should be orthogonal.

I know eigenvector solutions may be different because of scalar multiples, but here I am not able to understand the differences between the numerical and symbolic solution.

I probably missed something, but I spend the whole saturday trying to solve this problem, but I can not find it.

I attached both files.

Harry

eigendecomposition_numeric.mw

eigendecomposition_symbolic.mw

## Maple Formula Input...

Hallo,

im currently using Mathcad 15 and i want to change to a newer and better software with more possibilities.

But up to now i have not found a better software for calculating. One big advantage with mathcad is the possibilitie of symbolic formula input and calculation with units.

Now my question: Is it possible with Maple to write symbolic formulas (2D Structure of big formulas)

I dont write a formula in one row. Its nearly impossible ...

And can i calculate with units?

Thx Stefan

## How can I solve this symbolic nonlinear system?...

I meet a interesting nonlinear system in the analysis of an mechanics problem. This system can be shown as following:

wherein, the X and Y is the solutions. A, B, S, and T is the symbolic parameters.

I want to express X and Y with A, B, S, T. Who can give me a help, thanks a lot!

PS:the mw file is given here.

A_symbolic_nonlinear_system.mw

## How to calculate this integral with Maple?...

Let us consider the improper integral

```int((abs(sin(2*x))-abs(sin(x)))/x, x = 0 .. infinity);

Si(Pi)-Si((1/2)*Pi)+sum(-(-1)^_k*Si(Pi*_k)+signum(sin((1/2)*Pi*_k))*Si((1/2)*Pi*_k)+Si(Pi*_k+Pi)*(-1)^_k-signum(cos((1/2)*Pi*_k))*Si((1/2)*Pi*_k+(1/2)*Pi), _k = 1 .. infinity)
```

Mathematica 11 produces a similar expression and a warning

Integrate::isub: Warning: infinite subdivision of the integration domain has been used in computation of the definite integral \!\(\*SubsuperscriptBox[\(\[Integral]\), \(0\), \(\[Infinity]\)]\(\*FractionBox[\(\(-Abs[Sin[x]]\) + Abs[Sin[2\ x]]\), \(x\)] \[DifferentialD]x\)\). If the integral is not absolutely convergent, the result may be incorrect.

Up to Pedro Tamaroff http://math.stackexchange.com/questions/61828/proof-of-frullanis-theorem , the answer is 2/Pi*ln(2) because of

```J := int(abs(sin(2*x))-abs(sin(x)), x = 0 .. T) assuming T>2;
-1/2-signum(sin(T))*signum(cos(T))*cos(T)^2+(1/2)*signum(sin(T))*signum(cos(T))+cos(T)*signum(sin(T))+floor(2*T/Pi)

B := limit(J/T, T = infinity);
2 /Pi

K := x*(int((abs(sin(2*t))-abs(sin(t)))/t^2, t = x .. 1)) assuming x>0,x<1;

2*sin(x)*cos(x)-2*Ci(2*x)*x+Ci(x)*x+sin(1)*x-sin(2)*x+2*Ci(2)*x-Ci(1)*x-sin(x)

A := limit(K, x = 0, right);
0
```

Its numeric calculation results

```evalf(Int((abs(sin(2*x))-abs(sin(x)))/x, x = 0 .. infinity));
Float(undefined)
```

which seems not to be true.

The question is: how to obtain the reliable results for it with Maple, both symbolic and numeric?

## Solve symbolic integral function with various para...

I can not find a solution to the integral of the function below the maple, can anyone help me?

restart;
with(Student[MultivariateCalculus]);
with(Student[Calculus1]);

assume(-1 < rho and rho < 1, alpha1 > 0, beta1 > 0, alpha2 > 0, beta2 > 0, t1 > 0, t2 > 0)

f := proc (t1, t2, alpha1, beta1, alpha2, beta2, rho) options operator, arrow; (1/4)*(sqrt(beta1/t1)+(beta1/t1)^(3/2))*(sqrt(beta2/t2)+(beta2/t2)^(3/2))*exp(-((sqrt(t1/beta1)-sqrt(beta1/t1))^2/alpha1^2+(sqrt(t2/beta2)-sqrt(beta2/t2))^2/alpha2^2-2*rho*(sqrt(t1/beta1)-sqrt(beta1/t1))*(sqrt(t2/beta2)-sqrt(beta2/t2))/(alpha1*alpha2))/(2-2*rho^2))/(alpha1*beta1*alpha2*beta2*Pi*sqrt(1-rho^2)) end proc

int(int(f(t1, t2, alpha1, beta1, alpha2, beta2, rho), t2 = 1 .. infinity), t1 = 0.1e-2 .. y)

## Solve matrices symbolically...

Hello

Is there a way to solve matrices symbolically?

an example would be A*X=B

X=A^-1B

I have tried to look for a thing in maple that will do this but so far i had no luck. Does anyone know ?

## Symbolic summation gives wrong result?...

Hi,

I have encountered some strange issue with symbolic summation. Would be grateful for any help.

Here is the code (inserted as image):

Code in text:

`restart;F:=(n,a,b)->sum(r^(a+b)*cos(2*Pi/n*j+t)^a*sin(2*Pi/n*j+t)^b,j=0..n-1);F(n,2,2);F(4,2,2); `

The issue is that symbolic summation produces the formula (for general n) which contradicts the particular case (n=4).

Could somebody explain why this is happening? Is it a bug or am I missing something here?

I have tried all versions of Maple downto 14 - same situation.
Also Mathematica givers the same answer.

Pavel Holoborodko.

--
Multiprecision Computing Toolbox

## Error in Integrating Heaviside Function...

I'm running into a very simple problem with the way that Maple integrates Heaviside functions. Naively, it should act like a step function, but it is not integrating properly. See the attached document.

 (1)

 (2)

 (3)

Note that the symbolic integration of the Heaviside function (defined to be 1 inside the unit circle and 0 outside) gives zero, whereas it should clearly give the area of the unit circle, which the numerical integration does. I even checked that the (suposedly equivalent) piecewise definition symbolically evaluates to the area, and it, too, gets the right answer.

Anyone have any clue as to why the symbolic integration of this Heaviside function is so wrong? My understanding is that if we do the integral as two nested 1D integrals, the returned function (as a function of y) is zero everywhere except at y=0, but that result cannot be right either.

Thoughts?

## Symbolic resolution of trigonometric equations sys...

Hello,

I would like to determine a closed form solution (=analytical solution) of the following trigonometric equations system.

The unknowns are :

ListAllUnknowns := [Psi(t), Theta[1](t), Theta[2](t), x[1](t), x[2](t), z[1](t), z[2](t)]

Do you have ideas so as to conduct the symbolic resolution of this trigonometric equations system ?

I have been told that the use of Grobner basis could be useful but I have never try this.

Thanks a lot for yours feedbacks.

## Symbolic Solution of Polynomial System...

Hello everyone,
I would like to get a symbolic result of each variable x,y and z for the following 3 nonlinear equations. Maple does not respond to the following code at all. (Not even an error report.)

restart;

eq1 := x^2+y^2+z^2-134*x+800*y-360*z+31489, 2;
eq2 := x^2+y^2+z^2-934*x+900*y-370*z+321789, 2;
eq3 := x^2+y^2+z^2-614*x+1350*y-1110*z+70048, 97;
solve({eq1, eq2, eq3}, {x, y, z});

P.S: Afterwards my intention is to solve these equaitons numerically for different variable values, and transfer to MatLab in order to plot animations and graphs.

## A strange result from dsolve...

Hello guys,

I was just playing around with differential equations, when I noticed that symbolic solution is  different from the numerical.What is the reason for this strange behavior?

ODE := (diff(y(x), x))*(ln(y(x))+x) = 1

sol := dsolve({ODE, y(1) = 1}, y(x))

a := plot(op(2, sol), x = .75 .. 2, color = "Red");
sol2 := dsolve([ODE, y(1) = 1], numeric, range = .75 .. 2);

with(plots);
b := odeplot(sol2, .75 .. 2, thickness = 4);
display({a, b});

Mariusz Iwaniuk

## Problem with symbolical solution...

Hi,

I have been trying to solve the following equation with respect to y, but I have not been successful. In fact, I always get answer RootOf(...). I should mention that all variables and parameters are real non-negative. I have also tested with "assume", but it did not help. Any suggestion would be appreciated.

 (1)

 (2)

 (3)

Thanks.

## Symbolic calculation of matrix rank...

Hello,

I would like to symbolically determine the rank of a jacobian matrix. In the help, I have seen that the Rank function of the LinearAlgebra can be used for this purpose. However, when I use this function, the function doesn't allow to find the different singularities that can occur on my jacobian matrix.

Here a exemple of a jacobian matrix that I obtain on a slidercrank mechanism:

The rank of this jaobian (Phi) gives 2 whatever the values of theta(t) and beta(t). However, if the values of  theta(t) and beta(t) are :theta(t)=Pi/2,beta(t)=0. The rank shouldn't be 2 but 1.

Is a way to obtain the symbolic calculation of the rank of a jacobian matrix which can distinguish different cases following the values of the parameters ? In others words, my dream will be to have a Rank function (or another algorithm) which can gives :
the rank is 2 if theta(t) different of Pi/2 [Pi] and beta(t)=0 [Pi]
and otherwise 1 if ...
and perhaps 0 if ...

Thanks a lot for your help.

I let a piece of code with an example of calculation of the rank

RankMatrix.mw

## How to import matrix from MATLAB? ...

Hi guys,
I want to import symbolic matrix from matlab to Maple, How I can do that ?

## How is basis chosen?...

I solve a linear system of equations which is rank deficient. Naturally, when Maple solves it symbolically, it chooses some of its variables to use them as a basis to express the solution.

In a specific problem I'm solving, the basis chosen by Maple is -very- smart, showing a good exploitation of the problem structure.

I'm curious as to what kind of factorization is used by default, or if there's a lot of by hand "black magic" involved, what are its general characteristics.

Best regards

Claudio

 1 2 3 4 5 6 Page 1 of 6
﻿