## Problem Description and Formulation

The problem is a linear programming optimization problem. John needs to fulfill his daily requirements of calcium (at least 15 units) and iron (at least 20 units) by buying two types of pills: SD and LD. Each SD pill contains 1 unit of calcium and 4 units of iron, costing $1. Each LD pill contains 2 units of calcium and 1 unit of iron, costing $1.50. The goal is to minimize the total cost while meeting the daily requirements.

## Mathematical Formulation

Let's denote:
- \(x\) as the number of SD pills,
- \(y\) as the number of LD pills.

The objective function to minimize (total cost) is:
\[ \text{Minimize:} \quad 1x + 1.5y \]

Subject to the constraints:
\[ \text{Calcium constraint:} \quad 1x + 2y \geq 15 \]
\[ \text{Iron constraint:} \quad 4x + 1y \geq 20 \]
\[ \text{Non-negativity constraints:} \quad x \geq 0, y \geq 0 \]
And since you cannot buy a negative number of pills:
\[ x \in \mathbb{Z}, y \in \mathbb{Z} \] (However, we'll first solve this as a linear program and then consider integer constraints if necessary).

## Gurobi Code

```python
import gurobi

def solve_optimization_problem():
    # Create a new model
    model = gurobi.Model()

    # Define variables
    x = model.addVar(name="SD_pills", lb=0, vtype=gurobi.GRB.INTEGER)  # Number of SD pills
    y = model.addVar(name="LD_pills", lb=0, vtype=gurobi.GRB.INTEGER)  # Number of LD pills

    # Objective function: Minimize cost
    model.setObjective(x + 1.5 * y, gurobi.GRB.MINIMIZE)

    # Constraints
    model.addConstr(x + 2 * y >= 15, name="calcium_constraint")  # Calcium requirement
    model.addConstr(4 * x + y >= 20, name="iron_constraint")  # Iron requirement

    # Solve the model
    model.optimize()

    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: x = {x.varValue}, y = {y.varValue}")
        print(f"Minimum cost: ${model.objVal:.2f}")
    elif model.status == gurobi.GRB.INFEASIBLE:
        print("The model is infeasible.")
    else:
        print("The model has no optimal solution.")

solve_optimization_problem()
```

This code directly models the problem described, using Gurobi's Python interface to define the variables, objective function, and constraints. It then solves the optimization problem and prints out the optimal number of pills to buy and the minimum cost. If the problem is infeasible, it indicates that as well. 

Please ensure you have Gurobi installed and properly configured in your Python environment to run this code.