```python
import gurobipy as gp
from gurobipy import GRB

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

# Define variables
vitamin_b4 = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="vitamin_b4")
protein = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="protein")
iron = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="iron")
magnesium = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="magnesium")
vitamin_b7 = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="vitamin_b7")
vitamin_b5 = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="vitamin_b5")
vitamin_d = m.addVar(lb=0, vtype=GRB.CONTINUOUS, name="vitamin_d")


# Set objective function
m.setObjective(5.14 * vitamin_b4 + 9.45 * protein + 8.47 * iron + 2.88 * magnesium + 1.77 * vitamin_b7 + 8.7 * vitamin_b5 + 7.57 * vitamin_d, GRB.MAXIMIZE)

# Define resource constraints
resources = {
    'r0': {'upper_bound': 812, 'coefficients': [25, 2, 23, 2, 3, 24, 11]},
    'r1': {'upper_bound': 386, 'coefficients': [24, 6, 10, 15, 5, 23, 8]},
    'r2': {'upper_bound': 764, 'coefficients': [23, 1, 5, 15, 24, 10, 12]},
    'r3': {'upper_bound': 809, 'coefficients': [25, 8, 23, 20, 22, 6, 17]}
}

for r, data in resources.items():
    m.addConstr(
        data['coefficients'][0] * vitamin_b4 +
        data['coefficients'][1] * protein +
        data['coefficients'][2] * iron +
        data['coefficients'][3] * magnesium +
        data['coefficients'][4] * vitamin_b7 +
        data['coefficients'][5] * vitamin_b5 +
        data['coefficients'][6] * vitamin_d <= data['upper_bound'], name=r
    )


# Add immune support index constraints (examples)
# These are just a few examples, you'll need to add all of them based on your input.
m.addConstr(2 * protein + 3 * vitamin_b7 >= 47)
m.addConstr(25 * vitamin_b4 + 3 * vitamin_b7 + 24 * vitamin_b5 >= 97)
# ... add all other immune support index constraints ...
# ... add all other constraints ...


# Optimize model
m.optimize()

# Print results
if m.status == GRB.OPTIMAL:
    print('Optimal objective value:', m.objVal)
    for v in m.getVars():
        print(f'{v.varName}: {v.x}')
elif m.status == GRB.INFEASIBLE:
    print('Model is infeasible')
else:
    print(f'Optimization terminated with status {m.status}')

```