# Simulation of inflating a balloon or membrane

Hello,
I want to simulate the deformation of a thin, flexible material (membrane) under the influence of air pressure acting from below. The edge of the membrane is attached to a plane and air is pumped between this plane and the membrane. Below is the code that simulates a first approach to the problem. However, the force resulting from the pressure acts in the wrong direction: it should be perpendicular to the surface, but it is always vertical. As a result, even with a very large p value, a spherical “balloon” is never formed (but it should be). Does anyone know how to fix this?
The code:

``````//----------------------------

int nn = 50;
real p = 2.8; // pressure acting on the lower side of the surface

// Pressure function
func f = p;

// Creating a mesh
border a(t=0, 1.8*pi) {x = cos(t); y = sin(t); label=1;}
border b(t=1.0, 0) { x = t*cos(1.8*pi); y = t*sin(1.8*pi); label=1; }
border c(t=0, 1.0) { x = t; y = 0; label=1; }
mesh disk = buildmesh(a(nn)+b(nn)+c(nn));

// Or: reading a mesh from file (because this simulation should work for any, initially flat mesh)

fespace femp1(disk, P1);
femp1 u, v;

problem pressure (u, v)
= int2d(disk)(
dx(u) * dx(v) +
dy(u) * dy(v)
)
- int2d(disk)(
f * v          // the pressure acting exactly vertically (instead of perpendicular to the surface)
)
+ on(1, u=0);

pressure;
// moving vertices
meshS deformedDisk = movemesh23(disk, transfo=[x, y, u]);
//savemesh(deformedDisk,"result.mesh");
plot(deformedDisk,wait=1);
//----------------------------
``````