Hi,
I would like to hear what badegine would say.
I think your sentence is good and conveys the sense of your troubling days over the design of the control system is OVER.
Your sentence:
'I'm so glad! What a relief. The design of the control system had been troubling me, and sometimes when I looked at the equations I wondered why the second variable was function of y2.'
I think this is not good since the tenses are not consistent. Am I correct? Whenever I use a past perfect continuous, I look for a clue word/phrase (clause too?) that indicates something has been occurring some time before something else like "He had been watching TV until his father came home at 8 p.m. yesterday evening." -- Here "until his father came home at 8 p.m. yesterday evening" is a clue word or phrase.
And according to that, this wouldn't be correct. Am I right?
'I'm so glad! What a relief. The design of the control system had been troubling me, and sometimes when I look at the equations I wonder why the second variable was function of y2.'