# Solving equation on boundaries

**URL:** <https://community.wolfram.com/t/solving-equation-on-boundaries/24476>\
**Category:** Questions\
**Tags:** material-sciences, physics, equation-solving\
**Created:** [August 23, 2024, 9:04pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476 "2024-08-23T21:04:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![nele](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@nele](https://community.wolfram.com/u/nele)\
**Post date:** [August 23, 2024, 9:04pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/1 "2024-08-23T21:04:28Z")

</div>

Hello colleagues, I have a problem that is interesting.

I have the following equations:

1. diffusion equation

d is the diffusion coefficient,

1. Adsorption on the boundary (x=0)

The BC and IC:

```
D[s[t], t]==d*D[cb[t, x] at x=0

cb[t,a]== c0 (a and c0 constats)
cb[0,x] ==c0
s[0]==0

```

I found very akward to solve it. Any way to solve it? Or referentes about coupling ODE and PDE in Wolfram?

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [August 24, 2024, 10:02am UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/2 "2024-08-24T10:02:26Z")

</div>

if **x=0** why you have **s[t, x]** in the equation ?

What is : **sat)**? and **D[cb[t, x]**? you have a syntax errors.

---

<div class="post-metadata">

**Author:** ![nele](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@nele](https://community.wolfram.com/u/nele)\
**Post date:** [August 26, 2024, 5:42pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/3 "2024-08-26T17:42:56Z")

</div>

Thanks for the reply.

Sorry, I simplified the equations and some typos appeared;

```
D[cb[t, x], {x, 2}] == D[cb[t, x], t]/d

D[s[t], t] == k1*cb[t, 0] * (s[t] -sat)

```

s is only function of t.

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [August 26, 2024, 10:21pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/4 "2024-08-26T22:21:57Z")

</div>

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/d8bb8b7d-9476-4c4e-a13e-c087ecf5c1a9)

---

<div class="post-metadata">

**Author:** ![nele](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@nele](https://community.wolfram.com/u/nele)\
**Post date:** [August 27, 2024, 4:36pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/5 "2024-08-27T16:36:23Z")

</div>

Dear Mariusz Iwaniuk,

Greetings from Brazil.

Thanks for the solution. I particularly enjoyed the analytical one.

Please note that the ODE and PDE are coupled at the boundary:

```
D[s[t], t] == d*D[cb[t, x]] at x=0

```

The other BCs. are:

```
cb[t,a]== c0 (a and c0 constats)
cb[0,x] ==c0
s[0]==0

```

---

<div class="post-metadata">

**Author:** ![mariuszi28cg](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mariuszi28cg/32/308_2.png) [@mariuszi28cg](https://community.wolfram.com/u/mariuszi28cg)\
**Post date:** [August 27, 2024, 8:52pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/6 "2024-08-27T20:52:21Z")

</div>

I wrote earlier that: **D[cb[t, x]** have a syntax errors ?

what do you mean by: **D[cb[t, x]**?

```
D[s[t], t] == d*D[cb[t, x],t] (* ? *)
D[s[t], t] == d*D[cb[t, x],x] (* ? *)
D[s[t], t] == d*D*cb[t, x] (* ? *)

```

---

<div class="post-metadata">

**Author:** ![nele](https://avatars.discourse-cdn.com/v4/letter/n/838e76/32.png) [@nele](https://community.wolfram.com/u/nele)\
**Post date:** [August 28, 2024, 12:55pm UTC](https://community.wolfram.com/t/solving-equation-on-boundaries/24476/7 "2024-08-28T12:55:22Z")

</div>

Apologize,

my bad.

```
D[cb[t, x], {x, 2}] == D[cb[t, x], t]]/d

D[s[t], t] == k1*cb[t, 0] * (s[t] -sat) (* this is a BC*)

```

Double checking the equations in Wolfram now. No more mistakes.
