Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer this matlab problem statement and work through each point of the problem. Please work this out in MATLAB only! Thanks! Problem statement: The RC

answer this matlab problem statement and work through each point of the problem. Please work this out in MATLAB only! Thanks!
Problem statement:
The RC circuit shown is composed of a resistor, a capacitor, and a DC voltage source:
where V0=12V,R=3800, and C=400010-6F. The voltage on the capacitor VC
gradually increases when the switch is closed. Theoretically, VC as a function of time is given by:
VC=V0[1-e-tRC]
Goal: Create a plot of voltage VC vs. time t.
Write a function program the following features (template provided):
(a) Name the function voltageTheo.
(b) Name the input argument to the function as time and the output argument as voltage.
(c) Assign the values for V0,R, and C to the variables V0, R, and C, respectively.
(d) Using the equation given above, the function calculates the theoretical voltage VC(voltage)
for each value of time t(time). Use element-wise operations as needed.
Write a script program that performs the following (template provided):
(a) Create a row vector with 200 equally spaced values for time from 0 to 50. Assign the vector
to the variable t_theo.
(b) Call the function voltageTheo with t-theo as the input and assign the output to V-theo.
(c) Create a plot of voltage VC vs. time t for the theoretical data (as a solid red line).
(d) Label the horizontal axis as "Time, t(s)" and the vertical axis as "Voltage, V_C (V)".
(e) Add a title to the plot that reads "Plot of the capacitor voltage for an RC circuit."
Submit:
Each of your programs (function and script) as separate m-files. Do not submit the plot.
A single docx-file containing both programs (function and script). Do not submit the plot.
Extra-credit (+5%): Use MATLAB's "Publish" feature to create a PDF file.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions