Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
"Expression" based simulations?
December 6, 2017
16:42, EEST
Avatar
Predixer
Member
Members
Forum Posts: 6
Member Since:
December 6, 2017
sp_UserOfflineSmall Offline

Howto use the “expression” based simulation of signals?
1. The input field seems to accept only constant expressions like “5+1”. I’d like a (“(random value * 100) mod 54”).
2. In the table below the input field I can select some “Variables” but the field “Symbol” does’nt accept any input. I have entered some text, after leaving the field is reset to “Enter symbol”.

Are somewhere some samples howto use the “expression” based simulation?

December 7, 2017
10:18, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 523
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

The manual mentions:
“Expression signals can be defined with a custom mathematical expression. The expression may
also refer to other signals, which are defined with the Inputs parameter. Expression signals cannot
be used as inputs for other expressions.”
But other than that, no.

The links editor is a (JavaFX) table, which by default does not commit new values on defocus, instead you must press Enter to confirm new value (we should change this at some point as this is not very clear).

The “(random*100) mod 54” could be done by first making one Random signal, then adding that to a link variable e.g. “a”, and then entering “(a * 100) % 54” for the Experssion.

It is tested for simple uses, but the built-in functions of https://lallafa.objecthunter.net/exp4j/v0.3.11/ should work (Simulation Server uses that to calculate values at the moment) . In addition there is variables “Pi” for pi and “t” for simulation time in seconds.

– Bjarne

December 7, 2017
19:08, EEST
Avatar
Predixer
Member
Members
Forum Posts: 6
Member Since:
December 6, 2017
sp_UserOfflineSmall Offline

Hello Bjarne,
thanks a lot, works fine.
The points I missed in the documentation are the
o “… must press Enter …”
o reference to the “exp4j” documentation.

– Predixer

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online:
15 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 100

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 37

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 1058

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 981

Posts: 4145

Newest Members:

mats989, Sebastien Petitrenaud, sting2005, Ron Hoppe, Seb, p.devito, g.ilengo, MohamedLazrek, brittr83165991, martintinsley9

Moderators: Jouni Aro: 846, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 523, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 20, Markus Johansson: 18, Matti Siponen: 31, Lusetti: 0

Administrators: admin: 0