Riemann surface
matlab

Problem 1.3: Consider the simple pendulum of Example 1.3.1. Write a computer program to numerically solve the nonlinear equation (1.2.3) using the Euler method. Tabulate the numerical results for two different time steps $\Delta t=0.05$ and $\Delta t=0.025$ along with the exact linear solution.

.

Solution: In order to use the finite difference scheme of $\mathrm{Eq}$. (1.3.3), we rewrite (1.2.3) as a pair of first-order equations
$$\frac{d \theta}{d t}=v, \quad \frac{d v}{d t}=-\lambda^2 \sin \theta$$
Applying the scheme of Eq. (1.3.3) to the two equations at hand, we obtain
$$\theta_{i+1}=\theta_i+\Delta t v_i ; \quad v_{i+1}=v_i-\Delta t \lambda^2 \sin \theta_i$$
The above equations can be programmed to solve for $\left(\theta_i, v_i\right)$. Table P1.3 contains representative numerical results.

Problem 2.1: A nonlinear equation:
$$\begin{gathered} -\frac{d}{d x}\left(u \frac{d u}{d x}\right)+f=0 \quad \text { for } \quad 0<x<L \ \left.\left(u \frac{d u}{d x}\right)\right|_{x=0}=0 \quad u(1)=\sqrt{2} \end{gathered}$$

Solution: Following the three-step procedure, we write the weak form:
\begin{aligned} 0 & =\int_0^1 v\left[-\frac{d}{d x}\left(u \frac{d u}{d x}\right)+f\right] d x \ & =\int_0^1\left[u \frac{d v}{d x} \frac{d u}{d x}+v f\right] d x-\left[v\left(u \frac{d u}{d x}\right)\right]_0^1 \end{aligned}
Using the boundary conditions, $v(1)=0$ (because $u$ is specified at $x=1$ ) and $(d u / d x)=0$ at $x=0$, we obtain
$$0=\int_0^1\left[u \frac{d v}{d x} \frac{d u}{d x}+v f\right] d x$$
For this problem, the weak form does not contain an expression that is linear in both $u$ and $v$; the expression is linear in $v$ but not linear in $u$. Therefore, a quadratic functional does not exist for this case. The expressions for $B(\cdot, \cdot)$ and $\ell(\cdot)$ are given by
\begin{aligned} B(v, u) & =\int_0^1 u \frac{d v}{d x} \frac{d u}{d x} d x \text { (not linear in } u \text { and not symmetric in } u \text { and } v \text { ) } \ \ell(v) & =-\int_0^1 v f d x \end{aligned}

E-mail: help-assignment@gmail.com  微信:shuxuejun

help-assignment™是一个服务全球中国留学生的专业代写公司