Project 2: Frequency Response of Series RLC Circuit
Overview

The purpose of this project is to give you some experience compute the fundamental quality of a series RLC circuit and learning how to use Visual Studio 8 to write an user interface.

Step

user-interface (1).jpg

The top figure shows the user interface for this project. You can get the skeleton of the code.

  • You need to write the computation code of I, Vo, and Z for a specific frequency in CalcAndDraw.cpp which contain the following codes:

//****************************************************************************
//
// * Calculate the current, voltage and impedance for a RLC circuit at specific frequncy
//============================================================================
void Calculate(double R, double L, double C, double f, 
               double& I, double& Vo, double& Z)
//============================================================================
{
        // TODO
        I = Vo = Z = 0;
}

  • You also need to write the frequency response of I, Vo, and Z in CalcAndDraw.cpp which contain the following codes

//****************************************************************************
//
// * Compute the current, voltage and impedance frequency response
//   nSamplePerLogUnit is the number of samples in each unit
//   e.g. nSampleperLogUnit = 6 means you need have 6 uniform space computation 
//   between log1 and log10
//============================================================================
void FequencyResponse(double R, double L, double C, int nSamplePerLogUnit, 
               vector<double>& f_res, vector<double>& I_res, vector<double>& Vo_res,
               vector<double>& Z_res)
//============================================================================
{

}

How will we grade it?

You will send a rar files containing only CalcAndDraw.cpp and WheatstoneBridge.exe to TA(何柏輝). We will grade your code accordingly and check whether you have copied others' code.