Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
restrepo
GitHub Repository: restrepo/ComputationalMethods
Path: blob/master/exams/Examen_2020_2_02_enunciado.ipynb
934 views
Kernel: Python 3

Open In Colab

I) The period of a pendulum of length l oscillating at a large angle α\alpha is given by T=T02π0αdθ(cosθcosα)12 T=T_{0} \frac{\sqrt{2}}{\pi} \int_{0}^{\alpha} \frac{d \theta}{(\cos \theta-\cos \alpha)^{\frac{1}{2}}} where T0=2πlg T_{0}=2 \pi \sqrt{\frac{l}{g}} is the period of the same pendulum at small amplitudes. Any numerical evaluation of the integral as is would fail (explain why). If we change the variable by writing: sinθ2=sinα2sinϕ \sin \frac{\theta}{2}=\sin \frac{\alpha}{2} \sin \phi we can get: T=2T0π0π2dϕ(1sin2α2sin2ϕ)12 T=\frac{2 T_{0}}{\pi} \int_{0}^{\frac{\pi}{2}} \frac{d \phi}{\left(1-\sin ^{2} \frac{\alpha}{2} \sin ^{2} \phi\right)^{\frac{1}{2}}} which is a well-behaved integral. Write a program to use the above integral to calculate the ratio T/T0T/T_0 for integral amplitudes 0α900^\circ \le\alpha \le 90^\circ. Output these values as a pandas dataframe showing the amplitude in degrees and radians as well as T/T0T/T_0, and make a plot with the two columns. Explain the result when α=0.\alpha = 0.

II)

Casas-Ibarra parameterization

Consider a n×nn\times n symmetric matrix AA. We can assumme without lost of generality that this can be generated from a matrix YY such that A=YTY A=Y^{\operatorname{T}}Y Theorem 1 gurantees that exists an ortogonal matrix UU such that UTAU=UTYTYU=Dλ U^{\operatorname{T}} A U=U^{\operatorname{T}} Y^{\operatorname{T}}Y U=D_\lambda where Dλ=Adiag=diag(λ1,λ2,,λn) D_{\lambda}=A_{\text{diag}}=\operatorname{diag}\left(\lambda_1,\lambda_2,\ldots,\lambda_n\right) where λi\lambda_i are the eigenvalues of AA. Therefore YTY=UDλUT=UDλDλUT\begin{align} Y^{\operatorname{T}}Y =&U D_\lambda U^{\operatorname{T}}\\ =&U D_{\sqrt{\lambda}} D_{\sqrt{\lambda}} U^{\operatorname{T}}\\ \end{align} where Dλ=diag(λ1,λ2,λn) D_{\sqrt{\lambda}}=\operatorname{diag}\left(\sqrt{\lambda_1},\sqrt{\lambda_2},\ldots \sqrt{\lambda_n}\right) Therefore, exists an ortogonal arbitrary matrix RR, such that YTY=UDλRTRDλUT Y^{\operatorname{T}}Y =U D_{\sqrt{\lambda}}R^{\operatorname{T}}R D_{\sqrt{\lambda}} U^{\operatorname{T}}\\

In this way, the matrix YY can be parameterized in terms of RR as Y=RDλUT Y=R D_{\sqrt{\lambda}} U^{\operatorname{T}}

  1. By using the previous equations, build a matrix YY 2×22\times 2 with the following conditions

  • RR is an orthogonal matrix with a mixing angle as a random number between (0,2π)(0,2\pi). Use your identification number as the seed of the random number generator.

  • The eigenvalues are λ1=2\lambda_1=2 and λ2=4\lambda_2=4.

  • UU is a diagonalization matrix with mixing angle π/4\pi/4

  1. Build the matrix AA and check that has the proper eigenvalues and eigenvectors