Example 4.3-1 Potential Flow around a cylinder The rest of the example to find the pressure > restart; > w:=z->-vinf*R*(z/R+R/z); Eq. 4.3-16
> phi:=(x,y)->evalc(Re(w(x+I*y)));psi:=(x,y)->evalc(Im(w(x+I*y))); w(z)=phi(x,y)+i*psi(x,y). note that Maple requires i to be I. > assume(x,real,y,real,vinf,real,R,real); > phi(x,y);
> psi(x,y); eq. 4.3-18 > dw:=diff(w(z),z); > dw:=unapply(dw,z); > vx:=(x,y)->evalc(Re(-dw(x+I*y))); > vy:=(x,y)->evalc(Im(dw(x+I*y))); > vx(x,y);
> vy(x,y);
> vx2:=(r,theta)->simplify(vx(r*cos(theta),r*sin(theta))); > vx2(r,theta);
> vxbook:=(r,theta)->vinf*(1-(R/r)^2*cos(2*theta)); eq. 4.3-21 > simplify(vx2(r,theta)-vxbook(r,theta)); > expand(%);
> vy2:=(r,theta)->simplify(vy(r*cos(theta),r*sin(theta))); > vy2(r,theta); compare to eq. 4.3-22
> vsq:=theta->simplify((vx2(R,theta)^2+vy2(R,theta)^2)); > vsq(theta); eq. 4.3-23
> dP:=rho/2*(vinf^2-vsq(theta)); eq.4.3-24
> dPbook:=rho/2*vinf^2*(1-4*sin(theta)^2); eq. 4.3-25 > simplify(dP-dPbook);