Skip to content
Oakfield Operator Calculus Function Reference Site

Visual Mode

ModeDescription
phase_portraitScatter plot of real vs. imaginary components to expose attractors and limit cycles.
waveformTime-domain waveform view, useful for debugging scalar fields or reductions.
phasePhase-only rendering that highlights angular structure.
energyEnergy-density style view for quick stability checks.
frequencySpectral magnitude inspection for dispersion and filtering experiments.
polarPolar plotting of magnitude/phase pairs.
sim.sim_set_visual_mode(ctx, "polar") -- accepts string or integer code
local mode_value, mode_name = sim.sim_get_visual_mode(ctx)
sim.log("visual mode %d -> %s", mode_value, mode_name)

sim_set_visual_mode accepts either the integer code or any of the aliases shown above. The getter returns both the code and the canonical string.

local ctx = sim.sim_create()
sim.sim_set_timestep(ctx, 0.01)
sim.sim_set_visual_mode(ctx, "phase_portrait")
local field = sim.sim_add_field(ctx, {512}, {
type = "complex_double",
fill = {0, 0}
})
-- add operators...
sim.sim_step(ctx)