Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

wave equation (MATLAB program problem)

2 visualizzazioni (ultimi 30 giorni)
nana
nana il 12 Apr 2023
Chiuso: John D'Errico il 16 Apr 2023
Write matlab program The function U satisfies d^2U/dx^2 = d^2U/dt^2 satisfies the boundary conditions U=0 at x=0 and 1 , t>0 . and the initial conditions U=(1/8)*sin(pi*x) , dU/dt=0 for 0<=x<=1 when t=0 Use the explicit finite-difference formula (2) and a central difference approximation for the derivative condition (second IC), to calculate a solution for x=0 :0.1:1 , t=0:0.1: 5.0 (r=1) and for x= 0 : 0.01 : 1 , r=1.0 to t = 5. 0. Plot the solutions . Confirm that the analitical solution is U = (1/ 8 ) sin(pi*x) cos(pi*t) and compare with the numerical solution at several points, say at t= 1. 0 for x = 0. 2 and x =. 5 in both cases (h = 0. 1, h = 0. 01). Provide a printout of your codes, wave code and/or driver if you have one, the approximate solution values at time t = 1. 0 for the step size 0.1, but not for any other time values or step sizes. Do not provide printouts of any other output numbers, provide printouts of the approximate solutions, wire plots of wire positions, at t = 0. 5 and at t = 1. 0 for both cases and the 3-D plots of the compiled solutions up to t = 5. 0 for both cases. Provide Copies of your finite difference code and driver code if one was implemented and copies of your initial (IC) value function m-files, that is, for f(x) and g(x). 2. Printouts of the wire plots in each case at the indicated times, and for the full 3-D plot of resolutions of the solution, as a mesh plot, up to time 5 for both cases (step sizes.) Do not print out the intermediate values or provide printouts of all values computed. Print out the values at time 1 for the step size 0.1, but not for any others. The plots will indicate what is working or not

Risposte (0)

Questa domanda è chiusa.

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by