MATH529 L09
Nonhomogenous equations

PDE problem is inhomogeneous if either PDE or boundary conditions are inhomogeneous.

Time-independent inhomogeneity

Consider (Subscript[u, t]) = k (Subscript[u, x x])+ F(x), 0<x<L, t>0, a PDE with time-independent forcing together with initial condition u(x,0)=f(x), and time-independent Dirichlet boundary conditions u(0,t)=(Subscript[u, 0]), u(L,t)=(Subscript[u, 1]).
Decompose into transient and steady-state: u(x,t)=v(x,t)+w(x)

PDE = (∂_t)u[x,t] == k (∂_(x,x))u[x,t]+F[x]; IC = u[x,0]==f[x];
BC0= u[0,t]==u0; BC1 = u[L,t]==u1;

Transient problem captures effect of initial condition: (Subscript[v, t])=k (Subscript[v, x x]), v(0,t)=0, v(L,t)=0.

At steady-state there no further changes in time: 0=(Subscript[w, x x])+F(x), w(0)=(Subscript[u, 0]), w(L)=(Subscript[u, 1]).

Transient

vPDE = (∂_t)v[x,t] == k (∂_(x,x))v[x,t]; vIC = v[x,0]==f[x];
vBC0= v[0,t]==0; vBC1 = v[L,t]==0;
tIBVP = {vPDE,vIC,vBC0,vBC1};

v[n_,x_,t_]= Sin[(n π / L) x] Exp[-k(((n π / L))^2) t]

Assuming[n∈Integers, Simplify[tIBVP]]

v[x_,t_]=v[n,x,t];Assuming[n∈Integers, Simplify[tIBVP]]

A[n_]:=(2/L)Integrate[f[s] Sin[((n π s)/L)],{s,0,L}];
v[x_,t_] = Sum[A[n] v[n,x,t],{n,1,3}];
Assuming[n∈Integers, Simplify[tIBVP]]

Steady-state

wDE = 0 == k (∂_(x,x))w[x]+F[x]; wBC0= w[0]==u0; wBC1 = w[L]==0;
ssBVP = {wDE,wBC0,wBC1};

ssol=DSolve[ssBVP,w[x],x][[1,1]]

w[x_] = w[x] /. ssol

Assuming[k>0,Simplify[ssBVP]]

{Trus(L-s)e,(InactiveIntegrate[(InactiveIntegrate[-((F[K[1]])/k), K[1], 0, K[2]]), K[2], 0, 0])==0,True}

Example  F(x)=r, (Subscript[u, 0])=0, (Subscript[u, 1])=1, f(x)=x(L-x)

Transient

f[x_] = x(L-x);
A[n_]:=(2/L)Integrate[f[s] Sin[((n π s)/L)],{s,0,L}];
nTerms=15; An = Table[A[n],{n,1,nTerms}]

Clear[v];  v[n_,x_,t_]= Sin[(n π / L) x] Exp[-k(((n π / L))^2) t];
v[x_,t_] = Sum[An[[n]] v[n,x,t],{n,1,nTerms}]

Plot3D[v[x,t] /.{k->1, L->1},{x,0,1},{t,0,1},PlotRange->All]

Steady state

Clear[w]; wDE = 0 == k (∂_(x,x))w[x]+F[x]; wBC0= w[0]==u0; wBC1 = w[L]==0;
ssBVP = {wDE,wBC0,wBC1};

ssol=DSolve[ssBVP /.{u0->0,u1->1, F[x]->r},w[x],x][[1,1]]

w[x_] = w[x] /. ssol

Plot[w[x]/. {L->1,k->1,r->1},{x,0,1}]

Overall solution

Plot3D[(v[x,t] +w[x])/.{k->1, L->1,r->1},{x,0,1},{t,0,1},PlotRange->All]

Manipulate[Plot3D[(T v[x,t] +w[x])/.{k->kv, L->1,r->rv},{x,0,1},{t,0,5},PlotRange->{{0,1},{0,5},{0,2}},AxesLabel->{"x","t","u"}],{kv,0.1,2},{rv,0.1,1},{T,1,10}]