Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.4K Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

[?] Solve the following PDE?

Posted 7 years ago

Hi I want to solve the following PDE

heqn = D[u[x, t], t] == c*D[u[x, t], {x, 2}] -A* u[x, t]- B; // A, B and c are constants

ic = u[x, 0] == 2*A/b; // b is a constant
bc = u[0,t] ==0, u[500,t]==0;
sol = DSolveValue[{heqn, ic,bc}, u[x, t], {x, t}]

The solver is not working, can you please let me know where I am doing a mistake.

Thanks, Vishal

POSTED BY: vishal nandigana
5 Replies

Thanks, Mariusz. The code works now. Can you post the maple analytical solution for the above initial and boundary conditions. Sorry for troubling you for this.

Regards, Vishal

POSTED BY: Vishal Nandigana
POSTED BY: Mariusz Iwaniuk

Thanks, Mariusz for solving the equation. Can you tell me what is the solution when I have initial conditions which are as follows,

u(x,0) = exp(-Ax) + a*exp(Ax) -d

I tried using NDSolve, but it did not fetch me any results again.

I used

 A = 0.005;
      B = 2;
      c = 0.002;
      b = 3;
    a = 0.003;
    d = 0.004;
      heqn = D[u[x, t], t] == c*D[u[x, t], {x, 2}] - A*u[x, t] - B;
      ic = u[x, 0] ==exp(-Ax) + a*exp(Ax)-d;
      bc = {u[0, t] == 0, u[500, t] == 0};
      sol = NDSolve[{heqn, ic, bc}, u, {x, 0, 1}, {t, 0, 1}]
      Plot3D[u[x, t] /. sol, {x, 0, 1}, {t, 0, 1}, AxesLabel -> Automatic] 

Thanks, Vishal

POSTED BY: vishal nandigana

Hello.

You make syntax mistakes:

 u[x, 0] ==exp(-Ax) + a*exp(Ax)-d;(*its Wrong - Check Documentation Center or Help *)
 (* it should be:*)
 u[x, 0] == Exp[-A x] + a*Exp[A x] - d;

Corrected code:

 A = 0.005;
 B = 2;
 c = 0.002;
 b = 3;
 a = 0.003;
 d = 0.004;
 heqn = D[u[x, t], t] == c*D[u[x, t], {x, 2}] - A*u[x, t] - B;
 ic = u[x, 0] == Exp[-A x] + a*Exp[A x] - d;
 bc = {u[0, t] == 0, u[500, t] == 0};
 sol = NDSolve[{heqn, ic, bc}, u, {x, 0, 1}, {t, 0, 1}]
 Plot3D[u[x, t] /. sol, {x, 0, 1}, {t, 0, 1}, AxesLabel -> Automatic]

Regards,Mariusz

POSTED BY: Mariusz Iwaniuk
POSTED BY: Mariusz Iwaniuk
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard