A way to simulate the effects of different coils or magnetic fields on other magnets and charges.
Autocomplete, debugging if I was stuck for a biti, and styling for the main page control panel.
A way to simulate the effects of different coils or magnetic fields on other magnets and charges.
Autocomplete, debugging if I was stuck for a biti, and styling for the main page control panel.
Finally I completed my magnetic field simulator, I think one of the hardest parts was to make the rendering part work, especially cuz I was pretty new to THREE.js and WebGL in general. I think the project has reached a shippable milestone, so yeah I want to see your reaction!
Finally finished! I added a readme and deployed to pythonanywhere! It took some time cuz I had to iron out a final couple of bugs and I decided to render multiple loops of the coil, which I didnāt do before for some reason.
Log in to leave a comment
Soo I completed the styling, though I will admit a good chunk of it was from AI (im sry ik but css is too confusing for me smhw). But it looks great! There were some minor issues and bugs, so got them sorted out as well and made some ease of use adjustments, so I think this is ready to ship! Its reached a good stage and I want to see all of ur thoughts on this as well. Im just going to deploy and make a readme now
Log in to leave a comment
Ok so I fixed the problem where the field arrows were all weird and another bug where the force arrow construction caused a large red arrow even when there was no force. Now all I have left to do is make it stylish cuz rn the interface looks depressing. I think after that Iāll ship this proj cuz it has gotten to a pretty good stage and publishable.
Log in to leave a comment
Massive session. so I completely made the entire THREE.js frontend part of the sim, linked the python api and managed to get the thing working. But, its very buggy so I spent like an hour or 2 fixing it but no luck, so im going to do that next session. Also as you can see no styling yet, so that will also be part of the next session. Hopefully i dont lose my sanity. wish me luck!
Log in to leave a comment
So I worked on making the python script from before into an api instead. I just rly hope that it doesnt slow down. I need to make the frontend part of this next
Log in to leave a comment
Ok Iāve hit a problem. I was making the 3d simulation in matplotlib, but its extremely laggy with even small grid sizes and segmentation. I canāt rly continue it here, and I think that even in the future, matplotlib based simulation will be harder for everyone to access, so I am going to make this python script a backend and divert all of the rendering to WebGL, probably Three.js. The thing is I have never used WebGL, sooo this is going to be tough. Oh well, nothing I can do. Yāall have any suggestions for frameworks or should I continue with Three.js?
Log in to leave a comment
I worked on calculating the forces on each coil, but I ran into a lot of problems. First the axes were swapped in some places and that took me too much time than it should to figure out, but eventually the problem I found out was that the simulation has to be in 3d cuz I keep ignore the y axis in all calculations, which for some reason only causes the force to go haywire. I got it to work if both coils are lined up (pic 1) but if theyāre not, it doesnāt work (pic 2). So my main job for the next session is to make it fully 3d, which is gonna look kinda sick too. I totally forgot abt making the adjustable real time, so im going to do that too.
Log in to leave a comment
Ok so good progress, I got the whole class based setup of the coils setup, so now I can easily control number of coils, direction of the coil, current, frequency, phase and other stuff like that individually for each coil with minimal hassle. Took me so much time cuz I was trying to figure out how to make the previous extremely laggy version into something faster. Before, it took like 30s for a 2 coil setup to load, but now it hardly takes 5, so not bad if I do say myself. Next, I might explore calculating the forces on the coils, and movability of the coils without changing the parameters manually each time. (ik the image looks a lot like the first devlog but the internal code is fully changed. Check it out on the repo!)
Log in to leave a comment
So I decided to switch the previous code into a neater, more controllable version using a coil class, which allows me to fine tune each coil and easily debug as well. Iām not exactly done yet, but I figured out how to rotate the coil and calculate magnetic field by using rotation matrices. Also sped up the calculation by removing a lot of the for loops and replacing them with numpy functions. Next step is to complete the B at a point function to make the field i was getting before again. But for now look at this 3d graph of the coil I was able to make!
Log in to leave a comment
Soooo I started my project. First got a single loop simulation of the magnetic fields of the coil done, had to do some research on the biot savart law. Once I was done with that, I had to add multi loop coil support, which was simply just adding all of the vectors for each coordinate up to get a total net vector. But it was kinda boring cuz it was static, so I added an animation where I varied the current in the loops. Lastly I finished with adding multiple coils in one figure. I ran into the error where i thought the 2 coils together werenāt adding up correctly, but just ended up being a scaling bug (i wasted like 30 mins on this š) Next step would be to make the coils adjustable in orientation and direction, and figuring out how to make the coils vary in current or size or other specs.
Log in to leave a comment