Skip to contents

multimod 0.5.0

First CRAN release. The changes are listed against 0.0.1, the GitHub release of June 2025, which read GAMS and rendered models to LaTeX and back to GAMS.

Breaking changes

  • The S3 classes of model objects carry an mm_ prefix: mm_model, mm_set, mm_mapping, mm_parameter, mm_variable, mm_equation. Code testing inherits(x, "model") must use the new names; models saved with 0.0.1 must be rebuilt.
  • The constructors validate each node against the schema when it is built, so a malformed node is refused there. options(multimod.validate = FALSE) disables the check.
  • arrow and visNetwork are suggested rather than imported; the functions that need them fail with an installation hint.

New features

Building and reading models

  • mm_equation() builds an equation from MathProg, GAMS or JuMP text.
  • read_gmpl() reads MathProg models with their data sections, computed parameters and parametric defaults.
  • parse_jump_equation() reads a JuMP @constraint() statement.
  • read_gams() and read_gmpl() accept text as well as file paths.
  • Lags and leads are linear by default and wrap with circular = TRUE; GAMS reads and writes both forms (y-1, y--1).
  • example_models$toy is a small capacity-expansion model built with the constructors.

Rendering

  • as_gmpl(), as_pyomo() and write_gmpl(), write_jump(), write_pyomo() render a model to MathProg, JuMP and Pyomo, with its data embedded or read from CSV, Arrow IPC or Parquet files.
  • write_gams_data() (experimental) writes a model’s data to a GDX file, and write_gams(gdx =, include_solve =) emits the matching load and solve statements. Parameters defined by a formula are written as assignments.

Solving

Workspace, reduction and exchange

Configuration

  • Interpreter and solver paths resolve from R options, environment variables, a configuration file and auto-detection, in that order; see multimod_config_write() and multimod_config_show().
  • mm_setup_python() creates a Python environment for Pyomo, and mm_check_python() reports whether the configured one is usable.
  • The glpsol executable is taken from the ‘glpsol’ package when it is installed.

Documentation

  • vignette("multimod") takes a small model through reading, translation, redundancy analysis, LaTeX, export and solving. Website articles cover writing a model in R, folding and trimming, solving and reading results, two published models, the model workspace, configuration and LaTeX rendering.
  • The website moved to https://optimal2050.github.io/multimod/r/; the root is a landing page for the languages the repository is laid out for. Links to the old addresses are forwarded.

Bug fixes

  • read_gams() parses a sum over several indices, numbers in scientific notation with a signed exponent, and decimal literals in equation bodies.
  • read_gams() reads several symbols declared on one line (set tech, region;), and an equation header without a $ condition.
  • ^ no longer distributes over the terms of its base, so (1 + r)^n is evaluated as written.
  • as_gams() output compiles: conditions are bracketed, function arguments and multi-index sums are rendered, and iterated minima and maxima are written as smin() and smax().
  • write_gams() declares each equation over its sets, as GAMS requires, and writes no empty sets block.
  • as_latex() renders an equation’s index names in its header.
  • ast_dims() accepts a single node, and returns a dims node unchanged.

multimod 0.0.1 (2025-06-01)

  • Initial GitHub release (June 1, 2025).