1. The problem statement, all variables and given/known data We are given a circuit with a inductor that has a magnetic core and a magnet that is moving away from the inductor and to the inductor. We can control the flow of current through the inductor using 4 switches. We have to find the net average power at the output of the battery for two cases, one where it's positive and the other when it's negative. Below is how the system looks like: Sorry I couldn't do draw it any better in Paint. :( 2. Relevant equations We are given the equation for X (position of the magnet) and L (the inductance of the inductor): X = xmax*sin(wt) L = L0 - L1*sin([pi/2]*[X/xmax]) Where L1 = 0.5*L0 3. The attempt at a solution We need to get the current in order to get the power. I defined two cases for this problem. Case 1 is where switch 1 and 4 are closed and 2 and 3 are open, Case 2 is when switch 2 and 3 are closed and 1 and 4 are open. For case 1 we should get the current going through the inductor in a positive direction and case two in the negative direction. Using VL = L*(di/dt) + i*(dL/dt) where dL/dt = (dL/dx)*(dx/dt) I get the following equation: di/dt = (VDC - i*R - i*(dL/dt))/L By taking the integral of di/dt we can get i. We can use Simulink, so I used that to model the circuit. But I'm having trouble getting a negative and positive power. Unfortunately I don't have Simulink on computer I'm using right now so I can't upload my simulation results but can anyone help me with what the values of L0 and the frequency should be? It seems like when I choose a good L0 and freq value for the positive power I don't get a good signal for the negative power case and vise-versa.