# Coupled problem - square variable

**URL:** https://community.freefem.org/t/coupled-problem-square-variable/812
**Category:** General Discussion
**Created:** [February 16, 2021, 2:15pm UTC](https://community.freefem.org/t/coupled-problem-square-variable/812 "2021-02-16T14:15:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.freefem.org/u/Lisa)
#### Post date: [February 16, 2021, 2:15pm UTC](https://community.freefem.org/t/coupled-problem-square-variable/812/1 "2021-02-16T14:15:14Z")

</div>

Hello erevyone,

I am contacting you to try to get some answers about a problem related to a squared variable.  
Indeed, I put here my simplified program with simple constants A, B, C etc and the variable c1 and the test function c2.

The variational form is :

![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/1290c8149eb1353399fdb1ff00c30b9b878d7a58.png)

The corresponding code is :

problem first(c1,c2) =  
int2d(Sh)(c2_c1_c1/dt)  
- int2d(Sh)(c2_c1_c/dt)  
+ int2d(Sh)(R_c1_(dx(c1)_dx(c2)+dy(c1)dy(c2)))  
+ int2d(Sh)(ES_N\*(dx(c1)_dx(c2)+dy(c1)dy(c2))c1)  
- int2d(Sh)(RF/Nc1_c1_D_grad(c2)‘_grad(S))  
- int2d(Sh)(E_S_F_c1\*grad(c2)’\*grad(S))  
+ on(1,c1=C0)  
+ on(2,c1=C0)  
+ on(3,c1=C0)  
+ on(4,c1=C0)

I don’t understand why the code doesn’t accept the variable c1 to the square.

Would someone be able to answer me or give me a hint?

To give more details, at first, I started with a simple problem and it worked very well.  
The simple model was with a variational form like :

![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/cd39ce314548052ad29f225514c05b979ba81871.png)

So, as you can see, this simple code had no square variable c1\*c1 :

problem first(c1,c2) =  
int2d(Sh)(c2_c1/dt)  
- int2d(Sh)(c2_c/dt)  
+ int2d(Sh)(R\*(dx(c1)_dx(c2)+dy(c1)dy(c2)))  
- int2d(Sh)(RF/N_c1_D_grad(c2)’\*grad(S))  
+ on(1,c1=C0)  
+ on(2,c1=C0)  
+ on(3,c1=C0)  
+ on(4,c1=C0)

Thank you in advance for your response,

Lisa

---

<div class="post-metadata">

### Author: ![Lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Lisa](https://community.freefem.org/u/Lisa)
#### Post date: [February 23, 2021, 11:07am UTC](https://community.freefem.org/t/coupled-problem-square-variable/812/2 "2021-02-23T11:07:59Z")

</div>

I tried to linearize the equation by c1= c0+dc1 where c0 is an initial value and dc1 is the increment but even thanks to this linearization, I didn’t succeed to resolve the problem.  
This linearization allows me to have : c1_c1 = c0_c0+2_c0_dc1.  
But the code continues to show a problem…

Do you have some idea to help me, please?

Thank you in advance.
