Values of output variables (keys) at grid points

I am dealing with a problem wherein the difference between solutions at ends of 1D domain is required as shown below.

self.equations[“Energy”] = T.diff(t) - I*(R_a**2/D_c)/(717*298) * (4.3 - (Phi_1.subs(x,13) - Phi_1.subs(x,0)))

I am hoping that “Phi_1.subs()” will evaluate “Phi_1” at the desired “x” location as is the case with sympy expressions.

When I print the equation using pprint() function, following expression is displayed.

-0.00412793799668642Phi_1 + 0.00412793799668642Phi_1 + T__t - 0.0177501333857516

Is the subs() function working here? This is not clear from the printed expression.

If it’s not working, is there a way around to achieve the same.

Can you help me with this?

Hi @shubhamsp2195

I would imagine that as long as Phi_1 is a valid sympy expression, this should work fine although I don’t recall an example of us ever using this function.

To sanity check this you could take your custom PDE class, create the nodes using .make_nodes(), then manually check the evaluation of the equation via node.evaluate property to then feed in input variables manually. An example can be found here in the docs.

Thank you @ngeneva for this information