Skip to main content
Ctrl+K

02689 Advanced Numerical Algorithms - Assignment 2

  • Exercise scripts
  • API Reference
  • GitHub
  • Exercise scripts
  • API Reference
  • GitHub

Section Navigation

  • spectral.LegendreLobattoBasis
  • spectral.FourierEquispacedBasis
  • spectral.legendre_diff_matrix
  • spectral.legendre_mass_matrix
  • spectral.fourier_diff_matrix_cotangent
  • spectral.fourier_diff_matrix_on_interval
  • spectral.BvpProblem
  • spectral.solve_bvp
  • spectral.solve_legendre_collocation
  • spectral.solve_legendre_tau
  • spectral.solve_polar_bvp
  • spectral.TimeIntegrator
  • spectral.get_time_integrator
  • spectral.RK3
  • spectral.RK4
  • spectral.KdVSolver
  • spectral.soliton
  • spectral.two_soliton_initial
  • spectral.utils.io.ensure_output_dir
  • spectral.utils.io.load_simulation_data
  • spectral.utils.io.save_simulation_data
  • spectral.utils.formatting.extract_metadata
  • spectral.utils.formatting.format_dt_latex
  • spectral.utils.formatting.format_parameter_range
  • spectral.utils.formatting.build_parameter_string
  • spectral.utils.plotting.get_repo_root
  • spectral.utils.norms.discrete_l2_norm
  • spectral.utils.norms.discrete_l2_error
  • spectral.utils.norms.discrete_linf_error
  • API Reference
  • spectral.soliton

spectral.soliton#

spectral.soliton(x: ndarray, t: float, c: float, x0: float = 0.0) → ndarray[source]#

Compute KdV soliton solution.

Parameters:
xnp.ndarray

Spatial coordinates

tfloat

Time

cfloat

Soliton speed parameter

x0float, optional

Initial position offset (default: 0.0)

Returns:
np.ndarray

Soliton amplitude at each spatial point

previous

spectral.KdVSolver

next

spectral.two_soliton_initial

On this page
  • soliton()

© Copyright 2025, Louis Kamp Eskildsen, Aske Funch Schrøder Nielsen, Philip Korsager Nickel.

Created using Sphinx 8.2.3.

Built with the PyData Sphinx Theme 0.16.1.