  We obtain a new solution of the TOV-equation for an anisotropic fluid
distribution by imposing the Karmarkar condition. In order to close the system
of equations we postulate an interesting form for the grr gravitational
potential which allows us to solve for gtt metric component via the Karmarkar
condition. We demonstrate that the new interior solution has well-behaved
physical attributes and can be utilized to model relativistic static fluid
spheres. By using observational data sets for the radii and mass-to-radius
relations for compact stars such as 4U 1538-52, LMC X-4 and PSR J1614- 2230 we
show that our solution describes these objects to a very good degree of
accuracy. The physical plausibility of the solution depends on a parameter $c$
for a particular star. For 4U 1538-52 the solution behaves well for $0.1574 \le
c \le 0.46$ which corresponds to $1 \ge v^2_{r0} \ge 0:13$, $0.91 \ge
v^2_{t0}\ge 0.04$ and $17.8 \ge \Gamma_0 \ge 3.8$. For LMC X-4 the solution
behaves well for $0.1235 \le c \le 0.35$ which corresponds to $0.99 \ge
v^2_{r0} \ge 0.15$, $0.91 \ge v^2_{t0}\ge 0.06$ and $15.35 \ge \Gamma_0 \ge
3.35$. Our model approximates the pulsar PSR J1614-2230 for $0.05 \le c \le
0.13$ which corresponds to $1 \ge v^2_{r0}\ge 0.21$, $0.94 \ge v^2_{t0} \ge
0.13$ and $8.34 \ge \Gamma_0 \ge 2.34$. Our observations of the behavior of the
thermodynamical and physical variables of these compact objects lead us to
conclude that the parameter c plays an important role in determining the
equation of state of the stellar material. It is apparent that smaller values
of c lead to stiffer equation of states and vice-versa.
