Implement the algorithm for solving numerically the discrete

Implement the algorithm for solving numerically the (discrete) heat equation, assuming fixed temperature boundary conditions u(0, t) = 0, u(L, t) = 10, L = 1, and initial value u_j(0) = u(x_j, 0) = 10 x_j + 5 sin^2 2 pi x_j, 1 lessthanorequalto j lessthanorequalto N. Use K = 0.1 as diffusion coefficient. Then: With different numbers of discretization points (e.g., n = 10, n = 50, n - 80, n = 100, n = 200, ...), investigate the spread of time constants of the system. Use the command eig in MATLAB, and plot the time constants in a logarithmic scale (see the command semilogy.) What can you say about the stiffness of the system? Propagate the solution from t = 0 to t = 1. Try both ode45 and ode23s with different numbers of discretization points. What is the difference between the solutions? Clock the solvers using the command tic toc in MATLAB. Visualize the results using the mesh command in MATLAB. Remember: The time steps are not uniform, so in order to have a meaningful figure, you need to define the x- and t- variables for the mesh-command. In addition, make sure that your solution u(x, t) also contains the constant boundary values, not just values in the interior points x_j, 2 lessthanorequalto j lessthanorequalto n - 1.

Solution

Differential equations can describe nearly all systems undergoing change. They are ubiquitous is science and engineering as well as economics, social science, biology, business, health care, etc. Many mathematicians have studied the nature of these equations for hundreds of years and there are many well-developed solution techniques. Often, systems described by differential equations are so complex, or the systems that they describe are so large, that a purely analytical solution to the equations is not tractable. It is in these complex systems where computer simulations and numerical methods are useful. The techniques for solving differential equations based on numerical approximations were developed before programmable computers existed. During World War II, it was common to find rooms of people (usually women) working on mechanical calculators to numerically solve systems of differential equations for military calculations. Before programmable computers, it was also common to exploit analogies to electrical systems to design analog computersto study mechanical, thermal, or chemicalsystems. As programmable computers have increased in speed and decreased in cost, increasingly complex systems of differential equations can be solved with simple programs written to run on a common PC. Currently, the computer on your desk can tackle problems that were inaccessible to the fastest supercomputers just 5 or 10 years ago. This chapter will describe some ba

 Implement the algorithm for solving numerically the (discrete) heat equation, assuming fixed temperature boundary conditions u(0, t) = 0, u(L, t) = 10, L = 1,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site