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?
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?