From c7388b6d670e47730ddaa040f42e5f7a4270a4ee Mon Sep 17 00:00:00 2001
From: Jennifer Rinker <rink@win.dtu.dk>
Date: Tue, 13 Jun 2017 13:56:01 +0200
Subject: [PATCH] Created tutorial for master Excel creation

---
 docs/tutorials/1-creating-master-excel.md     | 111 +++
 .../data/DLCs_onshore/DLC12_IEC61400-1Ed3.txt |  26 +
 .../data/DLCs_onshore/DLC13_IEC61400-1Ed3.txt |  24 +
 .../data/DLCs_onshore/DLC14_IEC61400-1Ed3.txt |   5 +
 .../data/DLCs_onshore/DLC15_IEC61400-1Ed3.txt |  26 +
 .../data/DLCs_onshore/DLC21_IEC61400-1Ed3.txt |  26 +
 .../DLCs_onshore/DLC22b_IEC61400-1Ed3.txt     |  21 +
 .../DLCs_onshore/DLC22y_IEC61400-1Ed3.txt     |  25 +
 .../data/DLCs_onshore/DLC23_IEC61400-1Ed3.txt |   5 +
 .../data/DLCs_onshore/DLC24_IEC61400-1Ed3.txt |  23 +
 .../data/DLCs_onshore/DLC31_IEC61400-1Ed3.txt |   5 +
 .../data/DLCs_onshore/DLC32_IEC61400-1Ed3.txt |   6 +
 .../data/DLCs_onshore/DLC41_IEC61400-1Ed3.txt |   5 +
 .../data/DLCs_onshore/DLC42_IEC61400-1Ed3.txt |   8 +
 .../data/DLCs_onshore/DLC51_IEC61400-1Ed3.txt |   5 +
 .../data/DLCs_onshore/DLC61_IEC61400-1Ed3.txt |   4 +
 .../data/DLCs_onshore/DLC62_IEC61400-1Ed3.txt |  26 +
 .../data/DLCs_onshore/DLC63_IEC61400-1Ed3.txt |   4 +
 .../data/DLCs_onshore/DLC64_IEC61400-1Ed3.txt |  23 +
 .../data/DLCs_onshore/DLC81_IEC61400-1Ed3.txt |   4 +
 docs/tutorials/data/DLCs_onshore/Main.txt     |  53 ++
 .../tutorials/data/dtu10mw_master_onshore.htc | 730 ++++++++++++++++++
 22 files changed, 1165 insertions(+)
 create mode 100644 docs/tutorials/1-creating-master-excel.md
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC12_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC13_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC14_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC15_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC21_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC22b_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC22y_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC23_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC24_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC31_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC32_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC41_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC42_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC51_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC61_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC62_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC63_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC64_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/DLC81_IEC61400-1Ed3.txt
 create mode 100644 docs/tutorials/data/DLCs_onshore/Main.txt
 create mode 100644 docs/tutorials/data/dtu10mw_master_onshore.htc

diff --git a/docs/tutorials/1-creating-master-excel.md b/docs/tutorials/1-creating-master-excel.md
new file mode 100644
index 00000000..bbbecee0
--- /dev/null
+++ b/docs/tutorials/1-creating-master-excel.md
@@ -0,0 +1,111 @@
+# Tutorial 1: Creating master Excel file
+
+The Wind Energy Toolbox has a workflow for automatically running design load 
+bases (DLBs) on Gorm.
+This workflow has the following steps:
+1. Create a master Excel sheet defining each case in the DLB
+2. Create subordinate Excel sheets from each tab in the master Excel sheet
+3. Create htc files and PBS job scripts for each requisite simulation using 
+the subordinate Excel files and a master htc file.
+4. Submit all PBS job scripts to the cluster
+5. Post-process results
+6. Visualize results
+This tutorial presents how to accomplish Step 1.
+
+Note that it is possible to customize your simulations by skipping/modifying 
+steps.
+Such a procedure will be discussed in a later tutorial.
+
+## Background: master Excel file
+
+The master Excel file is an Excel file that is used to create subordinate 
+Excel files for generation of htc files and PBS job scripts.
+
+### Master file structure
+
+The master file has a main tab, called "Main", that defines default values 
+and necessary functions that are called in the other tabs.
+Each other tab defines a new case, and one subordinate Excel file will be 
+generated for each case.
+There are three variable types in the master Excel file:
+- Constants: values that do not change within a case
+- Variables: values that do change within a case, but are numbers that do not 
+depend on any other values (e.g., wind speed in DLC 1.2)
+- Functions: values that depend on other values
+
+### Tag names
+
+The values that are defined in the master Excel file (and eventually the 
+subordinate Excel files) are used to replace "tags" in the master htc file.
+These tags are of the form ```[$TAG_NAME]```.
+Theoretically, a user can define any new tags they desire, there are no 
+require naming conventions.
+However, there are some tags that are currently hard-coded into the Toolbox 
+that can result in errors if the tag names are changed.
+Thus, **we do not recommend you change the tag names from those in the 
+tutorial**.
+If you need new values that do not exist in the tutorial's master htc file 
+and produced master file, then it should be fine to add them.
+
+There are a few tags that deserve special mention:
+- ```[Case folder]```: the htc files for each case will be saved in this case 
+folder. We do not recommend changing the tag name or naming convention here 
+if you are doing a standard DLB.
+- ```[Case id.]```: this defines the naming convention for each htc file. We 
+do not recommend changing the tag name or naming convention here if you are 
+doing a standard DLB.
+- ```[seed]```: this variable indicates the desired number of seeds for each 
+set of variables. Thus, for example, in DLC 1.2, 1.3, the ```[seed]``` value 
+should be set to at least 6.
+
+Lastly, it is extremely important that your tag names in your master Excel 
+file match the tag names in your master htc file.
+Thus, **be sure to verify that your tag names in your master Excel and master 
+htc files are consistent**.
+
+## Tutorial
+
+The procedure for creating the master Excel sheet is simple: each desired DLB 
+is defined in a tab-delimited text file, and these are loaded into a single 
+Excel file.
+It is assumed that the user has a collection of text files in a folder for 
+all of the DLBs to be simulated.
+This tutorial uses the text files located in 
+```wetb/docs/tutorials/data/DLCs_onshore```, which contain a series of text 
+files for a full DLB of an onshore turbine.
+These text files correspond to the onshore DTU 10 MW master htc file that is 
+located in the same directoy.
+
+Generate the master Excel file in a few easy steps:
+1. Open a command window.
+2. If you are running the tutorial locally (i.e., not on Gorm), navigate to 
+the Wind Energy Toolbox tutorials directory.
+3. Run the code to generate the Excel file from a folder of text files:
+    * Windows: ```>> python ..\..\wetb\prepost\write_master.py --folder
+data\DLCs_onshore --filename DLCs_onshore.xlsx```
+    * Mac/Linux: ```$ python ../../wetb/prepost/write_master.py --folder
+data/DLCs_onshore  --filename DLCs_onshore.xlsx```
+    * Gorm: ```python 
+/home/MET/repositories/toolbox/WindEnergyToolbox/wetb/prepost/write_master.
+py 
+--folder=/home/MET/repositories/toolbox/WindEnergyToolbox/wetb/docs/tutoria
+ls/data/DLCs_onshore --filename=DLCs_onshore.xlsx```   
+The master Excel file "DLCs_onshore.xlsx" should now be in the your current 
+directory.
+
+Note that we have used the parser options ```--folder``` and ```--filename``` 
+to specify the folder with the text files and the name of the resulting Excel 
+file.
+Other parser options are also available (See doc string in 
+```write_master.py``` function.)
+
+## Generation options
+
+See doc string in ```write_master.py``` function.
+
+## Issues
+
+If there are any problems with this tutorial, please [submit an issue](
+https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox/issues).
+We will try to fix it as soon as possible.
+
diff --git a/docs/tutorials/data/DLCs_onshore/DLC12_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC12_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..0adb836e
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC12_IEC61400-1Ed3.txt
@@ -0,0 +1,26 @@
+C	F	V	V	V	F
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[TI]
+DLC12_IEC61400-1Ed3	"""DLC12_wsp[wsp]_wdir[wdir]_s[seed]"""	0	6	4	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"
+		350		6	
+		10		8	
+				10	
+				12	
+				14	
+				16	
+				18	
+				20	
+				22	
+				24	
+				26	
+					
+					
+					
+					
+					
+					
+					
+					
+					
+					
+					
+					
diff --git a/docs/tutorials/data/DLCs_onshore/DLC13_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC13_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..3d379038
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC13_IEC61400-1Ed3.txt
@@ -0,0 +1,24 @@
+C	F	V	V	V	F
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[TI]
+DLC13_IEC61400-1Ed3	"""DLC13_wsp[wsp]_wdir[wdir]_s[seed]"""	0	6	4	"2*[ref_ti]*(0,072*(0,2*[ref_wind_speed]/2+3)*([wsp]/2-4)+10)/[wsp]"
+		350		6	
+		10		8	
+				10	
+				12	
+				14	
+				16	
+				18	
+				20	
+				22	
+				24	
+				26	
+					
+					
+					
+					
+					
+					
+					
+					
+					
+					
diff --git a/docs/tutorials/data/DLCs_onshore/DLC14_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC14_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..94a27037
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC14_IEC61400-1Ed3.txt
@@ -0,0 +1,5 @@
+C	C	F	V	V	C	C	F	C	C	C	C	F	C
+[sim_time]	[Case folder]	[Case id.]	[wdir]	[wsp]	[seed]	[turb_format]	[TI]	[gust]	[gust_type]	[G_A]	[G_t0]	[G_phi0]	[G_T]
+100	DLC14_IEC61400-1Ed3	"""DLC14_wsp[wsp]_wdir[wdir]_s[seed]"""	0	10	1	0	"2*[ref_ti]*(0,072*(0,2*[ref_wind_speed]/2+3)*([wsp]/2-4)+10)/[wsp]"		ecd	15	110	720/[wsp]	10
+				12									
+				14									
diff --git a/docs/tutorials/data/DLCs_onshore/DLC15_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC15_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..1dabb2ed
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC15_IEC61400-1Ed3.txt
@@ -0,0 +1,26 @@
+F	C	F	V	V	V	C	C	F	C	C	F	C	C
+[sim_time]	[Case folder]	[Case id.]	[wdir]	[G_phi0]	[wsp]	[seed]	[turb_format]	[TI]	[gust]	[gust_type]	[G_A]	[G_T]	[G_t0]
+100	DLC15_IEC61400-1Ed3	"""DLC15_wsp[wsp]_wdir[wdir]_s[seed]_phi[G_phi0]"""	0	0	4	1	0	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"		ews	"(2,5+0,2*6,4*[TI]*[wsp]*([diameter]/[long_scale_param])**0,25)/[diameter]"	12	110
+				90	6								
+				180	8								
+				270	10								
+					12								
+					14								
+					16								
+					18								
+					20								
+					22								
+					24								
+					26								
+													
+													
+													
+													
+													
+													
+													
+													
+													
+													
+													
+													
diff --git a/docs/tutorials/data/DLCs_onshore/DLC21_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC21_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..e498782c
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC21_IEC61400-1Ed3.txt
@@ -0,0 +1,26 @@
+F	C	F	V	V	V	F	C
+[sim_time]	[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[TI]	[Grid loss time]
+100	DLC21_IEC61400-1Ed3	"""DLC21_wsp[wsp]_wdir[wdir]_s[seed]"""	0	4	4	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	110
+			350		6		
+			10		8		
+					10		
+					12		
+					14		
+					16		
+					18		
+					20		
+					22		
+					24		
+					26		
+							
+							
+							
+							
+							
+							
+							
+							
+							
+							
+							
+							
diff --git a/docs/tutorials/data/DLCs_onshore/DLC22b_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC22b_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..2953b0a5
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC22b_IEC61400-1Ed3.txt
@@ -0,0 +1,21 @@
+C	F	V	V	V	F	C	C
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[TI]	[Pitch 1 DLC22b]	[Time stuck DLC22b]
+DLC22b_IEC61400-1Ed3	"""DLC22b_wsp[wsp]_wdir[wdir]_s[seed]"""	0	12	4	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	0	0.1
+				6			
+				8			
+				10			
+				12			
+				14			
+				16			
+				18			
+				20			
+				22			
+				24			
+				26			
+							
+							
+							
+							
+							
+							
+							
diff --git a/docs/tutorials/data/DLCs_onshore/DLC22y_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC22y_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..fc8b674c
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC22y_IEC61400-1Ed3.txt
@@ -0,0 +1,25 @@
+C	F	V	V	V	F	C		
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[TI]	[dis_setbeta]		
+DLC22y_IEC61400-1Ed3	"""DLC22y_wsp[wsp]_wdir[wdir]_s[seed]"""	15	1	4	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	;		
+		30		6				
+		45		8				
+		60		10				
+		75		12				
+		90		14				
+		105		16				
+		120		18				
+		135		20				
+		150		22				
+		165		24				
+		180		26				
+		195						
+		210						
+		225						
+		240						
+		255						
+		270						
+		285						
+		300						
+		315						
+		330						
+		345						
diff --git a/docs/tutorials/data/DLCs_onshore/DLC23_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC23_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..7a823b3e
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC23_IEC61400-1Ed3.txt
@@ -0,0 +1,5 @@
+F	C	F	V	V	C	C	F	C	C	F	C	C	C	F
+[sim_time]	[Case folder]	[Case id.]	[wsp]	[Grid loss time]	[seed]	[turb_format]	[TI]	[gust]	[gust_type]	[G_A]	[G_phi0]	[G_T]	[G_t0]	[grid_gust_delay]
+100	DLC23_IEC61400-1Ed3	"""DLC23_wsp[wsp]_wdir[wdir]_s[seed]_tgl[grid_gust_delay]"""	10	122.5	1	0	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"		eog	"min([1,35*(0,8*1,4*[ref_wind_speed]-[wsp]);3,3*[TI]*[wsp]/(1+0,1*[diameter]/[long_scale_param])])"	0	10.5	120	([Grid loss time]-[G_t0])*10
+			14	124										
+			26	125.25								 		
diff --git a/docs/tutorials/data/DLCs_onshore/DLC24_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC24_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..20060ac1
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC24_IEC61400-1Ed3.txt
@@ -0,0 +1,23 @@
+C	F	V	V	V	C	F				
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]				
+DLC24_IEC61400-1Ed3	"""DLC24_wsp[wsp]_wdir[wdir]_s[seed]"""	340	3	4	1	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"				
+		20		6						
+				8						
+				10						
+				12						
+				14						
+				16						
+				18						
+				20						
+				22						
+				24						
+				26						
+										
+										
+										
+										
+										
+										
+										
+										
+										
diff --git a/docs/tutorials/data/DLCs_onshore/DLC31_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC31_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..a0d7a599
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC31_IEC61400-1Ed3.txt
@@ -0,0 +1,5 @@
+F	C	F	V	C	C	C	C
+[sim_time]	[Case folder]	[Case id.]	[wsp]	[seed]	[turb_format]	[TI]	[cutin_t0]
+250	DLC31_IEC61400-1Ed3	"""DLC31_wsp[wsp]_wdir[wdir]_s[seed]"""	4	1	0	0.0000	110
+			12				
+			25				
diff --git a/docs/tutorials/data/DLCs_onshore/DLC32_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC32_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..248003fe
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC32_IEC61400-1Ed3.txt
@@ -0,0 +1,6 @@
+F	C	F	V	C	C	F	C	C	F	C	F	C	V	F
+[sim_time]	[Case folder]	[Case id.]	[wsp]	[seed]	[turb_format]	[TI]	[gust]	[gust_type]	[G_A]	[G_phi0]	[G_t0]	[G_T]	[cutin_t0]	[grid_gust_delay]
+200	DLC32_IEC61400-1Ed3	"""DLC32_wsp[wsp]_wdir[wdir]_s[seed]_tci[grid_gust_delay]"""	4	1	0	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"		eog	"min([1,35*(0,8*1,4*[ref_wind_speed]-[wsp]);3,3*[TI]*[wsp]/(1+0,1*[diameter]/[long_scale_param])])"	0	[wsp]/(0.01813228 *[wsp] - 0.04811716)	10.5	50.1	([cutin_t0]-[G_t0])*10
+			10										52.5	
+			14										54	
+			26										55.25	
diff --git a/docs/tutorials/data/DLCs_onshore/DLC41_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC41_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..96e05e89
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC41_IEC61400-1Ed3.txt
@@ -0,0 +1,5 @@
+F	C	F	V	C	C	C	C
+[sim_time]	[Case folder]	[Case id.]	[wsp]	[seed]	[turb_format]	[TI]	[Cut-out time]
+100	DLC41_IEC61400-1Ed3	"""DLC41_wsp[wsp]_wdir[wdir]_s[seed]"""	4	1	0	0	110
+			12				
+			26				
diff --git a/docs/tutorials/data/DLCs_onshore/DLC42_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC42_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..c6a09f1d
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC42_IEC61400-1Ed3.txt
@@ -0,0 +1,8 @@
+F	C	F	V	C	C	F	C	C	F	C	C	C	V	F
+[sim_time]	[Case folder]	[Case id.]	[wsp]	[seed]	[turb_format]	[TI]	[gust]	[gust_type]	[G_A]	[G_phi0]	[G_t0]	[G_T]	[Cut-out time]	[grid_gust_delay]
+100	DLC42_IEC61400-1Ed3	"""DLC42_wsp[wsp]_wdir[wdir]_s[seed]_tco[grid_gust_delay]"""	10	1	0	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"		eog	"min([1,35*(0,8*1,4*[ref_wind_speed]-[wsp]);3,3*[TI]*[wsp]/(1+0,1*[diameter]/[long_scale_param])])"	0	120	10.5	120.1	([Cut-out time]-[G_t0])
+			14										122.5	
+			26										124	
+													125	
+													128	
+													130	
diff --git a/docs/tutorials/data/DLCs_onshore/DLC51_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC51_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..8c0d559f
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC51_IEC61400-1Ed3.txt
@@ -0,0 +1,5 @@
+F	C	F	V	V	V	C	F	C	C
+[sim_time]	[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]	[Cut-out time]	[Stop type]
+100	DLC51_IEC61400-1Ed3	"""DLC51_wsp[wsp]_wdir[wdir]_s[seed]"""	0	12	10	1	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	110	2
+					12				
+					14				
diff --git a/docs/tutorials/data/DLCs_onshore/DLC61_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC61_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..0d9bd463
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC61_IEC61400-1Ed3.txt
@@ -0,0 +1,4 @@
+C	F	V	V	V	C	C	C	C	C
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]	[shear_exp]	[cutin_t0]	[Induction]
+DLC61_IEC61400-1Ed3	"""DLC61_wsp[wsp]_wdir[wdir]_s[seed]"""	352	6	50	1	0.1100	0.11	1000	0
+		8							
diff --git a/docs/tutorials/data/DLCs_onshore/DLC62_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC62_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..36068f3a
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC62_IEC61400-1Ed3.txt
@@ -0,0 +1,26 @@
+C	F	V	V	V	C	C	C	C	C	C
+[Case folder]	[Case id.]	[wsp]	[wdir]	[seed]	[turb_format]	[TI]	[shear_exp]	[cutin_t0]	[Induction]	[dis_setbeta]
+DLC62_IEC61400-1Ed3	"""DLC62_wsp[wsp]_wdir[wdir]_s[seed]"""	50	0	1	1	0.1100	0.11	1000	0	;
+			15							
+			30							
+			45							
+			60							
+			75							
+			90							
+			105							
+			120							
+			135							
+			150							
+			165							
+			180							
+			195							
+			210							
+			225							
+			240							
+			255							
+			270							
+			285							
+			300							
+			315							
+			330							
+			345							
diff --git a/docs/tutorials/data/DLCs_onshore/DLC63_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC63_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..ea50e1b2
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC63_IEC61400-1Ed3.txt
@@ -0,0 +1,4 @@
+C	F	V	V	V	C	C	C	C	C
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]	[shear_exp]	[cutin_t0]	[Induction]
+DLC63_IEC61400-1Ed3	"""DLC63_wsp[wsp]_wdir[wdir]_s[seed]"""	340	6	40	1	0.1100	0.11	1000	0
+		20							
diff --git a/docs/tutorials/data/DLCs_onshore/DLC64_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC64_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..3ab5ef5b
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC64_IEC61400-1Ed3.txt
@@ -0,0 +1,23 @@
+C	F	V	V	V	C	F	C	C
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]	[cutin_t0]	[Induction]
+DLC64_IEC61400-1Ed3	"""DLC64_wsp[wsp]_wdir[wdir]_s[seed]"""	352	6	4	1	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	1000	0
+		8		6				
+				8				
+				10				
+				12				
+				14				
+				16				
+				18				
+				20				
+				22				
+				24				
+				26				
+				28				
+				30				
+				32				
+				34				
+								
+								
+								
+								
+								
diff --git a/docs/tutorials/data/DLCs_onshore/DLC81_IEC61400-1Ed3.txt b/docs/tutorials/data/DLCs_onshore/DLC81_IEC61400-1Ed3.txt
new file mode 100644
index 00000000..27b58bb3
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/DLC81_IEC61400-1Ed3.txt
@@ -0,0 +1,4 @@
+C	F	V	V	V	C	F	C	C	C	C	C
+[Case folder]	[Case id.]	[wdir]	[seed]	[wsp]	[turb_format]	[TI]	[cutin_t0]	[Induction]	[Rotor azimuth]	[Free shaft rot]	[Rotor locked]
+DLC81_IEC61400-1Ed3	"""DLC81_wsp[wsp]_wdir[wdir]_s[seed]"""	352	6	18	1	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"	1000	0	180	;	
+		8									
diff --git a/docs/tutorials/data/DLCs_onshore/Main.txt b/docs/tutorials/data/DLCs_onshore/Main.txt
new file mode 100644
index 00000000..d1b1b3c7
--- /dev/null
+++ b/docs/tutorials/data/DLCs_onshore/Main.txt
@@ -0,0 +1,53 @@
+																																					
+Master spreadsheets to generate the set of spreadsheets required as inputs to the DLB calculator.																																					
+"Each sheet defines the tags of a DLC, except the main one. The main sheet defines: wind turbine parameters, default tags values, and gusts and turbulence definitions."																																					
+"Tags are devided into 3 categories: constants (C), variables (V), and functions (F).  The category is specified in the line above the tag."																																					
+Constants do not change in a DLC. Variables define the number of cases within a DLC through their combinations. Functions are tags that depends on other tags through and expression. 																																					
+																																					
+Parameters:	Vrate	Vout																																			
+	12	26																																			
+																																					
+Default constants:	[ref_ti]	[ref_wind_speed]	[tsr]	[hub_height]	[diameter]	[t0]	[wdir]	[shear_exp]	[out_format]	[gust]	[gust_type]	[G_A]	[G_phi0]	[G_t0]	[G_T]	[Rotor azimuth]	[Free shaft rot]	[init_wr]	[Pitch 1 DLC22b]	[Rotor locked]	[Time stuck DLC22b]	[Cut-in time]	[Stop type]	[Pitvel 1]	[Pitvel 2]	[Grid loss time]	[Time pitch runaway]	[Induction]	[Dyn stall]	[dis_setbeta]	[long_scale_param]	[t_flap_on]	[turb_format]	[staircase]	[Rotor azimuth]	[sim_time]	[Cut-out time]
+	0.16	50	8.0	90	178	100	0	0.2	hawc_binary	;						0		0.5	0	;	-1	1	1	4	6	10000	10000	1	2	 	42	20	1	;	0	600	10000
+																																					
+																																					
+Default functions:	[Turb base name]	[time stop]	[turb_dx]	[wsp factor]	[wind_ramp_t1]	[wind_ramp_factor1]	[time_start]																														
+	"""turb_wsp[wsp]_s[seed]"""	[t0]+[sim_time]	"[wsp]*[time stop]/8192,0"	[tsr]/[wsp]	[t0]	[wsp factor]	[t0]																														
+																																					
+																																					
+																																					
+Gusts:																																					
+EOG	"min([1,35*(0,8*1,4*[ref_wind_speed]-[wsp]);3,3*[TI]*[wsp]/(1+0,1*[diameter]/[long_scale_param])])"																																				
+ECD	15																																				
+EWS	"(2,5+0,2*6,4*[TI]*[wsp]*([diameter]/[long_scale_param])**0,25)/[diameter]"																																				
+EDC	"4*arctan([TI]/(1+0,1*[diameter]/[long_scale_param]))*180/pi"																																				
+																																					
+Turbulence:																																					
+NTM	"([ref_ti]*(0,75*[wsp]+5,6))/[wsp]"																																				
+ETM	"2*[ref_ti]*(0,072*(0,2*[ref_wind_speed]/2+3)*([wsp]/2-4)+10)/[wsp]"																																				
+																																					
+	Wind speeds:																																				
+	4																																				
+	6																																				
+	8																																				
+	10																																				
+	12																																				
+	14																																				
+	16																																				
+	18																																				
+	20																																				
+	22																																				
+	24																																				
+	26																																				
+	28																																				
+	30																																				
+	32																																				
+	34																																				
+	36																																				
+	38																																				
+	40																																				
+	42																																				
+	44																																				
+	46																																				
+	48																																				
+	50																																				
diff --git a/docs/tutorials/data/dtu10mw_master_onshore.htc b/docs/tutorials/data/dtu10mw_master_onshore.htc
new file mode 100644
index 00000000..bcf46329
--- /dev/null
+++ b/docs/tutorials/data/dtu10mw_master_onshore.htc
@@ -0,0 +1,730 @@
+; DTU_10MW_RWT, version 5, 04-21-15, anyd 
+;
+; Demo master file for Wind Energy Toolbox
+; 
+begin simulation;
+  time_stop    [time stop];
+  solvertype   1 ;    (newmark)
+  on_no_convergence continue ;
+  convergence_limits 1E3 1.0 1E-7 ;
+  logfile ./logfiles/[Case folder]/[Case id.].log ;
+  begin newmark;
+    deltat    0.02;  
+  end newmark;
+end simulation;
+;
+;---------------------------------------------------------------------------------------------------------------------------------------------------------------- 
+begin new_htc_structure;
+;--------------------------------------------------------------------------------------------------
+[staircase]  beam_output_file_name  ./[eigenfreq_dir][Case folder]/[Case id.]/[Case id.]_beam.dat;
+[staircase]  body_output_file_name  ./[eigenfreq_dir][Case folder]/[Case id.]/[Case id.]_body.dat;
+[staircase]  struct_inertia_output_file_name ./[eigenfreq_dir][Case folder]/[Case id.]/[Case id.]_struct.dat;
+[staircase]  body_eigenanalysis_file_name ./[eigenfreq_dir][Case folder]/[Case id.]/[Case id.]_body_eigen.dat;
+[staircase]  structure_eigenanalysis_file_name ./[eigenfreq_dir][Case folder]/[Case id.]/[Case id.]_strc_eigen.dat;
+;---------------------------------------------------------------------------------------------------
+  begin main_body;         tower 115m
+    name        tower ;            
+    type        timoschenko ;
+    nbodies     1 ;
+    node_distribution     c2_def ;
+    damping_posdef   0.0 0.0 0.0 4.12E-03 4.12E-03 4.5E-04  ; Mx My Mz Kx Ky Kz , Ms raises overall level, Ks raises high freguency level "tuned by Larh"
+     begin timoschenko_input;
+      filename ./data/DTU_10MW_RWT_Tower_st.dat;
+      set 1 1 ; 
+    end timoschenko_input;
+    begin c2_def;              Definition of centerline (main_body coordinates)
+      nsec 11;
+      sec	1	0	0	0.00	0	;  x,y,z,twist
+      sec	2	0	0	-11.50	0	;
+      sec	3	0	0	-23.00	0	;
+      sec	4	0	0	-34.50	0	;
+      sec	5	0	0	-46.00	0	;
+      sec	6	0	0	-57.50	0	;
+      sec	7	0	0	-69.00	0	;
+      sec	8	0	0	-80.50	0	;
+      sec	9	0	0	-92.00	0	 ;
+      sec	10	0	0	-103.50	0	;
+      sec	11	0	0	-115.63	0	;	  
+     end c2_def ;
+    end main_body;
+;
+  begin main_body;
+    name        towertop ;              
+    type        timoschenko ;
+    nbodies     1 ;
+    node_distribution     c2_def ;
+    damping_posdef  0.0  0.0  0.0  7.00E-03  7.00E-03  7.00E-03  ;   "changed by Larh"	
+	concentrated_mass	2.0	0.0	2.6870E+00	3.0061E-01	4.4604E+05	4.1060E+06	4.1060E+05	4.1060E+06	;	Nacelle mass and inertia "corrected by Anyd 25/4/13"
+	begin timoschenko_input;
+      filename ./data/DTU_10MW_RWT_Towertop_st.dat ;
+      set 1 2 ;                
+    end timoschenko_input;
+    begin c2_def;              Definition of centerline (main_body coordinates)
+      nsec 2;
+      sec 1 0.0 0.0  0.0    0.0 ; x,y,z,twist
+      sec 2 0.0 0.0 -2.75   0.0 ; 
+    end c2_def ;
+  end main_body;
+;
+  begin main_body;
+    name        shaft ;              
+    type        timoschenko ;
+    nbodies     1 ;
+    node_distribution     c2_def ;
+	damping_posdef  0.0 0.0 0.0 4.65E-04  4.65E-04  3.983E-03 ; "tuned by Anyd 23/5/13 to 31.45 log decr. damping for free free with stiff rotor and tower"
+    concentrated_mass	1.0	0.0	0.0	0.0	0.0	0.0	0.0	3.751E+06	;	generator equivalent slow shaft "re_tuned by Anyd 20/2/13"  
+    concentrated_mass	5.0	0.0	0.0	0.0	1.0552E+05	0.0	0.0	3.257E+05	;	hub mass and inertia;	"re_tuned by Anyd 20/2/13"  
+	begin timoschenko_input;
+      filename ./data/DTU_10MW_RWT_Shaft_st.dat ;
+      set 1 1 ;                
+    end timoschenko_input;
+    begin c2_def;              Definition of centerline (main_body coordinates)
+      nsec 5;
+      sec 1 0.0 0.0 0.0 0.0 ; Tower top x,y,z,twist
+      sec 2 0.0 0.0 1.5 0.0 ; 
+      sec 3 0.0 0.0 3.0 0.0 ; 
+      sec 4 0.0 0.0 4.4	0.0 ; Main bearing
+      sec 5 0.0 0.0 7.1 0.0 ; Rotor centre
+    end c2_def ;
+  end main_body;	
+;
+  begin main_body;
+    name        hub1 ;              
+    type        timoschenko ;
+    nbodies     1 ;
+    node_distribution     c2_def ;
+    damping_posdef  0.0  0.0  0.0  3.00E-06  3.00E-06  2.00E-05;   "changed by Larh"	
+	begin timoschenko_input;
+      filename ./data/DTU_10MW_RWT_Hub_st.dat ;
+      set 1 2 ;                
+    end timoschenko_input;
+    begin c2_def;              Definition of centerline (main_body coordinates)
+      nsec 2;
+      sec 1 0.0 0.0 0.0 0.0 ; x,y,z,twist
+      sec 2 0.0 0.0 2.8 0.0 ; 
+    end c2_def ;
+  end main_body;
+;
+  begin main_body;
+    name           hub2 ;
+    copy_main_body hub1;
+  end main_body;
+;
+  begin main_body;
+    name           hub3 ;
+    copy_main_body hub1 ;
+  end main_body;
+;
+  begin main_body;
+    name        blade1 ;        
+    type        timoschenko ;
+    nbodies     10 ;
+    node_distribution    c2_def;
+	damping_posdef   0.0 0.0 0.0 1.53e-3 2.55e-3 3.3e-4 ; " 3% damping tuned by tkim 23/03/13 unable to fit 3rd and higher mode"
+    begin timoschenko_input ;
+      filename ./data/DTU_10MW_RWT_Blade_st.dat;
+      set 1 1 ;                set subset
+    end timoschenko_input;
+    begin c2_def;              Definition of centerline (main_body coordinates)
+		nsec 27 ;
+			sec	1	0.00000E+00	7.00600E-05	4.44089E-16	-1.45000E+01	;
+			sec	2	-2.06477E-05	-1.22119E-02	3.00000E+00	-1.45000E+01	;
+			sec	3	-7.28810E-03	-2.49251E-02	6.00000E+00	-1.44851E+01	;
+			sec	4	-1.89235E-02	-2.73351E-02	7.00004E+00	-1.44610E+01	;
+			sec	5	-5.41282E-02	-2.82163E-02	8.70051E+00	-1.43388E+01	;
+			sec	6	-1.26633E-01	-2.13210E-02	1.04020E+01	-1.40201E+01	;
+			sec	7	-2.25666E-01	-1.28378E-02	1.22046E+01	-1.33904E+01	;
+			sec	8	-2.88563E-01	-7.70659E-03	1.32065E+01	-1.29371E+01	;
+			sec	9	-3.99194E-01	-4.88317E-03	1.50100E+01	-1.19445E+01	;
+			sec	10	-5.76634E-01	-1.80296E-02	1.82151E+01	-9.98243E+00	;
+			sec	11	-7.07136E-01	-5.01772E-02	2.14178E+01	-8.45147E+00	;
+			sec	12	-7.91081E-01	-9.41228E-02	2.46189E+01	-7.46417E+00	;
+			sec	13	-8.37195E-01	-1.48880E-01	2.78193E+01	-6.72916E+00	;
+			sec	14	-8.53948E-01	-2.14514E-01	3.10194E+01	-6.08842E+00	;
+			sec	15	-8.49367E-01	-2.90618E-01	3.42197E+01	-5.49322E+00	;
+			sec	16	-7.93920E-01	-4.62574E-01	4.02204E+01	-4.39222E+00	;
+			sec	17	-7.16284E-01	-6.88437E-01	4.66217E+01	-3.09315E+00	;
+			sec	18	-6.34358E-01	-9.60017E-01	5.30232E+01	-1.75629E+00	;
+			sec	19	-5.53179E-01	-1.28424E+00	5.94245E+01	-5.00650E-01	;
+			sec	20	-4.75422E-01	-1.66402E+00	6.58255E+01	6.01964E-01	;
+			sec	21	-4.03180E-01	-2.10743E+00	7.22261E+01	1.55560E+00	;
+			sec	22	-3.30085E-01	-2.65630E+00	7.90266E+01	2.51935E+00	;
+			sec	23	-3.10140E-01	-2.78882E+00	8.05267E+01	2.72950E+00	;
+			sec	24	-2.86719E-01	-2.92517E+00	8.20271E+01	2.93201E+00	;
+			sec	25	-2.55823E-01	-3.06577E+00	8.35274E+01	3.11874E+00	;
+			sec	26	-2.07891E-01	-3.20952E+00	8.50277E+01	3.28847E+00	;
+			sec	27	-8.98940E-02	-3.33685E+00	8.63655E+01	3.42796E+00	;
+     end c2_def ;                                 
+   end main_body;
+;
+  begin main_body;
+    name           blade2 ;
+    copy_main_body blade1;
+  end main_body;
+;
+  begin main_body;
+    name           blade3 ;
+    copy_main_body blade1 ;
+  end main_body;
+;-------------------------------------------------------------------------------------------------------------------------------                   
+;
+  begin orientation;
+    begin base;
+      body   tower;
+      inipos        0.0 0.0 0.0 ;         initial position of node 1
+      body_eulerang 0.0 0.0 0.0;
+    end base;
+; 
+    begin relative;
+      body1  tower last;
+      body2  towertop 1;
+      body2_eulerang 0.0 0.0 0.0; 
+    end relative;
+;
+    begin relative;
+      body1  towertop last;
+      body2  shaft 1;
+      body2_eulerang 90.0 0.0 0.0; 
+      body2_eulerang 5.0 0.0 0.0;    5 deg tilt angle
+      body2_eulerang 0.0 0.0 [Rotor azimuth];
+[Free shaft rot]      mbdy2_ini_rotvec_d1 0.0 0.0 -1.0 [init_wr] ;
+    end relative;
+;
+    begin relative;
+      body1  shaft last;         
+      body2  hub1 1;
+      body2_eulerang -90.0 0.0 0.0;    
+      body2_eulerang 0.0 180.0 0.0;    
+      body2_eulerang 2.5 0.0 0.0;      2.5deg cone angle
+    end relative;
+;
+    begin relative;
+      body1  shaft last;         
+      body2  hub2 1;
+      body2_eulerang -90.0 0.0 0.0;    
+      body2_eulerang 0.0 60.0 0.0;   
+      body2_eulerang 2.5 0.0 0.0;      2.5deg cone angle
+    end relative;
+;
+    begin relative;
+      body1  shaft last;         
+      body2  hub3 1;
+      body2_eulerang -90.0 0.0 0.0;    
+      body2_eulerang 0.0 -60.0 0.0;    
+      body2_eulerang 2.5 0.0 0.0;      2.5deg cone angle
+    end relative;
+;
+    begin relative;
+      body1  hub1 last;         
+      body2  blade1 1;
+      body2_eulerang 0.0 0.0 0;    
+    end relative;
+;
+    begin relative;
+      body1  hub2 last;         
+      body2  blade2 1;
+      body2_eulerang 0.0 0.0 0.0;    
+    end relative;
+;
+    begin relative;
+      body1  hub3 last;         
+      body2  blade3 1;
+      body2_eulerang 0.0 0.0 0.0;    
+    end relative;
+;
+ 	end orientation;
+;-------------------------------------------------------------------------------------------------------------------------------
+begin constraint;   
+;
+    begin fix0;  fixed to ground in translation and rotation of node 1
+      body tower;
+    end fix0;
+;
+     begin fix1;
+		   body1 tower last ;
+		   body2 towertop 1;
+		 end fix1;
+;
+[Free shaft rot]    begin bearing1;                       free bearing
+[Free shaft rot]      name  shaft_rot;
+[Free shaft rot]      body1 towertop last;
+[Free shaft rot]      body2 shaft 1;
+[Free shaft rot]      bearing_vector 2 0.0 0.0 -1.0;        x=coo (0=global.1=body1.2=body2) vector in body2 coordinates where the free rotation is present
+[Free shaft rot]   end bearing1; 
+;
+[Rotor locked]    begin bearing3;                       free bearing
+[Rotor locked]      name  shaft_rot;
+[Rotor locked]      body1 towertop last;
+[Rotor locked]      body2 shaft 1;
+[Rotor locked]      bearing_vector 2 0.0 0.0 -1.0;        x=coo (0=global.1=body1.2=body2) vector in body2 coordinates where the free rotation is present
+[Rotor locked]      omegas 0.0 ;
+[Rotor locked]   end bearing3; 
+;
+     begin fix1;
+		   body1 shaft last ;
+		   body2 hub1 1;
+		 end fix1;
+;
+     begin fix1;
+		   body1 shaft last ;
+		   body2 hub2 1;
+		 end fix1;
+;
+     begin fix1;
+		   body1 shaft last ;
+		   body2 hub3 1;
+		 end fix1; 
+;	
+    begin bearing2;
+      name pitch1;		
+      body1 hub1 last;
+     body2 blade1 1;
+			bearing_vector 2 0.0 0.0 -1.0;
+   end bearing2;
+;
+    begin bearing2;
+      name pitch2;		
+      body1 hub2 last;
+      body2 blade2 1;
+			bearing_vector 2 0.0 0.0 -1.0;
+    end bearing2;
+;
+    begin bearing2;
+      name pitch3;		
+      body1 hub3 last;
+      body2 blade3 1;
+			bearing_vector 2 0.0 0.0 -1.0;
+    end bearing2;
+end constraint;
+;
+end new_htc_structure;
+;---------------------------------------------------------------------------------------------------------------------------------------------------------------- 
+begin wind ;
+  density                 1.225 ;
+  wsp                     [wsp]   ;
+  tint                    [TI]   ;
+  horizontal_input        1     ;
+  windfield_rotations     [wdir] 0.0 0.0 ;    yaw, tilt, rotation
+  center_pos0             0.0 0.0 -119 ; hub heigth
+  shear_format            3 [shear_exp] ;
+  turb_format             [turb_format]     ;  0=none, 1=mann,2=flex
+  tower_shadow_method     3     ;  0=none, 1=potential flow, 2=jet
+  scale_time_start       [t0] ;						   
+  wind_ramp_factor        0.0 [t0] [wsp factor] 1.0 ;
+ [gust] iec_gust               [gust_type] [G_A] [G_phi0] [G_t0] [G_T] ;
+; 
+[staircase]  wind_ramp_abs  400.0  401.0  0.0   1.0 ;   wsp. after the step:  5.0 
+[staircase]  wind_ramp_abs  501.0  502.0  0.0   1.0 ;   wsp. after the step:  6.0 
+[staircase]  wind_ramp_abs  602.0  603.0  0.0   1.0 ;   wsp. after the step:  7.0 
+[staircase]  wind_ramp_abs  703.0  704.0  0.0   1.0 ;   wsp. after the step:  8.0 
+[staircase]  wind_ramp_abs  804.0  805.0  0.0   1.0 ;   wsp. after the step:  9.0 
+[staircase]  wind_ramp_abs  905.0  906.0  0.0   1.0 ;   wsp. after the step: 10.0 
+[staircase]  wind_ramp_abs  1006.0  1007.0  0.0   1.0 ;   wsp. after the step: 11.0 
+[staircase]  wind_ramp_abs  1107.0  1108.0  0.0   1.0 ;   wsp. after the step: 12.0 
+[staircase]  wind_ramp_abs  1208.0  1209.0  0.0   1.0 ;   wsp. after the step: 13.0 
+[staircase]  wind_ramp_abs  1309.0  1310.0  0.0   1.0 ;   wsp. after the step: 14.0 
+[staircase]  wind_ramp_abs  1410.0  1411.0  0.0   1.0 ;   wsp. after the step: 15.0 
+[staircase]  wind_ramp_abs  1511.0  1512.0  0.0   1.0 ;   wsp. after the step: 16.0 
+[staircase]  wind_ramp_abs  1612.0  1613.0  0.0   1.0 ;   wsp. after the step: 17.0 
+[staircase]  wind_ramp_abs  1713.0  1714.0  0.0   1.0 ;   wsp. after the step: 18.0 
+[staircase]  wind_ramp_abs  1814.0  1815.0  0.0   1.0 ;   wsp. after the step: 19.0 
+[staircase]  wind_ramp_abs  1915.0  1916.0  0.0   1.0 ;   wsp. after the step: 20.0 
+[staircase]  wind_ramp_abs  2016.0  2017.0  0.0   1.0 ;   wsp. after the step: 21.0 
+[staircase]  wind_ramp_abs  2117.0  2118.0  0.0   1.0 ;   wsp. after the step: 22.0 
+[staircase]  wind_ramp_abs  2218.0  2219.0  0.0   1.0 ;   wsp. after the step: 23.0 
+[staircase]  wind_ramp_abs  2319.0  2320.0  0.0   1.0 ;   wsp. after the step: 24.0 
+[staircase]  wind_ramp_abs  2420.0  2421.0  0.0   1.0 ;   wsp. after the step: 25.0 
+  ;
+  begin mann ;
+    create_turb_parameters 29.4 1.0 3.9 [seed] 1.0 ;      L, alfaeps, gamma, seed, highfrq compensation
+    filename_u    ./[turb_dir][Turb base name]u.bin ;
+    filename_v    ./[turb_dir][Turb base name]v.bin ;
+    filename_w    ./[turb_dir][Turb base name]w.bin ;
+    box_dim_u    8192 [turb_dx] ;
+    box_dim_v    32 6.5;
+    box_dim_w    32 6.5;
+    std_scaling   1.0 0.7 0.5 ;
+  end mann ;
+;  
+  begin tower_shadow_potential_2;
+    tower_mbdy_link tower;
+    nsec  2;
+    radius      0.0  4.15 ;
+    radius     115.63 2.75 ;
+  end tower_shadow_potential_2;
+end wind;
+;
+begin aerodrag ;
+  begin aerodrag_element ;
+    mbdy_name tower;
+    aerodrag_sections uniform 10 ;
+    nsec 2 ;
+    sec 0.0 0.6 8.3 ;  tower bottom
+    sec 115.63 0.6 5.5 ;  tower top
+  end aerodrag_element;
+;
+  begin aerodrag_element ;        Nacelle drag side
+    mbdy_name shaft;
+    aerodrag_sections uniform 2 ;
+    nsec 2 ;
+    sec 0.0   0.8 10.0 ;  
+    sec 7.01  0.8 10.0 ;  
+  end aerodrag_element;
+end aerodrag;
+;
+begin aero ;
+  nblades  3;
+  hub_vec shaft -3 ;         rotor rotation vector (normally shaft composant directed from pressure to sustion side)
+  link 1 mbdy_c2_def blade1;
+  link 2 mbdy_c2_def blade2;
+  link 3 mbdy_c2_def blade3;
+  ae_filename        ./data/DTU_10MW_RWT_ae.dat ;
+  pc_filename        ./data/DTU_10MW_RWT_pc.dat ;
+  induction_method   [Induction] ;     0=none, 1=normal
+  aerocalc_method    1 ;     0=ingen aerodynamic, 1=med aerodynamic
+  aerosections       50 ; def. 50
+  ae_sets            1 1 1;
+  tiploss_method     1 ;     0=none, 1=prandtl
+  dynstall_method    [Dyn stall];     0=none, 1=stig øye method,2=mhh method
+;  
+end aero ;
+;-------------------------------------------------------------------------------------------------  
+begin dll;
+;
+  begin type2_dll;
+    name dtu_we_controller ;
+    filename  ./control/dtu_we_controller.dll ;
+    dll_subroutine_init init_regulation ;
+    dll_subroutine_update update_regulation ;
+    arraysizes_init  100 1 ;
+    arraysizes_update  50 100 ;
+	begin init ;
+       ; Overall parameters
+      constant   1 10000.0    	; Rated power [kW]                         
+      constant   2   0.628    	; Minimum rotor speed [rad/s]
+      constant   3   1.005    	; Rated rotor speed [rad/s]
+      constant   4  15.6E+06  	; Maximum allowable generator torque [Nm]
+      constant   5  100.0    	; Minimum pitch angle, theta_min [deg], 
+								; if |theta_min|>90, then a table of <wsp,theta_min> is read ;
+								; from a file named 'wptable.n', where n=int(theta_min)
+      constant   6  82.0    	; Maximum pitch angle [deg]
+      constant   7  10.0    	; Maximum pitch velocity operation [deg/s]
+      constant   8   0.4    	; Frequency of generator speed filter [Hz]
+      constant   9   0.7    	; Damping ratio of speed filter [-]
+      constant  10   1.92   	; Frequency of free-free DT torsion mode [Hz], if zero no notch filter used
+      ; Partial load control parameters
+      constant  11   1.175E+07  ; Optimal Cp tracking K factor [Nm/(rad/s)^2], ;
+                                ; Qg=K*Omega^2, K=eta*0.5*rho*A*Cp_opt*R^3/lambda_opt^3                     
+      constant  12   7.084E+07  ; Proportional gain of torque controller [Nm/(rad/s)]
+      constant  13   1.590E+07  ; Integral gain of torque controller [Nm/rad]
+      constant  14   0.0    	; Differential gain of torque controller [Nm/(rad/s^2)]
+;     Full load control parameters
+      constant  15   2      	; Generator control switch [1=constant power, 2=constant torque]
+      constant  16   1.304E+00  ; Proportional gain of pitch controller [rad/(rad/s)]
+      constant  17   3.511E-01  ; Integral gain of pitch controller [rad/rad]
+      constant  18   0.0    	; Differential gain of pitch controller [rad/(rad/s^2)]
+      constant  19   0.4e-8 	; Proportional power error gain [rad/W]
+      constant  20   0.4e-8 	; Integral power error gain [rad/(Ws)]
+      constant  21 	 1.135E+01  ; Coefficient of linear term in aerodynamic gain scheduling, KK1 [deg]
+      constant  22 	 4.007E+02  ; Coefficient of quadratic term in aerodynamic gain scheduling, KK2 [deg^2] &
+								; (if zero, KK1 = pitch angle at double gain)
+      constant  23   1.3    	; Relative speed for double nonlinear gain [-]
+;     Cut-in simulation parameters
+      constant  24  [Cut-in time] 		; Cut-in time [s]
+      constant  25  1.0   		; Time delay for soft start of torque [1/1P]
+;     Cut-out simulation parameters
+      constant  26  [Cut-out time]   ; Cut-out time [s]
+      constant  27   5.0 	; Time constant for linear torque cut-out [s]
+      constant  28  [Stop type]   	; Stop type [1=normal, 2=emergency]
+      constant  29  1.0  	; Time delay for pitch stop after shut-down signal [s]
+      constant  30  [Pitvel 1]  	; Maximum pitch velocity during initial period of stop [deg/s]
+      constant  31  3.0  	; Time period of initial pitch stop phase [s] (maintains pitch speed specified in constant 30)
+      constant  32  [Pitvel 2] 	; Maximum pitch velocity during final phase of stop [deg/s]
+;     Expert parameters (keep default values unless otherwise given)
+      constant  33   2.0  	; Lower angle above lowest minimum pitch angle for switch [deg]
+      constant  34   2.0  	; Upper angle above lowest minimum pitch angle for switch [deg], if equal then hard switch
+      constant  35  95.0  	; Ratio between filtered speed and reference speed for fully open torque limits [%]
+      constant  36   2.0  	; Time constant of 1st order filter on wind speed used for minimum pitch [1/1P]
+      constant  37   1.0  	; Time constant of 1st order filter on pitch angle used for gain scheduling [1/1P]
+;     Drivetrain damper
+      constant  38   0.0  	; Proportional gain of active DT damper [Nm/(rad/s)], requires frequency in input 10
+;	  Over speed
+	  constant  39  25.0  	; Overspeed percentage before initiating turbine controller alarm (shut-down) [%]
+;     Additional non-linear pitch control term (not used when all zero)
+	  constant  40   0.0  	; Err0 [rad/s] 
+	  constant  41   0.0  	; ErrDot0 [rad/s^2]
+	  constant  42   0.0  	; PitNonLin1 [rad/s]
+;     Storm control command
+	  constant 43   28.0  	; Wind speed 'Vstorm' above which derating of rotor speed is used [m/s]
+	  constant 44   28.0  	; Cut-out wind speed (only used for derating of rotor speed in storm) [m/s]	  
+;     Safety system parameters
+	  constant 45   30.0  ; Overspeed percentage before initiating safety system alarm (shut-down) [%]
+	  constant 46    1.5  ; Max low-pass filtered tower top acceleration level [m/s^2]
+;     Turbine parameter
+	  constant 47  178.0  ; Nominal rotor diameter [m]
+;     Parameters for rotor inertia reduction in variable speed region
+      constant 48    0.0  ; Proportional gain on rotor acceleration in variable speed region [Nm/(rad/s^2)] (not used when zero)
+;     Parameters for alternative partial load controller with PI regulated TSR tracking
+      constant 49    0.0  ; Optimal tip speed ratio [-] (only used when K=constant 11 = 0 otherwise  Qg=K*Omega^2 is used)
+;     Parameters for adding aerodynamic drivetrain damping on gain scheduling
+      constant 50    0.0  ; Proportional gain of aerodynamic DT damping [Nm/(rad/s)]
+      constant 51    0.0  ; Coefficient of linear term in aerodynamic DT damping scheduling, KK1 [deg]
+      constant 52    0.0  ; Coefficient of quadratic term in aerodynamic DT damping scheduling, KK2 [deg^2]
+	end init ;
+;
+    begin output ;
+      general time ; [s]     
+      constraint bearing1 shaft_rot 1 only 2 ; Drivetrain speed [rad/s]
+      constraint bearing2 pitch1 1 only 1; [rad]         
+      constraint bearing2 pitch2 1 only 1; [rad]                               
+      constraint bearing2 pitch3 1 only 1; [rad]                               
+      wind free_wind 1 0.0 0.0 -119 	 ; Global coordinates at hub height
+	  dll inpvec 2 2 					 ; Elec. power from generator servo .dll
+	  dll inpvec 2 8 					 ; Grid state flag from generator servo .dll
+	  mbdy state acc tower 10 1.0 global only 1 ; Tower top x-acceleration [m/s^2]
+	  mbdy state acc tower 10 1.0 global only 2 ; Tower top y-acceleration [m/s^2]
+    end output;     
+  end type2_dll;
+;
+   begin type2_dll;
+     name generator_servo ;
+     filename  ./control/generator_servo.dll ;
+     dll_subroutine_init init_generator_servo ;
+     dll_subroutine_update update_generator_servo ;
+     arraysizes_init  7 1 ;
+     arraysizes_update  4 8 ;
+ 	begin init ;
+       constant 1  20.0    ; Frequency of 2nd order servo model of generator-converter system [Hz]   
+       constant 2  0.9     ; Damping ratio 2nd order servo model of generator-converter system [-]
+       constant 3 15.6E+06 ; Maximum allowable LSS torque (pull-out torque) [Nm]
+       constant 4 0.94     ; Generator efficiency [-]
+       constant 5 1.0      ; Gearratio [-]
+       constant 6 0.0      ; Time for half value in softstart of torque [s]
+       constant 7 [Grid loss time]     ; Time for grid loss [s]
+     end init ;
+;
+     begin output;
+       general time                          	; Time [s]    
+       dll inpvec 1 1                        	; Electrical torque reference [Nm]  
+       constraint bearing1 shaft_rot 1 only 2	; Generator LSS speed [rad/s]   
+       mbdy momentvec shaft 1 1 shaft only 3 	; Shaft moment [kNm] (Qshaft)
+     end output;
+;
+     begin actions;    
+        mbdy moment_int shaft 1 -3 shaft towertop 2 ;   Generator LSS torque [Nm]
+     end actions;
+   end type2_dll;
+;
+   begin type2_dll;
+     name mech_brake ;
+     filename  ./control/mech_brake.dll ;
+     dll_subroutine_init init_mech_brake ;
+     dll_subroutine_update update_mech_brake ;
+     arraysizes_init    7 1 ;
+     arraysizes_update  4 6 ;
+ 	begin init ;
+      constant 1 2727252.0   ; Fully deployed maximum brake torque [Nm]
+      constant 2     100.0   ; Parameter alpha used in Q = tanh(omega*alpha), typically 1e2/Omega_nom
+      constant 3       0.625 ; Delay time for before brake starts to deploy [s] - from 5MW*1P_5/1P_10
+      constant 4       0.75  ; Time for brake to become fully deployed [s]
+     end init ;
+;
+     begin output;
+	   general time                           ; Time [s]
+	   constraint bearing1 shaft_rot 1 only 2 ; Generator LSS speed [rad/s]
+	   dll inpvec 1 25                        ; Command to deploy mechanical disc brake [0,1]
+     end output;
+;
+     begin actions;    
+        mbdy moment_int shaft 1 3 shaft towertop 2 ;   Brake LSS torque [Nm]
+     end actions;
+   end type2_dll;
+;
+  begin type2_dll;
+    name servo_with_limits ;
+    filename  ./control/servo_with_limits.dll ;
+    dll_subroutine_init init_servo_with_limits ;
+    dll_subroutine_update update_servo_with_limits ;
+    arraysizes_init  10 1 ;
+    arraysizes_update  5 9 ;
+	begin init ;
+      constant  1   3      ; Number of blades [-]
+      constant  2   1.0    ; Frequency of 2nd order servo model of pitch system [Hz]
+      constant  3   0.7    ; Damping ratio 2nd order servo model of pitch system [-]
+      constant  4  10.0    ; Max. pitch speed [deg/s]
+      constant  5  15.0    ; Max. pitch acceleration [deg/s^2]
+      constant  6  -5.0    ; Min. pitch angle [deg] 
+      constant  7  90.0    ; Max. pitch angle [deg] 	  
+	  constant  8 [Time pitch runaway]   ; Time for pitch runaway [s]
+	  constant  9 [Time stuck DLC22b]   ; Time for stuck blade 1 [s]
+	  constant 10 [Pitch 1 DLC22b]   ; Angle of stuck blade 1 [deg]
+	end init ;
+    begin output;
+      general time        ;  Time                         [s]     
+       dll inpvec 1 2     ;  Pitch1 demand angle          [rad]
+       dll inpvec 1 3     ;  Pitch2 demand angle          [rad]
+       dll inpvec 1 4     ;  Pitch3 demand angle          [rad]
+       dll inpvec 1 26    ;  Flag for emergency pitch stop         [0=off/1=on]
+    end output;           
+;
+    begin actions;    
+      constraint bearing2 angle pitch1 ; Angle pitch1 bearing    [rad]
+      constraint bearing2 angle pitch2 ; Angle pitch2 bearing    [rad]
+      constraint bearing2 angle pitch3 ; Angle pitch3 bearing    [rad]
+    end actions;                      
+  end type2_dll;
+;
+;	--- DLL for tower-blade tip distance -- ;
+  begin type2_dll; 
+    name towerclearance_mblade ; tower clearance DLL
+    filename  .\control\towerclearance_mblade ;
+    dll_subroutine_init initialize ;
+    dll_subroutine_update update ;
+    arraysizes_init  1 3 ;
+    arraysizes_update  12 6 ;
+    begin init ;    Variables passed into initialization function
+      constant  1 4.15  ; Tower radius at tower bottom [m] 
+      constant  2 2.75  ; Tower radius at tower top [m]
+      constant  3   3  ; Number of blade points to check [-]
+    end init ;
+    begin output;   Variables passed into update function
+      mbdy state pos  tower   1  0.00 global ; [1,2,3] global coordinates of tower base
+      mbdy state pos  tower  10  1.00 global ; [4,5,6] global coordinates of tower base
+      mbdy state pos blade1  26  1.00 global ; [7,8,9] global coordinates of point 1 (blade 1 100.0% R)
+      mbdy state pos blade2  26  1.00 global ; [10,11,12] global coordinates of point 2 (blade 2 100.0% R)
+      mbdy state pos blade3  26  1.00 global ; [12,13,14] global coordinates of point 3 (blade 3 100.0% R)
+    end output;    
+  end type2_dll;
+end dll;
+;---------------------------------------------------------------------------------------------------------------------------------------------------------------- 
+;
+begin output;
+  filename ./res/[Case folder]/[Case id.] ;
+  time [t0] [time stop] ;
+  data_format  [out_format];
+  buffer 1 ;
+;
+  general time;  
+  constraint bearing1 shaft_rot 2; angle and angle velocity 
+  constraint bearing2 pitch1 5;    angle and angle velocity 
+  constraint bearing2 pitch2 5;    angle and angle velocity 
+  constraint bearing2 pitch3 5;    angle and angle velocity 
+  aero omega ;
+  aero torque;
+  aero power;
+  aero thrust;
+  wind free_wind 1 0.0 0.0 -208.15; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z
+  wind free_wind 1 0.0 0.0 -169; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z
+  wind free_wind 1 0.0 0.0 -119; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z
+  wind free_wind 1 0.0 0.0 -69; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z  
+  wind free_wind 1 0.0 0.0 -29.85; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z
+  ; Moments:
+  mbdy momentvec tower  1 1  tower # tower base ;
+  mbdy momentvec tower  10 2 tower # tower yaw bearing ;
+  mbdy momentvec shaft  4 1  shaft # main bearing ;
+  mbdy momentvec blade1 2  2 blade1 # blade 1 root ;
+  mbdy momentvec blade2 2  2 blade2 # blade 2 root ;
+  mbdy momentvec blade3 2  2 blade3 # blade 3 root ;
+  mbdy momentvec blade1 13 1 local # blade 1 50% local e coo ;
+  mbdy momentvec blade2 13 1 local # blade 2 50% local e coo ;
+  mbdy momentvec blade3 13 1 local # blade 3 50% local e coo ;
+  ; Displacements and accellerations
+  mbdy state pos tower 10 1.0 global only 1 # Tower top FA displ; 
+  mbdy state pos tower 10 1.0 global only 2 # Tower top SS displ; 
+  mbdy state acc tower 10 1.0 global only 1 # Tower top FA acc; 
+  mbdy state acc tower 10 1.0 global only 2 # Tower top SS acc; 
+;  
+  mbdy state pos blade1  26 1.0 blade1 # blade 1 tip pos ;
+  mbdy state pos blade2  26 1.0 blade2 # blade 2 tip pos ;
+  mbdy state pos blade3  26 1.0 blade3 # blade 3 tip pos ;
+  mbdy state pos blade1  26 1.0 global # gl blade 1 tip pos ;  
+; - Monitor Aerodynamics - ;
+  aero windspeed 3 1 1 72.5;
+  aero alfa 1 72.5; 
+  aero alfa 2 72.5; 
+  aero alfa 3 72.5; 
+  aero cl 1 72.5;
+  aero cl 2 72.5;
+  aero cl 3 72.5;
+  aero cd 1 72.5;
+  aero cd 2 72.5;
+  aero cd 3 72.5;    
+; - Main Controller - 
+; Output to controller
+  ; dll outvec 1 1 # time;
+  ; dll outvec 1 2 # slow speed shaft rad/s;
+  ; dll outvec 1 3 # pitch angle 1;
+  ; dll outvec 1 4 # pitch angle 2;
+  ; dll outvec 1 5 # pitch angle 3;
+  ; dll outvec 1 6 # WSP_x_global;
+  ; dll outvec 1 7 # WSP_y_global;
+  ; dll outvec 1 8 # WSP_z_global;
+  ; dll outvec 1 9 # Elec. pwr ;
+  ; dll outvec 1 10 # Grid flag ;
+; Input from controller
+  dll inpvec 1  1 # Generator torque reference            [Nm]   ;
+  dll inpvec 1  2 # Pitch angle reference of blade 1      [rad]  ;
+  dll inpvec 1  3 # Pitch angle reference of blade 2      [rad]  ;
+  dll inpvec 1  4 # Pitch angle reference of blade 3      [rad]  ;
+  ; dll inpvec 1  5 # Power reference                       [W]    ;
+  ; dll inpvec 1  6 # Filtered wind speed                   [m/s]  ;
+  ; dll inpvec 1  7 # Filtered rotor speed                  [rad/s];
+  ; dll inpvec 1  8 # Filtered rotor speed error for torque [rad/s];
+  ; dll inpvec 1  9 # Bandpass filtered rotor speed         [rad/s];
+  ; dll inpvec 1 10 # Proportional term of torque contr.    [Nm]   ;
+  ; dll inpvec 1 11 # Integral term of torque controller    [Nm]   ;
+  ; dll inpvec 1 12 # Minimum limit of torque               [Nm]   ;
+  ; dll inpvec 1 13 # Maximum limit of torque               [Nm]   ;
+  dll inpvec 1 14 # Torque limit switch based on pitch    [-]    ;
+  ; dll inpvec 1 15 # Filtered rotor speed error for pitch  [rad/s];
+  ; dll inpvec 1 16 # Power error for pitch                 [W]    ;
+  ; dll inpvec 1 17 # Proportional term of pitch controller [rad]  ;
+  ; dll inpvec 1 18 # Integral term of pitch controller     [rad]  ;
+  ; dll inpvec 1 19 # Minimum limit of pitch                [rad]  ;
+  ; dll inpvec 1 20 # Maximum limit of pitch                [rad]  ;
+  dll inpvec 1 21 # Torque reference from DT dammper      [Nm]  ;
+  dll inpvec 1 22 # Status signal                         [-]  ;
+  ; dll inpvec 1 23 # Total added pitch rate                [rad/s]  ;  
+  dll inpvec 1 24 # Filtered Mean pitch for gain sch      [rad]  ;  
+  dll inpvec 1 25 # Flag for mechnical brake              [0=off/1=on] ;
+  dll inpvec 1 26 # Flag for emergency pitch stop         [0=off/1=on] ;
+  dll inpvec 1 27 # LP filtered acceleration level        [m/s^2] ;
+; ; Output to generator model
+   ; dll outvec 2 1  # time ;
+   ; dll outvec 2 2  # Electrical torque reference [Nm] ;
+   ; dll outvec 2 3  # omega LSS ;
+; Input from generator model
+   dll inpvec 2 1  # Mgen LSS [Nm];
+   dll inpvec 2 2  # Pelec W ;
+   dll inpvec 2 3  # Mframe ;
+   dll inpvec 2 4  # Mgen HSS ;
+   dll inpvec 2 5  # Generator Pmech kW ;
+   dll inpvec 2 6  # Filtered Gen speed ;
+   dll inpvec 2 7  # Elec. pwr ;
+   dll inpvec 2 8  # Grid flag ;
+; Output to mechanical brake
+   dll inpvec 3 1 # Brake torque [Nm] ;
+; ; Input from mechanical brake
+   ; dll outvec 3 1 # Time [s] ;
+   ; dll outvec 3 2 # Generator LSS speed [rad/s] ;
+   ; dll outvec 3 3 # Deploy brake ;
+; ; Output to pitch servo
+   ; dll outvec 4 1 # time;
+   ; dll outvec 4 2 # pitchref 1;
+   ; dll outvec 4 3 # pitchref 2;
+   ; dll outvec 4 4 # pitchref 3;
+   ; dll outvec 4 5 # Emerg. stop;
+; Input from pitch servo
+   dll inpvec 4 1 # pitch 1;
+   dll inpvec 4 2 # pitch 2;
+   dll inpvec 4 3 # pitch 3;
+; Outputs from tower clearence DLL
+   dll inpvec 5 1 # Min clearance [m];
+   dll inpvec 5 2 # Idx closest pt to towr [-];
+   dll inpvec 5 3 # Rel dist tower bottom to top [-];
+   dll inpvec 5 4 # Tower rad at pt height [m];
+   dll inpvec 5 5 # Tower center x at pt height [m];
+   dll inpvec 5 6 # Tower center y at pt height [m];
+end output;
+;
+exit;
\ No newline at end of file
-- 
GitLab