Message Boards Message Boards

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

[?] Solve the following PDE?

Posted 6 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

Hi enter image description here

Maple code:

  u(x, t) = Sum((1/250)*(Int((exp(-A*tau1)+a*exp(A*tau1)-d)*sin((1/500)*n*Pi*tau1), tau1 = 0 .. 500))*sin((1/500)*n*Pi*x)*exp(-
  (1/250000)*Pi^2*n^2*c*t-A*t), n = 1 .. infinity)+Int(Sum(-(1/250)*B*(Int(sin((1/500)*n*Pi*x), x = 0 .. 
  500))*sin((1/500)*n*Pi*x)*exp(-(1/250000)*(t-tau1)*(Pi^2*c*n^2+250000*A)), n = 1 .. infinity), tau1 = 0 .. t)

Mathematica code:

 Sum[(1/250)*(Integrate[(Exp[-A*tau1] + a*Exp[A*tau1] - d)*
       Sin[(1/500)*n*Pi*tau1], {tau1, 0, 500}])*Sin[(1/500)*n*Pi*x]*
    Exp[-(1/250000)*Pi^2*n^2*c*t - A*t], {n, Infinity}] + 
  Integrate[
   Sum[-(1/250)*B*(Integrate[Sin[(1/500)*n*Pi*x], {x, 0, 500}])*
     Sin[(1/500)*n*Pi*x]*
     Exp[-(1/250000)*(t - tau1)*(Pi^2*c*n^2 + 250000*A)], {n, 1, 
     Infinity}], {tau1, 0, t}]
POSTED BY: Mariusz Iwaniuk

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

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

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,

heqn = D[u[x, t], t] == c*D[u[x, t], {x, 2}] - A*u[x, t] - B;
ic = u[x, 0] == 2*A/b;
bc = {u[0, t] == 0, u[500, t] == 0};
sol = DSolve[{heqn, ic, bc}, u[x, t], {x, t}]
(* returns unevaluated *)

If a symbolic solver returns unevaluated, then Mathematica can't solve the problem. DSolve[]'s symbolic support for PDE's is still somewhat limited, so don't be surprised if some things don't work yet.

Numeric solution:

NDSolve[] needs numeric values for constans.

  A = 1;
  B = 2;
  c = 1/10;
  b = 3;
  heqn = D[u[x, t], t] == c*D[u[x, t], {x, 2}] - A*u[x, t] - B;
  ic = u[x, 0] == 2*A/b;
  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]

enter image description here

Comparison with Maple 2017.3 symbolic pdsolve solver: enter image description here

Regards,Mariusz.

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

Group Abstract Group Abstract