Hello
@Clk
I'm sorry you're still in distress. As the others said, it is going to get better.
For you right now, I think the most important things are to keep taking your pain medications on a strict regime and to reduce the amount of exercise.
Your knee has been through a major operation and it needs time and gentle treatment, so it can heal and recover. What it doesn't need is lots of PT and exercises, because they just irritate and upset your healing tissues, giving you more pain than is necessary. Your knee will get all the exercise it needs as you walk around the house, to the kitchen and bathroom. So, give it a break from formal exercises and instead spend as much time as you can resting, icing and elevating that poor knee, until it calms down.
You won't lose any of the progress you've made if you take a break from exercises. MY surgeon doesn't allow any PT at all for the first month after a knee replacement. He says that your knee needs that time, to start on its journey of healing.
There's no need to worry about ROM (Range of Motion) yet, because it can continue to improve for a year, or even much longer, after a knee replacement. There's no "window of opportunity", no deadline you have to meet:
Myth busting: the "window of opportunity" in TKR
It's not exercise that gets you the ROM - it's time. Time to for swelling to go down and time for your tissues to heal. Your ROM is already there inside your knee, just waiting for those things to happen, so it can reveal itself. Once some of your swelling goes down, your ROM will start to increase, all by itself.
One of the articles in the reading list that KarriB gave you talks about sleeplessness -
Sleep deprivation is pretty much inevitable - but what causes it? . We all seem to suffer from it during recovery, but that also gets better, as we heal.
By the way, please will you tell us the date of your surgery, so we can make a signature for you? Thank you.