Project

General

Profile

Download (4.48 KB) Statistics
| Branch: | Tag: | Revision:
1
-- This file has been generated by CoCoSim2.
2

    
3
-- Compiler: Lustre compiler 2 (ToLustre.m)
4
-- Time: 03-Dec-2018 22:42:03
5
node  abs_real(x : real;)
6
returns(y : real;);
7
let
8
	y = if (x >= 0.0) then
9
		x
10
	    else (- x);
11
tel
12

    
13
(*
14
external node code for doing Lookup_nD
15
*)
16
node  T_22975_003_ext_node(D_1 : real;)
17
returns(T_1 : real;);
18
var T_22975_003_table_elem_1 : real;
19
	T_22975_003_table_elem_2 : real;
20
	T_22975_003_Breakpoints_dim1_1 : real;
21
	T_22975_003_Breakpoints_dim1_2 : real;
22
	T_22975_003_dimJump_1 : int;
23
	T_22975_003_index_dim_1_1 : int;
24
	T_22975_003_index_dim_1_2 : int;
25
	T_22975_003_coords_dim_1_1 : real;
26
	T_22975_003_coords_dim_1_2 : real;
27
	T_22975_003_u_node_1 : real;
28
	T_22975_003_N_shape_1 : real;
29
	T_22975_003_u_node_2 : real;
30
	T_22975_003_N_shape_2 : real;
31
	T_22975_003_bound_node_index_1 : int;
32
	T_22975_003_bound_node_index_2 : int;
33
	T_22975_003_clip_input_1 : real;
34
let
35
	T_22975_003_table_elem_1 = 20.000000000000000;
36
	T_22975_003_table_elem_2 = 40.000000000000000;
37
	T_22975_003_Breakpoints_dim1_1 = 10.000000000000000;
38
	T_22975_003_Breakpoints_dim1_2 = 30.000000000000000;
39
	T_22975_003_dimJump_1 = 1;
40
	T_22975_003_index_dim_1_1 = if ((D_1 >= T_22975_003_Breakpoints_dim1_2) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
41
		1
42
	    else if ((D_1 >= T_22975_003_Breakpoints_dim1_1) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
43
		1
44
	    else 1;
45
	T_22975_003_coords_dim_1_1 = if ((D_1 >= T_22975_003_Breakpoints_dim1_2) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
46
		T_22975_003_Breakpoints_dim1_1
47
	    else if ((D_1 >= T_22975_003_Breakpoints_dim1_1) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
48
		T_22975_003_Breakpoints_dim1_1
49
	    else T_22975_003_Breakpoints_dim1_1;
50
	T_22975_003_index_dim_1_2 = if ((D_1 >= T_22975_003_Breakpoints_dim1_2) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
51
		2
52
	    else if ((D_1 >= T_22975_003_Breakpoints_dim1_1) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
53
		2
54
	    else 2;
55
	T_22975_003_coords_dim_1_2 = if ((D_1 >= T_22975_003_Breakpoints_dim1_2) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_2) <= 0.000000000000003552713678800501) then
56
		T_22975_003_Breakpoints_dim1_2
57
	    else if ((D_1 >= T_22975_003_Breakpoints_dim1_1) or abs_real(D_1 - T_22975_003_Breakpoints_dim1_1) <= 0.000000000000001776356839400250) then
58
		T_22975_003_Breakpoints_dim1_2
59
	    else T_22975_003_Breakpoints_dim1_2;
60
	T_22975_003_bound_node_index_1 = (T_22975_003_index_dim_1_1 * 1);
61
	T_22975_003_u_node_1 = if (T_22975_003_bound_node_index_1 = 1) then
62
		T_22975_003_table_elem_1
63
	    else T_22975_003_table_elem_2;
64
	T_22975_003_bound_node_index_2 = (T_22975_003_index_dim_1_2 * 1);
65
	T_22975_003_u_node_2 = if (T_22975_003_bound_node_index_2 = 1) then
66
		T_22975_003_table_elem_1
67
	    else T_22975_003_table_elem_2;
68
	T_22975_003_clip_input_1 = if ((D_1 < T_22975_003_coords_dim_1_1) and abs_real(D_1 - T_22975_003_coords_dim_1_1) > 0.000000000000001776356839400250) then
69
		T_22975_003_coords_dim_1_1
70
	    else if ((D_1 > T_22975_003_coords_dim_1_2) and abs_real(D_1 - T_22975_003_coords_dim_1_2) > 0.000000000000003552713678800501) then
71
		T_22975_003_coords_dim_1_2
72
	    else D_1;
73
	T_22975_003_N_shape_1 = ((T_22975_003_coords_dim_1_2 - T_22975_003_clip_input_1) / (T_22975_003_coords_dim_1_2 - T_22975_003_coords_dim_1_1));
74
	T_22975_003_N_shape_2 = ((T_22975_003_clip_input_1 - T_22975_003_coords_dim_1_1) / (T_22975_003_coords_dim_1_2 - T_22975_003_coords_dim_1_1));
75
	T_1 = ( (T_22975_003_N_shape_1 * T_22975_003_u_node_1) + (T_22975_003_N_shape_2 * T_22975_003_u_node_2) );
76
tel
77

    
78
(*
79
Original block name: FromWorkSpace_1_holding_final_value_PP/FromWorkspace
80
*)
81
node  FromWorkspace_19_086(__time_step : real;
82
	__nb_step : int;)
83
returns(Out1_1 : real;);
84
var D_1 : real;
85
	T_1 : real;
86
let
87
	D_1 = if ((__nb_step mod 1) = 0) then
88
		__time_step
89
	    else if (__nb_step = 0) then
90
		0.0
91
	    else (pre D_1);
92
	T_1 = T_22975_003_ext_node(D_1);
93
	Out1_1 = T_1;
94
tel
95

    
96
(*
97
Original block name: FromWorkSpace_1_holding_final_value_PP
98
*)
99
node  FromWorkSpace_1_holding_final_value_PP(_virtual : bool;)
100
returns(Out1_1 : real;);
101
var FromWorkspace_1 : real;
102
	__time_step : real;
103
	__nb_step : int;
104
let
105
	FromWorkspace_1 = FromWorkspace_19_086(__time_step, __nb_step);
106
	Out1_1 = FromWorkspace_1;
107
	__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
108
	__nb_step = (0 -> ((pre __nb_step) + 1));
109
tel
110

    
(703-703/1153)