## 30 Reputation

1 years, 209 days

## Generating Random Unitary Matrices...

Maple

I am working on a physics problem where I will need to generate random unitaries of size N x N.

As I understand it this would require me to sample uniformly from U(N), where 'uniform' is in the sense of the Haar measure.  I believe this construction in Mathematica is called 'circular unitary ensemble' and was wondering if there was a similar routine in Maple or some simple code that would allow me to generate random unitaries of particular size.

## Solving a Non-Linear Coupled System of O...

Maple

I am working on a problem in geometry where I have ended up with a system of nonlinear ODEs in F and G where F and G are functions of a coordinate y, and A and B are both real constants.  I have included the worksheet where I am working on the equations.

 >
 >

I would like to solve these in as explicit a way as possible by obtaining expressions for F and G and was wondering how best to do this with Maple (it doesn't really matter if the explicit solutions are messy, as I just need to know that they exist and can be written down in some form).  I have tried using the dsolve command directly but I receive the error message which you can see above.

## How do I use Gram-Schmidt Orthogonalisat...

Maple

I am attempting to use the Gram-Schmidt process with Maple to show that the first six orthogonal polynomials which satisfy the following orthogonality condition:

$\int_0^1 (1-x)^{3/2} \phi_n(x) \phi_m(x) dx = h_{n} \delta_{nm}$

can be expressed in the form:

\phi_0(x) = 1, \phi_1(x) = x − 2/7 , \phi_2(x) = x^2 − (8/11)x + 8/99 , \phi_3(x) = x^3 − (6/5)x^2 + (24/65)x − 16/715 , \phi_4(x) = x^4 − (32/19)x^3 + (288/323)x^2 − (256/1615)x + 128/20995 , \phi_5(x) = x^5 − (50/23)x^4 + (800/483)x^3 − (1600/3059)x^2 + (3200/52003)x − 256/156009.

At the same time I have to find the corresponding values for h_n, so for example, h_0 = 2/5 and h_1 = 8/441.  The polynomials which I obtain have to be combined with the Gaussian quadrature method to show that

$\int_0^1 (1-x)^{3/2} \phi_n(x) \phi_m(x) dx = h_{n} \delta_{nm} \approx \sum_{k=1}^4 c_k f(x_k)$

where x_k are the four roots of \phi_4(x)=0 such that x = [0.0524512, 0.256285, 0.548299, 0.827175]

and the 4 c_k coefficients are given by c = [0.121979, 0.168886, 0.0920439, 0.0170909].

I have learned about Gram-Schmidt orthogonalisation in a basic setting in linear algebra courses where a system of N linearly independent orthogonal vectors is constructed from a system of N linearly independent vectors, but unsure how to apply it to polynomials.  I am also vaguely familar with the idea of appoximating integrals with sets of orthogonal polynomials (Legendre, for example) but not exactly sure how this all works.

## How do I use Maple to Solve a Differenti...

Maple

I am working with the following differential equation:

$\frac{d^2z}{dx^2}+z=\frac{\cos 2x}{1+\epsilon z},\:\:\:z(-\pi/4)=z(\pi/4)=0$

where modulus of $\epsilon$ is much less than $1$.  The task is then to use perturbation theory (with Maple, if necessary) to show that the second-order approximation to the solution to this DE is:

$z=-\frac{1}{3}\cos 2x +\epsilon\bigg(\frac{1}{6}-\frac{8\sqrt{2}}{45}\cos x - \frac{1}{90}\cos 4x \bigg) + \epsilon^2 \bigg(\frac{2\sqrt{2}x}{45}\sin x - \frac{\sqrt{2}}{90}(\pi + 1)\cos x + \frac{7}{720} \cos 2x - \frac{\sqrt{2}}{90}\cos 3x - \frac{1}{1050}\cos 6x \bigg).$

I will then likely have to use Maple to determine the third-order term $\delta^{3}z_{3}(x)$ and evaluate $z_{3}(x)$ at $x=0$ and $x-\pi/8$.

My starting point is to use the theory for a regular perturbation (since the modulus of $\epsilon$ is much less than $1$).  For the unperturbed equation, I could set $\epsilon=0$ as that would give a simple differential equation which should be solvable.  I can then see that $1/{1+\epsilon z}$ can be expanded to second-order in $\epsilon$ as $1 - \epsilon z + \epsilon^2 z^2 + O(\epsilon^3), which looks promising. Could someone advise how I put this together? Do I then have to multiply the unperturbed solution by the expansion in$\epsilon\$?

## How to Diagonalize a Matrix with Maple?...

I am working on a quantum mechanics problem and would like to get a 4x4 matrix A into diagonal form such that A=UDU^{-1}.  Basically I just need to know the values of D and U required to make A a diagonal matrix (where D is diagonal) as I can then use it to do an explicit calculation for a matrix exponential.  As it is the matrix is not diagonal, so I cannot use the explicit expression for the matrix exponential.  Is there a code with Maple that can calculate D and U simply?

The matrix is 4 x 4 and has elements

1 0 0 1

0 -1 1 0

0 1 -1 0

1 0 0 1

 1 2 3 Page 1 of 3
﻿