I need help on how to write a program that will automatically adjust circuit resistance until the maximum power is delivered to the load. The circuit will consists of a programmable power supply, a variable resistor, a fixed resistor, and a programmable load resistor. The user will enter the value of the programmable power supply and the value of the programmable load. The program must automatically adjust the variable resistor R2 until the maximum power is transferred. R2 is a 0 to 10k ohm potentiometer that is controlled by the program. The programmable power supply has a range of 1 to 15 VDC and is accurate to 0.1 increments. The programmable load has a range of 100 ohm to 5k ohm and is accurate to 1 ohm. Values that are not within range will damage the equipment and cannot be accepted. After valid values are entered, the program will automatically adjust R2 until the power delivered to RL is at the maximum value. The program must output these values until the maximum power transferred: R2, RL, PR2, and PRL. When the maximum power is obtained, the following message must be provided. Maximum power transfer to RL is xxx.x P Watts. (X numbers, P metric prefix)


I doubt that you'll get what you want just by asking. We help people who want or need to program in C, and are able and willing to work.

If you want help, you'll need to get cracking, and post some work up. Ask specific questions about whatever has you stumped.

If you know your circuit equations (and I'm sure you do), this is not such a big problem. Your program can solve it like you would with paper and pencil, basically.