Snow

10 Reputation

One Badge

0 years, 322 days

MaplePrimes Activity


These are questions asked by Snow

Hello, I have a sipmle wave PDE with dirichlet BC,I am trying to plot the solution , so I us the following code try to solve it at first,

pde := diff(u(x, t), t $ 2) - diff(u(x, t), x $ 2) = 0:

h := piecewise(2 < x and x <= 3, 6 - 2*x, 0):

ic := u(x, 0) = h, D[2](u)(x, 0) = 0:

bc := u(0, t) = 0:

solution := pdsolve([pde, ic, bc])

The problem is the following code give me a zero solution, but it should't be according to the d'Alembert formula.

I am not sure where is problem in my code, could someone help me on this? thanks.

 

Hi, I have a 1D wave equation with a piecewise initial value, I am trying to plot the solution with animation, I use the below code, However, it does not give me the animation I want but give me some error, which I am not understande.

My code is following:

pde := diff(u(x, t), t $ 2) - diff(u(x, t), x $ 2) = 0

h := piecewise(-1 <= x and x <= 0, x + 2, 0 <= x and x <= 1, 2 - x, 0)

ic := u(x, 0) = h, D[2](u)(x, 0) = 0

sol := pdsolve([pde, ic])

plots[animate](plot, [sol, x = -10 .. 10], t = 0 .. 5)

and the result is showing as picture below

Page 1 of 1