You write a program where boss can enter/input the number of kilotons and the distance to derive the particle concentration count.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter3: Assignment, Formatting, And Interactive Input
Section: Chapter Questions
Problem 6PP: (Heat transfer) The formula developed in Exercise 5 can be used to determine the cooling time, t,...
icon
Related questions
Question

This is a matlab programing question:

I've attached two images, one is the prompt and the other is my work.

I'm stuck trying to plot the function as it goes through the for loop as the plot keeps coming up blank.  Any help would be great. 

You are located 50 miles away from the blast area with
concentration of 1.2 x 10° radioactive particles growing from
a 1 mile to a 50 mile radius. The area is increasing two miles in
radius every hour.
Show a graphic (multiple PLOT) of the decreasing
concentration hour by hour (plot concentration vs time) until it
reaches your location. Are you in a safe location (see below)?
Use this formula for the different megaton blasts from 1 to 10
kilotons with radioactive particles being generated by the
formula = a*1.2 x 108 (Osas10) where a = kilotons of blast.
You write a program where boss can enter/input the number
of kilotons and the distance to derive the particle
concentration count.
The output states:
President Jones, for your
your particle concentration is
kiloton blast at__ miles,
and you are in the
zone.
The output states the "CONCENTRATION COUNT" and:
If it's above 10°, it outputs "DANGER ZONE"
If its above 105 it outputs "WARNING ZONE"
If its below 105 it outputs " SAFETY ZONE"
Transcribed Image Text:You are located 50 miles away from the blast area with concentration of 1.2 x 10° radioactive particles growing from a 1 mile to a 50 mile radius. The area is increasing two miles in radius every hour. Show a graphic (multiple PLOT) of the decreasing concentration hour by hour (plot concentration vs time) until it reaches your location. Are you in a safe location (see below)? Use this formula for the different megaton blasts from 1 to 10 kilotons with radioactive particles being generated by the formula = a*1.2 x 108 (Osas10) where a = kilotons of blast. You write a program where boss can enter/input the number of kilotons and the distance to derive the particle concentration count. The output states: President Jones, for your your particle concentration is kiloton blast at__ miles, and you are in the zone. The output states the "CONCENTRATION COUNT" and: If it's above 10°, it outputs "DANGER ZONE" If its above 105 it outputs "WARNING ZONE" If its below 105 it outputs " SAFETY ZONE"
%Tsar Bomba Fall out Plot AUTOMATION FOR BOSSMAN
format shortE
kilotons = input ("what is the size (kilotons) of the blast? "); %Input for blast size
radius = input("At what radius (miles) are you checking? ");
concentration = (kilotons
if (concentration < 18*5)
zone = 'SAFTEY ZONE';
else if (concentration >= 10^5 && concentration < 10*6)
%sets the format
%Input for radius size
%Calculates concentration at inputed blast size, and radius
%saftey zone
* (1.2*1e*8))/(pi*radius^2);
Awarning Zone
zone = 'WARNING ZONE';
else if (concentration >= 10*6)
zone = 'DANGER ZONE';
%Danger zone
end
end
end
%Below is the output for the Boss
output = ['President Jones, for your ', num2str(kilotons), ' kiloton blast at ', num2str(radius), ' miles, your particle concentration is ', num2str
disp(output)
President Jones, for your 18 kiloton blast at 50 miles, your particle concentration is 152788.7454 and you are in the WARNING ZONE zone.
x108
Decreasing Concentration By Hour
%Below is the concerntration vs time plot
figure(1);
for i = 1:2:50
con = (kilotons * (1.2*10*8))/(pi*i^2);
plot(i,con)
ylabel('Concentration'), xlabel('Time (hr)')
title('Decreasing Concentration By Hour')
grid on
hold on
3.5
%for loop to run for 2miles of radius, or 1 hr of time
%Formula for calculating the concentration at each interval
%plots hours/radius against concentration
KLabels plot
3
2
%supposed to hold each plot as the for loop moves through its sequence
end
hold off
1.5
1F
0.5
10
20
30
40
50
Time (hr)
Concentration
Transcribed Image Text:%Tsar Bomba Fall out Plot AUTOMATION FOR BOSSMAN format shortE kilotons = input ("what is the size (kilotons) of the blast? "); %Input for blast size radius = input("At what radius (miles) are you checking? "); concentration = (kilotons if (concentration < 18*5) zone = 'SAFTEY ZONE'; else if (concentration >= 10^5 && concentration < 10*6) %sets the format %Input for radius size %Calculates concentration at inputed blast size, and radius %saftey zone * (1.2*1e*8))/(pi*radius^2); Awarning Zone zone = 'WARNING ZONE'; else if (concentration >= 10*6) zone = 'DANGER ZONE'; %Danger zone end end end %Below is the output for the Boss output = ['President Jones, for your ', num2str(kilotons), ' kiloton blast at ', num2str(radius), ' miles, your particle concentration is ', num2str disp(output) President Jones, for your 18 kiloton blast at 50 miles, your particle concentration is 152788.7454 and you are in the WARNING ZONE zone. x108 Decreasing Concentration By Hour %Below is the concerntration vs time plot figure(1); for i = 1:2:50 con = (kilotons * (1.2*10*8))/(pi*i^2); plot(i,con) ylabel('Concentration'), xlabel('Time (hr)') title('Decreasing Concentration By Hour') grid on hold on 3.5 %for loop to run for 2miles of radius, or 1 hr of time %Formula for calculating the concentration at each interval %plots hours/radius against concentration KLabels plot 3 2 %supposed to hold each plot as the for loop moves through its sequence end hold off 1.5 1F 0.5 10 20 30 40 50 Time (hr) Concentration
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr