Individual effects

Shashank,

  Here is an example of how to separate out these elements into individual effects (physics of one solenoid and control of one solenoid).  Have a look at these and then think about how to build your system from these "LEGOs".