Why does my off-axis solenoid calculation give wrong values?

3 replies · 3K views · last reply
eigenstaytes
Messages
5
Reaction score
0
What would be the best method to model a solenoid? I tried writing a program that calculated the off axis elements of the solenoid but the value came out wrong. Any idea?
 
I drew up a quick diagram to show what I mean.

Hand-drawn sketch of a helical coil of wire wound around a horizontal line labelled z, with the coil's turns sloping upward to the right.

The on-axis elements (along the Z-axis which is located along the center of the solenoid) can be calculated via some method. Ampere's law possibly? However, what would I have to do to calculate the values which are not along the Z-axis?