# How do I use split() on a function without having too few values to unpack?

**URL:** <https://fenicsproject.discourse.group/t/how-do-i-use-split-on-a-function-without-having-too-few-values-to-unpack/6085>\
**Category:** Errors\
**Created:** [June 25, 2021, 7:07pm UTC](https://fenicsproject.discourse.group/t/how-do-i-use-split-on-a-function-without-having-too-few-values-to-unpack/6085 "2021-06-25T19:07:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![abe\_w](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@abe\_w](https://fenicsproject.discourse.group/u/abe_w)\
**Post date:** [June 25, 2021, 7:07pm UTC](https://fenicsproject.discourse.group/t/how-do-i-use-split-on-a-function-without-having-too-few-values-to-unpack/6085/1 "2021-06-25T19:07:52Z")

</div>

I’m trying to use split() to create two coupled functions for solving a coupled heat equation. I’m getting an error about not having enough values to unpack. I’ve installed fenics through Anaconda, and I’m using Python 3.9.4.

```auto
n_shells = 1000
r_total = 0.8e-2

mesh = IntervalMesh(n_shells, 0, r_total)
V = FunctionSpace(mesh, 'P', 2)
vU = TestFunction(V)
vH = TestFunction(V)
u = Function(V)
uU, uH = split(u)

```

The error I’m getting is:

```auto
line 50, in <module>
    uU, uH = split(u)
ValueError: not enough values to unpack (expected 2, got 1)

```

Would someone mind helping me out?

---

<div class="post-metadata">

**Author:** ![nate](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/nate/32/17_2.png) [@nate](https://fenicsproject.discourse.group/u/nate)\
**Post date:** [June 25, 2021, 7:18pm UTC](https://fenicsproject.discourse.group/t/how-do-i-use-split-on-a-function-without-having-too-few-values-to-unpack/6085/2 "2021-06-25T19:18:42Z")

</div>

Your `FunctionSpace` does not support more than one variable, e.g:

```python
from dolfin import *

n_shells = 1000
r_total = 0.8e-2

mesh = IntervalMesh(n_shells, 0, r_total)
Ve = FiniteElement("CG", mesh.ufl_cell(), 2)
n_vars = 2
V = FunctionSpace(mesh, MixedElement([Ve]*n_vars))
vU = TestFunction(V)
vH = TestFunction(V)
u = Function(V)
uU, uH = split(u)

```

---

<div class="post-metadata">

**Author:** ![abe\_w](https://avatars.discourse-cdn.com/v4/letter/a/ebca7d/32.png) [@abe\_w](https://fenicsproject.discourse.group/u/abe_w)\
**Post date:** [June 25, 2021, 8:47pm UTC](https://fenicsproject.discourse.group/t/how-do-i-use-split-on-a-function-without-having-too-few-values-to-unpack/6085/3 "2021-06-25T20:47:56Z")

</div>

Thank you so, so much!!
