# Documentation

Filter Content By
Version
Languages

### bilinear.m

function bilinear
% This example formulates and solves the following simple bilinear model:
%  maximize    x
%  subject to  x + y + z <= 10
%              x * y <= 2         (bilinear inequality)
%              x * z + y * z = 1  (bilinear equality)
%              x, y, z non-negative (x integral in second version)

% Copyright 2019, Gurobi Optimization, LLC

% Linear constraint matrix
m.A = sparse([1, 1, 1]);
m.sense = '<';
m.rhs = 10;

% Variable names
m.varnames = {'x', 'y', 'z'};

% Objective function max 1.0 * x
m.obj = [1; 0; 0];
m.modelsense = 'max';

% Bilinear inequality constraint: x * y <= 2

% Bilinear equality constraint: x * z + y * z == 1