A convex approach for stability analysis of partial differential equations