AdvCalc1
.docx
keyboard_arrow_up
School
University of Waterloo *
*We aren’t endorsed by this school
Course
216
Subject
Electrical Engineering
Date
Dec 6, 2023
Type
docx
Pages
11
Uploaded by DrTitaniumSeal63 on coursehero.com
University of Waterloo
Faculty of Engineering
Department of Electrical and Computer Engineering
Hello.
NE 216
Laboratory 4
FALL 2011
Prepared by
Kapur
,
Vamika
UW Student ID Number:
20995888
UW User ID:
v4kapur
@uwaterloo.ca
Prepared by
Gupta
,
Shreeja
UW Student ID Number:
20996288
UW User ID:
s25gupta
@uwaterloo.ca
2A Nanotechnology Engineering
14/11/23
Having watched the presentation, we will go through the following exercise:
4.1-7
Your Solution
In Laboratory 2, you were required to document all aspects of your algorithm.
You were
also required to check all parameters for their types,
etc
.
You must do the same for this laboratory; however, you will only need to provide the
final solution for the Dormand-Prince algorithm; however, you will still be required to
implement and test an implementation of the 4
th
-order Runge Kutta algorithm with the
signature
function [t_out, y_out] = rk4( f, t_rng, y0, n )
Copy and paste your
entire Matlab
function for
dp45
with comments and error
checking here:
function [t_out, y_out] = dp45( f, t_rng, y0, h, eps_abs )
if
~isa(f,
'function_handle'
)
throw(MException(
'MATLAB:invalid_argument'
,
'f is not a function
handle'
));
end
if
~all(size(t_rng) == [1, 2])
throw(MException(
'MATLAB:invalid_argument'
,
't_rng is not a 2-D
row vector'
));
end
if
~isscalar(y0)
throw( MException(
'MATLAB:invalid_argument'
,
'y0 is not
scalar'
));
end
if
~isscalar(h) || (h <= 0)
throw(MException(
'MATLAB:invalid_argument'
,
'h is not positive,
scalar, or both'
));
end
if
~isscalar(eps_abs) || (eps_abs <= 0)
throw( MException(
'MATLAB:invalid_argument'
,
'eps_abs is not
positive, scalar, or both'
));
end
A = [ 0
0
0
0
0
0
0;
1
0
0
0
0
0
0;
1/4
3/4
0
0
0
0
0;
11/9
-14/3
40/9
0
0
0
0;
4843/1458 -3170/243
8056/729
-53/162
0
0
0;
9017/3168
-355/33
46732/5247
49/176 -5103/18656
0
0;
35/384
0
500/1113 125/192 -2187/6784
11/84 0]';
by = [5179/57600 0 7571/16695 393/640 -92097/339200 187/2100 1/40]';
bz = [
35/384
0
500/1113
125/192
-2187/6784
11/84
0]';
c = [0 1/5 3/10 4/5 8/9 1 1]';
K = zeros(1, 7);
% Initialize t_out and y_out
% Initialize our location to k = 1
2
t_out = t_rng(1);
y_out = y0;
k = 1;
while
t_out(k) < t_rng(2)
for
m = 1:7
K(m) = f(t_out(k) + h*c(m), y_out(k) + h*c(m)*K*A(:,m));
end
%end of for loop
y_tmp = y_out(k) + h*K*by;
z_tmp = y_out(k) + h*K*bz;
%error factor
s = ((h.*eps_abs)./(2 * (t_rng(2) - t_rng(1)) * abs(y_tmp -
z_tmp))).^(1/4);
if
s >= 2
y_out(k + 1) = z_tmp;
t_out(k + 1) = t_out(k) + h;
k = k + 1;
h = 2.*h;
else if
s >= 1
y_out(k + 1) = z_tmp;
t_out(k + 1) = t_out(k) + h;
k = k + 1;
else
h = h./2;
end
%end of while loop
%final check
if
t_out(k) + h > t_rng(2)
h = t_rng(2) - t_out(k);
end
end
end
4.8
Testing your Implementation
Warning: All the questions you will do in parts
a
,
b
, and
c
will be repeated with the
Dormand-Prince method in parts
d
,
e
, and
f
, respectively.
Use scripts to reduce your
workload!
Consider using a for loop for parts
c
and
f
.
We are now ready to test your code.
For all questions, use
format long
3
4.8
a
With examples from the presentations, we had:
function [dy] = f4a(t, y)
dy = (y - 1).^2 .* (t - 1).^2;
end
function [y] = y4a_soln( t )
y = (t.^3 - 3*t.^2 + 3*t)./(t.^3 - 3*t.^2 + 3*t + 3);
end
and we approximated the solution with:
[t2a, y2a] = rk4( @f4a, [0, 1], 0, 11 )
plot( t2a, y2a, 'or' )
hold on
[t2a, y2a] = ode45( @f4a, [0, 1], 0 );
plot( t2a, y2a, 'b' )
It’s up to you to make sure your solution matches the output shown in the presentation.
Save the right-hand side of the differential equation
(1)
cos
y
t
t y t
y t
t
y t
as the function
f
4
b
and execute the following:
[t2b, y2b] = rk4( @f4b, [0, 1], 0, 11 )
plot( t4b, y4b, 'or' )
[t2b, y4b] = ode45( @f4b, [0, 1], 0 );
hold on
plot( t4b, y4b, 'b' )
title( 'uwuserid and uwuserid' ) % or title( 'uwuserid' )
4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Suppose a power system consists of two isolated regions: a western region and an eastern region. Five units have been committed to supply 3090 MW as shown below. The two systems are separated by a transmission line that can handle a maximum transfer of 550 MW in either direction.
Calculate the spinning reserve for the overall system and for eachregion.
arrow_forward
Calculate the value of lx using source tranformation theorem.
arrow_forward
I have just started my first Semester (Fall 2021) out of 4 semesters in Master of Applied Science (M.A.S) in Power Engineering at Illinois Institute of Technology. I did not clearly undersand the course enrollment system because I am new to the system, so I ended up enrolling in courses; ECE58-Microgrid Design and Operation, and ECE579-Computer Aided Design of Electrical Machines. It appears ECE582 listed ECE418 (Power System Analysis) as a prerequisite; and ECE539 requires ECE319 (Fundamentals of Power Engineering) and ECE412(Hybrid Electric Vehicle Drives) as prerequisites. Let me hasten to add that I graduated in 2009 in a different academic setup in Africa in Electrical Engineering. So, not only do I have to cover the gap of about 12 year out of classroom, but I have compounded the problem by jumping into advanced courses before enrolling into foundation courses. Unfortunately I can no longer switch courses as the enrollment window has passed. I am only left with one option; to…
arrow_forward
If the values of real power and reactive power is specified for a bus, then it is called as PQ bus.
Select one:
True
False
arrow_forward
Can you provide clear solution? so i can rate!
arrow_forward
Power System Analysis
Please solve the question quickly
arrow_forward
Discuss the smart grid concept and how it leverages advanced technologies to enhance the efficiency and reliability of power systems.
arrow_forward
Humble Reqest To solve this.
subject Power Transmission and Distribution
arrow_forward
I want a solution in less than 30 minutes
Often, the network is referred as an infinite bus when a change in input mechanical power or in field excitation to the unit does not cause an appreciable change in
a.
system frequency or terminal voltage
b.
Total production cost
c.
system frequency and terminal voltage
d.
system frequency alone
arrow_forward
Explain the concept of smart grids and how they utilize advanced technology to enhance the efficiency and reliability of power distribution.
arrow_forward
Elaborate on the concept of a "smart grid" and how it leverages modern technology to improve the efficiency and reliability of power systems.
arrow_forward
In a string of three identical suspension insulator units supporting transmission line conductor.if the self capacitance of each unit is debited as C farads, The capacitance of each connector pin to ground can be taken as 0.1C farad's. If the maximum permissible voltage per unit is given as 20 kva then calculate
A.maximum safe working voltage
B.string efficiency
arrow_forward
Discuss the future trends and technologies in power systems, such as microgrids and energy storage systems.
arrow_forward
Discuss the challenges and solutions related to integrating renewable energy sources, such as solar and wind power, into the existing electrical power grid.
arrow_forward
What is a smart grid, and how does it improve the reliability and efficiency of power systems? Provide real-world examples of smart grid implementations.
arrow_forward
Large-scale Hydroelectric Power Stations usually has a Dam.
Select one:
True
False
arrow_forward
Consider a Pumped storage micro-hydel plant is to be built as a Peak load-plant on above mentioned Nathiya-Galli Water Fall with available head of 39 m and average discharge of 5640 m³/hour from the upper pound. The hydraulic efficiency and electrical efficiency of the plant to be 0.86 & 0.92 respectively.
Analyze the following output from the above Pumped Storage Plant:
a. Hydro-Power and Annual Hydro-energy available
b. Electrical Power and annual electrical energy units that can be generated from the plant.
arrow_forward
4. An aluminum conductor having a cross-sectional area of 1843 MCM is used
to transmit power from a high-voltage dc (HVDC) generating station to a large urban center. If the city is 900 km from the generating station, determine the resistance of the conductor at a temperature of 20oC. (Use 1 ft = 0.3048 m.) *Round off to 4 decimal digits.
arrow_forward
Use DFT method to compute the circular convolution of x(n)={4,4} and h(n)={2, 6}.
arrow_forward
The data for a wind turbine is given below:
Wind speed = 14 meters/sec, Length of blade = 10 meter
Refer to the above wind turbine choose the correct statement
a.
The wind rotor swept area is 40square meters.
b.
The wind rotor swept area is 314 square meters.
c.
The wind rotor swept area is 31.4 square meters.
d.
The wind rotor swept area is 62.4 square meters.
arrow_forward
Over-reliance on renewable energy sources is the main cause of energy crisis.
Select one:
True
False
arrow_forward
Explore the challenges and solutions related to integrating renewable energy sources (e.g., solar and wind) into the existing power grid.
arrow_forward
Explore the concept of smart grids and their potential benefits for power system management and sustainability.
arrow_forward
Since R1=18.10Kohm, R2=67.58Kohm, RC= 1.08Kohm, RE= 3.23Kohm, VCC=14.00V, Beta=241.00 in the circuit given in the figure, calculate the IC current by doing a complete analysis. When performing your operations, 2 steps will be taken after the point. choose the closest one from the stylish ones according to the +/-10% margin of error. There is only 1 correct answer to the question.
arrow_forward
Explore the concept of smart grids and their potential benefits to power distribution.
arrow_forward
If for example communication power is often normalized by assuming R to be a unity in Ohms, although R may be another value in actual circuit. If the actual value of the power is required, it is worked out by de-normalization of the normalized value. Use the above to determine the instantaneous power, given time interval to be (-4,4) and x = 2 + t2.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Power System Analysis and Design (MindTap Course ...
Electrical Engineering
ISBN:9781305632134
Author:J. Duncan Glover, Thomas Overbye, Mulukutla S. Sarma
Publisher:Cengage Learning
Related Questions
- Suppose a power system consists of two isolated regions: a western region and an eastern region. Five units have been committed to supply 3090 MW as shown below. The two systems are separated by a transmission line that can handle a maximum transfer of 550 MW in either direction. Calculate the spinning reserve for the overall system and for eachregion.arrow_forwardCalculate the value of lx using source tranformation theorem.arrow_forwardI have just started my first Semester (Fall 2021) out of 4 semesters in Master of Applied Science (M.A.S) in Power Engineering at Illinois Institute of Technology. I did not clearly undersand the course enrollment system because I am new to the system, so I ended up enrolling in courses; ECE58-Microgrid Design and Operation, and ECE579-Computer Aided Design of Electrical Machines. It appears ECE582 listed ECE418 (Power System Analysis) as a prerequisite; and ECE539 requires ECE319 (Fundamentals of Power Engineering) and ECE412(Hybrid Electric Vehicle Drives) as prerequisites. Let me hasten to add that I graduated in 2009 in a different academic setup in Africa in Electrical Engineering. So, not only do I have to cover the gap of about 12 year out of classroom, but I have compounded the problem by jumping into advanced courses before enrolling into foundation courses. Unfortunately I can no longer switch courses as the enrollment window has passed. I am only left with one option; to…arrow_forward
- Discuss the smart grid concept and how it leverages advanced technologies to enhance the efficiency and reliability of power systems.arrow_forwardHumble Reqest To solve this. subject Power Transmission and Distributionarrow_forwardI want a solution in less than 30 minutes Often, the network is referred as an infinite bus when a change in input mechanical power or in field excitation to the unit does not cause an appreciable change in a. system frequency or terminal voltage b. Total production cost c. system frequency and terminal voltage d. system frequency alonearrow_forward
- Explain the concept of smart grids and how they utilize advanced technology to enhance the efficiency and reliability of power distribution.arrow_forwardElaborate on the concept of a "smart grid" and how it leverages modern technology to improve the efficiency and reliability of power systems.arrow_forwardIn a string of three identical suspension insulator units supporting transmission line conductor.if the self capacitance of each unit is debited as C farads, The capacitance of each connector pin to ground can be taken as 0.1C farad's. If the maximum permissible voltage per unit is given as 20 kva then calculate A.maximum safe working voltage B.string efficiencyarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Power System Analysis and Design (MindTap Course ...Electrical EngineeringISBN:9781305632134Author:J. Duncan Glover, Thomas Overbye, Mulukutla S. SarmaPublisher:Cengage Learning
Power System Analysis and Design (MindTap Course ...
Electrical Engineering
ISBN:9781305632134
Author:J. Duncan Glover, Thomas Overbye, Mulukutla S. Sarma
Publisher:Cengage Learning