# Matlab report help please (Finite Difference Method)

• t0mm02
In summary, according to the conversation, the student needs to submit a Matlab assignment to show the heat transfer on a plate. However, they are struggling to write the report due to not understanding some details about the code they need to use. They need to summarize their code and show how it works.
t0mm02
Homework Statement
2D Diffusion Equation by using Explicit Finite Difference Method
Relevant Equations
none
We have to submit a Matlab (my worst module) assignment to show the heat transfer on a plate. However, I have the 2 codes almost done but I am struggling to write the report. To calculate the temperature on a 2D aluminum plate we need to use the Explicit Finite Difference Method. The problem comes now when I read the task description, which is the following one:
*Table of contents
*Introduction to the problem under consideration
*The constitutive equation of the problem
*Description of the numerical method chosen to discretize the constitutive equation
*The initial and boundary conditions implemented
*Details of your Finite Difference Method
*Analysis of the code... (I understand everything else from here)

This is what I don't understand and what I don't know if I have done properly:
**The constitutive equation of the problem (On here I explained TAYLOR SERIES and the HEAT TRANSFER)
**Description of the numerical method chosen to discretize the constitutive equation (On here I have explained the Explicit Finite Difference Method and numerical differentiation)
***Details of your Finite Difference Method (I don't even know what I have to do on here)

Why not ask your teacher if your answers are acceptable or does he/she want more detail...

It’s impossible for us to know what is acceptable or not for your case.

From your description, it seems you need to summarize your code:

- define the problem you’re trying to solve
- say what differential equations describe the system
- say what initial conditions were imposed on the system
- say what algorithm you chose and why

and then show your code and some charts that show the numerical solution.

jedishrfu said:
Why not ask your teacher if your answers are acceptable or does he/she want more detail...

It’s impossible for us to know what is acceptable or not for your case.

From your description, it seems you need to summarize your code:

- define the problem you’re trying to solve
- say what differential equations describe the system
- say what initial conditions were imposed on the system
- say what algorithm you chose and why

and then show your code and some charts that show the numerical solution.
Because it is weekend and I don't think he will be available until Tuesday.

Well, make the best of it, write down what you think he wants to see and then go talk to him. If I were your instructor that's what I would expect from all of my students.

I took a course on numerical simulations using Java and my prof wanted to see exactly what I wrote. The funny part about my prof was his inexperience with Java as the course was originally taught using Visual Basic and then a new version of the book appeared that used Java. The course started with 4 students and within a few days was left with 2 students. We knew Java well and taught him while he taught us the methodologies and the gotchas of choosing the best integrating methods for our equations.

t0mm02 said:
**The constitutive equation of the problem
I would say the essential point is that, as there are no heat sources in the plate, then at steady state, the heat flowing into any bounded region exactly equals the heat flowing out of that region, or Div D = 0 (ie the divergence is zero).

Hence the temperature at any grid point is the average of the temperatures at the adjacent grid points, which is the finite difference method.

Does that help?

A quick web search with finite difference heat flow found lots. I only scanned Two-Dimensional Conduction: Finite-Difference Equations and Solutions but it looks reasonable at first glance. It shows how the 1-D steady-state heat conduction equation (with internal heat generation) is approximated by finite differences, how the 2-D steady-state heat conduction equation follows and how, if there is no internal heat generation, then a node's temperature is the average of the surrounding nodes.

Reading this tutorial may also help: Explicit Finite Difference Method - A MATLAB Implementation. Again, I only skimmed it.

You may think finite difference models are a bit simplistic for real world applications - I did when I first came across them. Many weather forecasters, including the UK Met Office with its Unified Model, use finite difference methods.
ENDGame is the current operational dynamical core for the Unified Model and is based on a semi-implicit semi-Lagrangian discretization of the governing equations.

ENDGame is a finite-difference model discretized on a latitude-longitude grid and is based on the fully compressible, nonhydrostatic Euler equations.
Their computer has over 240,000 cores and a peak performance of 8,000 million million calculations per second. It takes hours to run a forecast.

Last edited:
jedishrfu
Not sure if this helps exactly, but if it's specifically a MATLAB report, there is a *publish* option that will export all codes triggered and output in command window along with a table of contents.

## 1. What is the Finite Difference Method in Matlab?

The Finite Difference Method is a numerical technique used to solve differential equations by approximating the derivatives with finite differences. In Matlab, it involves discretizing the domain and using matrix operations to solve the resulting algebraic equations.

## 2. How do I implement the Finite Difference Method in Matlab?

To implement the Finite Difference Method in Matlab, you will need to define the differential equation, discretize the domain, and create a matrix equation using the finite difference approximations. Then, you can use built-in functions like "solve" or "fsolve" to solve the matrix equation and obtain the solution.

## 3. What are the advantages of using the Finite Difference Method in Matlab?

The Finite Difference Method in Matlab allows for the efficient and accurate solution of differential equations, even for complex problems. It also offers flexibility in terms of discretization and can handle a wide range of boundary conditions. Additionally, Matlab has built-in functions and tools that make it easier to implement the method.

## 4. Can Matlab generate plots for the Finite Difference Method?

Yes, Matlab has powerful plotting capabilities that can be used to visualize the results of the Finite Difference Method. You can use functions like "plot" or "surf" to generate 2D or 3D plots, respectively, of the solution. You can also customize the plots by adding labels, legends, and other features.

## 5. Are there any resources available for learning about the Finite Difference Method in Matlab?

Yes, there are many online tutorials, textbooks, and resources available for learning about the Finite Difference Method in Matlab. Some recommended resources include the official Matlab documentation, online courses, and academic papers. You can also find sample codes and examples online to help you understand and implement the method.

### Similar threads

• Engineering and Comp Sci Homework Help
Replies
2
Views
1K
• Engineering and Comp Sci Homework Help
Replies
3
Views
1K
• Other Physics Topics
Replies
1
Views
2K
• Programming and Computer Science
Replies
8
Views
2K
• Engineering and Comp Sci Homework Help
Replies
1
Views
994
• Engineering and Comp Sci Homework Help
Replies
1
Views
2K
• Engineering and Comp Sci Homework Help
Replies
7
Views
858
• Differential Equations
Replies
4
Views
866
• Engineering and Comp Sci Homework Help
Replies
7
Views
2K
• Electrical Engineering
Replies
3
Views
863