close all
clear
clc
m = 0;
x = 0:0.2:1;
t = 0:0.01:0.5;
sol = pdepe(m,@pdefun,@icfun,@bcfun,x,t);
u = sol(:,:,1);
surf(x,t,u)
title('Solution of PDE')
xlabel('x'), ylabel('t'), zlabel('u')
% Error
[X,T] = meshgrid(x,t);
ua = exp(-(pi^2) T) . sin(pi*X);
error = abs(u - ua);
En = norm(error, Inf);
disp('En ='), disp(En)
function [c,f,s] = pdefun(x,t,u,DuDx)
c = 1;
f = DuDx;
s = 0;
end
function u0 = icfun(x)
u0 = sin(pi*x);
end
function [pl,ql,pr,qr] = bcfun(xl,ul,xr,ur,t)
pl = ul;
ql = 0;
pr = 0;
qr = 1;
end
Output:
En =
1.434450078921155
Plot:
Objective: Solve the wave equation numerically using finite difference methods with both dirichle...
1. Wave equation. Consider the wave equation on the finite interval (0, L) PDE BC where Neumann boundary conditions are specified Physically, with Neumann boundary conditions, u(r, t) could represent the height of a fluid that sloshes between two walls. (a) Find the general Fourier series solution by repeating the derivation from class now considering Neumann instead of Dirichlet boundary conditions. Your final solution should be (b) Consider the following general initial conditions u(x, 0)x) IC IC Derive formulas that...
Partial Differential Equation - Wave equation : Vibrating spring Question 2 A plucked string, Figure 2 shows the initial position function f (x) for a stretched string (of length L) that is set in motion by moving t at midpoint x =-aside the distance-bL and releasing it from rest timet- 0. f (x) bL Figure 2 (a) If the length of string is 10cm with amplitude 5cm was set initially, state the initial condition and the boundary conditions for the...
A plucked string. Figure 2 shows the initial position function f (x) for a stretched string (of lengt L) that is set in motion by moving it at midpoint x = ! aside the distance 1 bL and releasing it from rest time t = 0 f (x) Figure 2 (a) If the length of string is 10cm with amplitude 5cm was set initially, state the initial condition and the boundary conditions for the problem. [ Hints: f(x) = bx...
pls help 3. Solve the wave equation for a string of length π for initial conditions u(z,0-2(x-7), boundary conditions u (0, t)-0 u(n, t). (x,0)-0 and
d1=8 d2=9 lu for Find the solution u(x,t) for the l-D wave equation-=- Qx2 25 at2 (a) oo < x < oo with initial conditions u(x,0)-A(x) , where A(x) Is presented in the diagram below, and zero initial velocity. For full marks u(x,t) needs to be expressed as an equation involving x and t, somewhat similar to f(x) on page 85 of the Notes Part 2. d2+5 di+10 di+15dı+20 (b) Check for the wave equation in (a) that if (x...
Problem 3 Using Fourier series expansion, solve the heat conduction equation in one dimension a?т ат ax2 де with the Dirichlet boundary conditions: T T, if x 0, and T temperature distribution is given by: T(x, 0) -f(x) T, if x L. The initial 0 = *First find the steady state temperature distribution under the given boundary conditions. The steady form solution has the form (x)-C+C2x *Then write for the full solution T(x,t)=To(x)+u(x,t) with u(x,t) obeying the boundary contions U(0,t)...
Solve the wave equation a2 ∂2u ∂x2 = ∂2u ∂t2 , 0 < x < L, t > 0 (see (1) in Section 12.4) subject to the given conditions. u(0, t) = 0, u(L, t) = 0 u(x, 0) = 4hx L , 0 < x < L 2 4h 1 − x L , L 2 ≤ x < L , ∂u ∂t t = 0 = 0 We were unable to transcribe this imageWe were unable to transcribe...
Solve the wave equation on the domain 0 < x < , t > 0 ? uxx Utt = with the boundary condition u (0, t) = 0 and the initial conditions u (x,0) = x2 u (x,0) = x
)Consider the wave equation for a vibrating string of semi-infnite length with a fixed end at z = 0, t > 0 a(0,t) = 0, and initial conditions 0 < x < oo u(z,0) = 1-cos(nz), ut(x,0) = 0, Complete the table below with the values of u(0.5, t) at the specified time instants 0.5 0.5 x 0.5 0.5 0.5 2 0.5 0.75 t 0.25 u(x,t) )Consider the wave equation for a vibrating string of semi-infnite length with a fixed...
r Extra Credit: Write a complete analysis of the wave equation with friction for a string of length L subject to initial conditions u(x, 0)-f(x) and (x,0) (t) r Extra Credit: Write a complete analysis of the wave equation with friction for a string of length L subject to initial conditions u(x, 0)-f(x) and (x,0) (t)