# Variable sine wave source

Support Communities General PSIM Questions Variable sine wave source

This topic contains 0 replies, has 1 voice, and was last updated by  Albert Dunford 6 months, 2 weeks ago.

• Author
Posts
• #40043

Albert Dunford
Participant

A variable sine wave source is easy to implement as long as you stay away from a very common pitfall.

V(t) = sin(w*t+phi).

When we first look at this equation we think the best course of action is to simply change w, where w = 2*pi*Frequency. While keeping the other parts mainly ‘t’ constant. If you do this you are going to get into a lot of trouble. 2 sine waves with different frequencies only ever have the same slope and same V(t) value at a few points if any over many cycles. If you switch frequencies while keeping ‘t’ constant you will have discontinuities in V(t). You must treat the w*t+phi term as a “lump angle” term theta, and you must change theta at the rate of the frequency you want to operate at. To accomplish this we need an integral that will ramp from 0-2*pi in the period of the frequency we want. This is easy to do, have a look at the attached circuit.

###### Attachments:
You must be logged in to view attached files.

You must be logged in to reply to this topic.