# How to set an initial guess for the iterative solver in Comsol?

How to set the initial guess for the iterative solver GMRES or FGMRES for linear problems (Helmholtz equation of RF module) in Comsol?

I am not too familiar with the details of the iterative solve in Comsol; however, quick googling did reveal any easy way to set up a custom initial guess for an iterative linear solver. (I ready to be proven wrong).

A couple of notes:

1. It is a common practice to use a solution with the preconditioner as an initial guess. So, say, you are solving a system $$Ax=b \implies P^{-1}Ax=P^{-1}b \tag{1} \label{1}$$ with a left preconditioner $$P$$. Then, the solution of $$\eqref{2}$$ $$Px=b \tag{2} \label{2}$$ will serve as an initial guess for $$\eqref{1}$$. So, if a preconditioner is used, usually, one does not start with random/zero initial guess, and the quality of the initial guess is directly related to the quality of the preconditioner $$P$$.
2. For a linear system, the effect of the initial guess on the convergence is limited. Certainly, the better is the initial guess, the faster the iterative solver converges, especially if your initial guess is very-very close to the true solution. However, one has to be careful, as an over-specification of an initial guess can harm the iterative solver process.
3. If you are doing a frequency sweep, I think by default Comsol will use a solution from the previous frequency as an initial guess for the current one.

In conclusion, "my initial guess" is that Comsol decided not to include the option of setting a custom initial guess for linear problems because there is little value that can be obtained from that, it might complicate the interface, and even harm the convergence sometimes.