4620 Homework 7

You can use any programing language or tool that you want.

1) Use a forward difference in time and a forward difference in x to discretize

(Subscript[u, t])+ c (Subscript[u, x])=f  with u(0,t)=u(π,t) and u(x,0)=g(x)

with a constant speed c for a function f(x,t) and u(x,t) on 0<x<π and 0<t<100 using Nx subdivisions in the x direction and Nt subdivisions in the t direction. You should be able to use any number of subdivisions.  Find an exact solutions for your problem with speed c=1. Find an exact solution to your problem with c=-1.  Test your code on these problems.