implementations.problem_classes.FermiPastaUlamTsingou module

class fermi_pasta_ulam_tsingou(npart=2048, alpha=0.25, k=1.0, energy_modes=None)[source]

Bases: ptype

The Fermi-Pasta-Ulam-Tsingou (FPUT) problem was one of the first computer experiments. E. Fermi, J. Pasta and S. Ulam investigated the behavior of a vibrating spring with a weak correction term (which is quadratic for the FPU-\(\alpha\) model, and cubic for the FPU-\(\beta\) model [1]). This can be modelled by the second-order problem

\[\frac{d^2 u_j(t)}{d t^2} = (u_{j+1}(t) - 2 u_j(t) + u_{j-1}(t)) (1 + \alpha (u_{j+1}(t) - u_{j-1}(t))),\]

where \(u_j(t)\) is the position of the \(j\)-th particle. [2] is used as setup for this implemented problem class. The Hamiltonian of this problem (needed for second-order SDC) is

\[\sum_{i=1}^n \frac{1}{2}v^2_{i-1}(t) + \frac{1}{2}(u_{i+1}(t) - u_{i-1}(t))^2 + \frac{\alpha}{3}(u_{i+1}(t) - u_{i-1}(t))^3,\]

where \(v_j(t)\) is the velocity of the \(j\)-th particle.

Parameters:
  • npart (int, optional) – Number of particles.

  • alpha (float, optional) – Factor of the nonlinear force \(\alpha\).

  • k (float, optional) – Mode for initial conditions.

  • energy_modes (list, optional) – Energy modes.

dx

Mesh grid size.

Type:

float

xvalues

Spatial grid.

Type:

np.1darray

ones

Vector containing ones.

Type:

np.1darray

References

dtype_f

alias of acceleration

dtype_u

alias of particles

eval_f(u, t)[source]

Routine to compute the right-hand side of the problem.

Parameters:
  • u (dtype_u) – Current values of the numerical solution.

  • t (float) – Current time of the numerical solution is computed.

Returns:

f – The right-hand side of the problem.

Return type:

dtype_f

eval_hamiltonian(u)[source]

Routine to compute the Hamiltonian.

Parameters:

u (dtype_u) – The particles.

Returns:

ham – The Hamiltonian.

Return type:

float

eval_mode_energy(u)[source]

Routine to compute the energy following [1].

Parameters:

u (dtype_u) – Particles.

Returns:

energy – Energies.

Return type:

dict

u_exact(t)[source]

Routine to compute the exact/initial trajectory at time \(t\).

Parameters:

t (float) – Time of the exact solution.

Returns:

me – The exact/initial position and velocity.

Return type:

dtype_u