Figure 2 PDE constrained framework paper
Hi guys, I am trying to reproduce the simple heat equation inversion example mentioned in your framework paper. Unfortunately, I can not reproduce Fig 2c from the paper. I was simply using the following:
V = FunctionSpace(mesh, "CG", 1)
u = Function(V, name="State")
m = Function(V, name="Control")
v = TestFunction(V)
F = (inner(grad(u), grad(v)) - m*v)*dx
bc = DirichletBC(V, 0.0, "on_boundary")
solve(F == 0, u, bc)
u_desired = Expression(
J = Functional(
proj_udes = project(
reduced_functional = ReducedFunction
m_opt = minimize(
proj_error = project(
save_file = File("optim_
# desire solution
save_file << proj_udes
# L1 error
save_file << proj_error
# optimal forcing
save_file << m_opt
Am I doing something wrong?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- John
- Solved:
- Last query:
- Last reply: