Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Application: Nuclear Plant Data Analysis | Learning Through Applications
Matlab Basics
course content

Course Content

Matlab Basics

Matlab Basics

1. Basic Syntax and Coding with a Text Editor
2. Coding Foundations
3. Learning Through Applications
4. Visualizations
5. Recursion and Matrix Multiplication

book
Application: Nuclear Plant Data Analysis

Apply what you've learned to analyze power wastewater generation data coming from three nuclear power plants, and pick up a bunch of important details along the way!

Note
Note

The standard deviation of a random variable XX is defined mathematically as

Οƒ=E[(Xβˆ’ΞΌ)2]=E[X2]βˆ’ΞΌ2\sigma = \sqrt{E[(X - \mu)^2]} = \sqrt {E[X^2] - \mu^2}

where EE denotes the expectation value of its argument and ΞΌ=E[X]\mu = E[X]. This assumes we know the probability distribution of XX.

Alternatively, when we are dealing with a set of observations {x1,x2,x3,...,xn}\{x_1, x_2, x_3, ..., x_n\} of a random variable with a presumed (but unknown) distribution, we can estimate the standard deviation with this formula:

Οƒ=1nβˆ‘xi2βˆ’1nβˆ‘xi=[mean(xi2)βˆ’mean(xi)]0.5\sigma = \sqrt{\frac1n \sum x_i^2 - \frac1n \sum x_i} = [mean(x_i^2) - mean(x_i)]^{0.5}

which is the formula coded in the video (note that mean(xi)mean(x_i) was calculated on the line preceding the standard deviation calculation: so we reference this instead of recalculating for efficiency). A better, unbiased estimator would divide by nβˆ’1n - 1 instead of nn. We ignore this detail here for simplicity, however it could be easily fixed in the code by multiplying the result by:

nnβˆ’1\sqrt \frac{n}{n-1}

Task

1. Understand the Goals
expand arrow

Begin by watching the video to grasp the program's objectives. Use the video as a source of inspiration and guidance for your approach.

2. Identify the Excel File Location
expand arrow

Locate the file containing the data you'll be working with.

3. Import the Excel Data
expand arrow

Use appropriate libraries or methods to read the data from the Excel file.

4. Analyze and Split the Data
expand arrow
  • Divide the data based on the plant location;
  • Compute descriptive statistics (minimum, maximum, mean, and standard deviation) for each location, focusing on both power and wastewater data across the entire year.
5. Export the Results
expand arrow

Save your results, including the calculated statistics, into an Excel file for further use.

6. Iterate and Improve
expand arrow
  • Attempt to design your program in a modular and structured way;
  • If you encounter issues, rely more on hints or code shown in the video;
  • As a last resort, replicate the code in the video as closely as possible.
7. Quality Control
expand arrow

Validate your program's output by comparing it with the results shown in the video to ensure accuracy and reliability.

However, fair warning: it's better to practice coding your own versions now while there's a safety net, as we'll start getting less explicit with the code we show beginning in the next chapter.

The video also highlights several convenient checkpoints where you can check your programming as you go along by either:

  • Unsilencing variables (by removing the semicolon);
  • Having your function temporarily output the variable in question.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

course content

Course Content

Matlab Basics

Matlab Basics

1. Basic Syntax and Coding with a Text Editor
2. Coding Foundations
3. Learning Through Applications
4. Visualizations
5. Recursion and Matrix Multiplication

book
Application: Nuclear Plant Data Analysis

Apply what you've learned to analyze power wastewater generation data coming from three nuclear power plants, and pick up a bunch of important details along the way!

Note
Note

The standard deviation of a random variable XX is defined mathematically as

Οƒ=E[(Xβˆ’ΞΌ)2]=E[X2]βˆ’ΞΌ2\sigma = \sqrt{E[(X - \mu)^2]} = \sqrt {E[X^2] - \mu^2}

where EE denotes the expectation value of its argument and ΞΌ=E[X]\mu = E[X]. This assumes we know the probability distribution of XX.

Alternatively, when we are dealing with a set of observations {x1,x2,x3,...,xn}\{x_1, x_2, x_3, ..., x_n\} of a random variable with a presumed (but unknown) distribution, we can estimate the standard deviation with this formula:

Οƒ=1nβˆ‘xi2βˆ’1nβˆ‘xi=[mean(xi2)βˆ’mean(xi)]0.5\sigma = \sqrt{\frac1n \sum x_i^2 - \frac1n \sum x_i} = [mean(x_i^2) - mean(x_i)]^{0.5}

which is the formula coded in the video (note that mean(xi)mean(x_i) was calculated on the line preceding the standard deviation calculation: so we reference this instead of recalculating for efficiency). A better, unbiased estimator would divide by nβˆ’1n - 1 instead of nn. We ignore this detail here for simplicity, however it could be easily fixed in the code by multiplying the result by:

nnβˆ’1\sqrt \frac{n}{n-1}

Task

1. Understand the Goals
expand arrow

Begin by watching the video to grasp the program's objectives. Use the video as a source of inspiration and guidance for your approach.

2. Identify the Excel File Location
expand arrow

Locate the file containing the data you'll be working with.

3. Import the Excel Data
expand arrow

Use appropriate libraries or methods to read the data from the Excel file.

4. Analyze and Split the Data
expand arrow
  • Divide the data based on the plant location;
  • Compute descriptive statistics (minimum, maximum, mean, and standard deviation) for each location, focusing on both power and wastewater data across the entire year.
5. Export the Results
expand arrow

Save your results, including the calculated statistics, into an Excel file for further use.

6. Iterate and Improve
expand arrow
  • Attempt to design your program in a modular and structured way;
  • If you encounter issues, rely more on hints or code shown in the video;
  • As a last resort, replicate the code in the video as closely as possible.
7. Quality Control
expand arrow

Validate your program's output by comparing it with the results shown in the video to ensure accuracy and reliability.

However, fair warning: it's better to practice coding your own versions now while there's a safety net, as we'll start getting less explicit with the code we show beginning in the next chapter.

The video also highlights several convenient checkpoints where you can check your programming as you go along by either:

  • Unsilencing variables (by removing the semicolon);
  • Having your function temporarily output the variable in question.
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 1
some-alt