We consider a static spherically symmetric charged anisotropic fluid source of radius ∼ 10−16 cm by introducing a variable Λ dependent on the radial coordinate r under general relativity. From the solution sets a possible role of the cosmological constant is investigated which indicates the dependency of energy density on it.