I try to solve the Klein-Gordon equation (already posted by Prof. François Bouchut), but using variational form. What surprises me is that the two methods give (slightly ) different results. I think that the reason is: the initialization, because when I start with a very close U1 (see line 59 kg-VF.edp) the two methods give exactly the same results. My question is: How can I enhance the initialization (compute U1 very accurately) (in variational form) when the exact solution is unknown? Attached here
kg-VF.edp (3.5 KB)
kg-Matrix.edp (3.6 KB)
are the two codes.