is there a permanent magnet simulator like LTSPICE? - Page 1
Forum section: electronics / beginners

author: Capernicus
author_rank: Frequent Contributor
timestamp: May 17, 2021, 09:35:25 pm
content: Magnets are so confusing, and it takes so much time to setup a real jig for a permanent magnet device, its probably simpler than electricity to simulate, but it doesnt seem to be so popular.Is there a 3d permanent magnet simulator on the internet somewhere?Id prefer something like Falstad circuit simulator, realtime is the best.

author: penfold
author_rank: Frequent Contributor
timestamp: May 17, 2021, 10:28:05 pm
content: It's not 3D, and not real-time but FEMM is a very useful simulation tool for magnetics, electrostatics and thermal in 2D. Magnetics (and electrostatics) tend to rely on representing "space" as a finite grid/mesh and solving equations for each point results in quite slow and difficult to realise in real-time simulations. Also changing a single point would strictly require re-evaluating the entire mesh which makes "interactivity" hard to incorporate into simulations, I find FEMM to be a reasonable balance between quality of results and the ability to make quick changes to simulation.Most magnetics problems can be approximated as 2D, stuff like flux distribution in a motor or transformer. There is a scripting interface in FEMM that lets you rotate sections as if a motor's rotor for example.

author: Capernicus
author_rank: Frequent Contributor
timestamp: May 18, 2021, 01:14:28 am
content: Quote from: penfold on May 17, 2021, 10:28:05 pmI bet its nothing a gpu cant handle.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: May 18, 2021, 01:29:46 am
content: I have seen many magnetic simulation programs advertised in the trade magazines/journals. All were pricey, most were add-ons to mechanical design solid modeling software. There is a significant learning curve to learning the software, and magnetics are generally not simple themselves. Non-linear material behavior is the norm, not the exception.The are open source programs to do these things, but I don't have enough personal experience to recommend any, and found that for me it was a long way to useful output. Might be a personal problem, but it is very possible that test setups will be the "faster and easier" approach.

author: twospoons
author_rank: Frequent Contributor
timestamp: May 18, 2021, 05:36:17 am
content: Quote from: Capernicus on May 18, 2021, 01:14:28 amBet you it is.I used to run Ansys Maxwell for electromagnetic simulations of wireless power transfer - just the transmitting side - on an i7 with 64GB or ram and it could takedaysto run a single simulation.I would typically start a run on Friday and hope it was finished by Monday. Adding more cores didn't help much. The issue is just the sheer size of the problem once you start working in 3d. It ends up requiring a colossal amount of memory / disk space.There are free 3d simulators available, likehttps://www.csc.fi/web/elmer.FEMM4.1 is a very useful (and reasonably quick) FEA simulator that does 2D and 2.5D problems, and mentioned by penfold. Reducing a 3d problem to a 2d slice can still tell you quite a lot.

author: Terry Bites
author_rank: Super Contributor
timestamp: May 18, 2021, 12:01:20 pm
content: https://quickfield.com/free_soft.htm

author: penfold
author_rank: Frequent Contributor
timestamp: May 18, 2021, 12:53:48 pm
content: Quote from: Capernicus on May 18, 2021, 01:14:28 amThe floor is yours if you wish to code it

author: Capernicus
author_rank: Frequent Contributor
timestamp: May 18, 2021, 01:21:08 pm
content: Quote from: penfold on May 18, 2021, 12:53:48 pmI can code for gpu's and they are faster given the circumstance of what they are good at running, if u did the magnet sim like a giant particle system gpus kick ass at that, but its just a matter of making it realistic thats the problem, maybe one day I'll give it a go. There could be monetary benefit in a high performance mag sim... until they copy your idea and put out the alternative.

author: penfold
author_rank: Frequent Contributor
timestamp: May 18, 2021, 03:44:36 pm
content: Quote from: Capernicus on May 18, 2021, 01:21:08 pmI was pushed for time, so I stuck with the snarky answer sorry. I wasn't really saying it's not possible, and it's definitely been done in commercial (at a price tag) and academic software (no comment). The equations fit quite neatly into GPUs since they are single-function multiple-data and each mesh node requires its nearest neighbours and 1 or 2 historic values (for time-domain), I did just that a little over 10 years ago as an academic when CUDA was just starting to become useful and I'd be happy to share some bits of code if you want something to start with (...if I can remember where I archived it). I wouldn't really doubt that you could simulate simple shapes, rectangles, transformer cores, simple (very simple) motors with just enough resolution to help you develop a bit of intuition about how the fields behave in 3D. But... what I'm not sure about is whether that would actually be any easier to understand over a 2D slice?

author: Capernicus
author_rank: Frequent Contributor
timestamp: May 18, 2021, 05:34:05 pm
content: Not snarky at all, compared to what I'm used to its a breath of fresh air.I guess you have to get a thick skin as an engineer, mines formed hard and beautiful tree bark now, but I do have a way to go yet before I consider myself "philosophically sound in a crazy environment"I agree with what you said, sounds right to me, so u can do a bit of gpu work yourself. I started off in direct x, I was doing gp-gpu on shader 2 model. hehe.A 2d slice would go alot faster and more high resolution than 3d would, and its 99% all you need to test out whatever your making anyway.GPGPU game of life sims are 10,000x the resolution of cpu ones if you count x and y.It would be cool to have it on the internet, to go with FALSTAD, if anyone wants to put the time in to get it.You can do GPU code in browser based these days, but thats a missing area in my knowledge, I haven't learnt it, if you wanted to make it commercial.