Hello friends, i have to make this problem, i have errors while doing the equations. can you halp me out?

An airline operates the San Francisco-Los Angeles route. The demand for each flight clearly has two distinct components. There is a demand for business, with a price that responds to the curve p = 600-4q and a demand for leisure: p = 450-q. The costs of the company are 5 + 3q, where q represents the total number of seats sold.

- Analyze the model to be solved. Define (by hand) the parameters, variables and equations of the model. What kind of model is it, linear or non-linear? Non-linear
- Program the model in GAMS. How many sets do we have? Solve it. How many seats will the company sell in each class and at what price? Calculate the elasticity of each of the demands at this point and export them to an excel file.
- How will the solution change if the plane has a maximum capacity of 260 seats?
- Program a routine that allows you to solve the model for business demands p = a * (600-4q), where a takes the values from 1 to 1.5 in increments of 0.05. Export the results of the quantities, prices and benefits in each case. 11 times res optimization /01*11/

$title AIRLINE COMPANY PROBLEM

SET

i ‘flight’ / business, leisure /

Parameter

a(i)

/ business 600

leisure 450 /

b(i)

/ business -4

leisure -1 /;

VARIABLE

cost

price(i) “p1,p2”

quantity(i) “q1,q2”

profit

income(i)

Scalar f “numbers of seats” / 260 /;

Positive Variable price,quantity;

Equation

eqcost

eqprofit

eqprice(i)

eqincome(i)

eqquantity(i)

eqcost… =e= sum(i, quantity(i),*3+5));

eqprice(i)… a(i)-b(i)*quantity(i) =e=price(i);

eqquantity(i)… sum (5/3 ,cost(i)/3)), =e=;

eqincome(i)… price(i)*q(i), =e=income(i);

eqprofit sum (i,income(i)), -cost, =e=profit;

Model airline / all /;

solve airline using lp minimizing cost;

Several issues.

- the equation eqcost should be cost =e=…
- There should be a ; at the end of equation block.
- sum(5/3,…) is meaningless. Not sure what you try to achieve
- Many unmatched parantheses and simple syntax errors in equations

Please follow some tutorials in the GAMS documentation before you start.

https://www.gams.com/latest/docs/UG_MAIN.html#UG_Tutorial_Examples

when I divide by 3, I want to get the quantities

eqcost… cost =e= sum(i, quantity(i),*3+5)); in this line i still have the error 8

i have problems in eqquantity(i)

An airline operates the San Francisco-Los Angeles route. The demand for each flight clearly has two distinct components. There is a demand for business, with a price that responds to the curve p = 600-4q and a demand for leisure: p = 450-q. The costs of the company are 5 + 3q, where q represents the total number of seats sold.

- Analyze the model to be solved. Define (by hand) the parameters, variables and equations of the model. What kind of model is it, linear or non-linear? Non-linear
- Program the model in GAMS. How many sets do we have? Solve it. How many seats will the company sell in each class and at what price? Calculate the elasticity of each of the demands at this point and export them to an excel file.
- How will the solution change if the plane has a maximum capacity of 260 seats?
- Program a routine that allows you to solve the model for business demands p = a * (600-4q), where a takes the values from 1 to 1.5 in increments of 0.05. Export the results of the quantities, prices and benefits in each case. 11 times res optimization /01*11/

$title AIRLINE COMPANY PROBLEM

SET

i ‘flight’ / business, leisure /

Parameter

a(i)

/ business 600

leisure 450 /

b(i)

/ business -4

leisure -1 /;

VARIABLE

cost

price(i) “p1,p2”

quantity(i) “q1,q2”

profit

income(i)

Scalar f “numbers of seats” / 260 /;

Positive Variable price,quantity;

Equation

eqcost

eqprofit

eqprice(i)

eqincome(i)

eqquantity(i);

eqcost… cost =e= sum(i, quantity(i)*3+5);

eqprice(i)… a(i)-b(i)*quantity(i) =e=price(i);

eqquantity(i)… sum (5/3, cost(i)/3)), =e=;

eqincome(i)… price(i)*q(i), =e=income(i);

eqprofit sum (i,income(i)), -cost, =e=profit;

Model airline / all /;

solve airline using nlp minimizing cost;

error in eqproft line

$title AIRLINE COMPANY PROBLEM

SET

i ‘flight’ / business, leisure /

Parameter

a(i)

/ business 600

leisure 450 /

b(i)

/ business -4

leisure -1 /;

VARIABLE

cost

price(i) “p1,p2”

profit

income(i)

Scalar f “numbers of seats” / 260 /;

Positive Variable price,quantity;

Equation

eqcost

eqprofit

eqprice(i)

eqincome(i);

eqcost… cost =e= sum(i, quantity(i)*3+5);

eqprice(i)… a(i)-b(i)*quantity(i) =e=price(i);

eqincome(i)… (price(i)*a(i)) =e=income(i);

eqprofit sum (i,income(i), -cost) =e=profit;

Model airline / all /;

solve airline using nlp minimizing cost;

Please use code block while posting a code.

sum (i,income(i)**,** -cost) what is the purpose of this comma after income(i), please do not make up your own syntax. Try to read the error and check the syntax in GAMS documentation.

Good luck.