## Problem Description and Formulation

The electronics company produces two types of devices: entry-level and premium. The profit for each entry-level device is $300, and for each premium device, it is $200. There are constraints on the daily demand for each type of device: at most 20 entry-level devices and at most 15 premium devices. Additionally, the company can sell at most 30 devices in total per day.

## Mathematical Formulation

Let's denote:
- \(E\) as the number of entry-level devices sold,
- \(P\) as the number of premium devices sold.

The objective is to maximize profit \(Z = 300E + 200P\), subject to:
1. \(E \leq 20\)
2. \(P \leq 15\)
3. \(E + P \leq 30\)
4. \(E \geq 0\) and \(P \geq 0\), since the number of devices cannot be negative.

## Gurobi Code

```python
import gurobi

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

    # Define variables
    E = model.addVar(lb=0, ub=20, name="Entry-level_devices")
    P = model.addVar(lb=0, ub=15, name="Premium_devices")

    # Objective: Maximize profit
    model.setObjective(300*E + 200*P, gurobi.GRB.MAXIMIZE)

    # Constraint: Total devices sold is at most 30
    model.addConstraint(E + P <= 30)

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: Entry-level devices = {E.varValue}, Premium devices = {P.varValue}")
        print(f"Maximum profit: ${300*E.varValue + 200*P.varValue}")
    else:
        print("The model is infeasible")

solve_device_sales()
```