Hi
It looks like you are trying to scale your value P to a value Q where Q is between 10-20 and Q = P1 * scaler.
If you want to make this work, to being with, you need some labelled data to train the network.
The data can have the following columns.
P ------- Expected Q ------- Expected P1 (= Expected Q / scaler).
Once you have this data, you can fit a neural network between P (Inputs) and Expected P1 (Targets).
You can refer the following documentation to learn more about that.
You may also refer the following resources for more information.
Hope this helps.