Linear Solver

approvedunreviewed

by feror

Solve GMPL linear programs and visualize two-variable feasible regions.

↓ 43 downloadsUpdated 20d agoMIT

Linear Solver for Obsidian

CI

Write a scalar GMPL/MathProg linear model in a fenced code block and see its solution directly in Reading view. Two-variable models also get a theme-aware feasible-region plot.

```gmpl
var x1 >= 0;
var x2 >= 0;

maximize z: 30*x1 + 40*x2;

subject to c11: 2*x1 + x2 <= 100;
subject to c12: x1 + 3*x2 <= 120;
subject to c13: 2*x1 + 2*x2 <= 100;

end;
```

The plugin reports the objective, variable values, bounds/basis-style statuses, constraint activity and slack. It accepts gmpl, mathprog, and mod fence names.

Supported GMPL subset

  • Scalar var declarations with >=, <=, or fixed (=) numeric bounds
  • integer and binary variable modifiers
  • One named maximize or minimize objective
  • Named subject to constraints using <=, >=, or =
  • Linear arithmetic with +, -, *, /, and parentheses
  • # line comments

Indexed sets, parameters, summations, conditional expressions, and nonlinear terms are intentionally not supported yet. The plugin shows a precise parse error instead of silently misreading them.

Install for development

npm install
npm run check

Copy or symlink this directory into <vault>/.obsidian/plugins/linear-solver, then enable Linear Solver in Obsidian’s Community plugins settings. The runtime files are manifest.json, main.js, and styles.css.

Or build and install it into a vault in one step:

./scripts/install-vault.sh /path/to/your/vault
# Equivalent: npm run install:vault -- /path/to/your/vault

The installer validates that the destination contains .obsidian, builds the current source, and installs only the three runtime files under .obsidian/plugins/linear-solver.

During development, npm run dev watches and rebuilds main.js.

Releases

Pushing a version tag such as 0.1.1 runs the full check suite and publishes a GitHub release containing the three Obsidian runtime files. The workflow also creates GitHub build-provenance attestations for main.js and styles.css. Obsidian requires the tag to match the version in manifest.json exactly, without a v prefix.

To create the same package locally:

npm run package

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.