mathhook-core 0.2.0

Core mathematical engine for MathHook - expressions, algebra, and solving
Documentation
//! Fourier coefficient generation utilities

use crate::calculus::pde::registry::PDEError;
use crate::core::{Expression, Symbol};

/// Creates symbolic Fourier coefficients.
///
/// Generates symbolic coefficients A₁, A₂, ..., Aₙ (or custom prefix).
///
/// Note: This returns symbolic placeholders. Numerical evaluation requires
/// symbolic integration of initial/boundary data, which is planned for a future release.
///
/// # Arguments
/// * `prefix` - Coefficient name prefix (e.g., "A", "B", "C")
/// * `count` - Number of coefficients to generate
///
/// # Returns
/// Vector of symbolic coefficient expressions
///
/// # Examples
/// ```rust
/// use mathhook_core::calculus::pde::common::create_symbolic_coefficients;
///
/// let coeffs = create_symbolic_coefficients("A", 3).unwrap();
/// assert_eq!(coeffs.len(), 3);
/// ```
pub fn create_symbolic_coefficients(
    prefix: &str,
    count: usize,
) -> Result<Vec<Expression>, PDEError> {
    let coefficients: Vec<_> = (0..count)
        .map(|i| {
            let symbol = Symbol::new(format!("{}_{}", prefix, i + 1));
            Expression::symbol(symbol)
        })
        .collect();

    Ok(coefficients)
}