I am looking to plot the output of a DSolve for a quasi-linear first order ode with known boundary condition, which is solved using the Method of Characteristics.
In[1] sol =
DSolve[{D[u[t, x], t] + a D[u[t, x], x] == b - c u[t, x],
u[t, 0] == u0[t]}, u[t, x], {t, x}] // Simplify // ExpandAll
Out[1] {{u[t, x] ->
b/c - (b E^(-((c x)/a)))/c + E^(-((c x)/a)) u0[t - x/a]}}
I am unsure how to plot solutions given the functional representation u0[t - x/a], where a
,b
and c
are known. u0
is also a known function of time and is defined at x = 0
.
I am looking to do both 3D plots in x
and t
, as well as 2D plots for specific x
or t
values.
Edited to add: Although u0
, a
, b
and c
are known I don't want to have to specify them in the DSolve because I need to evaluate this many times over for different values.
EDIT: typo in the solution corrected.
u0[t]
? And sample values fora
,b
,c
, andf
? $\endgroup$