hello
it's a matter of how you implement the idea
here one solution
the attached model is a fixed step euler simulation
you have to initialize dt = 1e-7 in your workspace first
for the demo I have amplified the variable amount of the frequency
the graph below shows frequency, angle and output signal (as expected)