Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem 2: Monitoring System for a Pressurized Water Reactor (PWR) Objective: De

ID: 3869685 • Letter: P

Question

Problem 2: Monitoring System for a Pressurized Water Reactor (PWR) Objective: Develop the conditional logic to determine the state of a Pressurized Water Reactor (PWR) for generating electrical power from nuclear energy. Inputs: Temperature(C) and Pressure (atm) State of PWR: The table below shows how the state of the PWR is determined from the two inputs. If the two inputs dont result in the same state, the higher state should be chosen. For example, a reactor with a temperature &pressure; reading of 350 C& 0.092 atm., respectively, would be categorized as "very severe" for the temperature reading and "severe" for the pressure reading. The resulting state should be "very severe" for the reactor State Temperature C Pressure Melt Down Press>0.100 095 Press s0.10 345 CT 45 0090

Explanation / Answer


% Take user input for temperature and pressure respectively
prompt = 'What is the original value? ';
temperature = input(prompt);
prompt = 'What is the pressure value? ';
pressure = input(prompt);

%temperature = 326;
%pressure = 0.0093;

% 4 - Melt down, 3- very severe, 2-severe, 1-moderate, 0- Normal
currentState = 0;
%check the pwr state condition for temperature
if temperature > 355
% if condition is true then print the following
currentState = 4;
elseif( temperature > 345 && temperature<=355 )
% if else if condition is true
currentState = 3;
elseif( temperature > 335 && temperature<=345 )
% if else if condition is true
currentState = 2;
elseif( temperature > 325 && temperature<=335 )
% if else if condition is true
currentState = 1;
elseif temperature <= 325
% if else if condition is true
currentState = 0;

end

currentState = 0;
%check the pwr state condition for pressure and pick max state b/w pressure and temperature
if pressure > 355 && currentState < 4
% if condition is true then print the following
currentState = 4;
elseif( pressure > 345 && pressure<=355 && currentState < 3)
% if else if condition is true
currentState = 3;
elseif( pressure > 335 && pressure<=345 && currentState < 2)
% if else if condition is true
currentState = 2;
elseif( pressure > 325 && pressure<=335 && currentState < 1)
% if else if condition is true
currentState = 1;
elseif pressure <= 325
% if else if condition is true
currentState = 0;

end

if currentState == 4
% if condition is true then print the following
fprintf('The state of Pressurized Water Reactor is: Melt Down ');
elseif(currentState == 3)
% if else if condition is true
fprintf('The state of Pressurized Water Reactor is: Very Severe ');
elseif(currentState == 2)
% if else if condition is true
fprintf('The state of Pressurized Water Reactor is: Severe ');
elseif(currentState == 1)
% if else if condition is true
fprintf('The state of Pressurized Water Reactor is: Moderate ');
elseif(currentState == 0)
% if else if condition is true
fprintf('The state of Pressurized Water Reactor is: Normal ');

end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote