# Plot a solution of DSolveValue

**URL:** <https://community.wolfram.com/t/plot-a-solution-of-dsolvevalue/16456>\
**Category:** Questions\
**Tags:** control-systems, equation-solving\
**Created:** [July 17, 2020, 3:55pm UTC](https://community.wolfram.com/t/plot-a-solution-of-dsolvevalue/16456 "2020-07-17T15:55:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zouhairwalid9](https://avatars.discourse-cdn.com/v4/letter/z/9de0a6/32.png) [@zouhairwalid9](https://community.wolfram.com/u/zouhairwalid9)\
**Post date:** [July 17, 2020, 3:55pm UTC](https://community.wolfram.com/t/plot-a-solution-of-dsolvevalue/16456/1 "2020-07-17T15:55:40Z")

</div>

Hello, please I calculated the solution of a particular heat equation with control, now I have the solution but I can’t plot it if someone can help me please:

```
(* this first part is just for building the control, you can ignore it*)

T = 2 \[Pi];
l = 7 \[Pi]/4;
a = 1/100;
w1 = Sin;
(*Définit la fonction indicatrice*)
indicator[x_] := Piecewise[{{1, 0 < x < \[Pi]/2}}, 0];
(*Semi groupe S[f,t][x]*)
S[t_, f_, x_] := 
Sum[Exp[- t n^2] Integrate[f[s] Sin[s n], {s, 0, \[Pi]}] Sin[x n], {n, 5}]
v1[x_] := w1[x];
L[t_, x_] := S[T - t, v1, x];
Q[x_] := indicator[x] Integrate[L[s, x]^2, {s, T - l, T}];
g1[x_] := a v1[x] + Q[x];
g2[t_, x_] := indicator[x] v1[x] L[t, x];
u[t_, x_] := g2[t, x]/g1[x];

```

Now that we have our control u, we pass to the calculation of solution of our heat equation

```
homogen = D[f[x, t], t] - D[f[x, t], {x, 2}] - indicator[x] u[x, t] == 0;
 (*données initiales propres *)
ic = {f[x, T - l] == 0};
 (* Condition aux bord de Dirichlet*)
bc = {f[0, t] == 0, f[\[Pi], t] == 0};
(*résolution analytique de l'équation *)
sol1 = DSolveValue[{homogen, ic, bc}, f[x, t], {x, 0, \[Pi]}, {t, T - l, T}]

```

1. now we have the solution I want to plot the solution when t = T (fix) and x varies between 0 and \pi?

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [July 17, 2020, 4:04pm UTC](https://community.wolfram.com/t/plot-a-solution-of-dsolvevalue/16456/2 "2020-07-17T16:04:08Z")

</div>

I would do it this way:

```
sol1 = NDSolveValue[{homogen, ic, bc}, f, {x, 0, \[Pi]}, {t, T - l, T}]
Plot[sol1[x, T], {x, 0, Pi}]

```
