In this assignment you will be modelling a series RLC (Resistor-Inductor- Capaci
ID: 2314479 • Letter: I
Question
In this assignment you will be modelling a series RLC (Resistor-Inductor- Capacitor) circuit. The main goal is to solve the system using programming skills in Matlab and visualize the results. Consider a series RLC circuit (one that has a resistorR, an inductorL, and a capacitor 'C) with a constant driving electro-motive force (emf) E. The current equation for the circuit is di dt Differentiating, we get the second order differential equation, di di 1 The second order differential equation can be approximated by the following difference equations, which calculate current , and change in current y: and epresents the step size between two time instants and n represents each time instant.Explanation / Answer
Main Program(Main_Prog_RLC.m):
clc
close all;
R = input('Enter the value of Resistance:');
L = input('Enter the value of Inductance:');
C = input('Enter the value of Capacitance:');
tinc = input('Enter the change in Time-period:');
n = input('Enter the no. of iterations:');
i= input('Enter the initial value of I:');
j=input('Enter the initial value of J:');
[I,J] = RLC(R,L,C,tinc,n,i,j);
disp('The values of I(n) are:');
disp(I);
disp('The values of J(n) are:');
disp(J);
Function Program(RLC.m):
% Creating a function program "RLC" for calculation of currents and change
% in curretns
function [I,J] = RLC(R,L,C,tinc,n,i,j)
for p=2:n
I(1)=i; % Initial current value from user input
J(1)=j; % Initial change in current value from user input
J(p)=J(p-1)-(tinc/L)*(R*J(p-1)+(1/C)*I(p-1)); % difference equations given in queston
I(p)=I(p-1)+J(p)*tinc; % difference equations given in queston
end