# Facing problem in computing error in transient problem

**URL:** <https://discourse.julialang.org/t/facing-problem-in-computing-error-in-transient-problem/127628>\
**Category:** Performance\
**Tags:** question\
**Created:** [April 2, 2025, 1:24pm UTC](https://discourse.julialang.org/t/facing-problem-in-computing-error-in-transient-problem/127628 "2025-04-02T13:24:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stayal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stayal/32/215692_2.png) [@Stayal](https://discourse.julialang.org/u/Stayal)\
**Post date:** [April 2, 2025, 1:24pm UTC](https://discourse.julialang.org/t/facing-problem-in-computing-error-in-transient-problem/127628/1 "2025-04-02T13:24:06Z")

</div>

Hello everyone

```julia
using Gridap
using Printf

domain = (0.0, 1.0, 0.0, 1.0)
partition = (4, 4)
model = CartesianDiscreteModel(domain, partition)

order = 1
reffe = ReferenceFE(lagrangian, Float64, order)

u_ex(t) = x -> t*t * x[1] * (1.0 - x[1]) * x[2] * (1.0 - x[2])

V0 = TestFESpace(model, reffe, conformity=:H1, dirichlet_tags="boundary")
U = TransientTrialFESpace(V0, u_ex)

degree = 2 * order
Ω = Triangulation(model)
dΩ = Measure(Ω, degree)

f(t) = x -> 2*t * x[1] * (1.0 - x[1]) * x[2] * (1.0 - x[2]) + 2*t*t * x[1] * (1.0 - x[1]) + 2*t*t * x[2] * (1.0 - x[2])

m(t, dtu, v) = ∫(v * dtu)dΩ
a(t, u, v) = ∫(∇(v) ⋅ ∇(u))dΩ
l(t, v) = ∫(v * f(t))dΩ

op = TransientLinearFEOperator((a, m), l, U, V0)
op_opt = TransientLinearFEOperator((a, m), l, U, V0, constant_forms=(true, false))
ls = LUSolver()
Δt = 0.05
θ = 0.5
solver = ThetaMethod(ls, Δt, θ)
tableau = :SDIRK_2_2
solver_rk = RungeKutta(ls, ls, Δt, tableau)
t0, tF = 0.0, 1.0
uh0 = interpolate_everywhere(u_ex(t0), U(t0))
uh = solve(solver, op, t0, tF, uh0)
u_exact = interpolate_everywhere(u_ex(tF), U(tF))
e = u_exact - uh
el2 = sqrt(sum(∫(e * e) * dΩ))
println(el2)

```

Above I attached the heat equation code and the error computation part show error. Please help me in this regard.

error

```julia
 julia --project=~/gridap_project ~/Downloads/julia/heat.jl
ERROR: LoadError: MethodError: no method matching -(::Gridap.FESpaces.SingleFieldFEFunction{Gridap.CellData.GenericCellField{ReferenceDomain}}, ::Gridap.ODEs.GenericTransientFESolution)
The function `-` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  -(::CellField)
   @ Gridap ~/.julia/packages/Gridap/lHC3y/src/CellData/CellFields.jl:630
  -(::CellField, ::CellField)
   @ Gridap ~/.julia/packages/Gridap/lHC3y/src/CellData/CellFields.jl:638
  -(::CellField, ::Number)
   @ Gridap ~/.julia/packages/Gridap/lHC3y/src/CellData/CellFields.jl:639
  ...

Stacktrace:
 [1] top-level scope
   @ ~/Downloads/julia/heat.jl:38
in expression starting at /home/shivangi/Downloads/julia/heat.jl:38

```
