取消
显示结果 
搜索替代 
您的意思是: 

Global Variable from Control and simulation

已解决!
转到解答

The graph in your screenshot is what is called a piecewise function. Roughly, it would be something like this:

 

tmod = tsim modulo 6000

 

if tmod <= 1000

    y = tmod * 2 / 1000

if 1000 < tmod <= 2000

    y = 0

if 2000 < tmod <= 3000

    y = 2

ect...

 

where tsim is the simulation time and y is your output.

 

This is admittedly not as ideal as the periodic block you mentioned, but should be easy to implement none the less.

0 项奖励
11 条消息(共 13 条)
754 次查看

I changed your programming, it is working. please see it.

0 项奖励
12 条消息(共 13 条)
728 次查看

You replied to a post which is about 4 years old...

0 项奖励
13 条消息(共 13 条)
724 次查看