What slaughter weight for pigs maximizes farming profit?

Principles
In high-profit periods, slaughter large pigs; in low-profit periods, slaughter small pigs and improve the feed-to-meat ratio. There are three measures: (1) slaughter earlier; (2) reduce stocking density; (3) select good pigs to feed.
Explanation
To achieve high profits, one-sidedly pursuing a low feed-to-meat ratio or a high growth rate is incorrect. The two should be combined, and the average daily profit per pig should be calculated, because the 365 days in a year are fixed (if pen space is tight, raising large pigs will reduce the number of pigs slaughtered to a certain extent, meaning a batch of small pigs must be sold; this situation is related to the price of small pigs: if small pigs are expensive, slaughtering large pigs over 180 jin is more cost-effective).
Example
A small pig eats 1 jin of feed to gain 1 jin of meat, gaining 1 jin per day; a large pig eats 2 jin of feed to gain 1 jin of meat, gaining 2 jin per day. The feed price is 1.5.
If the pig price is 7.5 yuan/jin, the average daily profit of a large pig is 9 yuan (7.5*2-2*2*1.5), and the average daily profit of a small pig is 6 yuan (7.5-1.5); the average daily profit of the large pig is higher.
If the pig price is 4 yuan/jin, the average daily profit of a large pig is 2 yuan (4*2-2*2*1.5), and the average daily profit of a small pig is 2.5 yuan (4-1.5); the average daily profit of the small pig is higher.
The above is qualitative analysis. How exactly should the pig price and feed price be used to decide whether to slaughter large or small pigs?
The formula for average daily profit is as follows
Average daily profit = average daily weight gain*pig price—average daily weight gain*feed-to-meat ratio*feed price = average daily weight gain*(pig price—feed-to-meat ratio*feed price)
| Stage jin | Average daily weight gain | Feed-to-meat ratio | Total feed consumed | Days |
| 30—60 | 30/28 | 51.1/30 | 51.1 | 28 |
| 60—180 | 120/76 | 324.1/120 | 324.1 | 76 |
| 180-200 | 20/10 | 57/20 | 57 | 10 |
| 60—200 | 140/86 | 381.1/140 | 381.1 | 86 |
| 30-200 | 170/114 | 432.2/170 | 432.2 | 114 |
| 200—220 | 20/9 | 62/20 | 55.8(62) | 9 |
① If raising a large pig from 60—180 jin is unavoidable, we mainly look at whether the stage after 180 jin is worth raising.
Average daily profit (60—180 jin) = average daily weight gain 1*(pig price 1—feed-to-meat ratio 1*feed price) (the relevant data for the 60-180 jin stage is labeled 1, and the large pig stage is labeled 2)
Average daily profit (after 180 jin) = average daily weight gain 2*(pig price 2—feed-to-meat ratio 2*feed price)
If the large pig is worth raising, then average daily profit (after 180 jin) > average daily profit (60—180 jin). The derived result is:
(average daily weight gain*pig price 2 - average daily weight gain*pig price 1)/feed price > (average daily weight gain*meat-to-feed ratio 2 - average daily weight gain*meat-to-feed ratio 1)
Substitute the data from each stage into the calculation. If the above formula holds, the average daily profit after 180 jin is higher, so slaughter later; otherwise, slaughter earlier.
② If the pig prices for large and small pigs are the same, the above formula becomes:
(pig price/feed price) > [(average daily weight gain*meat-to-feed ratio 2 - average daily weight gain*meat-to-feed ratio 1) - (average daily weight gain 2 - average daily weight gain 1)]
Raise meat pigs or sell small pigs
The cost of a meat pig includes the 30-jin small pig and the feed from 30 jin to slaughter. Taking slaughter at 200 jin as an example, the price for under 30 jin is the pig price (under 30 jin),
The total cost is: 30*pig price (under 30 jin) + feed price*170*feed-to-meat ratio (30 to 100)
The break-even price for a meat pig is: total cost divided by 200.
If the profit is not high, slaughter earlier; otherwise, slaughter later.