Matlab Control Optimization logo

Matlab Control Optimization

Community
wzyn20051216
matlab-control-optimization

MATLAB workflow for control systems, system identification, robust control, MPC, Simulink Control Design, parameter tuning, constrained optimization, and numerical validation. Use whenever the user asks for controllers, transfer functions, state-space models, tuning, identification, optimal control, or solver-based engineering.

Overview

Publisherwzyn20051216
Repositorymatlab-agent-skills
Skill namematlab-control-optimization
Stars
32
Forks
1
Bundled files
7
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 7 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by wzyn20051216 on GitHub. Read the source before you install it.

Installation

Install the Matlab Control Optimization AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/wzyn20051216/matlab-agent-skills/tree/main/skills/matlab-control-optimization
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wzyn20051216/matlab-agent-skills.git /tmp/matlab-agent-skills
mkdir -p .claude/skills
cp -r /tmp/matlab-agent-skills/skills/matlab-control-optimization .claude/skills/matlab-control-optimization
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Matlab Control Optimization in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Matlab Control Optimization on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Matlab Control Optimization is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

MATLAB Control Optimization

Use this skill for control design and optimization workflows.

Skill Root

The installed directory containing this SKILL.md is the resource root. Add its helper folder for the current MATLAB session only — never through savepath, startup.m, or a global path edit:

matlab
skillRoot = '<absolute path to the installed matlab-control-optimization Skill directory>';
addpath(fullfile(skillRoot, 'scripts'));

Resolve references/, tests/, and helper calls from that root, not from the caller's working directory. If a shipped helper or reference is missing, report the exact path and reinstall the Skill; do not scan the disk for a substitute.

Workflow

  1. Define plant model, units, sample time, constraints, and performance goals.
  2. Confirm required products: Control System Toolbox, System Identification Toolbox, Optimization Toolbox, Robust Control Toolbox, or MPC Toolbox.
  3. Build an executable baseline model.
  4. Tune or optimize with explicit objective and constraints.
  5. Validate time-domain, frequency-domain, and robustness behavior when applicable.
  6. Save plots, tuned parameters, and numerical metrics.

Preferred APIs

  • tf, ss, zpk, c2d, d2c
  • step, lsim, bode, margin, bandwidth
  • pidtune, systune, hinfsyn, musyn when licensed
  • iddata, tfest, ssest, compare
  • optimproblem, fmincon, lsqnonlin, ga, particleswarm

Validation Metrics

Use checks such as:

  • Rise time, settling time, overshoot.
  • Gain margin, phase margin, bandwidth.
  • Constraint violation count.
  • Objective value and solver exit flag.
  • Identification fit percentage on held-out data.

Risk Checklist

Watch for:

  • Continuous/discrete sample-time mismatch.
  • Unscaled optimization variables.
  • Local minima and solver sensitivity.
  • Hidden actuator saturation.
  • Controller instability outside nominal operating points.

Stability Is Three Answers, Not One

Use mas_stability_verdict before reporting any stability conclusion:

matlab
r = mas_ctrl_analyze(L);                 % every crossing, poles, notes
v = mas_stability_verdict(L);            % or mas_stability_verdict(r)
v.math.stability                         % STABLE | UNSTABLE | UNDETERMINED
v.target.status                          % PASS | FAIL | UNDETERMINED
v.evidence.quality                       % VERIFIED | PARTIAL | NOT VERIFIED
v.notes                                  % why a value is NaN / undetermined
r = mas_ctrl_pid_design(P, struct('pmTarget',50,'gmTarget',6));
r = mas_ctrl_aw_sim(P, cfg, opts);       % saturation + 'none'|'clamp'|'backcalc'

Never turn "MATLAB ran", "poles are stable", "PM passed", or "the curve looks smooth" into one of the other answers. A missing margin is UNDETERMINED, not PASS. When the closed-loop poles and the frequency margins disagree, the verdict is UNDETERMINED with an EVIDENCE_CONFLICT note.

Boundary rules this tool encodes (each one a paid-for defect):

  • margin() returns Gm as an absolute ratio, not dB; allmargin also reports a ratio. c2d(10/(s+1),0.01) has ratio 20.0002 = 26.02 dB.
  • Phase is unwrapped and PM is wrapped into (-180,180]. Without the wrap a negative-gain loop reports +275.7 deg instead of -84.26 deg.
  • DC unity gain has its PM at DC (1/(s+1) -> 180 deg), not NaN.
  • Phase = -180 at DC with |L|>1 is a negative GM at w=0; -10/(s+1) is UNSTABLE although its 0 dB crossing looks healthy.
  • Discrete loops reach -180 at pi/Ts; that Nyquist boundary must be checked.
  • Multiple crossings: the worst one binds, never the first.
  • Delay: rational closed-loop poles exclude the delay, so evidence is PARTIAL.

Units are explicit: every crossing carries f (Hz) and wRadPerSec (rad/s), and opts.freqUnit selects how wmin/wmax are interpreted. Verify w = 2*pi*f.

Full definitions, boundary table, and independent reference values: references/stability-contracts.md.

tests/test_ctrl_analyze.m covers the known-stable loop, known-unstable plant, multi-crossing loop, discrete and delayed loops, PID design and anti-windup. tests/test_stability_contract.m covers the negative-gain encirclement, DC unity, double integrator, discrete Nyquist margin, no-crossing target, target-not-met, Hz/rad-s equivalence, NaN/Inf/empty inputs, and margin return-order units.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Matlab Control Optimization AI skill do?

MATLAB workflow for control systems, system identification, robust control, MPC, Simulink Control Design, parameter tuning, constrained optimization, and numerical validation. Use whenever the user asks for controllers, transfer functions, state-space models, tuning, identification, optimal control, or solver-based engineering.

Why use Matlab Control Optimization on TypingMind?

Because you install it once and use it with any model. Matlab Control Optimization is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Matlab Control Optimization in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/wzyn20051216/matlab-agent-skills/tree/main/skills/matlab-control-optimization. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Matlab Control Optimization?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Matlab Control Optimization?

As many as you like. As long as a model supports skills, you can use Matlab Control Optimization with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Matlab Control Optimization AI skill free?

Yes. It is published on GitHub by wzyn20051216 under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇