Write a program to implement this process

Assignment Help MATLAB Programming
Reference no: EM13799850

Exploration: Discretizing the Wave Equation

A computer cannot store an entire function in its memory. Typically it stores the values of the function at a finite number of points. It approximates derivatives by differences of functions. In particular,

1276_equation.png

Plugging this into equation gives a discretized version of the wave equation:

F(x, t + Δt) = 2f (x, t) - f (x, t - Δt)+ [v2(Δt)2/ (Δx)2][f(x + Δx, t) - 2f(x, t) + f(x- Δx, t)]

We will use above equation to solve the wave equation numerically. Take an interval [a, b] and a large integer N, let Δx = (b - a)/N, and let xk = a + kΔx. Pick a time interval Δt. Define variables yk(t) = f(xk,t). Pick a small value of Δt. Use above equation to evolve y1, . . . , yN-1 in time, but set y0(t) = yN(t) = 0. To implement our initial conditions, take yk(0) = f0(xk) and yk(-Δt) = f0(xk) - (Δt)g0(xk).

(1) Pick values of a, b, v, N, and Δt, and write a program to implement this process. Be sure to leave a, b, v, N, and Δt as parameters that can be changed easily.

(2) Run this program with a = 0, b = 10, v = 1, N = 100, and Δt = 0.01 with initial conditions f0(x) = max(1 - |x - 2|, 0) and g0(x) = 0. Plot f (x, t) for t ranging from 0 to 20 at intervals of 0.5.

(3) Vary the sizes of Δt and Δx, always keeping vΔt  <<  Δx. How small do Δx and Δt need to be to adequately model the continuous wave equation?

(4) Now take Δx <  vΔt. What happens? Why? If your program keeps crashing, take Δx only slightly less than vΔt.

Viewing the discretized wave equation as a second-order difference equation in N-1 variables, one of the modes crosses the line from neutrally stable to unstable when Δx hits vΔt. As Δx gets smaller and smaller, this mode becomes more and more unstable, and other modes become unstable as well. This is to be expected, since the discretized wave equation can only carry a pulse a distance Δx in time Δt. If Δx <  vΔt, the discretized wave equation cannot support traveling waves.

(5) Going back to the setup of step 2, take f0(x) as before but try different functions g0(x). Can you find a function for which the wave is purely a forward traveling wave at time t = 0?

(6) For various integers k, take f0(x) = sin (kΠ(x-a)/b-a) and g0(x) = 0. What happens? How fast?

(7) The conditions y0(t) = 0 and yN(t) -= 0 implement Dirichlet boundary conditions. To implement Neumann boundary conditions, take y0(t) = y1(t) and YN(t) = YN-1(t). Repeat step 2 with these boundary conditions.

(8) What happens if you take Dirichlet boundary conditions at x = a and Neumann boundary conditions at x = b? Try it!

Reference no: EM13799850

Questions Cloud

Assignment on using ebp to formulate a clinical : Using EBP to Formulate a Clinical
Write a paper about the growth of new digital media : Write a paper about The growth of new digital media.
Interpreting statistical output for data analysis : Interpreting Statistical Output for Data Analysis
Discuss the role that global inequality and poverty : Discuss the role that global inequality and poverty have played in your chosen event. Provide examples of these roles to support your rationale.
Write a program to implement this process : A computer cannot store an entire function in its memory. Typically it stores the values of the function at a finite number of points. Pick values of a, b, v, N, and Δt, and write a program to implement this process. Be sure to leave a, b, v, N, an..
Write an essay about about my self or my idetity : Write an essay about about my self or my idetity.
Complex array of outlets for sports coverage : Media technologies have evolved throughout history to include a complex array of outlets for sports coverage. What is the best formula for sports organizations hoping to effectively reach their varied audiences using ever changing media technologi..
What is idea that you are trying to impart to your audience : What is the idea/theme/emotion that you are trying to impart to your audience? Do you want to make a political statement or do you just want to make someone laugh?
An industry with a monopoly on a product has its average wee : An industry with a monopoly on a product has its average weekly costs given  by C(x)=(10000)/x +60-.03x+.00001x^2 The weekly demand for the product is given by p=120-.015x. Find the price the industry should set and the number of units it should prod..

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd