# Different solutions when using 'problem' and 'varf' keywords

**URL:** <https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987>\
**Category:** General Discussion\
**Created:** [February 22, 2024, 6:20pm UTC](https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987 "2024-02-22T18:20:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jna1g18](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Post date:** [February 22, 2024, 6:20pm UTC](https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987/1 "2024-02-22T18:20:51Z")

</div>

Hi all, I’m currently trying to understand how to properly use the `varf` keyword in FreeFem and I’ve come across an issue where the solution to a simple toy problem is different when the code is written using the `problem` keyword compared to when the `varf` keyword is used. Can someone explain why this is the case and perhaps suggest a fix? I’ve attached my two versions of code below. Any any help with this issue will be really appreciated!

Here’s the code that uses `problem`:  
[SimplerProblemLinearCoupled\_problem.edp](https://community.freefem.org/uploads/short-url/paU8SeTW7pDDI7Y2jhC2h2mSJlA.edp) (2.2 KB)

Here’s the code that uses `varf`:  
[SimplerProblemLinearCoupled\_varf.edp](https://community.freefem.org/uploads/short-url/cQpYGuyi35uM0CbroIbJECDHbA7.edp) (2.6 KB)

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 22, 2024, 7:12pm UTC](https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987/2 "2024-02-22T19:12:17Z")

</div>

First, solve a linear system without a loop in time. Is the solution the same? Second, you problem are not the same (different values for `mu1`, `mu2`, and `mu3`). Third, do not use fancy preconditioner until you sort this out and stick to an exact factorization instead of GAMG.

---

<div class="post-metadata">

**Author:** ![jna1g18](https://avatars.discourse-cdn.com/v4/letter/j/77aa72/32.png) [@jna1g18](https://community.freefem.org/u/jna1g18)\
**Post date:** [February 22, 2024, 7:21pm UTC](https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987/3 "2024-02-22T19:21:14Z")

</div>

You’ve just solved my problem, thank you very much and very well spotted. I must’ve forgotten that I’d changed my mu values! I’ll definitely bear in mind your advice about using different preconditioners.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 22, 2024, 7:22pm UTC](https://community.freefem.org/t/different-solutions-when-using-problem-and-varf-keywords/2987/4 "2024-02-22T19:22:34Z")

</div>

Nice, that was an easy fix! 😅
