top of page

How to Generate Three-Phase Sine Wave in MATLAB

How to Generate Three-Phase Sine Wave in MATLAB


We are going to explore how to generate a three-phase waveform in MATLAB. This tutorial will guide you through the steps to create a three-phase sine wave, including setting the amplitude, frequency, and phase angles.

Setting Up the Environment

To begin, open a new MATLAB window. Follow these steps to set up your working environment:

  1. Open the Library Browser from the MATLAB menu.

  2. Navigate to Sources.

  3. Place the Sine Wave block in the working area.

Configuring the Sine Wave Parameters

We will configure different parameters for the sine wave:

  • Amplitude: Set to 1.

  • Frequency: Set according to your requirements. For this example, we use 2π×12\pi \times 12π×1 rad/s, which corresponds to a frequency of 1 Hz.

  • Phase Angle: Set in radians.

Here is how to set these parameters in MATLAB:

  1. Amplitude: Keep it as 1.

  2. Frequency: Use 2π×f2\pi \times f2π×f, where fff is the desired frequency in Hz. For example, 2π×12\pi \times 12π×1 for 1 Hz.

  3. Phase Angles: For a three-phase waveform, the phase angles should be 120 degrees apart. Convert these degrees to radians.

Introducing Phase Angles

To introduce phase shifts of 120 degrees for each waveform:

  1. For the first sine wave, set the phase angle to 0 radians.

  2. For the second sine wave, set the phase angle to −120360×2π\frac{-120}{360} \times 2\pi360−120​×2π radians.

  3. For the third sine wave, set the phase angle to 120360×2π\frac{120}{360} \times 2\pi360120​×2π radians.

Combining the Three-Phase Waveforms

We need to combine these three waveforms using a Mux block to visualize them together.

  1. Use a Mux block with three inputs.

  2. Connect each sine wave to one input of the Mux block.

  3. Add a Scope block to measure and display the combined waveform.

Simulating the Model

  1. Connect the output of the Mux block to the Scope block.

  2. Simulate the model to check the results. If the output is not as expected, adjust the Maximum Step Size in the configuration parameters.

Adjusting Configuration Parameters

  1. Go to Configuration Parameters.

  2. Click on Additional Parameters.

  3. Set the Maximum Step Size to 1×10−41 \times 10^{-4}1×10−4.

  4. Apply the changes and run the simulation again.

Visualization of the Three-Phase Waveform

After simulation, you should see a proper three-phase sinusoidal waveform on the scope. If needed, you can change the frequency and amplitude of the sine waves:

  1. Frequency: Adjust the frequency parameter to your desired value (e.g., 50 Hz).

  2. Amplitude: To change the amplitude dynamically, use a Product block to multiply the sine wave with a step signal.

Example: Varying Amplitude

To vary the amplitude during the simulation:

  1. Add a Step signal block.

  2. Connect it to a Product block.

  3. Configure the step signal to change amplitude at a specific time (e.g., from 1 to 0.5 at 0.1 seconds).

  4. Connect the output of the Product block to the Mux block.

Simulate the model again to see the amplitude variation reflected in the three-phase waveform.


Generating a three-phase sine wave in MATLAB involves configuring sine wave parameters, introducing phase shifts, combining the waveforms, and visualizing them using a scope. This method can be extended by varying frequency and amplitude as required.

3 views0 comments


bottom of page