Module2 - self - 1 Quiz Modeling and Simulation

  • Due May 25, 2018 at 3pm
  • Points 3
  • Questions 3
  • Available after Apr 12, 2018 at 5pm
  • Time Limit None
  • Allowed Attempts 3

Instructions

This quiz concerns comparing simulation of the following simple electrical circuit in the equation-based acausal modeling environment OpenModelica (left) and the signal-flow based environment provided in Simulink (right). The intention is to illustrate the advantages of the first approach.

 

modelicahandinfig.jpeg

The following working files are given

wasp_quiz1_circuit.mo- an equation-based description in Modelica (left figure)

wasp_quiz1_simulinkmodel.slx - a simulink model  (right figure)

run_wasp_quiz1_simulinkmodel.m - runs the simulink simulation in matlab

(Numerical values on parameters are not the same as in the figure above.)

Use the provided files to simulate the circuit in both Modelica and Simulink for 0.25 seconds. Plot the current and make sure both methods provide similar results for the total current leaving the generator. In Modelica this variable is called i, in Simulink this is the output from the right-most sum-block (not that obvious by the way...).  The current should be a sinusoidal signal with amplitude close to 55.7.

 

The task you need to do to answer the quiz questions is to exchange the capacitor C in the diagram, with an inductor L (with same value as for the other inductor in your model).

 

The ease with how this could have been done, given a graphical Modelica model (not given to you), is shown in the following movie.

modelica_replacingCwithL

You do not have to implement the graphical Modelica model shown in the video, but you should do a change that has the same effect as in the video, by changing the equation-based model modelicacode.mo (you need to change one line), and changing the signal-flow based model simulinkmodel.slx  (which probably will take you more time).

You will be asked some questions about what happens.

Only registered, enrolled users can take graded quizzes