need to write a script from scratch in matlab and i have no idea how to even sta
ID: 1880909 • Letter: N
Question
need to write a script from scratch in matlab and i have no idea how to even start this..please help and if you could write notes so i could better understand. thanks
Capacitor Problem sidwer Part 2 Write a Matlab Script that Plots Value of the Current in the RC Circuit as a function of time for user defined input Allow for User input for R (Ohms) and C (Farads) . A constant voltage supply- fixed at 5 Volts . Calculate the Current as a function of time until the "steady state" behavior is reached. . Plot the current in the circait and have the axes properly labeled and the title of the plot reflect the user input data Publish your output in PDF format-follow instructions within lecture notes for publishing correctly Write your own program from the "name convention" and "program title section all the way through to the plot and axes labelsExplanation / Answer
In MAtlab, we need to do a Plot of the signal based on given values of variables.
In our case, we need to Plot Current (I) against time (t) in an RC circuit. Question has already giving startement as
I = Io *(e-t/RC),
Further, it is also stated in this circuit Io = V/R
I = (V/R) *(e-t/RC)
Now, we will assume vales of R and C so plot a sample trend in Matlab.
R = 10000
C = 10 F
V = 5 V (As per question)
We will have time constant RC = 10000 * 10 * (10-6) = 0.1 second
Based on above data we can write following program in MATLAB:
% Define the voltage
V = 5;
% Define the Resistor
R = 10e3;
% Define the capacitor
C = 10e-6;
% Define the time range where we want to plot the current
t = 0 : 0.005 : 0.50;
% Define the time constant
tau = R * C;
% Expression of Current
I = (V/R) * ( 1 – exp(-t/tau));
% Plot the responses
plot(t, I, 'b-')
grid on
title('Transient Current in RC circuit')
xlabel('Time (s)')
ylabel('Current in RC circuit (I)')
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.