Goal: Develop a program that will automatically adjust a variable resistor until
ID: 3837325 • Letter: G
Question
Goal: Develop a program that will automatically adjust a variable resistor until the maximum power is transferred to a load resistor.
Purpose: For this project, you will create a prototype of a circuit designed to transfer the maximum power to a load. The program will receive a keyboard input representing the value of the power supply (VCC) and the size of the load resistor (RL). The program will simulate driving a motor controlled variable resistor (Rint) by incrementally changing the value of the variable resistor.
Requirements: Analyze the following program requirements. -You are designing a circuit that will automatically adjust circuit resistance until the maximum power is delivered to the load. -The circuit consists of a programmable power supply (VCC), a variable internal resistor (Rint), and a programmable load resistor (RL). Examine the schematic:
-The user will enter the value of the VCC and the value of Rint. The program must automatically adjust RL until the maximum power is transferred. RL is a 100 to 10k ohm potentiometer that is controlled by the program.
-The Programmable Power Supply has a range of 1 to 15 VDC. Rint has a range of 200 Ohms to 5 kOhms 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 RL as follows: --The beginning value for RL will be 100 ohms below the value of Rint --RL will be incremented 1 ohm at a time and the power dissipated by both Rint and RL will be calculated at each increment of RL. --The final value of RL will be 100 ohms above Rint
-The program will then use the calculated values to determine the value of RL that delivers the maximum power to RL.
-The program must output the calculated values in descending order starting with the point of maximum power transfer to RL as well as printing separately the maximum power delivered to RL.
-The output above will also be written to a file with the filename “results.txt”
Program requirements:
1. Programmable Power Supply (VCC)
a. Valid output range is 1 to 15VDC.
b. Valid voltages are in increments of .1V.
2. Programmable Internal Resistance (Rint) a. Valid values are 200 Ohms to 5kOhms b. Valid resistance increments are 1 ohm. 3. Program Input
a. The program must not allow illegal input values. b. The program must either be tuning, producing output, or waiting for new power and load values with the following message. Input request: “New Power Supply Voltage: “ 4. Program Output a. The output must have the following structures. Output: “RL Rint Power Power” “ Rint RL” “100 1000 .008 .08” b. The final output message must look like the following: Maximum power transferred to RL is 99.1 m Watts. c. Invalid inputs must have corresponding messages that advise the user to provide valid inputs.
5. Program Structure: The program must use at least 1 function prototype.
Explanation / Answer
The below code satisfy the given requirement as follows:-
----------------------------------------------------------------------------------
#include <stdio.h>
main()
{
int V;
float Rint,RL,p;
printf("Enter a valid voltage range between 1 to 15VDC ");
scanf("%d", &V);
printf("Enter a valid Internal Resistance (Rint) range between 100 to 10k ohm in Kilo ohms ");
scanf("%f", &Rint);
if(V>1 && V<15)
{
if(Rint>0.1 && Rint<10000)
{
RL=Rint+100;
p=CalPow(V,Rint,RL);
printf("Maximum power transferred to RL is %f"&p);
}
}
else
{
printf("Enterd Values are invalid in the range");
}
}
float CalPow(int V,float Rint,float RL)
{
float i,p;
for( i = Rint; i< RL; i = i + 1 )
{
p=(V^2)/i;
printf("power disipated for Voltage %d , Internal Resistance Rint %f and RL %f is %f",&V,&Rint,&i,&p);
}
return p;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.