Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Example 7

Stanislav Mikhel edited this page Jun 11, 2017 · 1 revision

Next example shows some additional features of VPSYS. Here you can see some sources and sinks simultaneously.

 &SRC a: func="sin", k=10   # source is sinusoid
 && b = a                   # symbol && creates a copy of element
 b: k = 0.5                 # reduce frequency
 &SYNC c, d                 # you can create some elements 
 d: fname="sin_summ.dat"    # result will be saved into this file
 &SUM s                     # add summation 
 a -> s -> c, b -> s -> d   # get sum of a and b, send result to c and d
 Run %pi, 0.01               # execute

Despite of value 0.01, result will be shown with step 0.1 because for SYNC element it is the default value of parameter scale.

And one more short addition about references. Here you can see another way to set up parameters.

 %str = "sin"
 &SRC a: func=%str, %pk := k
 %pk = 10
Clone this wiki locally