Assignment 01 Summer2023
Assignment 01 Summer2023
Assignment #1
1. Approximate the following integral employing five rectangles, as shown in the figure. Use
Matlab to perform all calculations and include it in you solution.
2. Use Matlab to evaluate the following expressions (employ the highest accuracy available):
a.
b.
c.
Employ Matlab to evaluate the above summation (employ format long) for:
a. m=10
b. m=100
c. Calculate the true error (2/6 – approximate_value) for each case.
4. Use Matlab to assign values to the variables as follows: V=12, R=50, L=5 and C=10-4. The
following function is the solution of the capacitor voltage drop in a series RLC electric
circuit.
a. Evaluate the function v for t=0.1 and t=0.5 (employ format short).
b. Plot v vs. t, from t=0 to 0.7 employing the plot command.
c. Add a grid, x-axis title ‘t’ and y-axis title ‘v(t)’ .
Name your function series_pi. Save the sum in variable S_sum. Your function should employ
fprintf commands to display the value of m and S_sum (use 3 decimal places for S_sum). The two-
line output should look like this:
m = ……
S_sum = ………