Inside a Solenoid

Stretch the coil and the field drops, even though not a single turn was removed. The slider you are really moving is n = N/L, and the field only ever cared about that.

Field at the centre  B(0)
4.9634 mT
1.26% below the ideal 5.0265 mT
CORE SATURATED
Soft iron cannot carry much more than 2 T.
Turns per metre
2,000 /m
Ideal field
5.0265 mT
Field at the end
2.5053 mT
End / centre
0.5047
Flux through a turn
6.2372 µWb
Length / diameter
6.25
Ends matter: the ideal formula overstates B by 1.26%.
Turns, N500
Length, L0.250 m
Current, I2.0 A
Coreair
Coil radius R = 0.020 m (d = 0.040 m), fixed. It is deliberately not a control: the radius never appears in B.
Air core: relative permeability 1.
Try this: note the field, then drag L from 0.25 m to 0.50 m without touching N. Same wire, same current, half the field.