## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The factory needs to decide how many violins and harps to produce to maximize profits, given the constraints on woodworking and assembling time.

Let's define the decision variables:

* $v$ = number of violins produced
* $h$ = number of harps produced

The objective function is to maximize the total profit:

* Profit per violin = $200
* Profit per harp = $350
* Total profit = $200v + 350h$

The constraints are:

* Woodworking time: 6 hours per violin, 2 hours per harp, and at most 100 hours available
* Assembling time: 2.5 hours per violin, 10 hours per harp, and at most 150 hours available
* Non-negativity constraints: $v \geq 0$ and $h \geq 0$

## Mathematical Formulation

The mathematical formulation of the problem is:

Maximize: $200v + 350h$

Subject to:

* $6v + 2h \leq 100$ (woodworking time constraint)
* $2.5v + 10h \leq 150$ (assembling time constraint)
* $v \geq 0$ and $h \geq 0$ (non-negativity constraints)

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    v = model.addVar(lb=0, name="violins")
    h = model.addVar(lb=0, name="harps")

    # Define the objective function
    model.setObjective(200 * v + 350 * h, gurobi.GRB.MAXIMIZE)

    # Add the woodworking time constraint
    model.addConstr(6 * v + 2 * h <= 100, name="woodworking_time")

    # Add the assembling time constraint
    model.addConstr(2.5 * v + 10 * h <= 150, name="assembling_time")

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal solution:")
        print(f"Violins: {v.varValue}")
        print(f"Harp: {h.varValue}")
        print(f"Max Profit: {model.objVal}")
    else:
        print("No optimal solution found")

solve_factory_problem()
```