Simulation of Electromagnet Force

In summary: If you can explain it in English, that would be great. Thanks.In summary, the author is trying to simulate all forces of in the universe on his computer, putting in the correct physics equations for each force, one by one. He was already able to simulate the force of gravity with the following formulas/equations: G = 6.674205043E-11 'The Universal Constant of Gravitation' initialspeed = 0 'No additional force added. He then found one formula that is probably the correct its: K = 8987550000 'Coulomb's Constant' force = (K * q1 * q2) / distance. He was then able to use Newton's Law of Motion to calculate acceleration
  • #1
ComputerPsi
24
0
Hello,
This sounds like a silly idea, but I am trying to simulate all forces of in the universe on my computer, putting in the correct physics equations for each force, one by one.
I was already able to simulate the force of gravity with the following formulas/equations:

G = 6.674205043E-11 'The Universal Constant of Gravitation
initialspeed = 0 'No additional force added.

mass1 = 70 'Average Person

'Earth
mass2 = 5.98E+24 'Planet's Mass
distances = 6378000 'On surface

force = (G * mass1 * mass2) / distances ^ 2
acceleration = force / mass1
'Or
acceleration = (G * mass2) / distances ^ 2

'loop through time
newposition=initialspeed * Time + (1 / 2) * acceleration * Time ^ 2)
'Stop looping when crashed into planet


Now, I am trying to simulate electromagnetisem. I found one formula that is probably the correct its:
K = 8987550000 'Coulomb's Constant
force = (K * q1 * q2) / distance

My question is, can I use the same equation "acceleration = force / mass1" to convert this force into acceleration? If so, is mass1 equal to q1?

If both are true, This seems to become an interesting equation as a result:
(G * mass) / distance ^ 2 = (K * mass) / distance

...supposedly meaning that gravity is produced by an electromagnetic force...

Please correct me if I am wrong.

Edit:
I just did the calculations.
As an example, I made mass equal 70 and distance equal to .2

As a result I got:
(G*mass)/distance^2 = 1.167985883E-7
(K*mass)/distance = 3.1456425E+12

So.. something is wrong.



Also, its possible that I posted in the wrong section, I am not sure where to post this since I am new to this website.. Moderators, please redirect it to the correct position if it is in the wrong section. Thanks.
 
Last edited:
Physics news on Phys.org
  • #2
ComputerPsi said:
Now, I am trying to simulate electromagnetisem. I found one formula that is probably the correct its:
K = 8987550000 'Coulomb's Constant
force = (K * q1 * q2) / distance

What you wrote is almost Coulomb's Law of Electrostatics.
In your notation, it should be
force = (K * q1 * q2) / distance2

ComputerPsi said:
My question is, can I use the same equation "acceleration = force / mass1" to convert this force into acceleration? If so, is mass1 equal to q1?

If both are true, This seems to become an interesting equation as a result:
(G * mass) / distance ^ 2 = (K * mass) / distance

...supposedly meaning that gravity is produced by an electromagnetic force...

Please correct me if I am wrong.

The correct application of Newton's Law of Motion requires you to
write "acceleration = net force / mass1"

mass1 is not equal to q1. q1 is an electric charge, measured in coulombs.
(Note that G and K have units associated with the numbers you quoted.)


Looking over what you wrote, you need to work with vector--not merely scalar--quantities if you wish to, say, model the orbit of a planet.

You might wish to look over a text on simulations in physics, e.g.,
http://sip.clarku.edu/ .
 
Last edited by a moderator:
  • #3
Thanks for the response.
Some how, I didn't notice the "2" in:
force = (K * q1 * q2) / distance2

robphy said:
Looking over what you wrote, you need to work with vector--not merely scalar--quantities if you wish to, say, model the orbit of a planet.

A vector, not merely a scalar? I don't seem to understand what you are talking about... Can you elaborate? On the simulation, I am trying to make a visual of the actual objects, reacting to different forces. So, I would need both direction and speed. Also, as additional properties, it would have mass, length, and others... So, I suppose it would need both a vector and a scalar.. Is it possible to use both? Sorry if this is an elementary question.. I am relatively new to some math calculations in physics, and I am teaching all the information to myself, with many of the resources on the internet.
 
  • #4
But right now, the main question is, can I use the same formula as used in gravity to change force into acceleration, to use in electromagnetism too?

In the rewritten form:
acceleration = force / q1

Can I use this formula to change electromagnetism force into acceleration? Or is a different formula needed?
 
  • #5
ComputerPsi said:
But right now, the main question is, can I use the same formula as used in gravity to change force into acceleration, to use in electromagnetism too?

In the rewritten form:
acceleration = force / q1

Can I use this formula to change electromagnetism force into acceleration? Or is a different formula needed?

You are reffering to Newtons second law. This tells you, given a force, what the accelleration will be, independent of the source of the force. So even when you're delaing with electromagnetism you use acceleration = force / mass (note that this only applies when the mass of the object is constant).
 
  • #6
robphy, I finally understand what you ment about working with a vector.. So, right now, I'm trying to my the 1-deminsional calculation into a 2d visual of the objects moving.
 
  • #7
I don't know what language you are programming in... but from what i have read vpython might be good for you... it already has a vector "type" so to speak that's easy to manipulate and it will draw simple 3d scenes with little programming at all... there are also a lot of basic physics sims already available that you could look at and modify or what ever... note: the language is indent specific.

with the following...
'loop through time
newposition=initialspeed * Time + (1 / 2) * acceleration * Time ^ 2)
'Stop looping when crashed into planet

as your position is changing... you should be recalculating the force based on the new position in each iteration or you are using constant force...

i am not sure how you are using Time... i am assume you are using it as a dt? like a really small increment of time, in which case the following is what i think:

also i don't see initalspeed being updated in each iteration... so i don't think you are really conserving momentum of the object... but are actually calculating on each loop what the displacement would be if the object was stationary and now feeling an acceleration for the first time at this location.

otherwise if Time is total time elapsed... you don't seem to be updating it in your loop. also v0 + (1/2)at gives average velocity as t gets bigger I am sure that will start adding significant error.

i like to look at it as

dp/dt = fnet, so the rate of change of momentum is force (fnet should be the vector addition of all forces acting on the object... electric, gravity etc...

so

dp = fnet*dt this would tell you how much momentum changed for when a force fnet was applied for a time dt... the smaller dt the more accurate the calculation...

then update total momentum

p = p+dp

now you can get the velocity from p=mv so the current velocity is now
p/m or p*(1/m)

so updating position

newpos=oldpos+(p/m)*dt

(note fnet, p and dp should be vectors)
 
  • #8
In the VPython installation (see http://vpython.org ), there is a demo program called orbit.py. You might like to look at the source. It's under 30 lines of code.
 
  • #9
Well, programming is actually one of my strongest points, so, I would continue writing the program instead. Anyway, my program works a bit differently.. I'm coding it to have the most posible simplicty, to be able to handle all the forces simitaniusly, with correct timing.
Anyway, I tried running VPython, but it just freezes, when I try to run it...
 
Last edited:

1. What is simulation of electromagnet force?

Simulation of electromagnet force refers to the use of computer software or mathematical models to replicate and predict the behavior of electromagnetic forces in a given system. This allows scientists and engineers to understand and optimize the performance of electromagnetism in various applications.

2. Why is simulation of electromagnet force important?

Simulation of electromagnet force is important because it allows us to study and analyze the behavior of electromagnetic forces in a controlled and repeatable manner. This can help us design more efficient and effective electromagnet systems for various applications, such as motors, generators, and magnetic levitation.

3. What are some common methods used for simulating electromagnet force?

Some common methods used for simulating electromagnet force include finite element analysis (FEA), computational fluid dynamics (CFD), and circuit simulation. These methods involve using mathematical equations and algorithms to model the behavior of electromagnetic forces in a given system.

4. What factors can affect the accuracy of electromagnet force simulations?

The accuracy of electromagnet force simulations can be affected by various factors, such as the complexity of the system being simulated, the quality of the input data and parameters, and the accuracy of the mathematical models and algorithms used. The choice of simulation method and software can also impact the accuracy of the results.

5. How can simulation of electromagnet force be used in practical applications?

Simulation of electromagnet force can be used in various practical applications, such as designing and optimizing electromagnet systems in industries like transportation, energy, and manufacturing. It can also be used for research and development of new technologies involving electromagnetism, such as wireless power transfer and magnetic resonance imaging.

Similar threads

  • Introductory Physics Homework Help
Replies
8
Views
1K
  • Classical Physics
Replies
7
Views
746
  • Other Physics Topics
Replies
16
Views
14K
  • Electrical Engineering
Replies
2
Views
303
  • High Energy, Nuclear, Particle Physics
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
3K
  • Special and General Relativity
Replies
5
Views
350
  • Introductory Physics Homework Help
Replies
4
Views
1K
Replies
7
Views
580
  • Introductory Physics Homework Help
Replies
6
Views
706
Back
Top