Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

It needs to be done in c pgoramming ,its my final please help. The present quiz

ID: 2083538 • Letter: I

Question

It needs to be done in c pgoramming ,its my final please help.

The present quiz is concerned with making calculations on the circuit shown below which consists of an ideal battery with user-supplied terminal voltage V_oc and a user-supplied number m of branches of resistors which are connected in series within each branch, with these branches connected in parallel across each other, and with each branch consisting of a variable user-supplied number n of resistors and user-supplied values of the resistors. Design two programs in C, one using the method of call by value and the other using the method of call by reference, which will perform the following computations: the equivalent resistance R_eq seen by the battery, and the one-dimensional array whose elements are the currents l_0, I_1, ellipsis I_m-1 in the m branches. SAMPLE OUTPUT: For sample output, use the following values for the circuit elements: m = 3 (three resistor branches) R[0][0] = 10.0, R[0][1] = 14.5, R[0][2] = 25.5, R[0][3] = 50.0 (n_0 = 4, i.e., 4 resistors) R[1][0] = 20.0, R[1][1] = 50.5, R[1][2] = 29.5, (n_1 = 3, i.e., 3 resistors) R[2][0] = 15.4, R[2][1] = 34.6 (n_2 = 2, i.e., 2 resistors) V_0 = 25V All resistor values in ohms

Explanation / Answer


float Current(float *BranchRes, float Voltage)
{
unsigned char i,j;
float BranchCurrent[4];
for(i=0;i<4;i++) BranchCurrent[i]=0;

for(i=0;i<4;i++)
{
BranchCurrent[i]=Voltage/BranchRes[i]; //Computation of Branch Currents
}
}

float ComputeEqRes(float *R)
{
unsigned char i,j;
float TotalSeriesRes[4], temp=0, LCM=1;
float InverseVal=0;
for(i=0;i<4;i++) TotalSeriesRes[i]=0;
  
for(i=0;i<4;i++)
{
temp=0;
for(j=0;j<4;j++)
{
temp = temp + R[i,j]; //Series Resistance Summingup
}
TotalSeriesRes[i]=(1/temp); //Storing and summing of Rows wise series resistance and taking inverse (1/R1 + 1/R2 + ..
InverseVal = InverseVal + TotalSeriesRes[i];
}
EqRes = 1/Inverseval;
return(EqRes);
}

void main(void)
{
unsigned char r,c;
float Res[4][4];
float Eq_Res=0;
  
for(r=0;r<4;r++)
{
for(c=0;c<4;c++)
{
Res[r][c]=0;
}
}   

Res[0][0] = 10.0; Rs[0][1] = 14.5; Res[0][2] = 25.5; Res[0][3] = 50;
Res[1][0] = 20.0; Rs[1][1] = 50.5; Res[1][2] = 29.5;   
Res[2][0] = 15.4; Rs[2][1] = 34.6;
  
Eq_Res = ComputeEq_Res(&Res);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote