Help Needed! Drawing a Half-Wave Sinusoid in Simulink

In summary, to draw a half-wave sinusoid in Simulink, you can use the "Sine Wave" block and adjust the frequency and phase parameters. To change the amplitude, add a "Gain" block and adjust the gain parameter. You can also add noise by using the "Random Number" block. To change the frequency over time, use the "Time-Based Function" block. To view the output in a scope, add a "Scope" block and connect it to the output of the "Sine Wave" block.
  • #1
cherylt
1
0
Dear all, I am pretty bad at Simulink and I want to draw out a half wave sinusoid with the equation:
I(t)=360sin(pi*t/0.4), 0<=t<=0.4
I(t)= 0 , 0.4<t<=1

Any help or suggestions?
I've tried using the Sine block with amp=360 and freq=7.85 but the graph looks weird.
I want to get the graph in blue but only managed to get the one in yellow.
z9190q7.jpg
 
Last edited:
Engineering news on Phys.org
  • #2
You're not using enough points to generate the sine. Reduce the time step.
 

FAQ: Help Needed! Drawing a Half-Wave Sinusoid in Simulink

1. How do I draw a half-wave sinusoid in Simulink?

To draw a half-wave sinusoid in Simulink, you will need to use the "Sine Wave" block. First, add the "Sine Wave" block to your Simulink model. Then, double-click on the block to open its parameters. In the "Frequency" field, enter the desired frequency of your sinusoid. In the "Phase" field, enter 0. Finally, connect the output of the "Sine Wave" block to your desired output block. This will create a half-wave sinusoid in your Simulink model.

2. How do I change the amplitude of the half-wave sinusoid?

To change the amplitude of the half-wave sinusoid, you will need to use the "Gain" block. Add the "Gain" block to your Simulink model and connect it to the output of the "Sine Wave" block. Then, double-click on the "Gain" block to open its parameters. In the "Gain" field, enter the desired amplitude value. This will scale the amplitude of the half-wave sinusoid.

3. Can I add noise to the half-wave sinusoid in Simulink?

Yes, you can add noise to the half-wave sinusoid in Simulink by using the "Random Number" block. Add the "Random Number" block to your Simulink model and connect it to the output of the "Sine Wave" block. Then, double-click on the "Random Number" block to open its parameters. In the "Mean" field, enter 0. In the "Variance" field, enter the desired noise level. This will add noise to your half-wave sinusoid.

4. How can I change the frequency of the half-wave sinusoid over time?

To change the frequency of the half-wave sinusoid over time, you will need to use the "Time-Based Function" block. Add the "Time-Based Function" block to your Simulink model and connect it to the "Frequency" input of the "Sine Wave" block. Then, double-click on the "Time-Based Function" block to open its parameters. In the "Table" field, enter the desired frequency values at different time steps. This will change the frequency of your half-wave sinusoid over time.

5. How do I view the output of the half-wave sinusoid in a scope?

To view the output of the half-wave sinusoid in a scope, you will need to add a "Scope" block to your Simulink model. Connect the output of the "Sine Wave" block to the input of the "Scope" block. Then, double-click on the "Scope" block to open its parameters. In the "Number of Inputs" field, select "1". This will display the output of the half-wave sinusoid in the scope.

Back
Top