2.9.1 Linear System Simulator

State-Space model is supported.

Calculate this equation with given A/B/C/D matrix using built in 4-degree rungekutta.
Calling Procedure ;.

$runge_kutta("File Name",mode,Input_RealArray,Output_RealArray,[X])G

See example source of "bessel.vtakprj".
It simulates digital FM-Demudulator as below.

. 

Analog PLL Simulation

Fig. below shows typical analog pll block diagram.

Loop Filter transfer function is calculated per following equations.

Since Veritak Linear Simulator needs State-Space model, we must change the equation to State Space model. .
Matlab or Scilab can do this by tf2ss.
Following is an example.

C2=14e-12
C1=100e-12
R1=4.7e3
R1C1=R1*C1;
C1_C2=C1+C2;
C1C2R1=C1*C2*R1;
b=[R1C1 1];
a=[C1C2R1 C1_C2 0];

[A,B,C,D] = tf2ss(b,a)

freqs(b,a)
save 'F:\samples\loop_filter.txt' A B C D -ascii -double


This script generate "loop_filter.txt" in samples folder.

Load "pll_test.vtakprj"
It may be a good example to start mixed analog/digital simulation.

Tips:
 An example based on classic control theory is shown in http://www.sugawara-systems.com/opencores/pll/pll.htm

See also user contributed linear system simulator per following section, which has more generic approach with full source by C++.