# Line graphs of velocities over time

Dear all,
I’m solving unsteady Navier Stokes equation. I want to store data of velocities u and v for each time step and plot line graphs for each time step to observe the changing behavior of velocities over time. I am unable to find any related example. Much appreciate if anyone can help. I am working on a problem similar to this one:
real Re = 10^3;
real nu = 1.0/Re;
real Lx = 12;
real Ly = 5;
real dt = 0.5;
border c1(t=0,1){x=tLx; y=0;}
border c2(t=0,1){x=Lx; y=t
Ly;}
border c3(t=1,0){x=tLx; y=Ly;}
border c4(t=1,0){x=0; y=t
Ly;}
border c5(t=2pi,0){x=4+0.2cos(t); y=Ly/2+0.2sin(t);}
border c6(t=0,1){x=5+Lx/2
t; y=Ly/2+0.4;}
border c7(t=0,1){x=5+Lx/2t; y=Ly/2-0.4;}
mesh Th = buildmesh(c1(80)+c2(40)+c3(80)+c4(20)+c5(60)+c6(100)+c7(100));
plot(Th);
//
fespace Uh(Th, P2);
fespace Vh(Th, P1);
Uh u, v, uh, vh, uold, vold;
Vh p, ph;
Vh uplot, vplot, vort;
//
// Velocity field is initialized by steady state solution
//
real eps = 1e-10;
int2d(Th)( nu
dx(u)dx(uh) + nudy(u)dy(uh))
+int2d(Th)(nu
dx(v)dx(vh) + nudy(v)dy(vh) )
-int2d(Th)(p
dx(uh))
-int2d(Th)(pdy(vh))
//B.conditions
-int1d(Th, c2)(nu
dx(u)N.xuh+nudy(u)N.yuh)
-int1d(Th, c2)(nu
dx(v)N.xvh+nudy(v)N.yvh)
+int2d(Th)(dx(u)ph + dy(v)ph)
+int2d(Th)(eps
p
ph)
+on(c1, c3, c5, u=0, v=0)
+on(c4, u=4.0 * y/Ly * (1-y/Ly), v=0);
//
uplot = u;
vplot = v;
plot(Th, [uplot,vplot], nbiso=40, value=1);
uold = u;
vold = v;
//
// Now go for unsteady Navier−Stokes equations .
//
int it = 0;
problem navierstokes([u,v,p], [uh,vh,ph], init=it,
solver=sparsesolver) =
int2d(Th)(u
uh/dt)-int2d(Th)(convect([uold,vold], -dt, uold)uh/dt)+int2d(Th)(vvh/dt)-int2d(Th)(convect([uold,vold], -dt, vold)vh/dt)
+int2d(Th)( nu
dx(u)dx(uh) + nudy(u)dy(uh) )+int2d(Th)(nudx(v)dx(vh) + nudy(v)dy(vh) )-int2d(Th)(pdx(uh)) -int2d(Th)(pdy(vh))
-int1d(Th, c2)(nu
dx(u)N.xuh+nudy(u)N.yuh)
-int1d(Th, c2)(nu
dx(v)N.xvh+nu*dy(v)N.yvh)
+int2d(Th)(dx(u)ph + dy(v)ph)+int2d(Th)(epspph)
+on(c1, c3, c5, u=0, v=0)+on(c4, u=4.0 * y/Ly * (1-y/Ly), v=0);
for (it=0; it<20; it++) {
for (int subit=0; subit<5; subit++) {
navierstokes;
// Th = adaptmesh(Th, [u,v]) ; u = u; v = v;
uold = u;
vold = v;
}
uplot = u;
vplot = v;
plot(Th, [uplot, vplot],wait=true,value=1,fill=1, nbiso=60, ps=“u_ns_it=”+it+“.eps”);
vort = dy(u)-dx(v);
plot(vort,wait=true,value=1,fill=1, nbiso=60, ps=“vort_ns_it=”+it+“.jpg”);
}