Here's the formulation and Gurobi code to solve the smoothie optimization problem:

**Decision Variables:**

* `x`: Number of peanut butter smoothies
* `y`: Number of almond butter smoothies

**Objective Function:**

Maximize profit: `5x + 4y`

**Constraints:**

* Almond milk constraint: `3x + 2y <= 50`
* Protein powder constraint: `x + 1.5y <= 40`
* Non-negativity constraints: `x >= 0`, `y >= 0`


```python
import gurobipy as gp

# Create a new model
m = gp.Model("smoothie_optimization")

# Create decision variables
x = m.addVar(vtype=gp.GRB.CONTINUOUS, name="peanut_butter_smoothies")
y = m.addVar(vtype=gp.GRB.CONTINUOUS, name="almond_butter_smoothies")

# Set objective function
m.setObjective(5*x + 4*y, gp.GRB.MAXIMIZE)

# Add constraints
m.addConstr(3*x + 2*y <= 50, "almond_milk_constraint")
m.addConstr(x + 1.5*y <= 40, "protein_powder_constraint")

# Optimize model
m.optimize()

# Print results
if m.status == gp.GRB.OPTIMAL:
    print(f"Optimal Solution Found:")
    print(f"Peanut Butter Smoothies: {x.x}")
    print(f"Almond Butter Smoothies: {y.x}")
    print(f"Maximum Profit: ${m.objVal}")
elif m.status == gp.GRB.INFEASIBLE:
    print("Model is infeasible.")
else:
    print(f"Optimization terminated with status {m.status}")

```
