ModelW¶
ModelW is intended for wave-propagation PDE systems. It uses the same packed
state layout as ModelD, but the auxiliary block satisfies a time-dependent
equation.
Canonical system:
In preprocessing, ModelW sets tdep = 1, wave = 1,
nc = ncu * (nd + 1), and ncq = ncu * nd.
Difference From ModelD¶
ModelD uses \(q + \nabla u = 0\) as an algebraic mixed relation. ModelW
uses \(\partial q/\partial t + \nabla u = 0\), so the q block is part of the
time-evolved wave state.
Required And Optional Functions¶
For frontend-generated models, define:
initufor the initialustate.initqfor the initialqstate.initwfor wave examples that usew; the current MATLAB/Julia generation paths expectinitwforModelW.massto generateTdfuncwhen time dependence is active.
Text2Code uses the corresponding Initu, Initq or Inituq, Initw, and
Tdfunc functions.
Representative Examples¶
| Example | u |
q |
Notes |
|---|---|---|---|
| Acoustic wave | Pressure-like variable | Velocity/gradient-like wave variable | First-order acoustic system. |
| Elastic wave | Displacement/stress-related variables | Velocity/gradient-like variables | Depends on chosen first-order form. |
| Electromagnetic wave | Field component block | Companion wave block | User supplies Maxwell-type fluxes. |
| General wave system | Primary wave variables | Time-evolved auxiliary block | Requires consistent initu and initq. |
Repository examples include examples/WaveEquation/Membrane and
examples/WaveEquation/Scattering.
When To Choose ModelW¶
Choose ModelW when:
- The model is fundamentally a first-order wave system.
- The
qblock is not just a recovered gradient. - You need explicit initial conditions for both
uandq.
Do not choose ModelW solely because the problem is time dependent. Many
time-dependent diffusion and flow problems are still ModelD or
ModelC.