If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.
Special Thanks To:
Aaron Holmes
Aaron Wheeler
Adam Horden
Alan Scrimgeour
Andre
Andrew Haynes
Anonymous000
asabase
Austin Weil
barney
Barry
Bert Hickman
Bill Kukowski
Blitzorn
Brandon Paradelas
Bruce Bowling
BubeeMike
Byong Park
Cesiumsponge
Chris F.
Chris Hooper
Corey Worthington
Derek Woodroffe
Dalus
Dan Strother
Daniel Davis
Daniel Uhrenholt
datasheetarchive
Dave Billington
Dave Marshall
David F.
Dennis Rogers
drelectrix
Dr. John Gudenas
Dr. Spark
E.TexasTesla
eastvoltresearch
Eirik Taylor
Erik Dyakov
Erlend^SE
Finn Hammer
Firebug24k
GalliumMan
Gary Peterson
George Slade
GhostNull
Gordon Mcknight
Graham Armitage
Grant
GreySoul
Henry H
IamSmooth
In memory of Leo Powning
Jacob Cash
James Howells
James Pawson
Jeff Greenfield
Jeff Thomas
Jesse Frost
Jim Mitchell
jlr134
Joe Mastroianni
John Forcina
John Oberg
John Willcutt
Jon Newcomb
klugesmith
Leslie Wright
Lutz Hoffman
Mads Barnkob
Martin King
Mats Karlsson
Matt Gibson
Matthew Guidry
mbd
Michael D'Angelo
Mikkel
mileswaldron
mister_rf
Neil Foster
Nick de Smith
Nick Soroka
nicklenorp
Nik
Norman Stanley
Patrick Coleman
Paul Brodie
Paul Jordan
Paul Montgomery
Ped
Peter Krogen
Peter Terren
PhilGood
Richard Feldman
Robert Bush
Royce Bailey
Scott Fusare
Scott Newman
smiffy
Stella
Steven Busic
Steve Conner
Steve Jones
Steve Ward
Sulaiman
Thomas Coyle
Thomas A. Wallace
Thomas W
Timo
Torch
Ulf Jonsson
vasil
Vaxian
vladi mazzilli
wastehl
Weston
William Kim
William N.
William Stehl
Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Registered Member #1770
Joined: Mon Oct 20 2008, 08:57PM
Location:
Posts: 3
Hi all, I'm trying to write a coilgun simulation using Lagrangian approach. It has been done like 100 times before and I've read the papers, but I just can't make the bloody thing work. System I'm trying to model: 1 coil, 1 capacitor, no current switching, ideal ferromagnetic core without saturation. First, one should write Lagrangian: LL = T + Wm - We Kinetic energy T = (1/2)m*v^2 Solenoid energy Wm = (1/2)L(x)*I^2 Capacitor energy We = (q^2)/(2*C) Then by applying equation (d/dt)(dLL/dz'i) + dD/dz'i - dLL/dzi = 0, I derive equations of motion: mv' = (1/2)L'x*I^2 I'*L(x)+I(R+L'x*v)+q/c = 0 Then I numerically integrate this stuff with Runge-Kutta and get a (wrong) solution: no conservation of energy; with some parameters I get an efficiency more than 100%. What am I doing wrong?
Registered Member #29
Joined: Fri Feb 03 2006, 09:00AM
Location: Hasselt, Belgium
Posts: 500
We need more information.
Check the signs of the terms in your equations.
How are you modeling the inductance?
What order RK integration?
How are you doing the time stepping? (Explicit stepping will probably not work.)
The equations are non-linear. What solver are you using?
It is not a trivial exercise to make this work, even for the simplest case. You need to understand the limitations of the numerical methods you are using as well as the physics of the system.
Note also that the Lagrangian only gives a convenient route to developing the equations of motion. It has nothing to do with the numerical method as you describe it. You could have just as well used another method.
Registered Member #1770
Joined: Mon Oct 20 2008, 08:57PM
Location:
Posts: 3
Probably figured out what was wrong. My math was correct. The problem lies in peculiar behavior of L and L'x during integration: I was using a function that returns L(x) and L'x(x), but when I tried to integrate L'x*v*dt, it turned out to be different from L(x). This "desynchronisation" was the cause of enegy issues (magnetic energy was wrong). Now I'm using integrated L(x) and it kinda works (energy conservation holds).
What order RK integration? How are you doing the time stepping? (Explicit stepping will probably not work.)
RK4, explicit time stepping. Sure, implicit methods have advantages. But it's not like the explicit method will absolutely not work. It will just give less accuracy, right?
How are you modeling the inductance?
For given core position, I integrate magnetic energy over volume, increasing it mu-fold inside of the core. Then I tabulate it for different core positions with a fixed resolution dx and numerically differentiate it to get L'x. This kind of inductance representation seems to be related to the energy conservation problems, so I'm still working on it. And it's not that I confuse Lagrangian mechanics with numerical methods. I also derived equations of motion without using Lagrangian and got the same result.
Registered Member #29
Joined: Fri Feb 03 2006, 09:00AM
Location: Hasselt, Belgium
Posts: 500
RK4, explicit time stepping. Sure, implicit methods have advantages. But it's not like the explicit method will absolutely not work. It will just give less accuracy, right?
RK4 is a pretty good workhorse method. Just watch out for instability. If it happens, reduce time step. Implicit and semi-implicit methods are immune to this, but tend to be more complicated to implement. Also, simple explicit methods tend not to be "flux-conservative", meaning that over time, errors creep into things like charge, momentum and energy balance....
For given core position, I integrate magnetic energy over volume, increasing it mu-fold inside of the core.
I am not sure what you mean here. In order to know the magnetic field energy inside the core, you need to apply a boundary condition at the surface. The magnetic flux density B perpendicular to the core surface will be continuous and the tangential field H will also be continuous. In magnetic "circuit" terms, within the highly permeable ferromagnetic core, Vm = int( H . dl) and therefore H will essentially vanish. Energy is int(B . H dV) and will be very close to zero inside of the core material. The bulk of magnetic energy is found (counterintuitively) in the air surrounding the core. It is probably simplest to assume an infinitely permeable core (not a bad approx for non saturated iron) and work from there.
Registered Member #1770
Joined: Mon Oct 20 2008, 08:57PM
Location:
Posts: 3
RK4 is a pretty good workhorse method. Just watch out for instability. If it happens, reduce time step.
It seems to be pretty accurate and stable with dt up to 1000 microseconds, and it's simple, so for now I'll stick with it.
The bulk of magnetic energy is found (counterintuitively) in the air surrounding the core.
O_o shocked. Since inductance of a solenoid filled with magnetic is increased mu times (assuming no saturation), I thought that increasing energy inside of the core mu times is the way to go. I'll examine calculating magnetic field energy in more details.
Registered Member #29
Joined: Fri Feb 03 2006, 09:00AM
Location: Hasselt, Belgium
Posts: 500
I should say that the bulk of the energy is found in the air-gaps of the magnetic circuit. If the core completely encloses the coil (like in a transformer) then this argument does not work (and in fact mu does become a simple multiplying factor)
Registered Member #30
Joined: Fri Feb 03 2006, 10:52AM
Location: Glasgow, Scotland
Posts: 6706
It seems counterintuitive, but magnetic energy is the product of B and H, and a magnetic core means less H is required for a given B. Hence as Waverider says, in a mixed magnetic circuit of air and iron, most of the energy is stored in the air gaps, and only about 1/mu worth of it in the iron.
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.