
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
A certain mobile phone store purchases two types of phones, $A$ and $B$, from the manufacturer. They purchase a total of 20 phones. The unit purchase price $y_{1}$ (in yuan per phone) of type $A$ is related to the quantity $x_{1}$ (number of phones) as shown in the table below:

| $x_{1}$ (phones) | 1    | 2    | 3    | $\ldots$ | 20   |
|------------------|------|------|------|----------|------|
| $y_{1}$ (yuan/phone) | 1580 | 1560 | 1540 | $\ldots$ | 1200 |

The unit purchase price $y_{2}$ (in yuan per phone) of type $B$ is related to the quantity $x_{2}$ (number of phones) by $y_{2}=-10x_{2}+1360$ (where $0 < x_{2} \leqslant 20$, $x_{2}$ is an integer).

$(1)$ From the data in the table, it is known that $y_{1}$ and $x_{1}$ satisfy a linear function relationship. Find the function relationship between $y_{1}$ and $x_{1}$.

$(2)$ After negotiations with the manufacturer, it is decided that the quantity of type $A$ phones purchased should not be less than the quantity of type $B$ phones. Additionally, the quantity of type $A$ phones should not exceed 15 units. The store sells type $A$ and type $B$ phones at selling prices of 1800 yuan/phone and 1700 yuan/phone, respectively, and all phones are sold out. What is the maximum total profit when purchasing type $A$ phones, and how many type $A$ phones should be purchased to achieve this maximum profit?

Present the answer in LaTex format: \boxed{Your answer}
user