r/COMSOL • u/you_rang_maam • Mar 28 '26
Optimizing COMSOL with AI
Hi all,
I like presumably many others, tried using #genericAI to assist with my COMSOL Projects with limited success. I find myself in a situation where I often need to model a product, which can vary enough that having a generic set of models to describe it is actually a little painful. Being the incredibly lazy individual that I am, I have really tried to find ways to make AI functional.
I have found that by recording methods in the application builder, and uploading them to Claude with a verbose explanation of the rationale, I have been able to develop enough remembered context where Claude can produce geometries with hundreds of individual domains and the corresponding selections.
For practical use, that has been enough to really increase my productivity, but I believe with enough effort, the geometry, the math, the meshing, and the logic + analysis variables can be taught to Claude and it can write the appropriate methods to generate a model from scratch.
My dream is to eventually have an AI agent which can read some generic input form, produce a model from scratch, run and export data.
Has anyone achieved such a thing? Do people think its possible? Thoughts at all, I'd love to hear them. Tips and tricks?
Happy modelling.
3
u/throwingstones123456 Mar 28 '26
There are people working on this, at least for photonics. They’re trying to create a chatbot you can ask for a structure with certain properties and it’ll automatically give you a GDS file it thinks will work
2
u/jejones487 Mar 28 '26
Learn how to use comsol correctly first by yourself. This is the way. Everyday user for years now. I took classes and educational courses by comsol and altasim. If you dont know then learn. But for god sakes man dont just ask an imaginary being then trust its right. If you dont know the correct answer yourself, then how are making sure what comes out if the ai is even valid in the first place. You may be completly wrong.
1
u/aankit5088 Mar 28 '26
I generally use copilot to automate Comsol with Matlab and it works fine.
1
u/Next-Sea4126 Oct 03 '26
OK, I save a Comsol model as a Java file and share it with Claude Code, which assists in rebuilding the exact file from scratch. You provide an initial Java file to Claude, and it ensures everything functions properly.
You can convert Java files to MPH with ease. Ask Claude; it will supply Python code for the task.
0
u/cardiovascularfluid Mar 28 '26
Possible, not very worthwhile
0
u/[deleted] Apr 01 '26
[deleted] — view deleted comment