HW4 - The goal of this is to write the corresponding linear...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
UCSB ME 17: Mathematics of Engineering Spring 2011 Homework 4 Consider a domain [ a,b ] × [ c,d ] and the heat equation in two spatial dimensions: ∂u ∂t = D 2 u ∂x 2 + 2 u ∂y 2 ! + S, where D is the diffusion constant, u is the temperature and S is the source term. A numerical approximation of the heat equation can be written as: u n +1 i,j - u n i,j Δ t = D u n +1 i +1 ,j - 2 u n +1 i,j + u n +1 i - 1 ,j Δ x 2 + u n +1 i,j +1 - 2 u n +1 i,j + u n +1 i,j - 1 Δ y 2 ! + S n i,j , where U n i,j = u ( x i ,y j ,t n ), Δ x and Δ y are the given space step in the x and y directions, respectively and Δ t is the given time step.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The goal of this is to write the corresponding linear system Au = rhs , i.e. identify the matrix A and the vectors u and rhs . In particular: 1. Write by hand the linear system in the case where m = n = 4. 2. Write a MATLAB function that takes in D,a,b,c,d,m,n,dt , the solution u n at time t n and two function handles BC and S and constructs the linear system for u n +1 . 1...
View Full Document

This note was uploaded on 12/29/2011 for the course ME 243a taught by Professor Abamieh during the Fall '09 term at UCSB.

Ask a homework question - tutors are online