## 124 Reputation

17 years, 253 days

## PDE system - change of boundary conditio...

Method found:-

Option 1) does not seem to work since IBCs are set before the solution is started and apparently not revisited  thereafter

Option 2) does work as exemplified below:

> PDE := diff(u(x, t), t) = (1/10)*(diff(u(x, t), x, x));

d            1   d  / d         \

--- u(x, t) = -- --- |--- u(x, t)|

dt           10  dx \ dx        /

# First we set up the IBCs for 0<= t <1, which are Neumann for x=1, and then run the solution to t = 1:
> IBC := {u(0, t) = 0, u(x, 0) = 1, (D[1](u))(1, t) = 0};

> pds := pdsolve(PDE, IBC, numeric);

> p1 := pds:-animate(t = 0 .. 1, frames = 50, title = "time = %f");

# We now extract the solution at t = 1:

> pds:-value(t = 1, output = listprocedure);
[x = proc(x)  ...  end;, t = 1., u(x, t) = proc(x)  ...  end;]

> uval := rhs(op(3, %));
proc(x)  ...  end;

# and then include it as the initial condition for the t >1 part of the transient, while at the same time changing the boundary condition at x = 1 to be Dirichlet:

> IBC := {u(0, t) = 0, u(1, t) = 0, u(x, 1) = uval(x)};

> pds := pdsolve(PDE, IBC, numeric);

> p2 := pds:-animate(t = 1 .. 3, frames = 50, title = "time = %f");

# We now display the solutions in sequence to show the full transient:

> plots[display](p1, p2, insequence = true);

# This seems to work.

MRB

 Page 1 of 1
﻿