How can I plot pre-calculated y and x values against each other in a simulink graph that is not dependent on time?

조회 수: 1 (최근 30일)
I want to know if there is a way to plot pre-calculated y-values against the related x-values that is not dependent on time in a graph/plot/scope in Simulink.
I'm working with a Electric Subsea Actuator and need to make a torque profile for the motor based on the length the stem has moved.
I have calculated the required motor torque that each operational scenario needs (Crack Open, Running Open, Running Close, Pinch Close), and know how much the motor torque that is applied for each distance. I managed to plot it in MATLAB using plot, but I want to know if I can plot in Simulink as well.
Torque values: [0,11.5,9.4,1.9,1.9,-0.7,-0.7,6.1,6.1] (1x9) [N*m]
Stem Length values: [0, 1e-3, 19.9e-3,(19.9e-3+0.0000001), 188e-3, (188e-3+0.0000001), 356.1e-3,(356.1e-3+0.0000001),376e-3] (1x9) [mm]
I want the graph to look similar to the attached figure.
Thanks.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2019년 5월 20일
The "XY Graph" block might be used.
  댓글 수: 2
Preben Honerød-Bentsen
Preben Honerød-Bentsen 2019년 5월 23일
I have tried without success.
I tried to put all the 9 Stem Length values into a MUX to get the x-values into a vector. Then I took the Torque values into a MUX to get the y-values. Then I took the two MUX outputs into a XY Graph, but an error occur which I could'nt find an answer to solve it.
Any suggestions or recommendations?
Fangjun Jiang
Fangjun Jiang 2019년 5월 23일
No need to do that. During the simulation, as long as those x and y value pairs are used, The "XY Graph" block should give you the desired graph, although sometimes there are extra traces, because the order of the x and y value pairs may jump around.
See the example model in the document

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Dependency Analysis에 대해 자세히 알아보기

태그

제품


릴리스

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by