This project consists of three separate programming problems. 1. (30 pts) Consid
ID: 3625419 • Letter: T
Question
This project consists of three separate programming problems.
1. (30 pts) Consider the following tuning circuit connected to an antenna, where is a variable capacitor whose capacitance ranges from Cmin to Cmax.
The tuning circuit selects the frequency, f =(2 x )/(L x C). To design this circuit for a given frequency, take C = (Cmin x Cmax) and calculate the required inductance, L, from f and C. Now the circuit can be tuned to any frequency in the range fmin = (2 x )/(L x Cmin) to fmax = (2 x )/(L x Cmax).
Write a program to design a tuning circuit for a given frequency, using a variable capacitor with given values for CMIN and Cmax. (A typical input is f = 16.7 MHz, Cmin = 14 picoFarads, and Cmax = 365 picoFards.) The program should print the required inductance value and the range of frequencies to which the circuit can be tuned for the given inputs.
You must use seperate functions to get input values (inputs should be in MHz for the frequency and picoFarads for the capacitance), calculate the inductance, ca.culate the minimum and maximum frequency values, and to output the results.
Question:
Please I don't even know what functions to write, but I know my output is inductance, but I do not know what function to write and how I can relate it to calculate minimum and maximum output?.
Explanation / Answer
please rate - thanks
you'll have to check the formulas, but at least this will get you started
#include <stdio.h>
#include <conio.h>
#include <math.h>
double getf();
double getmin();
double getmax();
double induct(double,double);
double calf(double,double);
double calc(double,double);
int main()
{double f,cmin,cmax,L,ind,c,fmin,fmax;
f=getf();
cmin=getmin();
cmax=getmax();
c=calc(cmin,cmax);
L=induct(f,c);
fmin=calf(L,cmin);
fmax=calf(L,cmax);
printf("Inductance= %.2f ",L);
printf("Minimum frequency=%.2f ",fmin);
printf("Maximum frequency=%.2f ",fmax);
getch();
return 0;
}
double getf()
{double in;
printf("Enter frequency in MHz: ");
scanf("%lf",&in);
return in;
}
double getmin()
{double in;
printf("Enter minimum capacitance in picoFarads: ");
scanf("%lf",&in);
return in;
}
double getmax()
{double in;
printf("Enter maximum capacitance in picoFarads: ");
scanf("%lf",&in);
return in;
}
double induct(double f,double c)
{return (2.*(22./7.))/(f*sqrt(c));
}
double calf(double l,double c)
{return (2.*(22./7.))/(sqrt(l*c));
}
double calc(double min,double max)
{return sqrt(min*max);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.