Just made a short post about how to simulate electrostatic nonuniform charge density distributions with FEniCS; that is spatially varying charge density distributions. This could be useful for simulating things like particle beams which are commonly assumed to have Gaussian (or similar) distributions. This is a small extension of a previous post about how to simulate uniform charge density distributions.


@Rovine you could use node if you've already looked at JavaScript.

However, my script is now *very* linux only πŸ˜…

I needed to perform a numerical integral of a function I knew very little about. I tried to get decent resolution by having small slices in my integration.

Python was pretty slow to perform the integration, so I thought I'd have a look at writing it in c++. I haven't used c++ for ages, but eventually I got it working.

I then needed to plot the result of my integration against measured data, so I wanted access to my c++ functions in python, where I do my plotting.

Finally got my c++ functions imported into python using PyBind11 and I must say, it works amazingly well, I think it's well documented and the examples were great. Vectorising my functions so that I can run them for a whole numpy array of values was genuinely super-easy. I'm very impressed! Thanks to all the devs =]

@freemo works for me too now, thank you very much :)

@freemo I'm getting a gitlab 404 on video.qoto.org I'm afraid.

@mngrif nim is pretty interesting, you write something with a python-like syntax but its converted to c and compiled.

@freemo @freemo I'll sign up & upload my geometry making videos here, the instance I used originally has been down for a while now.

@Rovine well my aim isn't really to learn about blogging platforms so I wouldn't try anything too experimental, although I would consider a self hosted WordPress blog. Do you have a preferred host?

@Rovine @freemo I do this for physics and maths, if I want to learn a new subject I essentially copy a whole chapter out by hand. I often derive the results rigorously though, where books just quote an answer and I attempt some problems. I have found this to be very effective.

@freemo When I first saw this all I could think was "this is why nobody uses the divide symbol", all ambiguity disappears when it's written as a fraction.

@mycroft I suppose in some areas of education its necessary, I'm coming from a physics & math background.

@mycroft I wish people wouldn't use PowerPoint for teaching, I understand that its easier for teachers but I find it very unhelpful for actually learning.

@piggo Which of these features is Firefox lacking?

@Trillenial With a $50 telescope you can see other planets, all of them are clearly circular, what does he say about that? Its just a coincidence that they all happen to be showing their flat face to the earth?

WordPress.com offers a pretty good service, but its limiting in terms of access to WordPress features and puts pretty intrusive advertisements on my blog. I was thinking of moving to a different WordPress host.

I got magnetostatic simulations working yesterday, so I made a cos(theta) style dipole magnet with an iron yoke. The fields looked sensible although I didnt check the amplitudes, for the post I'll see if I can recreate the LHC dipoles!

My latest post is about using boundary conditions to assume symmetry in a finite element electrostatics problem.

To demonstrate Neumann boundaries I solve the Laplace equation for a coaxial geometry using 1/4 of the cross section. I then find the fields of a differential pair transmission line using half the cross section and a Dirichlet boundary.

This is all done with FEniCS, the open source finite element solver. ​


Show more
QOTO Mastodon

Welcome to the QOTO instance

QOTO: Question Others, Teach Others
No racism, No censorship, Just kind people who speak their mind.
We federate with all servers: we don't block any servers.