# Complete newbie looking for help: Solving PDE for mass transport influenced binding numerically

**URL:** <https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884>\
**Category:** General Discussion\
**Created:** [January 16, 2024, 11:54am UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884 "2024-01-16T11:54:06Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 16, 2024, 11:54am UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/1 "2024-01-16T11:54:06Z")

</div>

I am a biochemist by profession and not very experienced in working with programming codes.  
I am currently trying to develop a model to describe the mass transport and antigen binding of a biosensor. This involves a flow channel over a biologically activated surface. The aim is to simulate how long it takes for the analyte molecules diffusing freely in the system to bind completely to the biologically activated surface.  
I have already set up the corresponding partial differential equation and defined the necessary boundary conditions. However, I need help with the implementation of the FEM.  
Would anyone be willing to help me?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [January 17, 2024, 12:16pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/2 "2024-01-17T12:16:44Z")

</div>

Yes if is no to difficult,

Post your data and equation.

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:42pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/3 "2024-01-17T17:42:17Z")

</div>

Hello Frederic, thanks for replying 🙂  
This is the general set-up:  
 ![set-up](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/f/f9ed403e9df45a3574b8eb146dfa0714f1214281.png)  
I got it from a paper but I need to change the parameters and one boundary condition for my application.  
Myszka, David G., et al. "Extending the range of rate constants available from BIACORE: interpreting mass transport-influenced binding data. Biophysical journal 75.2 (1998): 583-594.

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:42pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/4 "2024-01-17T17:42:57Z")

</div>

And here is how it was calculated by the authors:

 ![Grid](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/f/f726bd4c2d878ca6060a5986046c44bbd9681235.png)

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:43pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/5 "2024-01-17T17:43:27Z")

</div>

Here is the PDE they used:  
 ![Eq6-bc7a](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/f/f096898f94c53a719f18ea01cc9b238af51b8ca7.png)

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:44pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/6 "2024-01-17T17:44:32Z")

</div>

with these boundary conditions:  
 ![bc7c-bc7d](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/6/6ca6bbb3a1af2900c13174bb6ac4ddfb0d8587e5.png)

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:45pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/7 "2024-01-17T17:45:52Z")

</div>

these are the nondimensionalized forms:  
 ![definitions](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/4/4793375f6e7d35656f84d2281f2e6e79fd57a04b.png)

---

<div class="post-metadata">

**Author:** ![marman](https://avatars.discourse-cdn.com/v4/letter/m/f05b48/32.png) [@marman](https://community.freefem.org/u/marman)\
**Post date:** [January 17, 2024, 5:46pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/8 "2024-01-17T17:46:33Z")

</div>

This is a exemplary result they got:  
 ![result](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/7/7ad9acadc78aa3da4354ef9db3710876b99eaec7.png)

Maybe this is to complex but it would be great if you can help me. Thank you in advance

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [January 22, 2024, 1:11am UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/9 "2024-01-22T01:11:00Z")

</div>

Probably look at the laplace equation examples and add the flow term at end up eqn 6.  
Time stepping is usually done in the examples for forward or backward Euler where  
a solution for C give the time derivative. You have another variable b which would  
have to be updated at each time step too. I guess they assume a flow velocity profile,

Maybe see some of this or related pages,

[https://doc.freefem.org/models/evolution-problems.html](https://doc.freefem.org/models/evolution-problems.html)

Most of the code is pretty self-explanatory although if you are not familiar  
with integration by parts the weak formulation may be confusing.

---

<div class="post-metadata">

**Author:** ![marchywka](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@marchywka](https://community.freefem.org/u/marchywka)\
**Post date:** [January 25, 2024, 7:45pm UTC](https://community.freefem.org/t/complete-newbie-looking-for-help-solving-pde-for-mass-transport-influenced-binding-numerically/2884/10 "2024-01-25T19:45:24Z")

</div>

IIRC Equation 6 comes from continuity equation applied to diffusion equation and  
AFAICT the term at the end is not going to be common in the examples.
