To get a variable output voltage (or current) smps, I would use an external error amplifier, and use that to connect into the comp pin of the ucxxxx device, and regulate like that...ground the fb pin on the ucxxxx.
You know the way an opto coupler connects up to the comp pin in an isolated uc3842 type smps, do it on those lines.
The external eror amp will be an opamp, and you have a reference itno one pin, and the other pins input comes from your sensed signal,.
Be aware if you try to regulate output voltage and current at the same time.....because the feedback loops could fight each other.
obviously if you have a 5000 ohm load then you cannot regulate current to 1 amp, so that's ok as the current loop will be railed and out of it, leaving the voltage loop to regulate to 50v.
so you change the ref voltage on the external error amp to get change of voltage/current.