Show HN: First Simulink Copilot

9 hours ago 1

I built the first Matlab Simulink copilot (for non-engineers matlab/simulink is like the boogeyman)

I’m a 2nd-year aero-engineering student at Imperial College London, I enjoy problem solving (did BPhO and got gold and UKMT) I'm a full-stack dev (or atleast trying to be lol) who hacked together Bloxi, an AI copilot that sits on top of Simulink and turns plain-English prompts into working control-system models and can easily debug them in real time. I felt the pain myself this term, watching top-tier students burn hours wiring blocks instead of engineering. With today’s multimodal LLMs finally able to “see” diagrams, this is the first moment an assistant like Bloxi can exist and the fastest way to give millions of engineers the same productivity leap coders just got with this whole AI/ML Craze. Quite like gpt it’s good and quick at building boilerplate which does take up majority of the time, leaving more time to actually focus on building.

I built this mainly to get comfortable with LLMs and “prompt-engineering,” and I think I’ve hit the point where I’m done tinkering; especially now that MathWorks have announced they’re working on their own version. So I figured I’d share what I’ve got and not just leave it in my private repository innit.

How it works (Two scripts + simple backend):

1. One builds the Simulink model. 2. The other handles the chat + simple UI. 3. Backend that glues together the OpenAI API and frontend

Drop in your own OpenAI API key and you’re off. I used it to debug and build a few uni-project models, and it’s been surprisingly handy.

At first it just spat out a finished Simulink file, but I wanted that ChatGPT “walk-through” vibe make it feel 'magical'. So I added a couple of for loops: one to drop in blocks step-by-step, and another to wire them up.

Since raw code isn’t visible in Simulink (to the best of my knowledge), within one of my scripts I had it walk through the simulink file and screenshot each stage, pipe them through the LLM, and let it spot inconsistencies. Works better than I expected. Perhaps someone can do better or find a better way?

Youtube video of me using it: https://lnkd.in/ePgkBRk6

Here’s the GitHub link if you want to play with it, poke around or build on it: https://lnkd.in/dzwhZcfp

To use download & open scripts then just do openChatbox().

Lmk what you think it's quite barebones but decided to speed through it as a 'proof of concept' so to speak.

Read Entire Article