0

I am new to Matlab and I'm trying to make a simple circuit in Simulink library Simscape. I have an AC voltage source with RMS value 50V and frequency 50Hz. But as shown in the image, the scope displays a noise, not a sine wave as I expected.

What could be the problem? Thanks.

enter image description here

am304
  • 13,758
  • 2
  • 22
  • 40

1 Answers1

0

No, the scope does display the correct signal, which is a sine wave at 50Hz. 50Hz corresponds to a period of 20ms, so if you want to see the sine wave correctly, you need to zoom in until you have a sufficient resolution, e.g. between 1s and 1.06s would give you 3 periods worth. Right now, you are looking at the whole signal from 0 to 10s, which why it appears like "noise".

If when zooming, you find that your plot does not appear "smooth" enough, you need to adjust your solver settings (you don't say what they are) to take smaller time steps.

am304
  • 13,758
  • 2
  • 22
  • 40
  • 1
    PS: you should not use `ode45` with Simscape models, see http://uk.mathworks.com/help/physmod/simscape/ug/setting-up-solvers-for-physical-models.html. Use either `ode15s` or `ode23t`. – am304 Dec 02 '14 at 15:53
  • Hello and thanks for the response. The problem wasn't the zoom, even if it could be.I had to use a powergui and set its frequency equal to the frequency of the AC source. I also removed the solver configuration and the electrical reference. Probably they are not needed(?) – Theodore Samuel Dec 05 '14 at 17:46
  • 1
    The solver configuration is mandatory. If you remove it, you will get an error message. – Karlo Nov 04 '15 at 07:57