summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xArduBasicRW.mo19
-rwxr-xr-xArduinoCode/IPCArdNew/IPCArdNew.ino27
-rwxr-xr-xArduinoIPCWrite.mo19
-rwxr-xr-xAvr_PID.mo10
-rw-r--r--CessnaTest.mo75
-rw-r--r--FlightControlModel.mo45
-rw-r--r--FlightLongs.mo123
-rw-r--r--FlightPitchHold.mo48
-rw-r--r--FlightPitchHoldHIL.mo35
-rw-r--r--FlightVelocityHold.mo29
-rw-r--r--Flight_Dynamics.mo404
-rwxr-xr-xFlight_Dynamics_Test.mo168
-rwxr-xr-xFlight_Eqns/Equations/Equations.aux1
-rwxr-xr-xFlight_Eqns/Equations/Equations.log184
-rwxr-xr-xFlight_Eqns/Equations/Equations.pdfbin0 -> 104191 bytes
-rwxr-xr-xFlight_Eqns/Equations/Equations.tex72
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOF.mo191
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOFBasic.mo95
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOFBlock.mo185
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOFLinTest.mo184
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOFVer.mo182
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/Wind6DOFZagi.mo187
-rw-r--r--Flight_Eqns/Wind_Axis_eqns/WindForceMoment.mo124
-rwxr-xr-xIPC_testing.mo46
-rwxr-xr-xInterProcessExamples/DCMotor.mo65
-rwxr-xr-xInterProcessExamples/DiscretePID.mo56
-rwxr-xr-xInterProcessExamples/package.mo16
-rwxr-xr-xInterProcessExamples/package.order2
-rwxr-xr-xMDD_HIL Practice_Cases/MDD_Testing.mo61
-rwxr-xr-xMDD_HIL Practice_Cases/Serial_Write.mo48
-rwxr-xr-xMDD_HIL Practice_Cases/Serial_read.mo36
-rwxr-xr-xMDD_HIL Practice_Cases/Serial_read_write.mo58
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/.gitignore37
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Arduino.mo1775
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Instructions.txt14
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_bothbin0 -> 24150 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.hex121
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both_main.c217
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clockbin0 -> 22099 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.hex101
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock_main.c213
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loopbin0 -> 25914 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.hex135
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop_main.c217
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_both.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_clock.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_loop.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_ledbin0 -> 23828 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.hex120
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led_main.c243
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_read.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_led.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_read.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blinkbin0 -> 23721 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.hex114
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink_main.c212
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_bluebin0 -> 4964 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.hex93
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delaybin0 -> 22109 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.hex100
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay_main.c212
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_main.c212
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_redbin0 -> 5364 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.hex108
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red_main.c215
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blinkbin0 -> 5900 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.hex131
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink_main.c212
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blink.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_delay.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_red.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_green_blink.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_thresholdbin0 -> 6052 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.hex150
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold_main.c264
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/runMDD_pot_threshold.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_buttonbin0 -> 21147 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.hex94
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button_main.c234
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_statusbin0 -> 21092 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.hex91
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status_main.c219
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_led_push_button.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_push_button_status.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_init.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_loop.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_pot.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_reverse.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_initbin0 -> 21112 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.hex94
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init_main.c213
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop_main.c235
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot_main.c244
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reversebin0 -> 22099 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.hex101
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse_main.c213
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_buzzer.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_read.mos11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzerbin0 -> 23856 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.hex121
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer_main.c253
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_readbin0 -> 5388 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.hex114
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.sh61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read_main.c226
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/README.md24
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Images/Icons/tqfp32.pngbin0 -> 11905 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/analog.h2
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/analogv.h2
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/dcmotor.h3
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/digital.h2
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/encoder.h1
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/ieeesingle2num.h3
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/modbus.h4
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/serial.h30
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Include/servomotor.h3
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog.obin0 -> 3112 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog_volt.obin0 -> 3576 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_digital.obin0 -> 3144 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/dcmotor.obin0 -> 5104 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/delay.obin0 -> 1424 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/ieeesingle2num.obin0 -> 3080 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalog.sobin0 -> 13306 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalogv.sobin0 -> 13373 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDCMotor.sobin0 -> 13300 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDigital.sobin0 -> 13222 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libModbus.sobin0 -> 17600 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libSerialComm.sobin0 -> 8072 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libServoMotor.sobin0 -> 13297 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libdelay.sobin0 -> 7909 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libfloor.sobin0 -> 7897 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/libinterrupt.sobin0 -> 8080 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/mfloor.obin0 -> 1432 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/modbus.obin0 -> 10152 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/noInterrupts.obin0 -> 1976 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/serialComm.obin0 -> 4664 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/servomotor.obin0 -> 3432 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/Library/wakeup.obin0 -> 1520 bytes
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog.c61
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog_volt.c63
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_digital.c63
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_encoder_init.c39
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/dcmotor.c117
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/delay.c11
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/ieeesingle2num.c87
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/mfloor.c6
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/modbus.c449
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/nointerrupts.c15
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/serialComm.c156
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/servomotor.c87
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/Resources/src/wakeup.c16
-rwxr-xr-xModelica-Arduino-MDD_Arduino_Revised/test_firmware.mo20
m---------Modelica_DeviceDrivers0
m---------Modelica_LinearSystems20
-rwxr-xr-xOM_Arduino_doc/IMG_20180427_131831.jpgbin0 -> 2026877 bytes
-rwxr-xr-xOM_Arduino_doc/Image_Of_Shield.jpgbin0 -> 2017215 bytes
-rwxr-xr-xOM_Arduino_doc/Model.pngbin0 -> 43120 bytes
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.aux25
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.log1488
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.out2
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.pdfbin0 -> 6241281 bytes
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.synctex.gzbin0 -> 21379 bytes
-rwxr-xr-xOM_Arduino_doc/OM_Arduino.tex80
-rwxr-xr-xOM_Arduino_doc/Shield_With_Code.jpgbin0 -> 2049084 bytes
-rw-r--r--PID_Practice_Cases/PulseDCMotorPID.mo37
-rw-r--r--PID_Practice_Cases/RLC_ckt.mo43
-rwxr-xr-xPID_Practice_Cases/SpringMassHIl.mo75
-rwxr-xr-xPID_Practice_Cases/SpringMassPID.mo38
-rwxr-xr-xPID_Practice_Cases/Virtual_PID.mo23
-rw-r--r--PID_Practice_Cases/tank_model.mo205
-rw-r--r--Prof_Arya/Cessna_6DOF.mdl2069
-rw-r--r--Prof_Arya/Cessna_6DOF.mdl.r2011a1849
-rw-r--r--Prof_Arya/Cessna_6DOF_Wind_trim.mdl2310
-rw-r--r--Prof_Arya/Cessna_6DOF_Wind_trim.mdl.r2014a2317
-rw-r--r--Prof_Arya/Cessna_6DOF_sfun.mexw640
-rw-r--r--Prof_Arya/Cessna_6DOF_trim_ha.slxbin0 -> 19457 bytes
-rw-r--r--Prof_Arya/Comp_LinMod.m32
-rw-r--r--Prof_Arya/Initial_Cessna.m93
-rw-r--r--Prof_Arya/Linearisation_LinMod.m16
-rw-r--r--Prof_Arya/Trim_Cessna_Body.m28
-rw-r--r--Prof_Arya/Trim_Function_Cessna.m26
-rw-r--r--Prof_Arya/[Content_Types].xml1
-rw-r--r--Prof_Arya/_rels/.rels1
-rw-r--r--Prof_Arya/getstatenames.m47
-rw-r--r--Prof_Arya/lineariz.zipbin0 -> 2809 bytes
-rw-r--r--Prof_Arya/metadata/coreProperties.xml1
-rw-r--r--Prof_Arya/metadata/thumbnail.pngbin0 -> 5911 bytes
-rw-r--r--Prof_Arya/simulink/blockdiagram.xml1840
-rw-r--r--Prof_Arya/slprj/_jitprj/jitEngineAccessInfo.matbin0 -> 834 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.lbin0 -> 17736 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.matbin0 -> 688 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.lbin0 -> 16000 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.matbin0 -> 705 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.lbin0 -> 16000 bytes
-rw-r--r--Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.matbin0 -> 702 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/binfo.matbin0 -> 2986 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_61lDY9MbzCSyk6tMTxmxsG.matbin0 -> 21061 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_jFM61yZv4AZtAtyV4ewisH.matbin0 -> 11024 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_v045JFXizl4FQXSha8a34C.matbin0 -> 21168 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.c2330
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.h41
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_cessna_6dof.obj0
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF_Wind_trim/_self/sfun/info/binfo.matbin0 -> 786 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/Cessna_6DOF_trim_ha/_self/sfun/info/binfo.matbin0 -> 785 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/EMLReport/emlReportAccessInfo.matbin0 -> 786 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/EMLReport/sEI9p49izcHUxn63CWpG2IC.matbin0 -> 18809 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/EMLReport/sjLZixcOZskMJeeDfIb93hH.matbin0 -> 34231 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/precompile/9awVvODnlASRfvLpAy51pB.matbin0 -> 879 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/precompile/CHfRUMKLp7zBZlxChVZlPD.matbin0 -> 870 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/precompile/VPBs6CX5Fj2d3KwfGqQPeF.matbin0 -> 867 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/precompile/autoInferAccessInfo.matbin0 -> 850 bytes
-rw-r--r--Prof_Arya/slprj/_sfprj/precompile/pFxf9FCl6UH0ED177v1E9B.matbin0 -> 882 bytes
-rw-r--r--RotationalSMD_Concat.mo17
-rw-r--r--SpringMassTest.mo17
-rwxr-xr-xTest6DOF.mo9
-rw-r--r--TestFmZagi.mo86
-rw-r--r--Trim_Cessna.mo96
-rwxr-xr-xavr_test.mo29
-rwxr-xr-xbasic_1st_order.mo6
-rw-r--r--log.out0
-rw-r--r--runMDDManasTest11
-rw-r--r--runMDDManasTest.mos11
240 files changed, 28394 insertions, 0 deletions
diff --git a/ArduBasicRW.mo b/ArduBasicRW.mo
new file mode 100755
index 0000000..8637b5e
--- /dev/null
+++ b/ArduBasicRW.mo
@@ -0,0 +1,19 @@
+model ArduBasicRW
+import InterProcessCommunication.SharedMemory.*;
+Real ModelicaInput;
+ Real ModelicaOutput (start = 1);
+ Real OutputDummy;
+ Real OP (start = 0);
+ equation
+
+ ModelicaOutput = time;
+ when sample(0, 0.02) then
+
+ ModelicaInput = InterProcessCommunication.SharedMemory.SharedMemoryRead(1);
+ OutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(1, ModelicaOutput);
+ end when;
+ OP = ModelicaOutput - ModelicaInput;
+annotation(
+ experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-6, Interval = 0.001));
+
+end ArduBasicRW; \ No newline at end of file
diff --git a/ArduinoCode/IPCArdNew/IPCArdNew.ino b/ArduinoCode/IPCArdNew/IPCArdNew.ino
new file mode 100755
index 0000000..3f9ae24
--- /dev/null
+++ b/ArduinoCode/IPCArdNew/IPCArdNew.ino
@@ -0,0 +1,27 @@
+void setup()
+{
+ Serial.begin(115200); //serial begin
+}
+
+void loop()
+{
+ String readStr = ""; //some variables
+ String readVal = "";
+ double inVal, outVal;
+
+ if (Serial.available()){ //when serial data comes from modelica
+ while(Serial.available()){
+ char readChar = (char)Serial.read();
+ readStr+=readChar;
+ if(readChar == '\n') break;
+ } //read the data and store in a string
+ for (int i = 1; i < (readStr.length()-1); i++)
+ {
+ readVal += readStr[i];
+ }
+ inVal = readVal.toDouble(); //extract value
+ outVal = inVal/2;
+ Serial.print("1," + String(outVal) + "\n"); //send data in same format i.e. ending with \n character
+ delay(1);
+ }
+}
diff --git a/ArduinoIPCWrite.mo b/ArduinoIPCWrite.mo
new file mode 100755
index 0000000..8b269b4
--- /dev/null
+++ b/ArduinoIPCWrite.mo
@@ -0,0 +1,19 @@
+class ArduinoIPCWrite
+
+import InterProcessCommunication.SharedMemory.*;
+Real ModelicaInput;
+ Real ModelicaOutput (start = 1);
+ Real OutputDummy;
+ equation
+
+
+ ModelicaOutput = sin(time)*100;
+ when sample(0, 0.005) then
+
+ ModelicaInput = InterProcessCommunication.SharedMemory.SharedMemoryRead(1);
+ OutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(1, ModelicaOutput);
+
+ end when;
+annotation(
+ experiment(StartTime = 0, StopTime = 20, Tolerance = 1e-6, Interval = 0.12));
+end ArduinoIPCWrite; \ No newline at end of file
diff --git a/Avr_PID.mo b/Avr_PID.mo
new file mode 100755
index 0000000..1e98b04
--- /dev/null
+++ b/Avr_PID.mo
@@ -0,0 +1,10 @@
+model Avr_PID
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-76, 76}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PI PI(T = 10 ^ 20, k = 1) annotation(
+ Placement(visible = true, transformation(origin = {-4, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
+equation
+
+ annotation(
+ uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2")));
+end Avr_PID; \ No newline at end of file
diff --git a/CessnaTest.mo b/CessnaTest.mo
new file mode 100644
index 0000000..6f2b473
--- /dev/null
+++ b/CessnaTest.mo
@@ -0,0 +1,75 @@
+model CessnaTest
+
+
+
+
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+//parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+parameter Real I_xx = 1285.31;
+parameter Real I_yy = 1824.93;
+parameter Real I_zz = 2666.893;
+
+
+ Wind6DOF wind6DOF1 ( CD0 = CD0, CD_alpha = CD_alpha, CD_beta = CD_beta, CD_delta_e = CD_delta_e, CD_q = CD_q, CL0 = CL0, CL_alpha = CL_alpha, CL_delta_e = CL_delta_e, CL_q = CL_q, Cl_beta = Cl_beta, Cl_delta_a = Cl_delta_a, Cl_delta_r =Cl_delta_r, Cl_p = Cl_p, Cl_r = Cl_r, Cm0 = Cm0, Cm_alpha = Cm_alpha, Cm_delta_e = Cm_delta_e, Cm_q = Cm_q, Cn_beta = Cn_beta, Cn_delta_a = Cn_delta_a, Cn_delta_r = Cn_delta_r, Cn_p = Cn_p, Cn_r = Cn_r, Cy_beta = Cy_beta, Cy_delta_a = Cy_delta_a, Cy_delta_r = Cy_delta_r, Cy_p = Cy_p, Cy_r = Cy_r, b= b, C_bar =C_bar, g = 9.81, m = m, I_xx = I_xx, I_yy = I_yy, I_zz = I_zz, rho = 1.225, S_ref = S_ref, alpha (start= 0.1), omega (start = {0, 0, 0}), pos (start = {0, 0, -100}), V (start = 39.8858)) annotation( Placement(visible = true, transformation(origin = {41, 9}, extent = {{-27, -27}, {27, 27}}, rotation = 0)));
+
+
+Modelica.Blocks.Sources.Constant thrust (k = 1112.82) annotation(
+ Placement(visible = true, transformation(origin = {-46, 18}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+
+ Modelica.Blocks.Sources.Constant [3] delta(k = {0, -0.15625, 0}) annotation(
+ Placement(visible = true, transformation(origin = {-82, -12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(wind6DOF1.delta, delta.y) annotation(
+ Line(points = {{12, 0}, {-30, 0}, {-30, -12}, {-70, -12}, {-70, -12}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(wind6DOF1.thrust, thrust.y) annotation(
+ Line(points = {{12, 18}, {-35, 18}}, color = {0, 0, 127}));
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+end CessnaTest; \ No newline at end of file
diff --git a/FlightControlModel.mo b/FlightControlModel.mo
new file mode 100644
index 0000000..aa89f85
--- /dev/null
+++ b/FlightControlModel.mo
@@ -0,0 +1,45 @@
+model FlightControlModel
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {26, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback2 annotation(
+ Placement(visible = true, transformation(origin = {-52, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ FlightLongs flightLongs1 annotation(
+ Placement(visible = true, transformation(origin = {72, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Gain gain2(k = 0.005) annotation(
+ Placement(visible = true, transformation(origin = {53, -17}, extent = {{5, -5}, {-5, 5}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PI PI(T = 15, k = 0.2) annotation(
+ Placement(visible = true, transformation(origin = {-14, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant altitude(k = 100) annotation(
+ Placement(visible = true, transformation(origin = {-148, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback3 annotation(
+ Placement(visible = true, transformation(origin = {-114, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PI PI1(T = 20, k = 0.1) annotation(
+ Placement(visible = true, transformation(origin = {-84, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant thrust(k = 1112.82) annotation(
+ Placement(visible = true, transformation(origin = {22, 54}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(thrust.y, flightLongs1.thrust) annotation(
+ Line(points = {{34, 54}, {46, 54}, {46, 20}, {62, 20}, {62, 20}}, color = {0, 0, 127}));
+ connect(flightLongs1.theta, feedback2.u2) annotation(
+ Line(points = {{84, 16}, {94, 16}, {94, -28}, {-52, -28}, {-52, 4}, {-52, 4}}, color = {0, 0, 127}));
+ connect(flightLongs1.q, gain2.u) annotation(
+ Line(points = {{84, 12}, {90, 12}, {90, -18}, {60, -18}, {60, -16}}, color = {0, 0, 127}));
+ connect(feedback1.y, flightLongs1.del) annotation(
+ Line(points = {{36, 12}, {60, 12}, {60, 12}, {62, 12}}, color = {0, 0, 127}));
+ connect(flightLongs1.z, feedback3.u2) annotation(
+ Line(points = {{83, 21}, {104, 21}, {104, -38}, {-112, -38}, {-112, 4}, {-114, 4}}, color = {0, 0, 127}));
+ connect(PI1.y, feedback2.u1) annotation(
+ Line(points = {{-72, 12}, {-62, 12}, {-62, 12}, {-60, 12}}, color = {0, 0, 127}));
+ connect(feedback3.y, PI1.u) annotation(
+ Line(points = {{-104, 12}, {-96, 12}, {-96, 12}, {-96, 12}}, color = {0, 0, 127}));
+ connect(feedback3.u1, altitude.y) annotation(
+ Line(points = {{-122, 12}, {-136, 12}, {-136, 12}, {-136, 12}}, color = {0, 0, 127}));
+ connect(PI.y, feedback1.u1) annotation(
+ Line(points = {{-3, 12}, {18, 12}}, color = {0, 0, 127}));
+ connect(PI.u, feedback2.y) annotation(
+ Line(points = {{-26, 12}, {-42, 12}}, color = {0, 0, 127}));
+ connect(gain2.y, feedback1.u2) annotation(
+ Line(points = {{47.5, -17}, {26, -17}, {26, -6.5}, {26, -6.5}, {26, 4}}, color = {0, 0, 127}));
+ annotation(experiment(StartTime = 0, StopTime = 500, Interval = 0.002), uses(Modelica(version = "3.2.2")));
+
+ end FlightControlModel; \ No newline at end of file
diff --git a/FlightLongs.mo b/FlightLongs.mo
new file mode 100644
index 0000000..3f5ecce
--- /dev/null
+++ b/FlightLongs.mo
@@ -0,0 +1,123 @@
+model FlightLongs
+
+import Modelica.Blocks.Interfaces.*;
+
+parameter Real rho = 1.225;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+parameter Real g = 9.81;//gravitational force
+//parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+
+//Initial conditions. (delta[2], thrust[1] and the others are straightforward)
+
+parameter Real I_yy = 1824.93;
+
+
+Real CL;
+Real CD;
+Real Cm;
+Real CX;
+Real CZ;
+
+
+ RealInput del (start = -0.15625) annotation( Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+
+ RealInput thrust (start = 1112.82) annotation( Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+
+
+ Modelica.Blocks.Interfaces.RealOutput q (start = 0) annotation(Placement(visible = true, transformation(origin = {110, -50}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110,-50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+ Modelica.Blocks.Interfaces.RealOutput V (start = 39.8858) annotation(Placement(visible = true, transformation(origin = {110, 100}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110,100}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+
+ Modelica.Blocks.Interfaces.RealOutput theta (start = 0.1) annotation(Placement(visible = true, transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110,0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+Real x (start = 0.1);
+ Modelica.Blocks.Interfaces.RealOutput z (start = 100) annotation(Placement(visible = true, transformation(origin = {110, 50}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110,50}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+Real alpha (start = 0.1) ;
+Real gamma = alpha - theta;
+
+
+Real qbar = 0.5*rho*V^2;
+
+Real Vdot;
+Real alphadot;
+Real gammadot;
+Real qdot;
+Real xdot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+CL_delta_e*del;
+CD = CD0 + K_drag*CL^2;
+Cm = Cm0+Cm_alpha*alpha+Cm_delta_e*del;
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+
+Vdot = der(V);
+alphadot = der(alpha);
+gammadot = der(gamma);
+qdot = der(q);
+xdot = der(x);
+zdot = der(z);
+
+
+
+Vdot = (1/m) *(thrust*cos(alpha) -qbar*S_ref*CD - m*g*sin(gamma));
+alphadot = q - (-(g/V)*cos(gamma) + (qbar*S_ref*CL + thrust*sin(alpha))/(m*V));
+qdot = (1/I_yy)*(qbar*S_ref*C_bar*Cm);
+gammadot = q;
+xdot=V*cos(gamma);
+zdot=-V*sin(gamma);
+
+ annotation(experiment(StartTime = 0, StopTime = 100, Tolerance = 1e-3, Interval = 0.02),
+ uses(Modelica(version = "3.2.2")));
+end FlightLongs; \ No newline at end of file
diff --git a/FlightPitchHold.mo b/FlightPitchHold.mo
new file mode 100644
index 0000000..606f5fd
--- /dev/null
+++ b/FlightPitchHold.mo
@@ -0,0 +1,48 @@
+model FlightPitchHold
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-12, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ FlightLongs flightLongs1 annotation(
+ Placement(visible = true, transformation(origin = {64, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Gain gain2(k = 0.005) annotation(
+ Placement(visible = true, transformation(origin = {31, -21}, extent = {{5, -5}, {-5, 5}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant pitch_angle(k = 0.1) annotation(
+ Placement(visible = true, transformation(origin = {-120, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant const(k = 1112.82) annotation(
+ Placement(visible = true, transformation(origin = {24, 58}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback2 annotation(
+ Placement(visible = true, transformation(origin = {-78, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PI PI(T = 15, k = 0.2) annotation(
+ Placement(visible = true, transformation(origin = {-44, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold1(samplePeriod = 0.02) annotation(
+ Placement(visible = true, transformation(origin = {22, 12}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold2(samplePeriod = 0.02) annotation(
+ Placement(visible = true, transformation(origin = {64, -20}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+ Modelica.Blocks.Discrete.ZeroOrderHold zeroOrderHold3(samplePeriod = 0.02) annotation(
+ Placement(visible = true, transformation(origin = {-4, -40}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+equation
+ connect(flightLongs1.q, zeroOrderHold2.u) annotation(
+ Line(points = {{76, 12}, {86, 12}, {86, -20}, {76, -20}}, color = {0, 0, 127}));
+ connect(gain2.u, zeroOrderHold2.y) annotation(
+ Line(points = {{38, -20}, {53, -20}}, color = {0, 0, 127}));
+ connect(flightLongs1.theta, zeroOrderHold3.u) annotation(
+ Line(points = {{76, 16}, {96, 16}, {96, -40}, {8, -40}, {8, -40}}, color = {0, 0, 127}));
+ connect(feedback2.u2, zeroOrderHold3.y) annotation(
+ Line(points = {{-78, 4}, {-78, 4}, {-78, -40}, {-14, -40}, {-14, -40}}, color = {0, 0, 127}));
+ connect(feedback1.y, zeroOrderHold1.u) annotation(
+ Line(points = {{-2, 12}, {10, 12}, {10, 12}, {10, 12}}, color = {0, 0, 127}));
+ connect(zeroOrderHold1.y, flightLongs1.del) annotation(
+ Line(points = {{34, 12}, {52, 12}, {52, 12}, {54, 12}}, color = {0, 0, 127}));
+ connect(PI.y, feedback1.u1) annotation(
+ Line(points = {{-32, 12}, {-22, 12}, {-22, 12}, {-20, 12}}, color = {0, 0, 127}));
+ connect(feedback2.y, PI.u) annotation(
+ Line(points = {{-68, 12}, {-56, 12}, {-56, 12}, {-56, 12}}, color = {0, 0, 127}));
+ connect(pitch_angle.y, feedback2.u1) annotation(
+ Line(points = {{-109, 12}, {-99, 12}, {-99, 12}, {-87, 12}, {-87, 12}, {-87, 12}, {-87, 12}, {-87, 12}}, color = {0, 0, 127}));
+ connect(gain2.y, feedback1.u2) annotation(
+ Line(points = {{25.5, -21}, {-12, -21}, {-12, 4}}, color = {0, 0, 127}));
+ connect(const.y, flightLongs1.thrust) annotation(
+ Line(points = {{36, 58}, {48, 58}, {48, 19}, {53, 19}}, color = {0, 0, 127}));
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+
+end FlightPitchHold; \ No newline at end of file
diff --git a/FlightPitchHoldHIL.mo b/FlightPitchHoldHIL.mo
new file mode 100644
index 0000000..76087d2
--- /dev/null
+++ b/FlightPitchHoldHIL.mo
@@ -0,0 +1,35 @@
+model FlightPitchHoldHIL
+ FlightLongs flightLongs1 annotation(
+ Placement(visible = true, transformation(origin = {68, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Real ModelicaInput (start = 0, fixed = true );
+
+ Real ModelicaOutput1 (fixed = true );
+ Real ModelicaOutput2 (fixed = true );
+
+ Real OutputDummy1;
+ Real OutputDummy2;
+ parameter Real sampleTime = 0.02;
+ Modelica.Blocks.Sources.Constant const(k = 1112.82) annotation(
+ Placement(visible = true, transformation(origin = {24, 48}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(const.y, flightLongs1.thrust) annotation(
+ Line(points = {{36, 48}, {44, 48}, {44, 20}, {58, 20}, {58, 20}}, color = {0, 0, 127}));
+ModelicaOutput1 = flightLongs1.q;
+ModelicaOutput2 = flightLongs1.theta;
+flightLongs1.del = ModelicaInput ;
+when sample(0, 0.018) then
+ ModelicaInput = InterProcessCommunication.SharedMemory.SharedMemoryRead(1) "SharedMemoryRead Function reads the value from the shared memory, pointed by pidOutputIndex tag and assigns it to the input of the DC motor";
+ OutputDummy1 = InterProcessCommunication.SharedMemory.SharedMemoryWrite(1, ModelicaOutput1)
+ "SharedMemoryWrite Function writes the value of measured speed into the shared memory, pointed by pidInputIndex tag" ;
+ OutputDummy2 = InterProcessCommunication.SharedMemory.SharedMemoryWrite(2, ModelicaOutput2);
+
+ end when;
+//equations from serial_read
+ annotation(
+ uses(Modelica(version = "3.2.2")),
+ Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-140, -100}, {140, 100}}, initialScale = 0.1), graphics = {Text(lineColor = {255, 0, 0}, extent = {{40, 37}, {90, 31}}, textString = "plant"), Rectangle(origin = {-24, 28},lineColor = {255, 0, 0}, extent = {{32, 40}, {110, -38}})}),
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})),
+ experiment(StopTime = 100, StartTime = 0, Tolerance = 1e-06, Interval = 0.01),
+ __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS", nls = "homotopy", clock = "RT"));
+
+end FlightPitchHoldHIL; \ No newline at end of file
diff --git a/FlightVelocityHold.mo b/FlightVelocityHold.mo
new file mode 100644
index 0000000..b702bb8
--- /dev/null
+++ b/FlightVelocityHold.mo
@@ -0,0 +1,29 @@
+model FlightVelocityHold
+ FlightLongs flightLongs1 annotation(
+ Placement(visible = true, transformation(origin = {46, 6}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-70, 16}, extent = {{-10, 10}, {10, -10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant const(k = 40) annotation(
+ Placement(visible = true, transformation(origin = {-114, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant const1(k = 0.15625) annotation(
+ Placement(visible = true, transformation(origin = {6, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PI PI annotation(
+ Placement(visible = true, transformation(origin = {-38, 16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Add add1 annotation(
+ Placement(visible = true, transformation(origin = {8, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(PI.y, add1.u1) annotation(
+ Line(points = {{-27, 16}, {-4, 16}}, color = {0, 0, 127}));
+ connect(feedback1.y, PI.u) annotation(
+ Line(points = {{-61, 16}, {-51, 16}}, color = {0, 0, 127}));
+ connect(const.y, feedback1.u1) annotation(
+ Line(points = {{-103, 16}, {-79, 16}, {-79, 16}, {-79, 16}}, color = {0, 0, 127}));
+ connect(feedback1.u2, flightLongs1.V) annotation(
+ Line(points = {{-70, 24}, {-70, 44}, {76, 44}, {76, 16}, {58, 16}}, color = {0, 0, 127}));
+ connect(add1.y, flightLongs1.thrust) annotation(
+ Line(points = {{20, 10}, {32, 10}, {32, 10}, {36, 10}}, color = {0, 0, 127}));
+ connect(flightLongs1.del, const1.y) annotation(
+ Line(points = {{36, 2}, {28, 2}, {28, -62}, {17, -62}}, color = {0, 0, 127}));
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+end FlightVelocityHold; \ No newline at end of file
diff --git a/Flight_Dynamics.mo b/Flight_Dynamics.mo
new file mode 100644
index 0000000..0435c35
--- /dev/null
+++ b/Flight_Dynamics.mo
@@ -0,0 +1,404 @@
+package Flight_Dynamics
+ extends Modelica.Icons.Package;
+
+ class Components
+ block ForceMoment_Gen
+ import Modelica.Math.Matrices.*;
+ import Modelica.SIunits.*;
+ import Modelica.Blocks.Interfaces.*;
+ import Modelica.Math.Vectors.*;
+ parameter Real rho = 1.225;
+ parameter Real g = 9.81;
+ parameter Real m = 1043.26;
+ //1.56 for zagi
+ parameter Real S_ref = 16.1651;
+ //reference area
+ parameter Real C_bar = 1.493;
+ //average chord
+ parameter Real b = 10.911;
+ //span
+ parameter Real CD0 = 0.036;
+ //= 0.01631;for Zagi
+ parameter Real K_drag = 0.0830304;
+ //for cessna
+ parameter Real CD_beta = 0.17;
+ //for cessna
+ parameter Real CD_alpha = 0.2108;
+ parameter Real CD_q = 0;
+ parameter Real CD_delta_e = 0.3045;
+ //side force
+ parameter Real Cy_beta = -0.31;
+ //for cessna
+ parameter Real Cy_p = -0.037;
+ //for cessna
+ parameter Real Cy_r = 0.21;
+ //for cessna
+ parameter Real Cy_delta_r = 0.187;
+ //for cessna
+ parameter Real Cy_delta_a = 0;
+ //for cessna
+ // lift
+ parameter Real CL0 = 0.25;
+ //for cessna
+ parameter Real CL_alpha = 4.47;
+ //for cessna
+ parameter Real CL_q = 3.9;
+ //for cessna
+ parameter Real CL_delta_e = 0.3476;
+ //for cessna
+ // rolling moment
+ parameter Real Cl_beta = -0.089;
+ //for cessna
+ parameter Real Cl_p = -0.47;
+ //for cessna
+ parameter Real Cl_r = 0.096;
+ //for cessna
+ parameter Real Cl_delta_a = -0.09;
+ //for cessna
+ parameter Real Cl_delta_r = 0.0147;
+ //for cessna
+ // pitching moment
+ parameter Real Cm0 = -0.02;
+ //for cessna
+ parameter Real Cm_alpha = -1.8;
+ //for cessna
+ parameter Real Cm_q = -12.4;
+ //for cessna
+ parameter Real Cm_delta_e = -1.28;
+ //for cessna
+ // yawing moment
+ parameter Real Cn_beta = 0.065;
+ //for cessna
+ parameter Real Cn_p = -0.03;
+ //for cessna
+ parameter Real Cn_r = -0.99;
+ //for cessna
+ parameter Real Cn_delta_a = -0.0053;
+ //for cessna
+ parameter Real Cn_delta_r = -0.0657;
+ //for cessna
+ Real CL;
+ Real CD;
+ Real CY;
+ Real Cl;
+ Real Cm;
+ Real Cn;
+ Real CX;
+ Real CZ;
+ RealInput thrust annotation(
+ Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //Thrust force
+ RealInput[3] delta annotation(
+ Placement(visible = true, transformation(origin = {-110, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ RealInput[3] VAB annotation(
+ Placement(visible = true, transformation(origin = {-33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {-33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
+ //V, alpha, beta
+ RealInput[3] omega annotation(
+ Placement(visible = true, transformation(origin = {33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
+ //Angular velocities
+ Real V = VAB[1];
+ Real alpha = VAB[2];
+ Real beta = VAB[3];
+ Real p = omega[1];
+ Real q = omega[2];
+ Real r = omega[3];
+ Real deltaE = delta[1];
+ Real deltaR = delta[2];
+ Real deltaA = delta[3];
+ Real qbar = 0.5 * rho * V ^ 2;
+ RealOutput Force[3] annotation(
+ Placement(visible = true, transformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //Thrust force
+ RealOutput Moment[3] annotation(
+ Placement(visible = true, transformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //Thrust force
+ equation
+ CL = CL0 + CL_alpha * alpha + CL_q * q * C_bar / (2 * V) + CL_delta_e * deltaE;
+//CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+ CD = CD0 + K_drag * CL ^ 2;
+ CY = Cy_beta * beta + Cy_p * (p * b) / (2 * V) + Cy_r * (r * b) / (2 * V) + Cy_delta_a * deltaA + Cy_delta_r * deltaR;
+//Sideslip coeff
+ Cl = Cl_beta * beta + Cl_p * (p * b) / (2 * V) + Cl_r * (r * b) / (2 * V) + Cl_delta_a * deltaA + Cl_delta_r * deltaR;
+//Rolling coeff
+ Cm = Cm0 + Cm_alpha * alpha + Cm_q * q * C_bar / (2 * V) + Cm_delta_e * deltaE;
+//pitching coeff
+ Cn = Cn_beta * beta + Cn_p * (p * b) / (2 * V) + Cn_r * (r * b) / (2 * V) + Cn_delta_a * deltaA + Cn_delta_r * deltaR;
+//Yawing coeff
+ CX = (-CD * cos(alpha)) + CL * sin(alpha);
+ CZ = (-CD * sin(alpha)) - CL * cos(alpha);
+ Force[1] = thrust * cos(alpha) * cos(beta) - 0.5 * rho * V ^ 2 * S_ref * (CD * cos(beta) - CY * sin(beta));
+ Force[2] = (-thrust * cos(alpha) * sin(beta)) + 0.5 * rho * V ^ 2 * S_ref * (CY * cos(beta) + CD * sin(beta));
+ Force[3] = 0.5 * rho * V ^ 2 * S_ref * CL + thrust * sin(alpha);
+ Moment[2] = Cm * qbar * S_ref * C_bar;
+ Moment[1] = Cl * qbar * S_ref * b;
+ Moment[3] = Cn * qbar * S_ref * b;
+ end ForceMoment_Gen;
+
+ block Flight6DOF
+ import Modelica.Math.Matrices.*;
+ import SI = Modelica.SIunits;
+ import Modelica.Blocks.Interfaces.*;
+ parameter Real g = 9.81;
+ parameter Real m = 1043.26;
+ //1.56 for zagi
+ parameter Real[3, 3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+ //12 states
+ RealOutput[3] omega(start = {0.0, 0.0, 0}) annotation(
+ Placement(visible = true, transformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //omega
+ Real OMEGA[3, 3] = skew(omega);
+ //Skew symmetric matrix form of the angular velocity term
+ Real V(start = 39.8858);
+ Real alpha(start = 0.1);
+ Real beta(start = 0);
+ RealOutput[3] VAB annotation(
+ Placement(visible = true, transformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //V, alpha, beta
+ Real x(start = 0);
+ Real y(start = 0);
+ Real z(start = 100);
+ Real mu(start = 0);
+ Real gamma(start = 0);
+ Real chi(start = 0);
+ RealInput Force[3] annotation(
+ Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //Thrust force
+ RealInput Moment[3] annotation(
+ Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ //Thrust force
+ Real Vdot;
+ Real alphadot;
+ Real betadot;
+ Real[3] omegadot;
+ Real mudot;
+ Real gammadot;
+ Real chidot;
+ Real xdot;
+ Real ydot;
+ Real zdot;
+ equation
+ Vdot = der(V);
+ alphadot = der(alpha);
+ betadot = der(beta);
+ omegadot = der(omega);
+ xdot = der(x);
+ ydot = der(y);
+ zdot = der(z);
+ mudot = der(mu);
+ gammadot = der(gamma);
+ chidot = der(chi);
+ Vdot = 1 / m * (Force[1] - m * g * sin(gamma));
+ alphadot = omega[2] - 1 / cos(beta) * ((omega[1] * cos(alpha) + omega[3] * sin(alpha)) * sin(beta) - g / V * cos(gamma) * cos(mu) + Force[3] / (m * V));
+ betadot = omega[1] * sin(alpha) - omega[3] * cos(alpha) + 1 / (m * V) * (Force[2] + m * g * cos(gamma) * sin(mu));
+ omegadot = inv(J) * (Moment - OMEGA * J * omega);
+ xdot = V * cos(gamma) * cos(chi);
+ ydot = V * cos(gamma) * sin(chi);
+ zdot = -V * sin(gamma);
+ mudot = omega[1] + tan(gamma) * sin(mu) * omega[2] + tan(gamma) * cos(mu) * omega[3];
+ gammadot = cos(mu) * omega[2] - sin(mu) * omega[3];
+ chidot = 1 / cos(gamma) * sin(mu) * omega[2] + 1 / cos(gamma) * cos(mu) * omega[3];
+ VAB = {V, alpha, beta};
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+ end Flight6DOF;
+ end Components;
+
+ class Test_Cases
+ model CessnaTrim
+ // The initial values for delta[2] (elevator), alpha, thrust, and V are obtained by executing Trim_Conditions_Cessna.mo.
+ parameter Real m = 1043.26;
+ //1.56 for zagi
+ parameter Real s = 16.1651;
+ //reference area
+ parameter Real cbar = 1.493;
+ //average chord
+ parameter Real b = 10.911;
+ //span
+ parameter Real W[3] = m * {0, 0, 9.81};
+ //gravitational force
+ //parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+ parameter Real CD0 = 0.036;
+ //= 0.01631;for Zagi
+ parameter Real K_drag = 0.0830304;
+ //for cessna
+ parameter Real CD_beta = 0.17;
+ //for cessna
+ parameter Real CD_alpha = 0.2108;
+ parameter Real CD_q = 0;
+ parameter Real CD_delta_e = 0.3045;
+ //side force
+ parameter Real Cy_beta = -0.31;
+ //for cessna
+ parameter Real Cy_p = -0.037;
+ //for cessna
+ parameter Real Cy_r = 0.21;
+ //for cessna
+ parameter Real Cy_delta_r = 0.187;
+ //for cessna
+ parameter Real Cy_delta_a = 0;
+ //for cessna
+ // lift
+ parameter Real CL0 = 0.25;
+ //for cessna
+ parameter Real CL_alpha = 4.47;
+ //for cessna
+ parameter Real CL_q = 3.9;
+ //for cessna
+ parameter Real CL_delta_e = 0.3476;
+ //for cessna
+ // rolling moment
+ parameter Real Cl_beta = -0.089;
+ //for cessna
+ parameter Real Cl_p = -0.47;
+ //for cessna
+ parameter Real Cl_r = 0.096;
+ //for cessna
+ parameter Real Cl_delta_a = -0.09;
+ //for cessna
+ parameter Real Cl_delta_r = 0.0147;
+ //for cessna
+ // pitching moment
+ parameter Real Cm0 = -0.02;
+ //for cessna
+ parameter Real Cm_alpha = -1.8;
+ //for cessna
+ parameter Real Cm_q = -12.4;
+ //for cessna
+ parameter Real Cm_delta_e = -1.28;
+ //for cessna
+ // yawing moment
+ parameter Real Cn_beta = 0.065;
+ //for cessna
+ parameter Real Cn_p = -0.03;
+ //for cessna
+ parameter Real Cn_r = -0.99;
+ //for cessna
+ parameter Real Cn_delta_a = -0.0053;
+ //for cessna
+ parameter Real Cn_delta_r = -0.0657;
+ //for cessna
+ //Initial conditions. (delta[2], thrust[1] and the others are straightforward)
+ parameter Real del[3] = {-0.15625, 0, 0};
+ parameter Real thrust = 1112.82;
+ Flight_Dynamics.Components.ForceMoment_Gen forceMoment_Gen1 annotation(
+ Placement(visible = true, transformation(origin = {-18, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Flight_Dynamics.Components.Flight6DOF flight6DOF1 annotation(
+ Placement(visible = true, transformation(origin = {24, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(forceMoment_Gen1.omega, flight6DOF1.omega) annotation(
+ Line(points = {{-14, 16}, {-14, 16}, {-14, 40}, {62, 40}, {62, 0}, {36, 0}, {36, 0}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(flight6DOF1.VAB, forceMoment_Gen1.VAB) annotation(
+ Line(points = {{36, 8}, {42, 8}, {42, 32}, {-20, 32}, {-20, 16}, {-22, 16}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.Moment, flight6DOF1.Moment) annotation(
+ Line(points = {{-6, 0}, {12, 0}, {12, 0}, {14, 0}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.Force, flight6DOF1.Force) annotation(
+ Line(points = {{-6, 8}, {12, 8}, {12, 8}, {14, 8}}, color = {0, 0, 127}, thickness = 0.5));
+ forceMoment_Gen1.thrust = thrust;
+ forceMoment_Gen1.delta = del;
+ annotation(
+ experiment(StartTime = 0, StopTime = 100, Tolerance = 1e-3, Interval = 0.001),
+ uses(Modelica(version = "3.2.2")));
+ end CessnaTrim;
+
+ model CessnaPerturbed
+ //The initial values for delta[2] (elevator), alpha, thrust, and V are obtained by executing Trim_Conditions_Cessna.mo.
+ parameter Real m = 1043.26;
+ //1.56 for zagi
+ parameter Real s = 16.1651;
+ //reference area
+ parameter Real cbar = 1.493;
+ //average chord
+ parameter Real b = 10.911;
+ //span
+ parameter Real W[3] = m * {0, 0, 9.81};
+ //gravitational force
+ //parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+ parameter Real CD0 = 0.036;
+ //= 0.01631;for Zagi
+ parameter Real K_drag = 0.0830304;
+ //for cessna
+ parameter Real CD_beta = 0.17;
+ //for cessna
+ parameter Real CD_alpha = 0.2108;
+ parameter Real CD_q = 0;
+ parameter Real CD_delta_e = 0.3045;
+ //side force
+ parameter Real Cy_beta = -0.31;
+ //for cessna
+ parameter Real Cy_p = -0.037;
+ //for cessna
+ parameter Real Cy_r = 0.21;
+ //for cessna
+ parameter Real Cy_delta_r = 0.187;
+ //for cessna
+ parameter Real Cy_delta_a = 0;
+ //for cessna
+ // lift
+ parameter Real CL0 = 0.25;
+ //for cessna
+ parameter Real CL_alpha = 4.47;
+ //for cessna
+ parameter Real CL_q = 3.9;
+ //for cessna
+ parameter Real CL_delta_e = 0.3476;
+ //for cessna
+ // rolling moment
+ parameter Real Cl_beta = -0.089;
+ //for cessna
+ parameter Real Cl_p = -0.47;
+ //for cessna
+ parameter Real Cl_r = 0.096;
+ //for cessna
+ parameter Real Cl_delta_a = -0.09;
+ //for cessna
+ parameter Real Cl_delta_r = 0.0147;
+ //for cessna
+ // pitching moment
+ parameter Real Cm0 = -0.02;
+ //for cessna
+ parameter Real Cm_alpha = -1.8;
+ //for cessna
+ parameter Real Cm_q = -12.4;
+ //for cessna
+ parameter Real Cm_delta_e = -1.28;
+ //for cessna
+ // yawing moment
+ parameter Real Cn_beta = 0.065;
+ //for cessna
+ parameter Real Cn_p = -0.03;
+ //for cessna
+ parameter Real Cn_r = -0.99;
+ //for cessna
+ parameter Real Cn_delta_a = -0.0053;
+ //for cessna
+ parameter Real Cn_delta_r = -0.0657;
+ //for cessna
+ //Initial conditions. (delta[2], thrust[1] and the others are straightforward)
+ parameter Real del[3] = {-0.15625, 0, 0};
+ parameter Real thrust = 1112.82;
+ Flight_Dynamics.Components.ForceMoment_Gen forceMoment_Gen1 annotation(
+ Placement(visible = true, transformation(origin = {-23, 7}, extent = {{-23, -23}, {23, 23}}, rotation = 0)));
+ Flight_Dynamics.Components.Flight6DOF flight6DOF1 annotation(
+ Placement(visible = true, transformation(origin = {52, 6}, extent = {{-26, -26}, {26, 26}}, rotation = 0)));
+ Modelica.Blocks.Sources.RealExpression delta annotation(
+ Placement(visible = true, transformation(origin = {-142, -5}, extent = {{-26, -47}, {26, 47}}, rotation = 0)));
+ equation
+ connect(delta.y, forceMoment_Gen1.delta) annotation(
+ Line(points = {{-113, -5}, {-50, -5}, {-50, -4}, {-48, -4}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.omega, flight6DOF1.omega) annotation(
+ Line(points = {{-16, 32}, {-16, 32}, {-16, 78}, {98, 78}, {98, -2}, {80, -2}, {80, -2}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.VAB, flight6DOF1.VAB) annotation(
+ Line(points = {{-30, 32}, {-28, 32}, {-28, 64}, {84, 64}, {84, 14}, {80, 14}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.Force, flight6DOF1.Force) annotation(
+ Line(points = {{2, 14}, {22, 14}, {22, 14}, {24, 14}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.Moment, flight6DOF1.Moment) annotation(
+ Line(points = {{2, 0}, {26, 0}, {26, -2}, {24, -2}}, color = {0, 0, 127}, thickness = 0.5));
+ forceMoment_Gen1.thrust = thrust;
+ annotation(
+ experiment(StartTime = 0, StopTime = 300, Tolerance = 1e-3, Interval = 0.001),
+ uses(Modelica(version = "3.2.2")));
+ end CessnaPerturbed;
+ end Test_Cases;
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+end Flight_Dynamics; \ No newline at end of file
diff --git a/Flight_Dynamics_Test.mo b/Flight_Dynamics_Test.mo
new file mode 100755
index 0000000..e412224
--- /dev/null
+++ b/Flight_Dynamics_Test.mo
@@ -0,0 +1,168 @@
+model Flight_Dynamics_Test
+import Modelica.Math.Matrices.*;
+import Modelica.SIunits.*;
+import Modelica.Blocks.Interfaces.*;
+import Modelica.Math.Vectors.*;
+
+function T1
+
+ input Real a;
+ output Real T[3,3];
+algorithm
+ T := {{ 1, 0, 0}, { 0, cos(a), sin(a)},{ 0,-sin(a), cos(a)}};
+end T1;
+
+function T2
+ input Real a;
+ output Real T[3,3];
+algorithm
+ T := {{ cos(a), 0,-sin(a)}, { 0, 1, 0},{ sin(a), 0, cos(a)}};
+end T2;
+
+function T3
+ input Real a;
+ output Real T[3,3];
+algorithm
+ T := {{ cos(a), sin(a), 0},{-sin(a), cos(a), 0},{ 0, 0, 1}};
+end T3;
+
+
+
+
+
+
+parameter Real alphazero = 0.010576161309471;
+
+parameter Real delta[3] = {0,-0.0304977268414434,0};
+parameter Real thrust[3] = {1526.49255280348 , 0, 0};
+
+
+Real[3] omega ( start = {0, 0, 0});
+Real[3] pos (start = {0, 0, -1000});
+Real[3] v (start = {60*cos(alphazero), 0, 60*sin(alphazero)});
+Real[3] angles ;
+Real[3] Force;//Forces
+
+Real[3] Moment;//Moments
+
+
+
+parameter Real m = 1043.26;
+parameter Real s = 16.1651;//reference area
+parameter Real cbar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+parameter Real W[3] = m*{0,0, -9.8};//gravitational force
+Real CL; //Coeff of Lift
+Real CD;//Coeff of Drag
+//Real CY;//Coeff of Sideslip
+//Real Cl;//Roll coeff
+Real Cm;//Pitch coeff
+//Real Cn;//Yaw coeff
+
+
+//// environmental constants
+parameter Real rho = 1.225; // air desnsity
+parameter Real g = 9.81; // gravity
+
+
+
+
+
+
+//weight
+
+//// aerodynamic coefficients
+// drag
+parameter Real CD0 = 0.036;
+parameter Real K_drag = 0.0830304;
+parameter Real CD_beta = 0.17;
+
+//side force
+parameter Real Cy_beta = -0.31;
+parameter Real Cy_p = -0.037;
+parameter Real Cy_r = 0.21;
+parameter Real Cy_delta_r = 0.187;
+parameter Real Cy_delta_a = 0;
+
+// lift
+parameter Real CL0 = 0.25;
+parameter Real CL_alpha = 4.47;
+parameter Real CL_q = 3.9;
+parameter Real CL_delta_e = 0.3476;
+
+// rolling moment
+parameter Real Cl_beta = -0.089;
+parameter Real Cl_p = -0.47;
+parameter Real Cl_r = 0.096;
+parameter Real Cl_delta_a = -0.09;
+parameter Real Cl_delta_r = 0.0147;
+
+// pitching moment
+parameter Real Cm0 = -0.02;
+parameter Real Cm_alpha = -1.8;
+parameter Real Cm_q = -12.4;
+parameter Real Cm_delta_e = -1.28;
+
+// yawing moment
+parameter Real Cn_beta = 0.065;
+parameter Real Cn_p = -0.03;
+parameter Real Cn_r = -0.99;
+parameter Real Cn_delta_a = -0.0053;
+parameter Real Cn_delta_r = -0.0657;
+
+
+parameter Real[3,3] J = {{1285.31, 0, 0}, {0, 1824.93, 0}, {0, 0, 2666.893}};//Moment of Inertia
+
+Real vdot[3];//Linear Acceleration
+Real omegadot[3];//Angular acceleration
+Real OMEGA[3,3] = skew(omega);//Skew symmetric matrix form of the angular velocity term
+Real DCM[3,3] = T1(angles[1])*T2(angles[2])*T3(angles[3]);//The direction cosine matrix
+Real Rotation_mat[3,3] = {{1, tan(angles[2])*sin(angles[1]), tan(angles[2])*cos(angles[1])}, {0, cos(angles[1]), -sin(angles[1])},{0, sin(angles[1])/cos(angles[2]) , cos(angles[1])/cos(angles[2])}};
+Real euler_rates[3];
+
+
+
+Real L;
+Real D;
+
+Real Q;
+Real alpha;
+Real alphadot;
+
+
+initial equation
+alpha = alphazero;
+angles[2] = alphazero;
+
+
+
+equation
+alpha = atan2(v[3],v[1]);
+alphadot = der(alpha);
+Q=0.5*rho*norm(v)*norm(v);
+CL = CL0+CL_alpha*alpha+((CL_q*omega[2]*cbar)/(2*norm(v)))+CL_delta_e*delta[2];
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*omega[2]*cbar)/(2*norm(v)))+Cm_delta_e*delta[2];
+CD = CD0+K_drag*CL^2;
+
+L = CL*s*Q;
+D = CD*s*Q;
+
+Moment[2] = Cm*s*cbar*Q;
+Moment[1] = 0;
+Moment[3] = 0;
+
+Force[1] = -D*cos(alpha)+L*sin(alpha)+thrust[1] - m*g*sin(angles[2]);
+Force[3] = -D*sin(alpha)-L*cos(alpha)+m*g*cos(angles[2]);
+Force[2] = 0;
+
+
+vdot = 1 / m * Force + OMEGA * v;
+der(v) = vdot;
+der(pos) = inv(DCM)*v;
+omegadot = inv(J) * (Moment- OMEGA * J * omega);
+der(omega) = omegadot;
+euler_rates = Rotation_mat * omega;
+der(angles) = euler_rates;
+
+
+end Flight_Dynamics_Test; \ No newline at end of file
diff --git a/Flight_Eqns/Equations/Equations.aux b/Flight_Eqns/Equations/Equations.aux
new file mode 100755
index 0000000..f23e546
--- /dev/null
+++ b/Flight_Eqns/Equations/Equations.aux
@@ -0,0 +1 @@
+\relax
diff --git a/Flight_Eqns/Equations/Equations.log b/Flight_Eqns/Equations/Equations.log
new file mode 100755
index 0000000..c5d053c
--- /dev/null
+++ b/Flight_Eqns/Equations/Equations.log
@@ -0,0 +1,184 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2018.5.22) 8 JUN 2018 12:57
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**Equations.tex
+(./Equations.tex
+LaTeX2e <2017-04-15>
+Babel <3.18> and hyphenation patterns for 84 language(s) loaded.
+(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
+Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
+(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen102
+)
+(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
+Package: amsmath 2017/09/02 v2.17a AMS math features
+\@mathmargin=\skip43
+
+For additional information on amsmath, use the `?' option.
+(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
+Package: amstext 2000/06/29 v2.01 AMS text
+
+(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty
+File: amsgen.sty 1999/11/30 v2.0 generic functions
+\@emptytoks=\toks14
+\ex@=\dimen103
+))
+(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty
+Package: amsbsy 1999/11/29 v1.2d Bold Symbols
+\pmbraise@=\dimen104
+)
+(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty
+Package: amsopn 2016/03/08 v2.02 operator names
+)
+\inf@bad=\count87
+LaTeX Info: Redefining \frac on input line 213.
+\uproot@=\count88
+\leftroot@=\count89
+LaTeX Info: Redefining \overline on input line 375.
+\classnum@=\count90
+\DOTSCASE@=\count91
+LaTeX Info: Redefining \ldots on input line 472.
+LaTeX Info: Redefining \dots on input line 475.
+LaTeX Info: Redefining \cdots on input line 596.
+\Mathstrutbox@=\box26
+\strutbox@=\box27
+\big@size=\dimen105
+LaTeX Font Info: Redeclaring font encoding OML on input line 712.
+LaTeX Font Info: Redeclaring font encoding OMS on input line 713.
+\macc@depth=\count92
+\c@MaxMatrixCols=\count93
+\dotsspace@=\muskip10
+\c@parentequation=\count94
+\dspbrk@lvl=\count95
+\tag@help=\toks15
+\row@=\count96
+\column@=\count97
+\maxfields@=\count98
+\andhelp@=\toks16
+\eqnshift@=\dimen106
+\alignsep@=\dimen107
+\tagshift@=\dimen108
+\tagwidth@=\dimen109
+\totwidth@=\dimen110
+\lineht@=\dimen111
+\@envbody=\toks17
+\multlinegap=\skip44
+\multlinetaggap=\skip45
+\mathdisplay@stack=\toks18
+LaTeX Info: Redefining \[ on input line 2817.
+LaTeX Info: Redefining \] on input line 2818.
+) (./Equations.aux)
+\openout1 = `Equations.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 8.
+LaTeX Font Info: ... okay on input line 8.
+
+LaTeX Warning: No \author given.
+
+
+Overfull \hbox (95.66002pt too wide) detected at line 20
+\OML/cmm/m/it/10 C[] \OT1/cmr/m/n/10 = []
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 20--23
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 30--32
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 41--51
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 41--51
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 41--51
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 41--51
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 54--71
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 54--71
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 54--71
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 54--71
+
+ []
+
+[1
+
+{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] [2] (./Equations.aux) )
+Here is how much of TeX's memory you used:
+ 841 strings out of 492982
+ 9389 string characters out of 6134896
+ 70413 words of memory out of 5000000
+ 4465 multiletter control sequences out of 15000+600000
+ 7803 words of font info for 29 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 27i,8n,20p,270b,193s stack positions out of 5000i,500n,10000p,200000b,80000s
+</u
+sr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/sha
+re/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/share/tex
+live/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi5.pfb></usr/share/texlive/te
+xmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb></usr/share/texlive/texmf-dis
+t/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texlive/texmf-dist/fonts
+/type1/public/amsfonts/cm/cmr12.pfb></usr/share/texlive/texmf-dist/fonts/type1/
+public/amsfonts/cm/cmr17.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/
+amsfonts/cm/cmr7.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts
+/cm/cmsy10.pfb></usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cm
+sy7.pfb>
+Output written on Equations.pdf (2 pages, 104191 bytes).
+PDF statistics:
+ 51 PDF objects out of 1000 (max. 8388607)
+ 36 compressed objects within 1 object stream
+ 0 named destinations out of 1000 (max. 500000)
+ 1 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/Flight_Eqns/Equations/Equations.pdf b/Flight_Eqns/Equations/Equations.pdf
new file mode 100755
index 0000000..a3d9af7
--- /dev/null
+++ b/Flight_Eqns/Equations/Equations.pdf
Binary files differ
diff --git a/Flight_Eqns/Equations/Equations.tex b/Flight_Eqns/Equations/Equations.tex
new file mode 100755
index 0000000..dab0ffb
--- /dev/null
+++ b/Flight_Eqns/Equations/Equations.tex
@@ -0,0 +1,72 @@
+\documentclass{article}
+
+\usepackage{amsmath}
+\newcommand\inv[1]{#1\raisebox{1.15ex}{$\scriptscriptstyle-\!1$}}
+
+
+\title{Equation of Motions already included}
+\begin{document}
+\maketitle
+
+These are the equations already included the 6DOF model.
+
+\[
+C_{b/n}=
+ \begin{bmatrix}
+ cos(\theta)cos(\psi) & cos(\theta)sin(\psi) & -sin(\theta) \\
+ -cos(\phi)sin(\psi) + sin(\phi)sin(\theta)cos(\psi) & cos(\phi)cos(\psi) + sin(\phi)sin(\theta)sun(\psi) & sin(\phi)cos(\theta) \\
+ sin(\phi)sin(\psi) + cos(\phi)sin(\theta)cos(\psi) & -sin(\phi)cos(\psi) + cos(\phi)sin(\theta)sin(\psi) & cos(\phi)cos(\theta)
+ \end{bmatrix}
+\]\\
+Also represented as: $C_{b/n} = fn(\Theta)$
+\\
+\[
+\Omega=
+ \begin{bmatrix}
+ 0 & -R & Q \\
+ R & 0 & -P\\
+ -Q & P & 0
+ \end{bmatrix}
+\]
+\\
+\[
+\left[ \begin{array}{c}
+ \dot{\phi}
+\\ \dot{\theta}
+\\ \dot{\psi}
+ \end{array} \right] = \begin{bmatrix} 1 & tan(\theta)sin(\phi) & tan(\theta)cos(\phi) \\ 0 & cos(\phi) & -sin(\phi)\\
+0 & sin(\phi)/cos(\theta) & cos(\phi)/cos(\theta)
+ \end{bmatrix} \times \left[ \begin{array}{c} P\\Q \\ R \end{array} \right]
+\\
+\]
+\\ Also represented as: $\dot{\Phi} = H(\Phi) \omega^b _{b/e}$
+\\
+\\
+${}^b\dot{v}^b_{CM/e} =(\frac{1}{m})F^b_{A,T} + C_{b/n} \times g + \Omega^b _{b/e}\times v^b_{CM/e} $
+\\ \\
+${}^e \dot{p}^n_{CM/T} = C_{n/b} \times v^b_{CM/e} $
+\\ \\
+${}^b\dot{\omega}^b_{b/e} = inv(J^b) \times [M^b_{A,T}- \Omega^b_{b/e}\times J^b \times \omega^b_{b/e}]$
+\\
+
+These are the equations in the force-moment model.
+
+$\alpha = tan^-1 (w/u) $
+\\
+$Q = 0.5 \times \rho \times \lVert V \rVert ^2 $
+\\\\
+$C_{L} = C_{L0} + C_{L \alpha} \times \alpha + (\frac{C_{Lq} \times q \times c_{bar}}{2 \times \lVert V \rVert}) + C_{Lde} \times \delta_{e} $
+\\
+$C_{m} = C_{m0} + C{m \alpha} \times \alpha +(\frac{C_{mq}*q*c_{bar}}{(2 \times \lVert V \rVert})+C_{mde} \times \delta_{e}$
+\\
+$C_{D} = C_{D0} + K_{drag} \times C_{L} ^2$
+\\ \\
+$L = C_{L} \times s \times Q$
+\\
+$D = C_{D} \times s \times Q$
+\\ \\
+$Force = \left[ \begin{array}{c} -D \times cos(\alpha)+L \times sin(\alpha)+ thrust - mg \times sin(\theta)\\0 \\ -D \times sin(\alpha)-L \times cos(\alpha)+mg \times cos(\theta) \end{array} \right]$
+\\ \\
+$Moment = \left[ \begin{array}{c} 0\\C_{m} \times s\times c_{bar} \times Q \\ 0 \end{array} \right]$
+
+ \end{document} \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOF.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOF.mo
new file mode 100644
index 0000000..bff2c49
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOF.mo
@@ -0,0 +1,191 @@
+block Wind6DOF
+
+import Modelica.Math.Matrices.*;
+import Modelica.SIunits.*;
+import Modelica.Blocks.Interfaces.*;
+import Modelica.Math.Vectors.*;
+
+
+RealInput thrust annotation(
+ Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+RealInput[3] delta annotation(
+ Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+
+
+Modelica.Blocks.Interfaces.RealOutput V annotation(start =39.8858,
+ Placement(visible = true, transformation(origin = {110, 100}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 100}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Linear velocity
+
+Modelica.Blocks.Interfaces.RealOutput alpha annotation(start =0.1,
+ Placement(visible = true, transformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Angle of attack
+
+Modelica.Blocks.Interfaces.RealOutput beta annotation(start = 0,
+ Placement(visible = true, transformation(origin = {110, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Angle of sideslip
+
+
+Modelica.Blocks.Interfaces.RealOutput pos[3]annotation(
+ Placement(visible = true, transformation(origin = {110, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ //Position (Displacement) //Displacement
+
+Modelica.Blocks.Interfaces.RealOutput omega[3] annotation(
+ Placement(visible = true, transformation(origin = {110, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, -60}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Angular velocity around the CM
+Modelica.Blocks.Interfaces.RealOutput angles[3] annotation(
+ Placement(visible = true, transformation(origin = {110, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, -100}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //mu, gamma, and chi
+
+
+
+
+
+
+parameter Real rho;
+parameter Real m;//1.56 for zagi
+parameter Real S_ref;//reference area
+parameter Real C_bar ;//average chord
+parameter Real b ;//span
+parameter Real g = 9.81;//gravitational force
+//parameter Real b= 1.4224, C_bar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0;//= 0.01631;for Zagi
+parameter Real K_drag ;//for cessna
+parameter Real CD_beta;//for cessna
+parameter Real CD_alpha;
+parameter Real CD_q;
+parameter Real CD_delta_e;
+
+//side force
+parameter Real Cy_beta;//for cessna
+parameter Real Cy_p;//for cessna
+parameter Real Cy_r;//for cessna
+parameter Real Cy_delta_r; //for cessna
+parameter Real Cy_delta_a; //for cessna
+
+// lift
+parameter Real CL0 ; //for cessna
+parameter Real CL_alpha;//for cessna
+parameter Real CL_q;//for cessna
+parameter Real CL_delta_e;//for cessna
+
+// rolling moment
+parameter Real Cl_beta;//for cessna
+parameter Real Cl_p;//for cessna
+parameter Real Cl_r;//for cessna
+parameter Real Cl_delta_a;//for cessna
+parameter Real Cl_delta_r ;//for cessna
+
+// pitching moment
+parameter Real Cm0;//for cessna
+parameter Real Cm_alpha ;//for cessna
+parameter Real Cm_q;//for cessna
+parameter Real Cm_delta_e;//for cessna
+
+// yawing moment
+parameter Real Cn_beta;//for cessna
+parameter Real Cn_p;//for cessna
+parameter Real Cn_r;//for cessna
+parameter Real Cn_delta_a ;//for cessna
+parameter Real Cn_delta_r;//for cessna
+
+
+//Initial conditions. (delta[2], thrust[1] and the others are straightforward)
+
+parameter Real I_xx;
+parameter Real I_yy;
+parameter Real I_zz;
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+//Params
+//parameter Real delta[1] = 0;
+//parameter Real delta[3] = 0;
+
+//Modelica.Blocks.Sources.RealExpression delta[2] (y = if time > 100 and time < 105 then -0.15625+3.1412 /180 else -0.15625) annotation( Placement(visible = true, transformation(origin = {-112, 1}, extent = {{-26, -47}, {26, 47}}, rotation = 0)));
+//parameter Real delta[2] = -0.15625;
+
+//parameter Real thrust = 1112.82;
+
+
+
+Real qbar = 0.5*rho*V^2;
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real pdot;
+Real qdot;
+Real rdot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*omega[2]*C_bar)/(2*V))+CL_delta_e*delta[2];
+//CD = CD0+CD_alpha*alpha+((CD_q*omega[2]*C_bar)/(2*V))+CD_delta_e*abs(delta[2]);// + CDbeta * beta + CDdelta[2] * Elevator;
+CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (omega[1]*b)/(2*V) + Cy_r *(omega[3]*b)/(2*V) + Cy_delta_a * delta[1] + Cy_delta_r*delta[3];//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(omega[1]*b)/(2*V) + Cl_r *(omega[3]*b)/(2*V) + Cl_delta_a * delta[1] + Cl_delta_r * delta[3];//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*omega[2]*C_bar)/(2*V))+Cm_delta_e*delta[2];//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (omega[1]*b)/(2*V) + Cn_r *(omega[3]*b) /(2*V) + Cn_delta_a * delta[1] + Cn_delta_r * delta[3];//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+pdot = der(omega[1]);
+qdot = der(omega[2]);
+rdot = der(omega[3]);
+
+xdot = der(pos[1]);
+ydot = der(pos[2]);
+zdot = der(pos[3]);
+
+mudot = der(angles[1]);
+gammadot = der(angles[2]);
+chidot = der(angles[3]);
+
+
+
+
+Vdot = 1/m*(thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta))-m*g*sin(angles[2]));
+
+alphadot = omega[2]-1/cos(beta)*((omega[1]*cos(alpha)+omega[3]*sin(alpha))*sin(beta)-g/V*cos(angles[2])*cos(angles[1])+0.5*rho*V^2*S_ref*CL/(m*V)+thrust*sin(alpha)/(m*V));
+
+betadot = (omega[1]*sin(alpha)-omega[3]*cos(alpha))+1/(m*V)*(-thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta))+m*g*cos(angles[2])*sin(angles[1]));
+
+
+pdot = (I_yy-I_zz)/I_xx*omega[2]*omega[3]+1/(2*I_xx)*rho*V^2*S_ref*b*Cl;
+qdot = (I_zz-I_xx)/I_yy*omega[1]*omega[3]+1/(2*I_yy)*rho*V^2*S_ref*C_bar*Cm;
+rdot = (I_xx-I_yy)/I_zz*omega[1]*omega[2]+1/(2*I_zz)*rho*V^2*S_ref*b*Cn;
+
+
+xdot=V*cos(angles[2])*cos(angles[3]);
+ydot=V*cos(angles[2])*sin(angles[3]);
+zdot=-V*sin(angles[2]);
+
+mudot = omega[1]+tan(angles[2])*sin(angles[1])*omega[2]+tan(angles[2])*cos(angles[1])*omega[3];
+gammadot = cos(angles[1])*omega[2]-sin(angles[1])*omega[3];
+chidot=(1/cos(angles[2]))*sin(angles[1])*omega[2]+(1/cos(angles[2]))*cos(angles[1])*omega[3];
+
+end Wind6DOF; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBasic.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBasic.mo
new file mode 100644
index 0000000..0d4c90c
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBasic.mo
@@ -0,0 +1,95 @@
+model Wind6DOFBasic
+
+import Modelica.Math.Matrices.*;
+import SI=Modelica.SIunits;
+import Modelica.Blocks.Interfaces.*;
+
+
+
+parameter Real g = 9.81;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real[3,3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+
+
+
+//12 states
+RealOutput[3] omega(start = {0.0,0.0,0}) annotation( Placement(visible = true, transformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//omega
+
+Real OMEGA[3,3] = skew(omega);//Skew symmetric matrix form of the angular velocity term
+
+
+Real V (start =39.8858);
+Real alpha (start =0.1);
+Real beta (start = 0);
+
+RealOutput[3] VAB annotation( Placement(visible = true, transformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//V, alpha, beta
+
+
+Real x (start = 0);
+Real y (start = 0);
+Real z (start = 100);
+
+Real mu (start = 0);
+Real gamma (start = 0);
+Real chi (start = 0);
+
+
+RealInput Force[3] annotation( Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+RealInput Moment[3] annotation( Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real[3] omegadot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+omegadot= der(omega);
+
+xdot = der(x);
+ydot = der(y);
+zdot = der(z);
+
+mudot = der(mu);
+gammadot = der(gamma);
+chidot = der(chi);
+
+
+Vdot = 1/m*(Force[1] -m*g*sin(gamma));
+
+alphadot = omega[2]-1/cos(beta)*((omega[1]*cos(alpha)+omega[3]*sin(alpha))*sin(beta)-g/V*cos(gamma)*cos(mu)+Force[3]/(m*V));
+
+betadot = (omega[1]*sin(alpha)-omega[3]*cos(alpha))+1/(m*V)*(Force[2]+m*g*cos(gamma)*sin(mu));
+
+
+omegadot = inv(J) * (Moment- OMEGA* J*omega);
+
+xdot=V*cos(gamma)*cos(chi);
+ydot=V*cos(gamma)*sin(chi);
+zdot=-V*sin(gamma);
+
+mudot = omega[1]+tan(gamma)*sin(mu)*omega[2]+tan(gamma)*cos(mu)*omega[3];
+gammadot = cos(mu)*omega[2]-sin(mu)*omega[3];
+chidot=(1/cos(gamma))*sin(mu)*omega[2]+(1/cos(gamma))*cos(mu)*omega[3];
+
+VAB = {V,alpha,beta};
+
+end Wind6DOFBasic; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBlock.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBlock.mo
new file mode 100644
index 0000000..40731a3
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFBlock.mo
@@ -0,0 +1,185 @@
+block Wind6DOFBlock
+
+import Modelica.Math.Matrices.*;
+import SI=Modelica.SIunits;
+import Modelica.Blocks.Interfaces.*;
+
+parameter Real rho = 1.225;
+parameter Real g = 9.81;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+//parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+
+//Initial conditions. (deltaE, thrust[1] and the others are straightforward)
+
+parameter Real[3,3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+//Params
+RealInput deltaE (start = -0.15625) annotation(start = 0.1,Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+
+//Change inelevator angle
+parameter Real deltaR = 0;
+
+parameter Real deltaA= 0;
+
+
+
+
+RealInput thrust (start = 1112.82) annotation(Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force = 1112.82;
+
+//12 states
+Real p (start = 0);
+Modelica.Blocks.Interfaces.RealOutput q (start = 0) annotation(Placement(visible = true, transformation(origin = {110, 33}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 33}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Angular velocity
+Real r (start = 0);
+
+Real OMEGA[3,3] = skew({p,q,r});//Skew symmetric matrix form of the angular velocity term
+
+
+Real V (start =39.8858);
+Modelica.Blocks.Interfaces.RealOutput alpha (start = 0.1) annotation( Placement(visible = true, transformation(origin = {110, -33}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, -33}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); //Angle of attack
+Real beta (start = 0);
+
+
+Real x (start = 0);
+Real y (start = 0);
+Real z (start = 100);
+
+Real gamma (start = 0);
+Real chi (start = 0);
+Real mu (start = 0);
+
+Real qbar = 0.5*rho*V^2;
+Real [3] Moment;
+
+
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real[3] omegadot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*q*C_bar)/(2*V))+CL_delta_e*deltaE;
+//CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (p*b)/(2*V) + Cy_r *(r*b)/(2*V) + Cy_delta_a * deltaA + Cy_delta_r*deltaR;//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(p*b)/(2*V) + Cl_r *(r*b)/(2*V) + Cl_delta_a * deltaA + Cl_delta_r * deltaR;//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*q*C_bar)/(2*V))+Cm_delta_e*deltaE;//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (p*b)/(2*V) + Cn_r *(r*b) /(2*V) + Cn_delta_a * deltaA + Cn_delta_r * deltaR;//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+Moment[2] = Cm*qbar*S_ref*C_bar;
+Moment[1] = Cl*qbar*S_ref*b;
+Moment[3] = Cn*qbar*S_ref*b;
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+omegadot[1] = der(p);
+omegadot[2] = der(q);
+omegadot[3] = der(r);
+
+xdot = der(x);
+ydot = der(y);
+zdot = der(z);
+
+mudot = der(mu);
+gammadot = der(gamma);
+chidot = der(chi);
+
+
+
+
+Vdot = 1/m*(thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta))-m*g*sin(gamma));
+
+alphadot = q-1/cos(beta)*((p*cos(alpha)+r*sin(alpha))*sin(beta)-g/V*cos(gamma)*cos(mu)+0.5*rho*V^2*S_ref*CL/(m*V)+thrust*sin(alpha)/(m*V));
+
+betadot = (p*sin(alpha)-r*cos(alpha))+1/(m*V)*(-thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta))+m*g*cos(gamma)*sin(mu));
+
+
+omegadot = inv(J) * (Moment- OMEGA* J*{p,q,r});
+
+
+
+xdot=V*cos(gamma)*cos(chi);
+ydot=V*cos(gamma)*sin(chi);
+zdot=-V*sin(gamma);
+
+mudot = p+tan(gamma)*sin(mu)*q+tan(gamma)*cos(mu)*r;
+gammadot = cos(mu)*q-sin(mu)*r;
+chidot=(1/cos(gamma))*sin(mu)*q+(1/cos(gamma))*cos(mu)*r;
+
+
+annotation(experiment(StartTime = 0, StopTime = 500, Interval = 0.002),
+ uses(Modelica(version = "3.2.2")));
+end Wind6DOFBlock; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOFLinTest.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFLinTest.mo
new file mode 100644
index 0000000..3005f2e
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFLinTest.mo
@@ -0,0 +1,184 @@
+model Wind6DOFLinTest
+
+import Modelica.Math.Matrices.*;
+import SI=Modelica.SIunits;
+import Modelica.Blocks.Interfaces.*;
+
+parameter Real rho = 1.225;
+parameter Real g = 9.81;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+//parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+
+//Initial conditions. (deltaE, thrust[1] and the others are straightforward)
+
+parameter Real[3,3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+//Params
+RealInput deltaE (start = -0.15625) annotation(Placement(visible = true, transformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+parameter Real deltaR = 0;
+
+parameter Real deltaA = 0;
+// Modelica.Blocks.Sources.Constant deltaA (k =0) annotation( Placement(visible = true, transformation(origin = {-42, 28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+
+
+
+RealInput thrust (start = 1112.82) annotation(Placement(visible = true, transformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force = 1112.82;
+
+//12 states
+Real p (start = 0);
+Real q (start = 0);
+Real r (start = 0);
+
+Real OMEGA[3,3] = skew({p,q,r});//Skew symmetric matrix form of the angular velocity term
+
+
+Real V (start =39.8858);
+Real alpha (start = 0.1);
+Real beta (start = 0);
+
+
+Real x (start = 0);
+Real y (start = 0);
+Real z (start = 100);
+
+Real gamma (start = 0);
+Real chi (start = 0);
+Real mu (start = 0);
+
+Real qbar = 0.5*rho*V^2;
+Real [3] Moment;
+
+
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real[3] omegadot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*q*C_bar)/(2*V))+CL_delta_e*deltaE;
+//CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (p*b)/(2*V) + Cy_r *(r*b)/(2*V) + Cy_delta_a * deltaA + Cy_delta_r*deltaR;//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(p*b)/(2*V) + Cl_r *(r*b)/(2*V) + Cl_delta_a * deltaA + Cl_delta_r * deltaR;//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*q*C_bar)/(2*V))+Cm_delta_e*deltaE;//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (p*b)/(2*V) + Cn_r *(r*b) /(2*V) + Cn_delta_a * deltaA + Cn_delta_r * deltaR;//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+Moment[2] = Cm*qbar*S_ref*C_bar;
+Moment[1] = Cl*qbar*S_ref*b;
+Moment[3] = Cn*qbar*S_ref*b;
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+omegadot[1] = der(p);
+omegadot[2] = der(q);
+omegadot[3] = der(r);
+
+xdot = der(x);
+ydot = der(y);
+zdot = der(z);
+
+mudot = der(mu);
+gammadot = der(gamma);
+chidot = der(chi);
+
+
+
+
+Vdot = 1/m*(thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta))-m*g*sin(gamma));
+
+alphadot = q-1/cos(beta)*((p*cos(alpha)+r*sin(alpha))*sin(beta)-g/V*cos(gamma)*cos(mu)+0.5*rho*V^2*S_ref*CL/(m*V)+thrust*sin(alpha)/(m*V));
+
+betadot = (p*sin(alpha)-r*cos(alpha))+1/(m*V)*(-thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta))+m*g*cos(gamma)*sin(mu));
+
+
+omegadot = inv(J) * (Moment- OMEGA* J*{p,q,r});
+
+
+
+xdot=V*cos(gamma)*cos(chi);
+ydot=V*cos(gamma)*sin(chi);
+zdot=-V*sin(gamma);
+
+mudot = p+tan(gamma)*sin(mu)*q+tan(gamma)*cos(mu)*r;
+gammadot = cos(mu)*q-sin(mu)*r;
+chidot=(1/cos(gamma))*sin(mu)*q+(1/cos(gamma))*cos(mu)*r;
+
+
+annotation(experiment(StartTime = 0, StopTime = 500, Interval = 0.002), uses(Modelica(version = "3.2.2")));
+
+end Wind6DOFLinTest; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOFVer.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFVer.mo
new file mode 100644
index 0000000..353e365
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFVer.mo
@@ -0,0 +1,182 @@
+model Wind6DOFVer
+
+import Modelica.Math.Matrices.*;
+import SI=Modelica.SIunits;
+import Modelica.Blocks.Interfaces.*;
+
+parameter Real rho = 1.225;
+parameter Real g = 9.81;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+//parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+
+//Initial conditions. (deltaE, thrust[1] and the others are straightforward)
+
+parameter Real[3,3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+//Params
+parameter Real deltaE = -0.15625;
+parameter Real deltaR = 0;
+
+parameter Real deltaA = 0;
+
+
+
+
+parameter Real thrust = 1112.82;
+
+//12 states
+Real p (start = 0);
+Real q (start = 0);
+Real r (start = 0);
+
+Real OMEGA[3,3] = skew({p,q,r});//Skew symmetric matrix form of the angular velocity term
+
+
+Real V (start =39.8858);
+Real alpha (start =0.1);
+Real beta (start = 0);
+
+
+Real x (start = 0);
+Real y (start = 0);
+Real z (start = 100);
+
+Real mu (start = 0);
+Real gamma (start = 0);
+Real chi (start = 0);
+
+Real qbar = 0.5*rho*V^2;
+Real [3] Moment;
+
+
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real[3] omegadot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*q*C_bar)/(2*V))+CL_delta_e*deltaE;
+//CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (p*b)/(2*V) + Cy_r *(r*b)/(2*V) + Cy_delta_a * deltaA + Cy_delta_r*deltaR;//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(p*b)/(2*V) + Cl_r *(r*b)/(2*V) + Cl_delta_a * deltaA + Cl_delta_r * deltaR;//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*q*C_bar)/(2*V))+Cm_delta_e*deltaE;//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (p*b)/(2*V) + Cn_r *(r*b) /(2*V) + Cn_delta_a * deltaA + Cn_delta_r * deltaR;//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+Moment[2] = Cm*qbar*S_ref*C_bar;
+Moment[1] = Cl*qbar*S_ref*b;
+Moment[3] = Cn*qbar*S_ref*b;
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+omegadot[1] = der(p);
+omegadot[2] = der(q);
+omegadot[3] = der(r);
+
+xdot = der(x);
+ydot = der(y);
+zdot = der(z);
+
+mudot = der(mu);
+gammadot = der(gamma);
+chidot = der(chi);
+
+
+
+
+Vdot = 1/m*(thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta))-m*g*sin(gamma));
+
+alphadot = q-1/cos(beta)*((p*cos(alpha)+r*sin(alpha))*sin(beta)-g/V*cos(gamma)*cos(mu)+(0.5*rho*V^2*S_ref*CL+thrust*sin(alpha))/(m*V));
+
+betadot = (p*sin(alpha)-r*cos(alpha))+1/(m*V)*(-thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta))+m*g*cos(gamma)*sin(mu));
+
+
+omegadot = inv(J) * (Moment- OMEGA* J*{p,q,r});
+
+
+
+xdot=V*cos(gamma)*cos(chi);
+ydot=V*cos(gamma)*sin(chi);
+zdot=-V*sin(gamma);
+
+mudot = p+tan(gamma)*sin(mu)*q+tan(gamma)*cos(mu)*r;
+gammadot = cos(mu)*q-sin(mu)*r;
+chidot=(1/cos(gamma))*sin(mu)*q+(1/cos(gamma))*cos(mu)*r;
+
+
+annotation(experiment(StartTime = 0, StopTime = 500, Interval = 0.002), uses(Modelica(version = "3.2.2")));
+end Wind6DOFVer; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/Wind6DOFZagi.mo b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFZagi.mo
new file mode 100644
index 0000000..b6c90d7
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/Wind6DOFZagi.mo
@@ -0,0 +1,187 @@
+model Wind6DOFZagi
+
+import Modelica.Math.Matrices.*;
+import SI=Modelica.SIunits;
+import Modelica.Blocks.Interfaces.*;
+
+parameter Real rho = 1.225;
+parameter Real m = 1.56;//1.56 for zagi
+parameter Real S_ref = 0.2589;//reference area
+parameter Real C_bar = 0.3302 ;//average chord
+parameter Real b = 1.4224 ;//span
+parameter Real g = 9.81;//gravitational force
+//parameter Real b= 1.4224, C_bar = 0.3302,s = 0.2589;
+
+// lift
+parameter Real CL0 = 0.09167; //for cessna
+parameter Real CL_alpha = 3.5016;//for cessna
+parameter Real CL_q = 2.8932;//for cessna
+parameter Real CL_delta_e = 0.2724;//for cessna
+
+parameter Real CD0 = 0.01631;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_0;
+parameter Real Cy_beta = -0.07359;//for cessna
+parameter Real Cy_p = 0;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+
+
+// rolling moment
+parameter Real Cl_0 = 0;
+parameter Real Cl_beta = -0.02854;//for cessna
+parameter Real Cl_p = -0.3209;//for cessna
+parameter Real Cl_r = 0.03066;//for cessna
+parameter Real Cl_delta_a= 0.1682;//for cessna
+parameter Real Cl_delta_r = 0;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02338;//for cessna
+parameter Real Cm_alpha = -0.5675;//for cessna
+parameter Real Cm_q = -1.3990;//for cessna
+parameter Real Cm_delta_e = -0.3254;//for cessna
+
+// yawing moment
+parameter Real Cn_0 = 0;
+parameter Real Cn_beta = -0.00040;//for cessna
+parameter Real Cn_p = -0.01297;//for cessna
+parameter Real Cn_r = -0.00434;//for cessna
+parameter Real Cn_delta_a = -0.00328;//for cessna
+parameter Real Cn_delta_r = 0;//for cessna
+
+
+//Initial conditions. (deltaE, thrust[1] and the others are straightforward)
+
+parameter Real[3,3] J = {{0.1147, 0.0, -0.0015}, {0.0, 0.0576, 0.0}, {-0.0015, 0.0, 0.2589}};
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+//Params
+parameter Real deltaE = -0.246251;
+parameter Real deltaR = 0;
+
+//Modelica.Blocks.Sources.RealExpression deltaA (y = if time > 100 and time < 105 then 3.1412 /180 elseif time > 105 and time < 110 then -3.1412 /180 else 0) annotation( Placement(visible = true, transformation(origin = {-112, 1}, extent = {{-26, -47}, {26, 47}}, rotation = 0)));
+ Modelica.Blocks.Sources.Constant deltaA (k =0) annotation( Placement(visible = true, transformation(origin = {-42, 28}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+
+
+
+parameter Real thrust = 4.47729;
+
+//12 states
+Real p (start = 0);
+Real q (start = 0);
+Real r (start = 0);
+
+Real OMEGA[3,3] = skew({p,q,r});//Skew symmetric matrix form of the angular velocity term
+
+
+Real V (start =15.8114);
+Real alpha (start =0.1);
+Real beta (start = 0);
+
+
+Real x (start = 0);
+Real y (start = 0);
+Real z (start = 100);
+
+Real gamma (start = 0);
+Real chi (start = 0);
+Real mu (start = 0);
+
+Real qbar = 0.5*rho*V^2;
+Real [3] Moment;
+
+
+
+Real Vdot;
+Real alphadot;
+Real betadot;
+
+Real[3] omegadot;
+
+Real mudot;
+Real gammadot;
+Real chidot;
+
+Real xdot;
+Real ydot;
+Real zdot;
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*q*C_bar)/(2*V))+CL_delta_e*deltaE;
+CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+//CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (p*b)/(2*V) + Cy_r *(r*b)/(2*V) + Cy_delta_a * deltaA.k + Cy_delta_r*deltaR;//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(p*b)/(2*V) + Cl_r *(r*b)/(2*V) + Cl_delta_a * deltaA.k + Cl_delta_r * deltaR;//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*q*C_bar)/(2*V))+Cm_delta_e*deltaE;//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (p*b)/(2*V) + Cn_r *(r*b) /(2*V) + Cn_delta_a * deltaA.k + Cn_delta_r * deltaR;//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+Moment[2] = Cm*qbar*S_ref*C_bar;
+Moment[1] = Cl*qbar*S_ref*b;
+Moment[3] = Cn*qbar*S_ref*b;
+
+Vdot = der(V);
+alphadot = der(alpha);
+betadot = der(beta);
+
+omegadot[1] = der(p);
+omegadot[2] = der(q);
+omegadot[3] = der(r);
+
+xdot = der(x);
+ydot = der(y);
+zdot = der(z);
+
+mudot = der(mu);
+gammadot = der(gamma);
+chidot = der(chi);
+
+
+
+
+Vdot = 1/m*(thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta))-m*g*sin(gamma));
+
+alphadot = q-1/cos(beta)*((p*cos(alpha)+r*sin(alpha))*sin(beta)-g/V*cos(gamma)*cos(mu)+0.5*rho*V^2*S_ref*CL/(m*V)+thrust*sin(alpha)/(m*V));
+
+betadot = (p*sin(alpha)-r*cos(alpha))+1/(m*V)*(-thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta))+m*g*cos(gamma)*sin(mu));
+
+
+omegadot = inv(J) * (Moment- OMEGA* J*{p,q,r});
+
+
+
+xdot=V*cos(gamma)*cos(chi);
+ydot=V*cos(gamma)*sin(chi);
+zdot=-V*sin(gamma);
+
+mudot = p+tan(gamma)*sin(mu)*q+tan(gamma)*cos(mu)*r;
+gammadot = cos(mu)*q-sin(mu)*r;
+chidot=(1/cos(gamma))*sin(mu)*q+(1/cos(gamma))*cos(mu)*r;
+
+
+annotation(experiment(StartTime = 0, StopTime = 500, Interval = 0.002),
+ uses(Modelica(version = "3.2.2")));
+end Wind6DOFZagi; \ No newline at end of file
diff --git a/Flight_Eqns/Wind_Axis_eqns/WindForceMoment.mo b/Flight_Eqns/Wind_Axis_eqns/WindForceMoment.mo
new file mode 100644
index 0000000..9f3c8e4
--- /dev/null
+++ b/Flight_Eqns/Wind_Axis_eqns/WindForceMoment.mo
@@ -0,0 +1,124 @@
+model WindForceMoment
+
+import Modelica.Math.Matrices.*;
+import Modelica.SIunits.*;
+import Modelica.Blocks.Interfaces.*;
+import Modelica.Math.Vectors.*;
+
+
+
+parameter Real rho = 1.225;
+parameter Real g = 9.81;
+parameter Real m = 1043.26;//1.56 for zagi
+parameter Real S_ref = 16.1651;//reference area
+parameter Real C_bar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+
+parameter Real CD0 = 0.036;//= 0.01631;for Zagi
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+Real CL;
+Real CD;
+Real CY;
+Real Cl;
+Real Cm;
+Real Cn;
+Real CX;
+Real CZ;
+
+RealInput thrust annotation( Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+RealInput[3] delta annotation(
+ Placement(visible = true, transformation(origin = {-110, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-110, -50}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+
+RealInput[3] VAB annotation( Placement(visible = true, transformation(origin = {-33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {-33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));//V, alpha, beta
+
+RealInput[3] omega annotation( Placement(visible = true, transformation(origin = {33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90), iconTransformation(origin = {33, 110}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));//Angular velocities
+
+
+
+Real V = VAB[1];
+Real alpha = VAB[2];
+Real beta = VAB[3];
+
+Real p = omega[1];
+Real q = omega[2];
+Real r = omega[3];
+
+Real deltaE = delta[1];
+Real deltaR = delta[2];
+Real deltaA = delta[3];
+
+Real qbar = 0.5*rho*V^2;
+
+
+
+RealOutput Force[3] annotation( Placement(visible = true, transformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, 33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+RealOutput Moment[3] annotation( Placement(visible = true, transformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {110, -33}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));//Thrust force
+
+
+
+equation
+CL = CL0+CL_alpha*alpha+((CL_q*q*C_bar)/(2*V))+CL_delta_e*deltaE;
+//CD = CD0+CD_alpha*alpha+((CD_q*q*C_bar)/(2*V))+CD_delta_e*abs(deltaE) ;
+CD = CD0 + K_drag*CL^2;
+CY = Cy_beta * beta + Cy_p * (p*b)/(2*V) + Cy_r *(r*b)/(2*V) + Cy_delta_a * deltaA + Cy_delta_r*deltaR;//Sideslip coeff
+
+
+Cl = Cl_beta * beta + Cl_p*(p*b)/(2*V) + Cl_r *(r*b)/(2*V) + Cl_delta_a * deltaA + Cl_delta_r * deltaR;//Rolling coeff
+
+Cm = Cm0+Cm_alpha*alpha+((Cm_q*q*C_bar)/(2*V))+Cm_delta_e*deltaE;//pitching coeff
+
+Cn = Cn_beta * beta + Cn_p * (p*b)/(2*V) + Cn_r *(r*b) /(2*V) + Cn_delta_a * deltaA + Cn_delta_r * deltaR;//Yawing coeff
+
+CX = -CD*cos(alpha) + CL*sin(alpha);
+CZ = -CD*sin(alpha) - CL*cos(alpha);
+
+Force[1] = thrust*cos(alpha)*cos(beta)-0.5*rho*V^2*S_ref*(CD*cos(beta)-CY*sin(beta));
+Force[2] = -thrust*cos(alpha)*sin(beta)+0.5*rho*V^2*S_ref*(CY*cos(beta)+CD*sin(beta));
+Force[3] = 0.5*rho*V^2*S_ref*CL+thrust*sin(alpha);
+
+
+Moment[2] = Cm*qbar*S_ref*C_bar;
+Moment[1] = Cl*qbar*S_ref*b;
+Moment[3] = Cn*qbar*S_ref*b;
+
+end WindForceMoment; \ No newline at end of file
diff --git a/IPC_testing.mo b/IPC_testing.mo
new file mode 100755
index 0000000..ee523bd
--- /dev/null
+++ b/IPC_testing.mo
@@ -0,0 +1,46 @@
+class IPC_testing
+ import InterProcessCommunication.SharedMemory.*;
+ //extends Modelica.Mechanics.Rotational.Components;
+ // Declaration of variables and constants
+ Real motorInputValue "Value of input to the Discrete PID Controller";
+ Real motorOutputValue "Value of output of Discrete PID Controller";
+ Integer motorInputIndex = 1;
+ //Address from where to read, can be any number between 0 to 10, it must match the address given to output value in second model i.e. DiscretePID_SM_Example in this case
+ Integer motorOutputIndex = 1;
+ //Address where to write, can be any number between 0 to 10
+ Real motorOutputDummy "Dummy value to be returned by the SharedMemoryWrite function";
+ Modelica.Blocks.Continuous.FirstOrder firstOrder1(T = 1, k = 1) annotation(
+ Placement(visible = true, transformation(origin = {-50, 14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ firstOrder1.u = motorInputValue "The value of control signal (pidOutputValue) is acquired by the SharedMemoryRead function and it is assigned to the input of the DC motor";
+ motorOutputValue = firstOrder1.y "The measured speed of the DC motor is assigned to pidInputValue, which is written into the shared memory using SharedMemoryWrite Function";
+ when sample(0, 0.02) then
+ motorInputValue = InterProcessCommunication.SharedMemory.SharedMemoryRead(motorInputIndex) "SharedMemoryRead Function reads the value from the shared memory, pointed by pidOutputIndex tag and assigns it to the input of the DC motor";
+ motorOutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(motorOutputIndex, motorOutputValue) "SharedMemoryWrite Function writes the value of measured speed into the shared memory, pointed by pidInputIndex tag";
+ end when;
+ annotation(
+ Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-140, -100}, {140, 100}}, initialScale = 0.1)),
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})),
+ Documentation(info = "<html>
+
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+The <b>DCMotor</b> model contains the DC motor, which reads the control signal from shared memory (given by discrete PID controller) and the speed sensor measures the resulting rotation. The measured speed from speed sensor is written into the shared memory.
+
+ </p>
+
+ <p>
+The values of control signal and speed of the DC motor are read from and written into the shared memory at sampling interval of 0.05 seconds. <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> and <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> functions are used to read the control signal from the shared memory and write the measured speed into the shared memory respectively. The motorOutputIndex and motorInputIndex variables serve as index of the tag i.e. motorInputIndex points to the value of control signal and motorOutputIndex points to the value of speed of the DC motor. The value of the control signal, returned by the <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> function is stored in the motorInputValue variable. The value of the motorInputValue is in turn assigned to the torque.tau variable, which serves as an input to the DC motor. Similarly, the value of the measured speed is assigned to motorOutputvalue variable. Therefore, the value of the motorOutputvalue is written into shared memory using <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> function.
+</p>
+
+<p>
+<b>License:</b> GNU GPLV3 2017<br />
+This is a free program, and you are welcome to modify and redistribute it. This program comes with ABSOLUTELY NO WARRANTY.<br /><br />
+<b>Credits:</b> ModeliCon Infotech Team <br />Ankur Gajjar <br />Shubham Patne <br />Jal Panchal <br />Ritesh Sharma <br />Pavan P <br />
+</p>
+
+</html>"),
+ experiment(StopTime = 30, StartTime = 0, Tolerance = 1e-06, Interval = 0.01),
+ __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS", nls = "homotopy", clock = "RT"),
+ uses(Modelica(version = "3.2.2")));
+end IPC_testing; \ No newline at end of file
diff --git a/InterProcessExamples/DCMotor.mo b/InterProcessExamples/DCMotor.mo
new file mode 100755
index 0000000..d902201
--- /dev/null
+++ b/InterProcessExamples/DCMotor.mo
@@ -0,0 +1,65 @@
+within InterProcessCommunication.Examples.InterProcessExamples;
+
+model DCMotor
+ extends Modelica.Icons.Example;
+ //extends Modelica.Mechanics.Rotational.Components;
+ Modelica.Mechanics.Rotational.Components.Inertia load(J = 10, phi(fixed = true, start = 0), w(fixed = true, start = 0)) annotation(
+ Placement(transformation(extent = {{67, 0}, {87, 20}})));
+ Modelica.Mechanics.Rotational.Sensors.SpeedSensor speed annotation(
+ Placement(transformation(extent = {{-10, -10}, {6, 6}}, rotation = -90, origin = {94, -7})));
+ Modelica.Mechanics.Rotational.Sources.Torque torque annotation(
+ Placement(transformation(extent = {{40, 0}, {60, 20}})));
+ Modelica.Blocks.Interfaces.RealOutput y annotation(
+ Placement(visible = true, transformation(origin = {50, -44}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {80, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+ // Declaration of variables and constants
+
+ Real motorInputValue "Value of input to the Discrete PID Controller" ;
+ Real motorOutputValue "Value of output of Discrete PID Controller" ;
+ Integer motorInputIndex = 1;//Address from where to read, can be any number between 0 to 10, it must match the address given to output value in second model i.e. DiscretePID_SM_Example in this case
+ Integer motorOutputIndex = 1;//Address where to write, can be any number between 0 to 10
+ Real motorOutputDummy "Dummy value to be returned by the SharedMemoryWrite function";
+
+equation
+
+ connect(speed.w, y) annotation(
+ Line(points = {{92, -14}, {90, -14}, {90, -44}, {50, -44}, {50, -44}}, color = {0, 0, 127}));
+ connect(speed.flange, load.flange_b) annotation(
+ Line(points = {{92, 3}, {92, 10}, {87, 10}}, color = {0, 0, 0}, smooth = Smooth.None));
+ connect(torque.flange, load.flange_a) annotation(
+ Line(points = {{60, 10}, {67, 10}}, color = {0, 0, 0}, smooth = Smooth.None));
+
+ torque.tau = motorInputValue "The value of control signal (pidOutputValue) is acquired by the SharedMemoryRead function and it is assigned to the input of the DC motor";
+ motorOutputValue = speed.w "The measured speed of the DC motor is assigned to pidInputValue, which is written into the shared memory using SharedMemoryWrite Function";
+
+ when sample(0, 0.05) then
+ motorInputValue = InterProcessCommunication.SharedMemory.SharedMemoryRead(motorInputIndex) "SharedMemoryRead Function reads the value from the shared memory, pointed by pidOutputIndex tag and assigns it to the input of the DC motor";
+ motorOutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(motorOutputIndex, motorOutputValue) "SharedMemoryWrite Function writes the value of measured speed into the shared memory, pointed by pidInputIndex tag" ;
+ end when;
+
+ annotation(
+ Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-140, -100}, {140, 100}}, initialScale = 0.1), graphics = {Text(lineColor = {255, 0, 0}, extent = {{40, 37}, {90, 31}}, textString = "plant"), Rectangle(lineColor = {255, 0, 0}, extent = {{32, 40}, {104, -40}})}),
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})),
+ Documentation(info = "<html>
+
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+The <b>DCMotor</b> model contains the DC motor, which reads the control signal from shared memory (given by discrete PID controller) and the speed sensor measures the resulting rotation. The measured speed from speed sensor is written into the shared memory.
+
+ </p>
+
+ <p>
+The values of control signal and speed of the DC motor are read from and written into the shared memory at sampling interval of 0.05 seconds. <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> and <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> functions are used to read the control signal from the shared memory and write the measured speed into the shared memory respectively. The motorOutputIndex and motorInputIndex variables serve as index of the tag i.e. motorInputIndex points to the value of control signal and motorOutputIndex points to the value of speed of the DC motor. The value of the control signal, returned by the <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> function is stored in the motorInputValue variable. The value of the motorInputValue is in turn assigned to the torque.tau variable, which serves as an input to the DC motor. Similarly, the value of the measured speed is assigned to motorOutputvalue variable. Therefore, the value of the motorOutputvalue is written into shared memory using <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> function.
+</p>
+
+<p>
+<b>License:</b> GNU GPLV3 2017<br />
+This is a free program, and you are welcome to modify and redistribute it. This program comes with ABSOLUTELY NO WARRANTY.<br /><br />
+<b>Credits:</b> ModeliCon Infotech Team <br />Ankur Gajjar <br />Shubham Patne <br />Jal Panchal <br />Ritesh Sharma <br />Pavan P <br />
+</p>
+
+</html>"),
+ experiment(StopTime = 30, StartTime = 0, Tolerance = 1e-06, Interval = 0.01),
+ __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS", nls = "homotopy", clock = "RT"));
+
+end DCMotor; \ No newline at end of file
diff --git a/InterProcessExamples/DiscretePID.mo b/InterProcessExamples/DiscretePID.mo
new file mode 100755
index 0000000..a387057
--- /dev/null
+++ b/InterProcessExamples/DiscretePID.mo
@@ -0,0 +1,56 @@
+within InterProcessCommunication.Examples.InterProcessExamples;
+
+model DiscretePID
+ extends Modelica.Icons.Example;
+ parameter Real sampleTime = 0.05;
+ parameter Integer pidInputIndex = 1;//Address from where to read, can be any number between 0 to 10, it must match the address given to output value in second model i.e. DCMotor_SM_Example in this case
+ parameter Integer pidOutputIndex = 1;//Address where to write, can be any number between 0 to 10
+ Real MotorSpeed;//motor speed sensed by speed sensor and received as feedback
+ Real pidOutputDummy;//dummy return value from shared memory
+ Real pidInputValue;//value read from shared memory
+ Real pidOutputValue;//value written to shared memory
+ Modelica.Blocks.Continuous.PID PID(Td = 0.05, Ti = 5, k = 9) annotation(
+ Placement(visible = true, transformation(origin = {50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.Filter filter1(f_cut = 0.8, order = 3) annotation(
+ Placement(visible = true, transformation(origin = {24, -32}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Step step1(height = 20, startTime = 5) annotation(
+ Placement(visible = true, transformation(origin = {-50, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+algorithm
+ when sample(0, sampleTime) then
+ pidInputValue := InterProcessCommunication.SharedMemory.SharedMemoryRead(pidInputIndex) "SharedMemoryRead Function reads the value from the shared memory, pointed by pidOutputIndex tag and assigns it to the input of the DC motor";
+ filter1.u := pidInputValue;
+ feedback1.u2 := filter1.y;
+ MotorSpeed := feedback1.u2;
+ pidOutputValue := PID.y;
+ pidOutputDummy := InterProcessCommunication.SharedMemory.SharedMemoryWrite(pidOutputIndex, pidOutputValue) "SharedMemoryWrite Function writes the value of measured speed into the shared memory, pointed by pidInputIndex tag";
+ end when;
+equation
+ connect(step1.y, feedback1.u1) annotation(
+ Line(points = {{-38, 0}, {-10, 0}, {-10, 0}, {-8, 0}}, color = {0, 0, 127}));
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{10, 0}, {38, 0}, {38, 0}, {38, 0}}, color = {0, 0, 127}));
+ annotation(
+ experiment(StartTime = 0, StopTime = 30, Tolerance = 1e-06, Interval = 0.01),
+ __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS", nls = "homotopy", clock = "RT"), Documentation(info="<html>
+
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+The <b>DiscretePID</b> model contains the discretized PID controller with the step signal with 20 amplitude and 5s start time as a reference signal. The measured speed of the DC motor is read from the shared memory and given to the feedback of the discrete PID controller. Based on the difference between setpoint and measured speed, the discrete PID controller provides a control signal, which is written into the shared memory.
+</p>
+
+<p>
+The values of control signal and speed of the DC motor are written into and read from the shared memory at sampling interval of 0.05 seconds respectively. <a href=\"modelica://InterProcessCommunication.SharedMemory_Functions.SharedMemoryRead\"> SharedMemoryRead </a> and <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> functions are used to read the speed of the DC motor from the shared memory and write the control signal into the shared memory respectively. The pidOutputIndex and pidInputIndex variables serve as index of the tag i.e. pidOutputIndex points to the value of control signal and pidInputIndex points to the value of speed of the DC motor. The value of the speed of the DC motor, returned by the <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> function is stored in the pidIutputValue variable. The value of the pidIutputValue is in turn assigned to the filter1.u variable, which serves as an input to the feedback of the discrete PID controller. Similarly, the value of control signal is assigned to pidOutputvalue variable. Therefore, the value of the pidOutputvalue is written into shared memory using <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> function.
+</p>
+
+<p>
+<b>License:</b> GNU GPLV3 2017<br />
+This is a free program, and you are welcome to modify and redistribute it. This program comes with ABSOLUTELY NO WARRANTY.<br /><br />
+<b>Credits:</b> ModeliCon Infotech Team <br />Ankur Gajjar <br />Shubham Patne <br />Jal Panchal <br />Ritesh Sharma <br />Pavan P <br />
+</p>
+
+</html>"),
+ Diagram(graphics = {Rectangle(origin = {0, -10}, extent = {{-68, 50}, {68, -50}}), Text(origin = {0, 36}, lineColor = {255, 0, 0}, fillColor = {255, 0, 0}, extent = {{-26, -6}, {26, 6}}, textString = "Controller Package")}));
+
+end DiscretePID; \ No newline at end of file
diff --git a/InterProcessExamples/package.mo b/InterProcessExamples/package.mo
new file mode 100755
index 0000000..77de993
--- /dev/null
+++ b/InterProcessExamples/package.mo
@@ -0,0 +1,16 @@
+within InterProcessCommunication.Examples;
+
+package InterProcessExamples
+extends Modelica.Icons.ExamplesPackage;
+ annotation (Documentation(info= "<html>
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+This package contains example models for inter process and intersystem communication. For User's guide to those models and necessary setups refer to <a href=\"modelica://InterProcessCommunication.info.Tutorial\"> Tutorial</a>
+</p>
+<p>
+<b>License:</b> GNU GPL 2017<br />
+This is a free program, and you are welcome to modify and redistribute it. This program comes with ABSOLUTELY NO WARRANTY.<br /><br />
+<b>Credits:</b> ModeliCon Infotech Team <br />Ankur Gajjar <br />Shubham Patne <br />Jal Panchal <br />Ritesh Sharma <br />Pavan P <br />
+</p>
+</html>"));
+end InterProcessExamples; \ No newline at end of file
diff --git a/InterProcessExamples/package.order b/InterProcessExamples/package.order
new file mode 100755
index 0000000..99c50a3
--- /dev/null
+++ b/InterProcessExamples/package.order
@@ -0,0 +1,2 @@
+DiscretePID
+DCMotor
diff --git a/MDD_HIL Practice_Cases/MDD_Testing.mo b/MDD_HIL Practice_Cases/MDD_Testing.mo
new file mode 100755
index 0000000..677f3d8
--- /dev/null
+++ b/MDD_HIL Practice_Cases/MDD_Testing.mo
@@ -0,0 +1,61 @@
+class HIL_PID
+ import Modelica_DeviceDrivers.*;
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortSend serialSend(Serial_Port = "/dev/ttyACM0", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, sampleTime = 0.002) annotation(
+ Placement(visible = true, transformation(origin = {-46, -90}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packager packager(sampleTime = 0.001, useBackwardPropagatedBufferSize = true, useBackwardSampleTimePropagation = true) annotation(
+ Placement(visible = true, transformation(extent = {{-56, 18}, {-36, 38}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortReceive serialReceive(Serial_Port = "/dev/ttyACM0", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, sampleTime = 0.002, startTime = 0) annotation(
+ Placement(visible = true, transformation(origin = {-8, 50}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedInteger unpackInt(nu = 1, width = 8) annotation(
+ Placement(visible = true, transformation(extent = {{-18, -2}, {2, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddInteger addInteger(n = 1, nu = 1) annotation(
+ Placement(visible = true, transformation(extent = {{-56, -34}, {-36, -14}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetInteger getInteger annotation(
+ Placement(visible = true, transformation(extent = {{-20, -78}, {0, -58}}, rotation = 0)));
+ Modelica.Blocks.Math.RealToInteger realToInteger1 annotation(
+ Placement(visible = true, transformation(origin = {-76, 62}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica.Blocks.Math.IntegerToReal integerToReal1 annotation(
+ Placement(visible = true, transformation(origin = {28, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 90)));
+ Modelica.Blocks.Continuous.FirstOrder firstOrder1(T = 1, initType = Modelica.Blocks.Types.Init.NoInit, k = 1) annotation(
+ Placement(visible = true, transformation(origin = {-26, 86}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation(
+ Placement(visible = true, transformation(origin = {70, 68}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(addInteger.pkgOut[1], serialSend.pkgIn) annotation(
+ Line(points = {{-46, -35}, {-46, -79}}));
+ connect(realToInteger1.y, addInteger.u[1]) annotation(
+ Line(points = {{-76, 51}, {-76, -24}, {-58, -24}}, color = {255, 127, 0}));
+ connect(realToInteger1.u, firstOrder1.y) annotation(
+ Line(points = {{-76, 74}, {-76, 86}, {-38, 86}}, color = {0, 0, 127}));
+ connect(packager.pkgOut, addInteger.pkgIn) annotation(
+ Line(points = {{-46, 17}, {-46, -13}}));
+ connect(unpackInt.pkgOut[1], getInteger.pkgIn) annotation(
+ Line(points = {{-8, -3}, {-7, -3}, {-7, -20}, {-10, -20}, {-10, -57}}, thickness = 0.5));
+ connect(serialReceive.pkgOut, unpackInt.pkgIn) annotation(
+ Line(points = {{-8, 39}, {-8, 19}}));
+ connect(integerToReal1.u, unpackInt.y) annotation(
+ Line(points = {{28, 58}, {28, 8}, {3, 8}}, color = {255, 127, 0}));
+ connect(firstOrder1.u, integerToReal1.y) annotation(
+ Line(points = {{-14, 86}, {28, 86}, {28, 82}, {28, 82}, {28, 82}}, color = {0, 0, 127}));
+ annotation(
+ Documentation(info = "<html>
+<h4><span style=\"color:#008000\">Example for serial port support</span></h4>
+<h4><span style=\"color:#008000\">Hardware setup</span></h4>
+<p>In order to execute the example an appropriate physical connection between the sending and the receiving serial port needs to be established, (e.g., by using a null modem cable between the two serial port interfaces <a href=\"http://en.wikipedia.org/wiki/Null_modem\">http://en.wikipedia.org/wiki/Null_modem</a>). In fact a minimal mull modem with lines (<code>TxD</code>, <code>Rxd</code> and <code>GND</code>) is sufficient. Next, the <code>SerialPortReceive</code> and <code>SerialPortSend</code> blocks parameters must be updated with the device filenames corresponding to the connected physical serial ports. Now, the example can be executed.</p>
+<h4><span style=\"color:#008000\">Alternative: Using virtual serial port devices for test purposes</span></h4>
+<p>To run the example without serial port hardware, it is possible to resort to virtual serial ports. Possible ways of doing this are described in the following.</p>
+<p>On Linux, make sure that <i>socat</i> is installed, e.g., on an Ubuntu machine do</p>
+<pre>sudo aptitude install socat</pre>
+<p>Now open a console and create two virtual serial port interfaces using socat:</p>
+<pre>socat -d -d pty,raw,echo=0 pty,raw,echo=0</pre>
+<p>The socat program will print the device file names that it created. The output will resemble the following:</p>
+<pre>2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/1
+2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/3
+2013/11/24 15:20:21 socat[3262] N starting data transfer loop with FDs [3,3] and [5,5]</pre>
+<p>Use them in the Send and Receive block. E.g., for the output above you would use <code>&quot;/dev/pts/1&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;/dev/pts/3&quot;</code> in <code>SerialPortSend</code>.</p>
+<p>You may have also have a look at the discussion about virtual serial port devices on stackoverflow<a href=\"http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux\">http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux</a>.</p>
+<p>On Windows, make sure that the null modem emulator <i>com0com</i> is installed.</p>
+<p>Start the Setup for <i>com0com</i> and check the device names of the created virtual port pair. E.g. you could type <code>&quot;COM6&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;COM7&quot;</code> in <code>SerialPortSend</code>.</p>
+</html>"),
+ uses(Modelica_DeviceDrivers(version = "1.5.0")));
+end HIL_PID; \ No newline at end of file
diff --git a/MDD_HIL Practice_Cases/Serial_Write.mo b/MDD_HIL Practice_Cases/Serial_Write.mo
new file mode 100755
index 0000000..d5b0b57
--- /dev/null
+++ b/MDD_HIL Practice_Cases/Serial_Write.mo
@@ -0,0 +1,48 @@
+class Serial_Write
+import OpenModelica.Scripting.*;
+ import Modelica_DeviceDrivers;
+ Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime annotation(
+ Placement(transformation(extent = {{62, 50}, {82, 70}})));
+ Modelica.Blocks.Math.RealToInteger realToInteger1 annotation(
+ Placement(visible = true, transformation(origin = {-68, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddInteger addInteger1(nu = 1) annotation(
+ Placement(visible = true, transformation(origin = {-36, -4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Sine sine1(amplitude = 100, freqHz = 0.5, offset = 100, startTime = 0) annotation(
+ Placement(visible = true, transformation(origin = {-68, 66}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packager packager(sampleTime = 0.005, useBackwardPropagatedBufferSize = true, useBackwardSampleTimePropagation = false) annotation(
+ Placement(visible = true, transformation(extent = {{-44, 30}, {-24, 50}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortSend serialSend(Serial_Port = "/dev/ttyACM0", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, sampleTime = 0.002) annotation(
+ Placement(visible = true, transformation(origin = {-36, -58}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+equation
+ alarm(1);
+ connect(packager.pkgOut, addInteger1.pkgIn) annotation(
+ Line(points = {{-34, 29}, {-34, 17.5}, {-36, 17.5}, {-36, 6}}));
+ connect(addInteger1.pkgOut[1], serialSend.pkgIn) annotation(
+ Line(points = {{-36, -14}, {-36, -47}}, thickness = 0.5));
+ connect(sine1.y, realToInteger1.u) annotation(
+ Line(points = {{-68, 55}, {-68, 38}}, color = {0, 0, 127}));
+ connect(realToInteger1.y, addInteger1.u[1]) annotation(
+ Line(points = {{-68, 16}, {-68, 16}, {-68, -4}, {-48, -4}, {-48, -4}}, color = {255, 127, 0}));
+ annotation(
+ Documentation(info = "<html>
+<h4><span style=\"color:#008000\">Example for serial port support</span></h4>
+<h4><span style=\"color:#008000\">Hardware setup</span></h4>
+<p>In order to execute the example an appropriate physical connection between the sending and the receiving serial port needs to be established, (e.g., by using a null modem cable between the two serial port interfaces <a href=\"http://en.wikipedia.org/wiki/Null_modem\">http://en.wikipedia.org/wiki/Null_modem</a>). In fact a minimal mull modem with lines (<code>TxD</code>, <code>Rxd</code> and <code>GND</code>) is sufficient. Next, the <code>SerialPortReceive</code> and <code>SerialPortSend</code> blocks parameters must be updated with the device filenames corresponding to the connected physical serial ports. Now, the example can be executed.</p>
+<h4><span style=\"color:#008000\">Alternative: Using virtual serial port devices for test purposes</span></h4>
+<p>To run the example without serial port hardware, it is possible to resort to virtual serial ports. Possible ways of doing this are described in the following.</p>
+<p>On Linux, make sure that <i>socat</i> is installed, e.g., on an Ubuntu machine do</p>
+<pre>sudo aptitude install socat</pre>
+<p>Now open a console and create two virtual serial port interfaces using socat:</p>
+<pre>socat -d -d pty,raw,echo=0 pty,raw,echo=0</pre>
+<p>The socat program will print the device file names that it created. The output will resemble the following:</p>
+<pre>2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/1
+2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/3
+2013/11/24 15:20:21 socat[3262] N starting data transfer loop with FDs [3,3] and [5,5]</pre>
+<p>Use them in the Send and Receive block. E.g., for the output above you would use <code>&quot;/dev/pts/1&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;/dev/pts/3&quot;</code> in <code>SerialPortSend</code>.</p>
+<p>You may have also have a look at the discussion about virtual serial port devices on stackoverflow<a href=\"http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux\">http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux</a>.</p>
+<p>On Windows, make sure that the null modem emulator <i>com0com</i> is installed.</p>
+<p>Start the Setup for <i>com0com</i> and check the device names of the created virtual port pair. E.g. you could type <code>&quot;COM6&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;COM7&quot;</code> in <code>SerialPortSend</code>.</p>
+</html>"),
+ uses(Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0")));
+
+end Serial_Write; \ No newline at end of file
diff --git a/MDD_HIL Practice_Cases/Serial_read.mo b/MDD_HIL Practice_Cases/Serial_read.mo
new file mode 100755
index 0000000..59aaea1
--- /dev/null
+++ b/MDD_HIL Practice_Cases/Serial_read.mo
@@ -0,0 +1,36 @@
+class Serial_read
+ Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime annotation(
+ Placement(transformation(extent = {{62, 50}, {82, 70}})));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedInteger unpackInt(nu = 1, width = 8) annotation(
+ Placement(visible = true, transformation(extent = {{4, -4}, {24, 16}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetInteger getInteger annotation(
+ Placement(visible = true, transformation(extent = {{4, -66}, {24, -46}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortReceive serialReceive(Serial_Port = "/dev/ttyACM1", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, enableExternalTrigger = false, sampleTime = 0.002) annotation(
+ Placement(visible = true, transformation(origin = {14, 54}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+equation
+ connect(serialReceive.pkgOut, unpackInt.pkgIn) annotation(
+ Line(points = {{14, 43}, {14, 17}}));
+ connect(unpackInt.pkgOut[1], getInteger.pkgIn) annotation(
+ Line(points = {{14, -5}, {14, -45}}, thickness = 0.5));
+ annotation(
+ Documentation(info = "<html>
+<h4><span style=\"color:#008000\">Example for serial port support</span></h4>
+<h4><span style=\"color:#008000\">Hardware setup</span></h4>
+<p>In order to execute the example an appropriate physical connection between the sending and the receiving serial port needs to be established, (e.g., by using a null modem cable between the two serial port interfaces <a href=\"http://en.wikipedia.org/wiki/Null_modem\">http://en.wikipedia.org/wiki/Null_modem</a>). In fact a minimal mull modem with lines (<code>TxD</code>, <code>Rxd</code> and <code>GND</code>) is sufficient. Next, the <code>SerialPortReceive</code> and <code>SerialPortSend</code> blocks parameters must be updated with the device filenames corresponding to the connected physical serial ports. Now, the example can be executed.</p>
+<h4><span style=\"color:#008000\">Alternative: Using virtual serial port devices for test purposes</span></h4>
+<p>To run the example without serial port hardware, it is possible to resort to virtual serial ports. Possible ways of doing this are described in the following.</p>
+<p>On Linux, make sure that <i>socat</i> is installed, e.g., on an Ubuntu machine do</p>
+<pre>sudo aptitude install socat</pre>
+<p>Now open a console and create two virtual serial port interfaces using socat:</p>
+<pre>socat -d -d pty,raw,echo=0 pty,raw,echo=0</pre>
+<p>The socat program will print the device file names that it created. The output will resemble the following:</p>
+<pre>2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/1
+2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/3
+2013/11/24 15:20:21 socat[3262] N starting data transfer loop with FDs [3,3] and [5,5]</pre>
+<p>Use them in the Send and Receive block. E.g., for the output above you would use <code>&quot;/dev/pts/1&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;/dev/pts/3&quot;</code> in <code>SerialPortSend</code>.</p>
+<p>You may have also have a look at the discussion about virtual serial port devices on stackoverflow<a href=\"http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux\">http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux</a>.</p>
+<p>On Windows, make sure that the null modem emulator <i>com0com</i> is installed.</p>
+<p>Start the Setup for <i>com0com</i> and check the device names of the created virtual port pair. E.g. you could type <code>&quot;COM6&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;COM7&quot;</code> in <code>SerialPortSend</code>.</p>
+</html>"));
+
+end Serial_read; \ No newline at end of file
diff --git a/MDD_HIL Practice_Cases/Serial_read_write.mo b/MDD_HIL Practice_Cases/Serial_read_write.mo
new file mode 100755
index 0000000..f7878a6
--- /dev/null
+++ b/MDD_HIL Practice_Cases/Serial_read_write.mo
@@ -0,0 +1,58 @@
+class Serial_read_write
+ import OpenModelica.Scripting.*;
+ import Modelica_DeviceDrivers;
+ Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime annotation(
+ Placement(transformation(extent = {{62, 50}, {82, 70}})));
+ Modelica.Blocks.Math.RealToInteger realToInteger1 annotation(
+ Placement(visible = true, transformation(origin = {-68, 26}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddInteger addInteger1(nu = 1) annotation(
+ Placement(visible = true, transformation(origin = {-36, -4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Sine sine1(amplitude = 100, freqHz = 0.5, offset = 100, startTime = 0) annotation(
+ Placement(visible = true, transformation(origin = {-68, 66}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packager packager(sampleTime = 0.005, useBackwardPropagatedBufferSize = true, useBackwardSampleTimePropagation = false) annotation(
+ Placement(visible = true, transformation(extent = {{-44, 30}, {-24, 50}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortSend serialSend(Serial_Port = "/dev/ttyACM0", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, sampleTime = 0.002) annotation(
+ Placement(visible = true, transformation(origin = {-36, -58}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortReceive serialReceive(Serial_Port = "/dev/ttyACM0", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, enableExternalTrigger = false, sampleTime = 0.002) annotation(
+ Placement(visible = true, transformation(origin = {18, 54}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetInteger getInteger annotation(
+ Placement(visible = true, transformation(extent = {{6, -66}, {26, -46}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedInteger unpackInt(nu = 1, width = 8) annotation(
+ Placement(visible = true, transformation(origin = {16, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+alarm(1);
+ connect(unpackInt.pkgOut[1], getInteger.pkgIn) annotation(
+ Line(points = {{16, -6}, {18, -6}, {18, -46}, {16, -46}}, thickness = 0.5));
+ connect(serialReceive.pkgOut, unpackInt.pkgIn) annotation(
+ Line(points = {{18, 44}, {16, 44}, {16, 14}, {16, 14}, {16, 14}}));
+ connect(packager.pkgOut, addInteger1.pkgIn) annotation(
+ Line(points = {{-34, 29}, {-34, 17.5}, {-36, 17.5}, {-36, 6}}));
+ connect(addInteger1.pkgOut[1], serialSend.pkgIn) annotation(
+ Line(points = {{-36, -14}, {-36, -47}}, thickness = 0.5));
+ connect(sine1.y, realToInteger1.u) annotation(
+ Line(points = {{-68, 55}, {-68, 38}}, color = {0, 0, 127}));
+ connect(realToInteger1.y, addInteger1.u[1]) annotation(
+ Line(points = {{-68, 16}, {-68, 16}, {-68, -4}, {-48, -4}, {-48, -4}}, color = {255, 127, 0}));
+ annotation(
+ Documentation(info = "<html>
+<h4><span style=\"color:#008000\">Example for serial port support</span></h4>
+<h4><span style=\"color:#008000\">Hardware setup</span></h4>
+<p>In order to execute the example an appropriate physical connection between the sending and the receiving serial port needs to be established, (e.g., by using a null modem cable between the two serial port interfaces <a href=\"http://en.wikipedia.org/wiki/Null_modem\">http://en.wikipedia.org/wiki/Null_modem</a>). In fact a minimal mull modem with lines (<code>TxD</code>, <code>Rxd</code> and <code>GND</code>) is sufficient. Next, the <code>SerialPortReceive</code> and <code>SerialPortSend</code> blocks parameters must be updated with the device filenames corresponding to the connected physical serial ports. Now, the example can be executed.</p>
+<h4><span style=\"color:#008000\">Alternative: Using virtual serial port devices for test purposes</span></h4>
+<p>To run the example without serial port hardware, it is possible to resort to virtual serial ports. Possible ways of doing this are described in the following.</p>
+<p>On Linux, make sure that <i>socat</i> is installed, e.g., on an Ubuntu machine do</p>
+<pre>sudo aptitude install socat</pre>
+<p>Now open a console and create two virtual serial port interfaces using socat:</p>
+<pre>socat -d -d pty,raw,echo=0 pty,raw,echo=0</pre>
+<p>The socat program will print the device file names that it created. The output will resemble the following:</p>
+<pre>2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/1
+2013/11/24 15:20:21 socat[3262] N PTY is /dev/pts/3
+2013/11/24 15:20:21 socat[3262] N starting data transfer loop with FDs [3,3] and [5,5]</pre>
+<p>Use them in the Send and Receive block. E.g., for the output above you would use <code>&quot;/dev/pts/1&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;/dev/pts/3&quot;</code> in <code>SerialPortSend</code>.</p>
+<p>You may have also have a look at the discussion about virtual serial port devices on stackoverflow<a href=\"http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux\">http://stackoverflow.com/questions/52187/virtual-serial-port-for-linux</a>.</p>
+<p>On Windows, make sure that the null modem emulator <i>com0com</i> is installed.</p>
+<p>Start the Setup for <i>com0com</i> and check the device names of the created virtual port pair. E.g. you could type <code>&quot;COM6&quot;</code> in <code>SerialPortReceive</code> and <code>&quot;COM7&quot;</code> in <code>SerialPortSend</code>.</p>
+</html>"),
+ uses(Modelica(version = "3.2.2"), Modelica_DeviceDrivers(version = "1.5.0")));
+
+end Serial_read_write; \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/.gitignore b/Modelica-Arduino-MDD_Arduino_Revised/.gitignore
new file mode 100755
index 0000000..b3bdba3
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/.gitignore
@@ -0,0 +1,37 @@
+# Compiled source #
+###################
+*.com
+*.class
+
+# Backup Files #
+############
+*~
+
+# Packages #
+############
+# it's better to unpack these files and commit the raw source
+# git has its own built in compression methods
+*.7z
+*.dmg
+*.gz
+*.iso
+*.jar
+*.rar
+*.tar
+*.zip
+
+# Logs and databases #
+######################
+*.log
+*.sql
+*.sqlite
+
+# OS generated files #
+######################
+.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Arduino.mo b/Modelica-Arduino-MDD_Arduino_Revised/Arduino.mo
new file mode 100755
index 0000000..156e79d
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Arduino.mo
@@ -0,0 +1,1775 @@
+package Arduino
+ extends Arduino.SerialCommunication.Icons.GenericICPackage;
+
+ package SerialCommunication "Serial Communication Package for Arduino"
+ extends Arduino.SerialCommunication.Icons.FunctionLayerIcon;
+ import ModelicaReference.Operators;
+
+ package Functions
+ extends Modelica.Icons.Package;
+ import Modelica;
+
+ function open_serial "Command to initialize the serial port which is connected to Arduino"
+ extends Modelica.Icons.Function;
+ input Integer handle, port, baudrate;
+ output Integer OK;
+
+ external OK = open_serial(handle, port, baudrate) annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>open_serial</b>(handle,port,baudrate);
+</pre></blockquote>
+<h4>Description</h4>
+<p>
+Establishes a serial communication using port number \"port\".To connect to the Arduino board, check the port number from the device manager or check it from the Arduino software.
+</p>
+</html>"));
+ end open_serial;
+
+ function read_serial "read characters from serial port"
+ extends Modelica.Icons.Function;
+ input Integer handle;
+ input Integer size;
+ output Integer r_OK;
+ protected
+ Integer buf[size + 1];
+ //String buf;
+
+ external r_OK = read_serial(handle, buf, size) annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>read_serial</b>(handle,size);
+</pre></blockquote>
+<h4>Description</h4>
+<p>The translation setting of openserial can come in the way, affecting the number of characters effectively read. If that is the case, omitting the parameter n might be a bad idea, as scilab can hang. This would happen if the input stream contains CR or LF characters which are filtered out: in such cases serialstatus counts them, but readserial does not see them and keeps wating (if the blocking mode of openserial was true) until the total number is received.
+</p>
+</html>"));
+ end read_serial;
+
+
+ //algorithm
+ //Modelica.Utilities.Streams.print(String(buf));
+
+ function write_serial "write to the serial port"
+ extends Modelica.Icons.Function;
+ input Integer handle;
+ input String str;
+ input Integer size;
+ output Integer w_OK;
+
+ external w_OK = write_serial(handle, str, size) annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>write_serial</b>(handle,str,size);
+</pre></blockquote>
+<h4>Description</h4>
+<p>No end of line character is appended to the string; the user might have to add it if the device being talked to requires it. The Tcl command puts -nonewline is used. In addition, the translation mode of openserial can come into way.
+</p>
+</html>"));
+ end write_serial;
+
+ function close_serial "Command to close the serial port which is connected to Arduino"
+ extends Modelica.Icons.Function;
+ input Integer handle;
+ output Integer c_OK;
+
+ external c_OK = close_serial(handle) annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>close_serial</b>(handle);
+</pre></blockquote>
+<h4>Description</h4>
+<p>Closes the port for serial communication specified by \"handle\".It is important to close the serial port after use, else the port would be busy and restart of Scilab might required to connect to it again.
+</p>
+</html>"));
+ end close_serial;
+
+ function status_serial "get status of the serial port"
+ extends Modelica.Icons.Function;
+ input Integer handle;
+ output Integer stat_OK;
+ protected
+ Integer bytes[2];
+
+ external stat_OK = status_serial(handle, bytes) annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>status_serial</b>(handle);
+</pre></blockquote>
+<h4>Description</h4>
+<p>Provides status of serial communication channel specified by \"handle\".Get some information about the number of characters present in the input and output buffers of the serial port, and about the status lines (DTS, CTS, etc.).The translation setting of openserial can come in the way. If the input stream contains CR or LF characters which are filtered out, openserial counts them but readserial does not see them.
+</p>
+</html>"));
+ end status_serial;
+
+ function cmd_digital_out "Command to sent out digital signal to a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no, val;
+ output Integer digital_w_OK;
+
+ external digital_w_OK = cmd_digital_out(h, pin_no, val) annotation(
+ Library = "Digital");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>cmd_digital_out</b>(handle,pin_no,value);
+</pre></blockquote>
+<h4>Description</h4>
+<p>The Arduino board has a set of logical ports (digital) that are used for writing or reading data from a component.
+To map a UNO, ports 2-13 are available (0 and 1 are used for serial transmission). For MEGA board, ports 2-53 are available. The port takes the low logic level (0) or logic high (1) which corresponds to the reference voltage.
+</p>
+</html>"));
+ end cmd_digital_out;
+
+ function cmd_digital_in "Command to read in digital signal from a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no;
+ output Integer digital_in;
+
+ external digital_in = cmd_digital_in(h, pin_no) annotation(
+ Library = "Digital");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>cmd_digital_in</b>(handle,pin_no);
+</pre></blockquote>
+<h4>Description</h4>
+<p>The Arduino board has a set of logical ports (digital) that are used for writing or reading data from a component.
+To map a UNO, ports 2-13 are available (0 and 1 are used for serial transmission). For MEGA board, ports 2-53 are available. The port takes the low logic level (0) or logic high (1) which corresponds to the reference voltage.
+</p>
+</html>"));
+ end cmd_digital_in;
+
+ function delay "Provides delay.Suspends Openmodelica."
+ extends Modelica.Icons.Function;
+ input Integer t;
+
+ external delay(t) annotation(
+ Library = "delay");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>delay</b>(milliseconds);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Delay process for specified number of miliseconds specified by the argument. The actual suspension time may be longer because of other activities in the system, or because of the time spent in processing the call.
+ </p>
+ </html>"));
+ end delay;
+
+ function wakeup
+ extends Modelica.Icons.Function;
+
+ external wakeup() annotation(
+ Library = "SerialComm");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>Block for code running with interrupts</b>;
+ </pre></blockquote>
+ </html>"));
+ end wakeup;
+
+ function noInterrupts
+ extends Modelica.Icons.Function;
+
+ external noInterrupts() annotation(
+ Library = "noInterrupts");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>Block for code running without interrupts</b>;
+ </pre></blockquote>
+ </html>"));
+ end noInterrupts;
+
+ function cmd_analog_in "Command to read in analog signal from a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no;
+ output Integer val;
+
+ external val = cmd_analog_in(h, pin_no) annotation(
+ Library = "Analog");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>cmd_analog_in</b>(handle,pin_no);
+</pre></blockquote>
+<h4>Description</h4>
+<p>Arduino UNO board has 6 analog input ports (A0 to A5), the Arduino Mega board has 16 analog input ports (A0 to A15). The 10 bits channels convert the analog input from 0 to 5 volts, to a digital value between 0 and 1023.
+</p>
+</html>"));
+ end cmd_analog_in;
+
+ function cmd_analog_out "Command to sent out analog signal to a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no;
+ input Real val;
+ output Integer analog_w_OK;
+
+ external analog_w_OK = cmd_analog_out(h, pin_no, val) annotation(
+ Library = "Analog");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>cmd_analog_out</b>(handle,pin_no,val);
+</pre></blockquote>
+<h4>Description</h4>
+<p>The analog outputs of the Arduino Uno is available at the pins 3,5,6,9,10 and 11, while on the Mega board, the outputs are on pins 1-13 and 44-46. It is a bit misleading to use the term 'analog output', because in order to generate this output while minimizing energy losses, the Arduino uses PWM (Pulse Width Modulation) available on these ports. By varying the duty cycle of the PWM is altered the average voltage across the component connected to this port, which has the effect of having a analog output voltage.
+The input port accepts the value from 0 to 255 which is correspoding to the duty cycle of 0 to 100%. In other words, sending 0 to the block will generate 0 V output at the port, 127 generates 2.5V and 255 generates 5V. (the port is 8 bits, so the resolutions of output would be 2^8 =256).
+</p>
+</html>"));
+ end cmd_analog_out;
+
+ function cmd_analog_in_volt "Command to read in analog signal from a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no;
+ output Integer val;
+
+ external val = cmd_analog_in_volt(h, pin_no) annotation(
+ Library = "Analogv");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_analog_in_volt</b>(handle,pin_no);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Arduino UNO board has 6 analog input ports (A0 to A5), the Arduino Mega board has 16 analog input ports (A0 to A15). The 10 bits channels convert the analog input from 0 to 5 volts, to a digital value between 0 and 1023. This function scale the reading to 0-5 so the user could get the measured voltage directly.
+ </p>
+ </html>"));
+ end cmd_analog_in_volt;
+
+ function cmd_analog_out_volt "Command to sent out analog signal to a connected Arduino board"
+ extends Modelica.Icons.Function;
+ input Integer h, pin_no;
+ input Real val;
+ output Integer analog_v_wOK;
+
+ external analog_v_wOK = cmd_analog_out_volt(h, pin_no, val) annotation(
+ Library = "Analogv");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_analog_out_volt</b>(handle,pin_no,val);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>The analog outputs of the Arduino Uno is available at the pins 3,5,6,9,10 and 11, while on the Mega board, the outputs are on pins 1-13 and 44-46. It is a bit misleading to use the term 'analog output', because in order to generate this output while minimizing energy losses, the Arduino uses PWM (Pulse Width Modulation) available on these ports. By varying the duty cycle of the PWM is altered the average voltage across the component connected to this port, which has the effect of having a analog output voltage.
+ </p>
+ </html>"));
+ end cmd_analog_out_volt;
+
+ function cmd_dcmotor_setup "Command to setup pins to control DC motor"
+ extends Modelica.Icons.Function;
+ input Integer handle, driver_type, motor_no, pin1, pin2;
+
+ external cmd_dcmotor_setup(handle, driver_type, motor_no, pin1, pin2) annotation(
+ Library = "DCMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_dcmotor_setup</b>(handle,driver_type,motor_no,pin_no1,pin_no2);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Arduino board does not deliver enough power, so it is necessary to use a H-bridge circuit/IC to control the motor. There are several types of H-bridge IC that do not all operate on the same principle. For example, the L298 requires the use of a PWM signal with current sense. The L293 uses two PWM to set the speed and direction. Ready-to-use Shields are also available.
+ Remember that the PWM is 8-bit (0 to 255). The input of the block could accept any value, but it would saturate at +- 255.
+ </p>
+ </html>"));
+ end cmd_dcmotor_setup;
+
+ function cmd_dcmotor_run "Command to run DC motor after setting up"
+ extends Modelica.Icons.Function;
+ input Integer handle, motor_no, val;
+
+ external cmd_dcmotor_run(handle, motor_no, val) annotation(
+ Library = "DCMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_dcmotor_run</b>(handle,motor_no,value);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Arduino board does not deliver enough power, so it is necessary to use a H-bridge circuit/IC to control the motor. There are several types of H-bridge IC that do not all operate on the same principle. For example, the L298 requires the use of a PWM signal with current sense. The L293 uses two PWM to set the speed and direction. Ready-to-use Shields are also available.
+ Remember that the PWM is 8-bit (0 to 255). The input of the block could accept any value, but it would saturate at +- 255.
+ </p>
+ </html>"));
+ end cmd_dcmotor_run;
+
+ function cmd_dcmotor_release "Command to release pins which have setup for DC motor"
+ extends Modelica.Icons.Function;
+ input Integer handle, motor_no;
+
+ external cmd_dcmotor_release(handle, motor_no) annotation(
+ Library = "DCMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_dcmotor_release</b>(handle,motor_no);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Arduino board does not deliver enough power, so it is necessary to use a H-bridge circuit/IC to control the motor. There are several types of H-bridge IC that do not all operate on the same principle. For example, the L298 requires the use of a PWM signal with current sense. The L293 uses two PWM to set the speed and direction. Ready-to-use Shields are also available.
+ Remember that the PWM is 8-bit (0 to 255). The input of the block could accept any value, but it would saturate at +- 255.
+ </p>
+ </html>"));
+ end cmd_dcmotor_release;
+
+ function cmd_servo_attach "Command to attach servo motor to Arduino"
+ extends Modelica.Icons.Function;
+ input Integer handle, servo_no;
+
+ external cmd_servo_attach(handle, servo_no) annotation(
+ Library = "ServoMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_servo_attach</b>(handle,servo_no);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>A servomotor is an rotary actuator consist of an electric motor, gears, a potentiometer and an analogue or digital electronics for control. The servomotor usualy used for a position control application (or speed for continuous rotation servos).
+ The user must give the command of the position setpoint or desired speed. This command is sent to the actuator in pulses spaced by 10 to 20 ms. The coding of these pulses is made such that a pulse of 1.5 ms corresponding to the centered position (rest), a pulse of 1 ms corresponds to an angle of 90° in the anticlockwise direction, and a pulse 2 ms corresponds to an angle of 90° clockwise. All other pulse widths give intermediate values​​.
+ A servomotor for continuous rotation, the pulse width control the rotational speed and the direction. It is recommended to use a voltage regulator to power the servomotor instead of using the Arduino board power. For simplicity, the function takes an input commnad in degrees from 0 to 180. Two actuators can be controlled with this toolbox. (modified version of 3 motors available)
+ </p>
+ </html>"));
+ end cmd_servo_attach;
+
+ function cmd_servo_move "Command to run servo motor which has been setup"
+ extends Modelica.Icons.Function;
+ input Integer handle, servo_no, val;
+
+ external cmd_servo_move(handle, servo_no, val) annotation(
+ Library = "ServoMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_servo_move</b>(handle,servo_no,value);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>A servomotor is an rotary actuator consist of an electric motor, gears, a potentiometer and an analogue or digital electronics for control. The servomotor usualy used for a position control application (or speed for continuous rotation servos).
+ The user must give the command of the position setpoint or desired speed. This command is sent to the actuator in pulses spaced by 10 to 20 ms. The coding of these pulses is made such that a pulse of 1.5 ms corresponding to the centered position (rest), a pulse of 1 ms corresponds to an angle of 90° in the anticlockwise direction, and a pulse 2 ms corresponds to an angle of 90° clockwise. All other pulse widths give intermediate values​​.
+ A servomotor for continuous rotation, the pulse width control the rotational speed and the direction. It is recommended to use a voltage regulator to power the servomotor instead of using the Arduino board power. For simplicity, the function takes an input commnad in degrees from 0 to 180. Two actuators can be controlled with this toolbox. (modified version of 3 motors available)
+ </p>
+ </html>"));
+ end cmd_servo_move;
+
+ function cmd_servo_detach "Command to release the pin which has been setup for servo motor"
+ extends Modelica.Icons.Function;
+ input Integer handle, servo_no;
+
+ external cmd_servo_attach(handle, servo_no) annotation(
+ Library = "ServoMotor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>cmd_servo_detach</b>(handle,servo_no);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>A servomotor is an rotary actuator consist of an electric motor, gears, a potentiometer and an analogue or digital electronics for control. The servomotor usualy used for a position control application (or speed for continuous rotation servos).
+ The user must give the command of the position setpoint or desired speed. This command is sent to the actuator in pulses spaced by 10 to 20 ms. The coding of these pulses is made such that a pulse of 1.5 ms corresponding to the centered position (rest), a pulse of 1 ms corresponds to an angle of 90° in the anticlockwise direction, and a pulse 2 ms corresponds to an angle of 90° clockwise. All other pulse widths give intermediate values​​.
+ A servomotor for continuous rotation, the pulse width control the rotational speed and the direction. It is recommended to use a voltage regulator to power the servomotor instead of using the Arduino board power. For simplicity, the function takes an input commnad in degrees from 0 to 180. Two actuators can be controlled with this toolbox. (modified version of 3 motors available)
+ </p>
+ </html>"));
+ end cmd_servo_detach;
+
+ function ieeesingle2num "ieee-745 floating point converter"
+ extends Modelica.Icons.Function;
+ input String hexa;
+ output Real y;
+
+ external y = ieeesingle2num(hexa) annotation(
+ Library = "ieeesingle2num");
+ annotation(
+ Documentation(info = "<html>
+<h4>Syntax</h4>
+<blockquote><pre>
+Arduino.SerialCommunication.Functions.<b>ieeesingle2num</b>(hexa);
+</pre></blockquote>
+<h4>Description</h4>
+<p>Converts an hexadecimal integer to ieee single precision format
+ </p>
+</html>"));
+ end ieeesingle2num;
+
+ function math_floor "Floor function"
+ extends Modelica.Icons.Function;
+ input Real x;
+ output Integer y;
+
+ external y = mfloor(x) annotation(
+ Library = "floor");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Functions.<b>math_floor</b>(x);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Returns the greatest integer less than or equal to x
+ </p>
+ </html>"));
+ end math_floor;
+
+ function getArduinoVersion "Returns the Arduino version used"
+ extends Modelica.Icons.Function;
+ output String arduinoVersion(fixed = true);
+ algorithm
+ arduinoVersion := "1.1";
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.<b>getArduinoVersion</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Gives the version of the arduino used.
+ </p>
+ </html>"));
+ end getArduinoVersion;
+
+ function cmd_encoder_init "Initiates the encoder"
+ extends Modelica.Icons.Function;
+ input Integer h, encoder_mode, pin_no1, pin_no2;
+
+ external cmd_encoder_init(h, encoder_mode, pin_no1, pin_no2) annotation(
+ Library = "Encoder");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.<b>cmd_encoder_init</b>(handle,encoder_mode,pin_no1,pin_no2);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Used to read encoder signal from one or more channels
+ </p>
+ </html>"));
+ end cmd_encoder_init;
+
+ //Incomplete
+
+ package MDD_Servo
+ extends Modelica.Icons.Package;
+
+ class Init
+ extends ExternalObject;
+
+ function constructor "Return device handle"
+ extends .Modelica.Icons.Function;
+ import Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions;
+ import Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import Arduino.SerialCommunication.Functions.MDD_Servo;
+ input sComm.Types.Servo_no servo_no;
+ output sComm.Functions.MDD_Servo.Init servo;
+
+ external "C" servo = MDD_avr_servo_initialize(servo_no) annotation(
+ Include = "#include \"/home/souradip/OpenModelica/Resources/Include/MDDAVRServo.h\"");
+ end constructor;
+
+ function destructor "Destructor"
+ extends .Modelica.Icons.Function;
+ import Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import Arduino.SerialCommunication.Functions.MDD_Servo;
+ input sComm.Types.Servo_no servo_no "Device handle";
+
+ external "C" MDD_avr_servo_finalize(servo_no) annotation(
+ Include = "#include \"/home/souradip/OpenModelica/Resources/Include/MDDAVRServo.h\"");
+ end destructor;
+ end Init;
+
+ function Move
+ extends Modelica.Icons.Function;
+ import sComm = Arduino.SerialCommunication.Functions;
+ input sComm.Functions.MDD_Servo.Init servo;
+ input Integer value;
+
+ external "C" MDD_avr_servo_move(servo, value) annotation(
+ Include = "#include \"/home/souradip/OpenModelica/Resources/Include/MDDAVRServo.h\"");
+ end Move;
+ end MDD_Servo;
+ end Functions;
+
+ package Examples
+ extends Modelica.Icons.ExamplesPackage;
+
+ package led
+ extends Modelica.Icons.ExamplesPackage;
+
+ model led_blue "Turn on Blue LED"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "This will turn ON the blue LED";
+ end if;
+ strm.print(String(time));
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end led_blue;
+
+ model led_blue_delay "Turn on Blue LED for a period of 2 seconds"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "This will turn the blue LED";
+ sComm.delay(2000) "let the blue LED be on for two seconds";
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "turn off blue LED";
+ sComm.delay(2000) "let the blue LED be off for two seconds";
+ end if;
+ strm.print(String(time));
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end led_blue_delay;
+
+ model led_blue_red "Turn on Red & Blue LED"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ sComm.delay(2000);
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "This will turn the blue LED";
+ digital_out := sComm.cmd_digital_out(1, 11, 1) "This will turn the red LED";
+ sComm.delay(5000) "Delay for 5 seconds";
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "This turns off the blue Led";
+ sComm.delay(3000) "Delay for 3 seconds";
+ digital_out := sComm.cmd_digital_out(1, 11, 0) "This turns off the red Led";
+ end if;
+ strm.print(String(time));
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end led_blue_red;
+
+ model led_blink "This will turn on and turn off the user LED for every second for 10 times"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ for i in 1:10 loop
+ digital_out := sComm.cmd_digital_out(1, 52, 0) "This will turn off the LED";
+ sComm.delay(500) "Delay for 0.5 seconds";
+ digital_out := sComm.cmd_digital_out(1, 52, 1) "This turns the Led";
+ sComm.delay(500) "Delay for 0.5 seconds";
+ end for;
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end led_blink;
+
+ model led_green_blink "This will turn on and turn off the green LED for every second for 5 times"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(1000);
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ for i in 1:10 loop
+ digital_out := sComm.cmd_digital_out(1, 10, 0) "This will turn off the green LED";
+ sComm.delay(1000) "Delay for 1 second";
+ digital_out := sComm.cmd_digital_out(1, 10, 1) "This turns the green Led";
+ sComm.delay(1000) "Delay for 1 second";
+ end for;
+ end if;
+ strm.print(String(time));
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end led_green_blink;
+ end led;
+
+ package push
+ extends Modelica.Icons.ExamplesPackage;
+
+ model led_push_button "Conrolling LED with PushButton"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_in(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ digital_in := sComm.cmd_digital_in(1, 12) "Read from digital pin 12";
+ if digital_in == 0 then
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "This will turn OFF the blue LED";
+ sComm.delay(200);
+ else
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "This will turn ON the blue LED";
+ sComm.delay(200);
+ end if;
+ end if;
+//for i in 1:1000 loop
+//end for;
+//strm.print(String(time));
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.01));
+ end led_push_button;
+
+ model push_button_status "Checking Status of PushButton"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer digital_in(fixed = false);
+ Integer digital_out(start = 0, fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ digital_in := sComm.cmd_digital_in(1, 12);
+ if digital_in == 0 then
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "This will turn OFF the blue LED";
+ strm.print("LOW");
+ sComm.delay(200);
+ else
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "This will turn ON the blue LED";
+ strm.print("HIGH");
+ sComm.delay(200);
+ end if;
+ end if;
+//for i in 1:1000 loop
+//end for;
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//sComm.cmd_arduino_meter(digital_in);
+ annotation(
+ experiment(StartTime = 0, StopTime = 1, Tolerance = 1e-6, Interval = 0.01));
+ end push_button_status;
+ end push;
+
+ package ldr
+ extends Modelica.Icons.ExamplesPackage;
+
+ model ldr_led "LED indicating light sensor readings"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer analog_in(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 2, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ analog_in := sComm.cmd_analog_in(1, 5) "read analog pin 5 (ldr)";
+ if analog_in < 300 then
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "Turn ON LED";
+ else
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "Turn OFF LED";
+ end if;
+ sComm.delay(200);
+ end if;
+//for i in 1:500 loop
+//end for;
+//strm.print(String(time));
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//Run for 500 iterations
+//Setting Threshold value of 300
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 0.02));
+ end ldr_led;
+
+ model ldr_read "Reading light intensity using ldr"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer analog_in(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ analog_in := sComm.cmd_analog_in(1, 5) "read analog pin 5 (ldr)";
+ strm.print("LDR Readings at time " + String(time) + " : " + String(analog_in));
+ sComm.delay(500);
+ end if;
+//for i in 1:10 loop
+//end for;
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//Run for 10 iterations
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 1));
+ end ldr_read;
+ end ldr;
+
+ package pot
+ extends Modelica.Icons.ExamplesPackage;
+
+ model pot_threshold
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer analog_in(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(1000);
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ analog_in := sComm.cmd_analog_in(1, 2) "read analog pin 2";
+ strm.print("Potentiometer Readings:" + String(analog_in));
+ if analog_in >= 0 and analog_in < 320 then
+ digital_out := sComm.cmd_digital_out(1, 11, 1) "Turn ON LED";
+ sComm.delay(1000);
+ digital_out := sComm.cmd_digital_out(1, 11, 0) "Turn OFF LED";
+ elseif analog_in >= 320 and analog_in <= 900 then
+ digital_out := sComm.cmd_digital_out(1, 10, 1) "Turn ON LED";
+ sComm.delay(1000);
+ digital_out := sComm.cmd_digital_out(1, 10, 0) "Turn OFF LED";
+ elseif analog_in > 900 and analog_in <= 1023 then
+ digital_out := sComm.cmd_digital_out(1, 9, 1) "Turn ON LED";
+ sComm.delay(1000);
+ digital_out := sComm.cmd_digital_out(1, 9, 0) "Turn OFF LED";
+ end if;
+ end if;
+//for i in 1:10 loop
+//end for;
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//Run for 10 iterations
+//Threshold 1
+//Threshold 2
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 1));
+ end pot_threshold;
+ end pot;
+
+ package thermistor
+ extends Modelica.Icons.ExamplesPackage;
+
+ model therm_buzzer "Sound buzzer depending on thermistor readings"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer analog_in(fixed = false);
+ Integer digital_out(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ analog_in := sComm.cmd_analog_in(1, 4) "read analog pin 4";
+ if analog_in > 500 then
+ digital_out := sComm.cmd_digital_out(1, 3, 1) "Turn ON Buzzer";
+ else
+ digital_out := sComm.cmd_digital_out(1, 3, 0) "Turn OFF Buzzer";
+ end if;
+ sComm.delay(200);
+ end if;
+//for i in 1:500 loop
+//end for;
+//Run for 500 iterations
+//Setting Threshold value of 500
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 0.02));
+ end therm_buzzer;
+
+ model therm_read "Thermistor Readings"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer analog_in(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "At port 0 with baudrate of 115200";
+ sComm.delay(2000);
+ end when;
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ analog_in := sComm.cmd_analog_in(1, 4) "read analog pin 5 (ldr)";
+ strm.print("Thermistor Readings " + " : " + String(analog_in));
+ sComm.delay(500);
+ end if;
+//for i in 1:20 loop
+//end for;
+ when terminal() then
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//Run for 20 iterations
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 0.5));
+ end therm_read;
+ end thermistor;
+
+ package dcmotor
+ extends Modelica.Icons.ExamplesPackage;
+
+ model dcmotor_clock "Rotate DC Motor clockwise"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 1, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ sComm.delay(2000);
+ sComm.cmd_dcmotor_setup(1, 3, 1, 9, 10) "Setup DC motor of type 3 (L293D), motor 1, pin 9 and 10";
+ sComm.cmd_dcmotor_run(1, 1, 100) "Motor 1 runs at PWM 100";
+ sComm.delay(3000) "This is allowed to continue for 3 seconds";
+ sComm.cmd_dcmotor_release(1, 1) "Motor 1 is released";
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end dcmotor_clock;
+
+ model dcmotor_both "Rotate DC Motor in both directions"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ sComm.delay(2000);
+ sComm.cmd_dcmotor_setup(1, 3, 1, 9, 10) "Setup DC motor of type 3 (L293D), motor 1, pin 9 and 10";
+ sComm.cmd_dcmotor_run(1, 1, 255) "Motor 1 runs at PWM 100";
+ sComm.delay(3000) "for 3 seconds";
+ sComm.cmd_dcmotor_run(1, 1, -255) "Motor 1 runs at PWM -100 in reverse direction";
+ sComm.delay(2000) "for 2 seconds";
+ sComm.cmd_dcmotor_release(1, 1) "Motor 1 is released";
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end dcmotor_both;
+
+ model dcmotor_loop "Rotate DC Motor in both directions in a loop"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Unable to open serial port, please check");
+ else
+ for i in 1:4 loop
+ sComm.cmd_dcmotor_setup(1, 3, 1, 9, 10) "Setup DC motor of type 3 (L293D), motor 1, pins 9 and 10";
+ sComm.cmd_dcmotor_run(1, 1, 100) "Motor 1 runs at PWM 100";
+ sComm.delay(2000) "for 3 seconds";
+ sComm.cmd_dcmotor_run(1, 1, 0) "Halt the motor";
+ sComm.delay(2000) "for 2 seconds";
+ sComm.cmd_dcmotor_run(1, 1, -100) "Run it at PWM 100 in reverse direction";
+ sComm.delay(2000) "for 2 seconds";
+ sComm.cmd_dcmotor_release(1, 1) "Motor 1 is released";
+ end for;
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+ end dcmotor_loop;
+ end dcmotor;
+
+ package servo
+ extends Modelica.Icons.ExamplesPackage;
+
+ model servo_init "Rotate Servo Motor "
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ sComm.delay(2000);
+ sComm.cmd_servo_attach(1, 1) "To attach the motor to pin 9 of servo1";
+ sComm.cmd_servo_move(1, 1, 0) "tell servo to rotate by 30 degrees";
+ sComm.delay(3000);
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 5, Tolerance = 1e-6, Interval = 5));
+ end servo_init;
+
+ model servo_loop "Rotate servo motor by 20 degrees 10 times"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ Integer angle(fixed = true);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ sComm.delay(2000);
+ sComm.cmd_servo_attach(1, 1) "Attach motor to pin 9. 1 means pin 9.";
+ sComm.delay(2000);
+ angle := 20 "Angle by which it has to move";
+ for i in 1:10 loop
+ sComm.cmd_servo_move(1, 1, angle * i) "tell servo to rotate by 20 degrees";
+ sComm.delay(1000) "waits for a sec";
+ end for;
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//sComm.cmd_servo_detach(1, 1) "Detach the motor";
+ annotation(
+ experiment(StartTime = 0, StopTime = 5, Tolerance = 1e-6, Interval = 5));
+ end servo_loop;
+
+ model servo_reverse
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ sComm.delay(2000);
+ sComm.cmd_servo_attach(1, 1) "Attach the motor to pin 9. 1 means 9";
+ sComm.cmd_servo_move(1, 1, 90) "Move the servo to 90 degree";
+ sComm.delay(1000) "be there for one second";
+ sComm.cmd_servo_move(1, 1, 45) "Move the servo to 45 degree";
+ sComm.delay(1000) "be there for one second";
+ sComm.delay(1000);
+ end if;
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//sComm.cmd_servo_detach(1, 1) "Detach the motor";
+ annotation(
+ experiment(StartTime = 0, StopTime = 5, Tolerance = 1e-6, Interval = 5));
+ end servo_reverse;
+
+ model servo_pot "Control Servo Motor using Potentiometer"
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import strm = Modelica.Utilities.Streams;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ Integer analog_in(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 115200) "COM port is 0 and baud rate is 115200";
+ if ok <> 0 then
+ strm.print("Check the serial port and try again");
+ else
+ sComm.delay(2000);
+ sComm.cmd_servo_attach(1, 1) "Attach the motor to pin 9";
+ sComm.delay(2000);
+ for i in 1:5000 loop
+ analog_in := sComm.cmd_analog_in(1, 2) "Read potentiometer value";
+ analog_in := sComm.math_floor(analog_in * (180 / 1023)) "Scale Potentiometer value to 0-180";
+ sComm.cmd_servo_move(1, 1, analog_in) "Command the servo motor";
+ sComm.delay(1000) "sleep for 500 milliseconds";
+ strm.print("Potentiometer Reading at time" + String(time) + " : " + String(analog_in));
+ end for;
+ end if;
+ sComm.cmd_servo_detach(1, 1) "Detach the motor";
+ sComm.delay(5000);
+ c_ok := sComm.close_serial(1) "To close the connection safely";
+ end when;
+//5,000 itterations
+ annotation(
+ experiment(StartTime = 0, StopTime = 5, Tolerance = 1e-6, Interval = 5));
+ end servo_pot;
+ end servo;
+
+ package modbus
+ extends Modelica.Icons.ExamplesPackage;
+
+ function read_voltage
+ extends Modelica.Icons.Function;
+
+ external read_voltage() annotation(
+ Library = "Modbus");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Examples.modbus.<b>read_voltage</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>
+ </p>
+ </html>"));
+ end read_voltage;
+
+ function read_current
+ extends Modelica.Icons.Function;
+
+ external read_voltage() annotation(
+ Library = "Modbus");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Examples.modbus.<b>read_current</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>
+ </p>
+ </html>"));
+ end read_current;
+
+ function read_val
+ extends Modelica.Icons.Function;
+ input Integer addr_byte;
+ output Real p;
+
+ external p = read_val(addr_byte) annotation(
+ Library = "Modbus");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Examples.modbus.<b>read_val</b>(address_byte);
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>
+ </p>
+ </html>"));
+ end read_val;
+
+ function read_active_power
+ extends Modelica.Icons.Function;
+
+ external read_active_power() annotation(
+ Library = "Modbus");
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.Examples.modbus.<b>read_active_power</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>
+ </p>
+ </html>"));
+ end read_active_power;
+
+ model modbus_test
+ extends Modelica.Icons.Example;
+ import sComm = Arduino.SerialCommunication.Functions;
+ import modbus = Arduino.SerialCommunication.Examples.modbus;
+ Integer ok(fixed = false);
+ Integer c_ok(fixed = false);
+ algorithm
+ when initial() then
+ ok := sComm.open_serial(1, 0, 9600);
+ modbus.read_voltage();
+ modbus.read_current();
+ modbus.read_active_power();
+ c_ok := sComm.close_serial(1);
+ end when;
+ end modbus_test;
+ end modbus;
+ end Examples;
+
+ package MDD_Examples "Interfacing arduino with OpenModelica using Modelica Device Drivers"
+ extends Modelica.Icons.ExamplesPackage;
+
+ package MDD_led
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_led_blue ""
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 41}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {39, -21}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = true) annotation(
+ Placement(visible = true, transformation(origin = {-41, -21}, extent = {{-15, -17}, {15, 17}}, rotation = 0)));
+ equation
+ connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{-24, -20}, {14, -20}, {14, -20}, {16, -20}}, color = {255, 0, 255}));
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.MDD_Examples.MDD_led.<b>MDD-led_blue</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>
+ </p>
+ </html>"));
+ end MDD_led_blue;
+
+ model MDD_led_blue_delay
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {31, 41}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {41, -17}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = if time < 5 then true else false) annotation(
+ Placement(visible = true, transformation(origin = {-27, -16}, extent = {{-21, -16}, {21, 16}}, rotation = 0)));
+ equation
+ connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{-4, -16}, {20, -16}}, color = {255, 0, 255}));
+ end MDD_led_blue_delay;
+
+ model MDD_led_blink
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-45, 71}, extent = {{-23, -23}, {23, 23}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'5', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {42, -22}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {23, 71}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = mod(time, 2) >= 1) annotation(
+ Placement(visible = true, transformation(origin = {-24, -21}, extent = {{-16, -15}, {16, 15}}, rotation = 0)));
+ equation
+ connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{-6, -21}, {16, -21}, {16, -22}, {18, -22}}, color = {255, 0, 255}));
+ end MDD_led_blink;
+
+ model MDD_led_blue_red
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-47, 47}, extent = {{-21, -21}, {21, 21}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {38, -16}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {40, 44}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean2(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'3', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {38, -62}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = if time < 5 then true else false) annotation(
+ Placement(visible = true, transformation(origin = {-32, -16}, extent = {{-18, -14}, {18, 14}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression2(y = if time < 8 then true else false) annotation(
+ Placement(visible = true, transformation(origin = {-32, -62}, extent = {{-18, -16}, {18, 16}}, rotation = 0)));
+ equation
+ connect(digitalWriteBoolean2.u, booleanExpression2.y) annotation(
+ Line(points = {{18, -62}, {-12, -62}, {-12, -62}, {-12, -62}}, color = {255, 0, 255}));
+ connect(booleanExpression2.y, digitalWriteBoolean2.u) annotation(
+ Line(points = {{-12, -62}, {18, -62}, {18, -62}, {18, -62}}, color = {255, 0, 255}));
+ connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{-12, -16}, {18, -16}, {18, -16}, {18, -16}}, color = {255, 0, 255}));
+ end MDD_led_blue_red;
+
+ model MDD_led_green_blink
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'2', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {46, -30}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 39}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = mod(time, 2) >= 1) annotation(
+ Placement(visible = true, transformation(origin = {-17, -30}, extent = {{-15, -14}, {15, 14}}, rotation = 0)));
+ equation
+ connect(booleanExpression1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{0, -30}, {24, -30}, {24, -30}, {24, -30}}, color = {255, 0, 255}));
+ end MDD_led_green_blink;
+ end MDD_led;
+
+ package MDD_push
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_led_push_button
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-38, 40}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 41}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica.Blocks.Logical.LogicalSwitch logicalSwitch1 annotation(
+ Placement(visible = true, transformation(origin = {16, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = true) annotation(
+ Placement(visible = true, transformation(origin = {-20, 8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression2(y = false) annotation(
+ Placement(visible = true, transformation(origin = {-18, -62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalReadBoolean digitalReadBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'4', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {-36, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {62, -26}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(logicalSwitch1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{28, -26}, {48, -26}, {48, -26}, {50, -26}}, color = {255, 0, 255}));
+ connect(digitalReadBoolean1.y, logicalSwitch1.u2) annotation(
+ Line(points = {{-24, -26}, {2, -26}, {2, -26}, {4, -26}}, color = {255, 0, 255}));
+ connect(booleanExpression1.y, logicalSwitch1.u1) annotation(
+ Line(points = {{-8, 8}, {-2, 8}, {-2, -18}, {4, -18}, {4, -18}}, color = {255, 0, 255}));
+ connect(booleanExpression2.y, logicalSwitch1.u3) annotation(
+ Line(points = {{-6, -62}, {-2, -62}, {-2, -34}, {4, -34}, {4, -34}}, color = {255, 0, 255}));
+ end MDD_led_push_button;
+
+ model MDD_push_button_status
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-43, 43}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {20, 42}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalReadBoolean digitalReadBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'4', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {-39, -19}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Interaction.Show.BooleanValue booleanValue1(use_activePort = true) annotation(
+ Placement(visible = true, transformation(origin = {31, -19}, extent = {{-15, -17}, {15, 17}}, rotation = 0)));
+ equation
+ connect(digitalReadBoolean1.y, booleanValue1.activePort) annotation(
+ Line(points = {{-18, -18}, {14, -18}, {14, -18}, {14, -18}}, color = {255, 0, 255}));
+ end MDD_push_button_status;
+ end MDD_push;
+
+ package MDD_ldr
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_ldr_led
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-45, 65}, extent = {{-21, -21}, {21, 21}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {40, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {79, -23}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = true) annotation(
+ Placement(visible = true, transformation(origin = {-60, 12}, extent = {{-14, -16}, {14, 16}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression2 annotation(
+ Placement(visible = true, transformation(origin = {-59, -79}, extent = {{-13, -17}, {13, 17}}, rotation = 0)));
+ Modelica.Blocks.Logical.LogicalSwitch logicalSwitch1 annotation(
+ Placement(visible = true, transformation(origin = {28, -22}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
+ Modelica.Blocks.Logical.GreaterThreshold greaterThreshold1(threshold = 600) annotation(
+ Placement(visible = true, transformation(origin = {-21, -23}, extent = {{-11, -11}, {11, 11}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A5, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 1024, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-72, -22}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ equation
+ connect(adc.y, greaterThreshold1.u) annotation(
+ Line(points = {{-50, -22}, {-34, -22}}, color = {0, 0, 127}));
+ connect(greaterThreshold1.y, logicalSwitch1.u2) annotation(
+ Line(points = {{-8, -22}, {8, -22}, {8, -22}, {8, -22}}, color = {255, 0, 255}));
+ connect(logicalSwitch1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{46, -22}, {58, -22}, {58, -22}, {58, -22}}, color = {255, 0, 255}));
+ connect(booleanExpression1.y, logicalSwitch1.u1) annotation(
+ Line(points = {{-44, 12}, {8, 12}, {8, -10}, {8, -10}}, color = {255, 0, 255}));
+ connect(booleanExpression2.y, logicalSwitch1.u3) annotation(
+ Line(points = {{-44, -78}, {6, -78}, {6, -34}, {8, -34}}, color = {255, 0, 255}));
+ end MDD_ldr_led;
+
+ model MDD_ldr_read
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-37, 39}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {50, 38}, extent = {{-22, -22}, {22, 22}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A5, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 1024, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-39, -17}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation(
+ Placement(visible = true, transformation(origin = {30, -17}, extent = {{-18, -17}, {18, 17}}, rotation = 0)));
+ equation
+ connect(adc.y, realValue1.numberPort) annotation(
+ Line(points = {{-20, -17}, {7, -17}}, color = {0, 0, 127}));
+ end MDD_ldr_read;
+ end MDD_ldr;
+
+ package MDD_pot
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_pot_threshold ""
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-79, 79}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {80, 80}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica.Blocks.Logical.Switch switch11 annotation(
+ Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.Switch switch12 annotation(
+ Placement(visible = true, transformation(origin = {10, -64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.Greater greater1 annotation(
+ Placement(visible = true, transformation(origin = {42, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.Greater greater2 annotation(
+ Placement(visible = true, transformation(origin = {36, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'1', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {82, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean2(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'2', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {82, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean3(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'3', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.B) annotation(
+ Placement(visible = true, transformation(origin = {82, -64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold1(threshold = 0) annotation(
+ Placement(visible = true, transformation(origin = {-42, 44}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold2(threshold = 320) annotation(
+ Placement(visible = true, transformation(origin = {-42, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold3(threshold = 900) annotation(
+ Placement(visible = true, transformation(origin = {-40, -64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.RealExpression realExpression1(y = 0) annotation(
+ Placement(visible = true, transformation(origin = {-40, -92}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.RealExpression realExpression2(y = 1) annotation(
+ Placement(visible = true, transformation(origin = {-44, 84}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.Switch switch1 annotation(
+ Placement(visible = true, transformation(origin = {0, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.RealToBoolean realToBoolean1(threshold = 0.5) annotation(
+ Placement(visible = true, transformation(origin = {44, -64}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A2, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 1024, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-88, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(adc.y, greaterEqualThreshold1.u) annotation(
+ Line(points = {{-76, 0}, {-70, 0}, {-70, 46}, {-54, 46}}, color = {0, 0, 127}));
+ connect(greaterEqualThreshold1.y, switch1.u2) annotation(
+ Line(points = {{-31, 46}, {-24, 46}, {-24, 70}, {-12, 70}}, color = {255, 0, 255}));
+ connect(adc.y, greaterEqualThreshold3.u) annotation(
+ Line(points = {{-76, 0}, {-70, 0}, {-70, -64}, {-52, -64}, {-52, -64}}, color = {0, 0, 127}));
+ connect(adc.y, greaterEqualThreshold2.u) annotation(
+ Line(points = {{-76, 0}, {-54, 0}, {-54, 0}, {-54, 0}}, color = {0, 0, 127}));
+ connect(realToBoolean1.y, digitalWriteBoolean3.u) annotation(
+ Line(points = {{56, -64}, {70, -64}, {70, -64}, {70, -64}}, color = {255, 0, 255}));
+ connect(switch12.y, realToBoolean1.u) annotation(
+ Line(points = {{22, -64}, {32, -64}, {32, -64}, {32, -64}}, color = {0, 0, 127}));
+ connect(realExpression1.y, switch1.u3) annotation(
+ Line(points = {{-28, -92}, {-16, -92}, {-16, 62}, {-12, 62}, {-12, 62}}, color = {0, 0, 127}));
+ connect(realExpression2.y, switch1.u1) annotation(
+ Line(points = {{-32, 84}, {-20, 84}, {-20, 78}, {-12, 78}, {-12, 78}}, color = {0, 0, 127}));
+ connect(switch1.y, greater2.u1) annotation(
+ Line(points = {{12, 70}, {22, 70}, {22, 70}, {24, 70}}, color = {0, 0, 127}));
+ connect(greater1.y, digitalWriteBoolean2.u) annotation(
+ Line(points = {{54, 0}, {70, 0}}, color = {255, 0, 255}));
+ connect(switch11.y, greater2.u2) annotation(
+ Line(points = {{14, 0}, {18, 0}, {18, 62}, {24, 62}, {24, 62}}, color = {0, 0, 127}));
+ connect(switch11.y, greater1.u1) annotation(
+ Line(points = {{14, 0}, {30, 0}}, color = {0, 0, 127}));
+ connect(switch12.y, greater1.u2) annotation(
+ Line(points = {{22, -64}, {22, -64}, {22, -8}, {30, -8}, {30, -8}}, color = {0, 0, 127}));
+ connect(greaterEqualThreshold2.y, switch11.u2) annotation(
+ Line(points = {{-30, 0}, {-10, 0}, {-10, 0}, {-10, 0}}, color = {255, 0, 255}));
+ connect(greater2.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{48, 70}, {56, 70}, {56, 40}, {70, 40}, {70, 40}}, color = {255, 0, 255}));
+ connect(realExpression2.y, switch12.u1) annotation(
+ Line(points = {{-32, 84}, {-20, 84}, {-20, -56}, {-2, -56}, {-2, -56}}, color = {0, 0, 127}));
+ connect(realExpression2.y, switch11.u1) annotation(
+ Line(points = {{-32, 84}, {-20, 84}, {-20, 8}, {-10, 8}, {-10, 8}}, color = {0, 0, 127}));
+ connect(realExpression1.y, switch11.u3) annotation(
+ Line(points = {{-28, -92}, {-16, -92}, {-16, -8}, {-10, -8}, {-10, -8}}, color = {0, 0, 127}));
+ connect(realExpression1.y, switch12.u3) annotation(
+ Line(points = {{-28, -92}, {-16, -92}, {-16, -72}, {-2, -72}, {-2, -72}}, color = {0, 0, 127}));
+ connect(greaterEqualThreshold3.y, switch12.u2) annotation(
+ Line(points = {{-28, -64}, {-2, -64}, {-2, -64}, {-2, -64}}, color = {255, 0, 255}));
+ annotation(
+ Documentation(info = "<html>
+ <h4>Syntax</h4>
+ <blockquote><pre>
+ Arduino.SerialCommunication.MDD_Examples.MDD_pot.<b>MDD_pot_threshold</b>();
+ </pre></blockquote>
+ <h4>Description</h4>
+ <p>Voltage reference used to represent 10 bit precision(1024) of ADC along with prescaling by by 128.Internal voltage reference is applied to adc.
+ </p>
+ </html>"));
+ end MDD_pot_threshold;
+ end MDD_pot;
+
+ package MDD_thermistor
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_therm_read
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {40, 42}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A5, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 1024, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-40, -20}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation(
+ Placement(visible = true, transformation(origin = {39, -21}, extent = {{-15, -19}, {15, 19}}, rotation = 0)));
+ equation
+ connect(adc.y, realValue1.numberPort) annotation(
+ Line(points = {{-18, -20}, {20, -20}, {20, -20}, {22, -20}}, color = {0, 0, 127}));
+ end MDD_therm_read;
+
+ model MDD_therm_buzzer
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-61, 61}, extent = {{-21, -21}, {21, 21}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A4, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 1024, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-68, 1.77636e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {41, 61}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Interaction.Show.RealValue realValue1(use_numberPort = true) annotation(
+ Placement(visible = true, transformation(origin = {12, -56}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.DigitalWriteBoolean digitalWriteBoolean1(pin = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Pin.'3', port = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Port.D) annotation(
+ Placement(visible = true, transformation(origin = {78, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.LogicalSwitch logicalSwitch1 annotation(
+ Placement(visible = true, transformation(origin = {40, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = false) annotation(
+ Placement(visible = true, transformation(origin = {10, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression2(y = true) annotation(
+ Placement(visible = true, transformation(origin = {10, 32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Logical.GreaterEqualThreshold greaterEqualThreshold1(threshold = 550) annotation(
+ Placement(visible = true, transformation(origin = {-4, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(greaterEqualThreshold1.y, logicalSwitch1.u2) annotation(
+ Line(points = {{8, 0}, {28, 0}, {28, 0}, {28, 0}}, color = {255, 0, 255}));
+ connect(adc.y, greaterEqualThreshold1.u) annotation(
+ Line(points = {{-46, 0}, {-16, 0}, {-16, 0}, {-16, 0}}, color = {0, 0, 127}));
+ connect(adc.y, realValue1.numberPort) annotation(
+ Line(points = {{-46, 0}, {-32, 0}, {-32, -56}, {0, -56}}, color = {0, 0, 127}));
+ connect(logicalSwitch1.y, digitalWriteBoolean1.u) annotation(
+ Line(points = {{52, 0}, {66, 0}, {66, 0}, {66, 0}}, color = {255, 0, 255}));
+ connect(booleanExpression2.y, logicalSwitch1.u1) annotation(
+ Line(points = {{22, 32}, {24, 32}, {24, 8}, {28, 8}, {28, 8}}, color = {255, 0, 255}));
+ connect(booleanExpression1.y, logicalSwitch1.u3) annotation(
+ Line(points = {{22, -32}, {24, -32}, {24, -8}, {28, -8}, {28, -8}}, color = {255, 0, 255}));
+ end MDD_therm_buzzer;
+ end MDD_thermistor;
+
+ package MDD_dcmotor
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_dcmotor_clock
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 40}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 41}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.B}) annotation(
+ Placement(visible = true, transformation(origin = {51, -3}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = if time < 5 then 255 else 0) annotation(
+ Placement(visible = true, transformation(origin = {-40, -3}, extent = {{-16, -13}, {16, 13}}, rotation = 0)));
+ equation
+ connect(pwm.u[1], integerExpression1.y) annotation(
+ Line(points = {{28, -3}, {-22, -3}}, color = {255, 127, 0}, thickness = 0.5));
+ end MDD_dcmotor_clock;
+
+ model MDD_dcmotor_both
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {56, 60}, extent = {{-18, -18}, {18, 18}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {54, 1.77636e-15}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = if mod(time, 5) >= 2.5 then 100 else 0) annotation(
+ Placement(visible = true, transformation(origin = {-41, 3.55271e-15}, extent = {{-23, -20}, {23, 20}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression2(y = if mod(time, 5) < 2.5 then 100 else 0) annotation(
+ Placement(visible = true, transformation(origin = {-39, -48}, extent = {{-23, -20}, {23, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm1(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.B}) annotation(
+ Placement(visible = true, transformation(origin = {54, -48}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ equation
+ connect(integerExpression2.y, pwm1.u[1]) annotation(
+ Line(points = {{-14, -48}, {28, -48}, {28, -48}, {30, -48}}, color = {255, 127, 0}));
+ connect(integerExpression1.y, pwm.u[1]) annotation(
+ Line(points = {{-16, 0}, {28, 0}, {28, 0}, {30, 0}}, color = {255, 127, 0}));
+ end MDD_dcmotor_both;
+
+ model MDD_dcmotor_loop
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 62}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {40, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {44, 16}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm1(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.B}) annotation(
+ Placement(visible = true, transformation(origin = {44, -30}, extent = {{-16, -16}, {16, 16}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = if mod(time, 6) < 3 then 255 else 0) annotation(
+ Placement(visible = true, transformation(origin = {-53, 16}, extent = {{-17, -16}, {17, 16}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression2(y = if mod(time, 6) > 3 then 255 else 0) annotation(
+ Placement(visible = true, transformation(origin = {-52, -30}, extent = {{-16, -14}, {16, 14}}, rotation = 0)));
+ equation
+ connect(integerExpression2.y, pwm1.u[1]) annotation(
+ Line(points = {{-34, -30}, {24, -30}}, color = {255, 127, 0}));
+ connect(integerExpression1.y, pwm.u[1]) annotation(
+ Line(points = {{-34, 16}, {24, 16}}, color = {255, 127, 0}));
+ end MDD_dcmotor_loop;
+ end MDD_dcmotor;
+
+ package MDD_servo
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_servo_init
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 58}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {59, 59}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {44, -6}, extent = {{-28, -28}, {28, 28}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = 30) annotation(
+ Placement(visible = true, transformation(origin = {-57, -6}, extent = {{-23, -18}, {23, 18}}, rotation = 0)));
+ equation
+ connect(integerExpression1.y, pwm.u[1]) annotation(
+ Line(points = {{-32, -6}, {10, -6}}, color = {255, 127, 0}));
+ end MDD_servo_init;
+
+ model MDD_servo_loop
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-41, 41}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 41}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {80, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.MathInteger.TriggeredAdd triggeredAdd1(use_reset = false, use_set = false) annotation(
+ Placement(visible = true, transformation(origin = {10, -8}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = 10) annotation(
+ Placement(visible = true, transformation(origin = {-34, -8}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.BooleanExpression booleanExpression1(y = if mod(time, 0.2) > 0.1 then true else false) annotation(
+ Placement(visible = true, transformation(origin = {-22, -32}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(booleanExpression1.y, triggeredAdd1.trigger) annotation(
+ Line(points = {{-10, -32}, {6, -32}, {6, -16}, {6, -16}}, color = {255, 0, 255}));
+ connect(integerExpression1.y, triggeredAdd1.u) annotation(
+ Line(points = {{-22, -8}, {2, -8}, {2, -8}, {2, -8}}, color = {255, 127, 0}));
+ connect(triggeredAdd1.y, pwm.u[1]) annotation(
+ Line(points = {{17, -8}, {68, -8}}, color = {255, 127, 0}));
+ end MDD_servo_loop;
+
+ model MDD_servo_pot
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-40, 60}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {39, 61}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.ADC adc(analogPort = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPort.A2, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.AnalogPrescaler.'1/128', voltageReference = 180, voltageReferenceSelect = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.VRefSelect.Internal) annotation(
+ Placement(visible = true, transformation(origin = {-52, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {48, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.RealToInteger realToInteger1 annotation(
+ Placement(visible = true, transformation(origin = {-6, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(adc.y, realToInteger1.u) annotation(
+ Line(points = {{-40, -10}, {-18, -10}, {-18, -10}, {-18, -10}, {-18, -10}}, color = {0, 0, 127}));
+ connect(realToInteger1.y, pwm.u[1]) annotation(
+ Line(points = {{6, -10}, {36, -10}, {36, -10}, {36, -10}}, color = {255, 127, 0}));
+ end MDD_servo_pot;
+
+ model MDD_servo_reverse
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.01, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-59, 61}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {55, 61}, extent = {{-19, -19}, {19, 19}}, rotation = 0)));
+ Modelica.Blocks.Sources.IntegerExpression integerExpression1(y = if time < 0.2 then 22 else 15) annotation(
+ Placement(visible = true, transformation(origin = {-44, 0}, extent = {{-22, -22}, {22, 22}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.PWM pwm(fastPWM = true, initialValues = {0}, prescaler = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerPrescaler.'1/1024', timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer1, timerNumbers = {Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerNumber.A}) annotation(
+ Placement(visible = true, transformation(origin = {44, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(integerExpression1.y, pwm.u[1]) annotation(
+ Line(points = {{-20, 0}, {32, 0}}, color = {255, 127, 0}));
+ end MDD_servo_reverse;
+ end MDD_servo;
+
+ package MDD_modbus
+ extends Modelica.Icons.ExamplesPackage;
+
+ model MDD_read_val
+ extends Modelica.Icons.Example;
+ inner Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu(desiredPeriod = 0.002, platform = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.Platform.ATmega328P) annotation(
+ Placement(visible = true, transformation(origin = {-45, 67}, extent = {{-15, -15}, {15, 15}}, rotation = 0)));
+ Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.SynchronizeRealtime synchronizeRealtime1(timer = Modelica_DeviceDrivers.EmbeddedTargets.AVR.Types.TimerSelect.Timer0) annotation(
+ Placement(visible = true, transformation(origin = {28, 68}, extent = {{-12, -12}, {12, 12}}, rotation = 0)));
+ Modelica.Blocks.MathInteger.MultiSwitch multiSwitch1(expr = {86, 88, 78}, nu = 3, use_pre_as_default = true, y_default = 0) annotation(
+ Placement(visible = true, transformation(origin = {-32.6577, -10}, extent = {{-10.0019, -22}, {30.0056, 22}}, rotation = 0)));
+ Modelica.Blocks.Interaction.Show.RealValue realValue1 annotation(
+ Placement(visible = true, transformation(origin = {60, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Blocks.Read_Val read_Val1 annotation(
+ Placement(visible = true, transformation(origin = {26, -10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ connect(read_Val1.y, realValue1.numberPort) annotation(
+ Line(points = {{38, -10}, {48, -10}, {48, -10}, {48, -10}}, color = {0, 0, 127}));
+ connect(multiSwitch1.y, read_Val1.u) annotation(
+ Line(points = {{-2, -10}, {14, -10}, {14, -10}, {14, -10}}, color = {255, 127, 0}));
+ end MDD_read_val;
+ end MDD_modbus;
+ end MDD_Examples;
+
+ package Blocks
+ extends Modelica.Icons.Package;
+
+ model Read_Val
+ extends Modelica.Blocks.Interfaces.SISO;
+ import Modelica_DeviceDrivers.EmbeddedTargets.AVR;
+ import sComm = Arduino.SerialCommunication.Functions;
+ outer Modelica_DeviceDrivers.EmbeddedTargets.AVR.Blocks.Microcontroller mcu;
+ annotation(
+ defaultComponentName = "Read_Val",
+ Icon(graphics = {Text(extent = {{-95, -95}, {95, 95}}, textString = "Read_Val", fontName = "Arial")}));
+ end Read_Val;
+ end Blocks;
+
+ package Icons "Collection of icons used for library components"
+ extends Modelica.Icons.IconsPackage;
+
+ partial package GenericICPackage "Icon with a generic IC"
+ annotation(
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}), graphics = {Bitmap(extent = {{-95, -95}, {95, 95}}, fileName = "Resources/Images/Icons/tqfp32.png", rotation = 0)}),
+ Documentation(info = "<html>
+ <p>
+ This partial class is intended to design a <em>default icon for microcontrollers</em>.
+ </p>
+ </html>"));
+ end GenericICPackage;
+
+ partial block GenericIC "Icon with a generic IC"
+ annotation(
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}), graphics = {Bitmap(extent = {{-95, -95}, {95, 95}}, fileName = "Resources/Images/Icons/tqfp32.png", rotation = 0)}),
+ Documentation(info = "<html>
+ <p>
+ This partial class is intended to design a <em>default icon for microcontrollers</em>.
+ </p>
+ </html>"));
+ end GenericIC;
+
+ partial package FunctionLayerIcon "Icon for packages that represent the function layer"
+ extends Modelica.Icons.Package;
+ annotation(
+ Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Text(lineColor = {128, 128, 128}, extent = {{-90, -90}, {90, 90}}, textString = "f"), Ellipse(lineColor = {128, 128, 128}, extent = {{-80, -80}, {80, 80}})}),
+ Documentation(info = "<html>
+ <p>This icon indicates Modelica functions.</p>
+ </html>"));
+ end FunctionLayerIcon;
+ annotation(
+ preferredView = "info",
+ Documentation(info = "<html>
+ <p>
+ A collection of basic icons to be used for different elements of the library.
+ </p>
+ </html>"));
+ end Icons;
+ annotation(
+ Documentation(info = "<html>
+<h4>Description</h4>
+<p>
+A serial communication package for hardware interfacing.
+</p>
+</html>"));
+ end SerialCommunication;
+ annotation(
+ uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2")));
+end Arduino;
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Instructions.txt b/Modelica-Arduino-MDD_Arduino_Revised/Instructions.txt
new file mode 100755
index 0000000..3c8a081
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Instructions.txt
@@ -0,0 +1,14 @@
+Compiling sources:
+gcc -c -Wall -fPIC filename.c
+gcc -shared -fPIC -o libfilename.so file1.o file2.o ....
+
+MDD:
+Executing Blink example within MOdelica_DeviceDrivers EmbeddedTargets Package:-
+Put the runMDDAvr.mos file in a (build) directory and execute following commands on the command line:
+
+omc --simCodeTarget=ExperimentalEmbeddedC runMDDAvr.mos
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections Blink_main.c -o Blink -I /path_to_MDD/Modelica_DeviceDrivers/Resources/Include -I /usr/include/omc/c
+
+avr-objcopy -O ihex -R .eeprom Blink Blink.hex
+avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:Blink.hex
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both
new file mode 100755
index 0000000..49bd982
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.hex
new file mode 100755
index 0000000..6092d32
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.hex
@@ -0,0 +1,121 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C942C0140
+:100020000C9451000C9451000C9451000C94FB0062
+:100030000C9451000C9451000C94CA000C94510083
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E4E5F7E002C0F3
+:1000800005900D92A831B107D9F711E0A8E1B1E0D0
+:1000900001C01D92AD31B107E1F70E94A4010C949B
+:1000A000A8030C940000CF92DF92EF92FF92CF93BF
+:1000B000DF93EC01C880D980EA80FB80C701B601DC
+:1000C0000E9479029B01AC01C701B6010E94D301D5
+:1000D0006B017C0120E030E040E05FE30E944103DF
+:1000E00087FD03C084E690E002C080E090E09D833D
+:1000F0008C8320E030E040E05FE3C701B6010E945E
+:10010000380287FF03C084E690E002C080E090E000
+:100110009F838E838E899F898230910561F0833021
+:10012000910599F00197C9F416BC80916E00826028
+:1001300080936E0016C0109285001092840080910A
+:100140006F00826080936F000CC01092B2008091AB
+:10015000700082608093700004C081E090E00E9493
+:10016000A80378949FB7F89480911A019FBF8823C1
+:10017000C9F310921A01EE85FF858C818083EA898C
+:10018000FB898E818083DF91CF91FF90EF90DF908C
+:10019000CF9008951F920F920FB60F9211242F93B4
+:1001A0003F938F939F93809118019091190101962D
+:1001B000909319018093180180911A01813091F078
+:1001C000209118013091190180911B0190911C011F
+:1001D0002817390738F081E080931A01109219012D
+:1001E000109218019F918F913F912F910F900FBE08
+:1001F0000F901F9018951F920F920FB60F92112417
+:100200002F933F938F939F938091180190911901A1
+:100210000196909319018093180180911A01813001
+:1002200091F0209118013091190180911B0190915A
+:100230001C012817390738F081E080931A011092C9
+:100240001901109218019F918F913F912F910F905A
+:100250000FBE0F901F9018951F920F920FB60F921E
+:1002600011242F933F938F939F9380911801909126
+:1002700019010196909319018093180180911A0138
+:10028000813091F0209118013091190180911B016A
+:1002900090911C012817390738F081E080931A01EA
+:1002A00010921901109218019F918F913F912F91F7
+:1002B0000F900FBE0F901F901895CF93DF93FC0106
+:1002C000C1E8D0E088818D60888322E030E0318B06
+:1002D000208B229A40E850E0DA018C9181628C9365
+:1002E0008AE890E0DC0111961C921E921C92938B7E
+:1002F000828B88818D60888335872487219ADA01F3
+:100300008C9181688C93A8E8B0E011961C921E92A3
+:100310001C92B787A68785B5836085BD81E090E094
+:10032000958B848B2AE030E030931C0120931B01D5
+:1003300024B5226024BD29EF27BD978B868B80E0F2
+:1003400090E0DF91CF910895CF92DF92EF92FF92EC
+:1003500080E091E00E945D01C12CD12C760160E02B
+:1003600070E0CB0160930001709301018093020162
+:100370009093030180E091E00E9453008FEFC81A30
+:10038000D80AE80AF80AC701B6010E943C022FE623
+:1003900032E143E05BE30E94450320E030E0A90145
+:1003A0000E94D401DFCF5058BB27AA270ED018C116
+:1003B00009D130F00ED120F031F49F3F11F41EF43A
+:1003C000FEC00EF4E095E7FBCBC0E92F1AD180F315
+:1003D000BA17620773078407950718F071F49EF542
+:1003E00049C10EF4E0950B2EBA2FA02D0B01B901D7
+:1003F00090010C01CA01A0011124FF27591B99F09B
+:10040000593F50F4503E68F11A16F040A22F232FA6
+:10041000342F4427585FF3CF469537952795A795F6
+:10042000F0405395C9F77EF41F16BA0B620B730B9D
+:10043000840BBAF09150A1F0FF0FBB1F661F771F0E
+:10044000881FC2F70EC0BA0F621F731F841F48F4C3
+:10045000879577956795B795F7959E3F08F0B3CF49
+:100460009395880F08F09927EE0F97958795089533
+:1004700053D008F481E00895E89409C097FB3EF456
+:1004800090958095709561957F4F8F4F9F4F9923E1
+:10049000A9F0F92F96E9BB279395F695879577955F
+:1004A0006795B795F111F8CFFAF4BB0F11F460FF1F
+:1004B0001BC06F5F7F4F8F4F9F4F16C0882311F077
+:1004C00096E911C0772321F09EE8872F762F05C08B
+:1004D000662371F096E8862F70E060E02AF09A9526
+:1004E000660F771F881FDAF7880F9695879597F91B
+:1004F0000895A9D080F09F3740F491110EF0BBC051
+:1005000060E070E080E89FEB089526F41B16611D03
+:10051000711D811D2BC045C0990F0008550FAA0BF6
+:10052000E0E8FEEF16161706E807F907C0F0121606
+:100530001306E407F50798F0621B730B840B950B09
+:1005400039F40A2661F0232B242B252B21F408955E
+:100550000A2609F4A140A6958FEF811D811D0895FB
+:1005600097F99F6780E870E060E00895882371F450
+:10057000772321F09850872B762F07C0662311F43C
+:1005800099270DC09051862B70E060E02AF09A9573
+:10059000660F771F881FDAF7880F9695879597F96A
+:1005A00008959F3F31F0915020F487957795679596
+:1005B000B795880F911D9695879597F908959FEFA8
+:1005C00080EC089500240A941616170618060906EA
+:1005D000089500240A9412161306140605060895B9
+:1005E000092E0394000C11F4882352F0BB0F40F441
+:1005F000BF2B11F460FF04C06F5F7F4F8F4F9F4F81
+:10060000089557FD9058440F551F59F05F3F71F002
+:100610004795880F97FB991F61F09F3F79F0879569
+:100620000895121613061406551FF2CF4695F1DFF2
+:1006300008C0161617061806991FF1CF8695710582
+:10064000610508940895E5DFA0F0BEE7B91788F4C6
+:10065000BB279F3860F41616B11D672F782F8827A7
+:10066000985FF7CF869577956795B11D93959639E5
+:10067000C8F30895E894BB2766277727CB0197F93D
+:1006800008954ADF08F48FEF08950BD0A9CF9ADFC1
+:1006900028F09FDF18F0952309F062CF90CF112446
+:1006A000EACFAFDFA0F3959FD1F3950F50E0551F30
+:1006B000629FF001729FBB27F00DB11D639FAA27B7
+:1006C000F00DB11DAA1F649F6627B00DA11D661F06
+:1006D000829F2227B00DA11D621F739FB00DA11D27
+:1006E000621F839FA00D611D221F749F3327A00DE1
+:1006F000611D231F849F600D211D822F762F6A2F7D
+:1007000011249F5750408AF0E1F088234AF0EE0F01
+:10071000FF1FBB1F661F771F881F91505040A9F70E
+:100720009E3F510570F01CCFA6CF5F3FECF3983E83
+:10073000DCF3869577956795B795F795E7959F5F75
+:10074000C1F7FE2B880F911D9695879597F908950F
+:04075000F894FFCF4B
+:1007540000000000000000000AD7233C0000000055
+:0807640000000000000000008D
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.sh
new file mode 100755
index 0000000..762735b
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_dcmotor_both.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_dcmotor_both.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections dcmotor_both_main.c -o dcmotor_both -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom dcmotor_both dcmotor_both.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:dcmotor_both.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both_main.c
new file mode 100755
index 0000000..dbf03a2
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_both_main.c
@@ -0,0 +1,217 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct dcmotor_both_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct dcmotor_both_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[2];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[6];
+} dcmotor_both_fmi2Component;
+
+dcmotor_both_fmi2Component dcmotor_both_component = {
+ .fmi2IntegerVars = {
+ 0 /*pwm._u[1]*/,
+ 0 /*pwm1._u[1]*/,
+ },
+ .fmi2RealParameter = {
+ 0.01 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component dcmotor_both_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &dcmotor_both_component;
+}
+
+fmi2Status dcmotor_both_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_both_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[2] /* pwm1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[3] /* pwm1._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[2] /* pwm1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 2, 0, fmi2False);
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 10);
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_both_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status dcmotor_both_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status dcmotor_both_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */ = ((om_mod(comp->currentTime,1.0))>=(0.5)) ? (100) : (0); /* equation 4 */
+ comp->fmi2IntegerVars[1] /* pwm1._u[1] DISCRETE */ = ((om_mod(comp->currentTime,1.0))<(0.5)) ? (100) : (0); /* equation 5 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[3] /* pwm1._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[1] /* pwm1._u[1] DISCRETE */);
+}
+
+fmi2Status dcmotor_both_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ dcmotor_both_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = dcmotor_both_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ dcmotor_both_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ dcmotor_both_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ dcmotor_both_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = dcmotor_both_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock
new file mode 100755
index 0000000..0e58a0e
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.hex
new file mode 100755
index 0000000..f752eb8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.hex
@@ -0,0 +1,101 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E50088
+:100020000C9451000C9451000C9451000C94B400A9
+:100030000C9451000C9451000C9483000C945100CA
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0ECE1F6E002C0F0
+:1000800005900D92A231B107D9F711E0A2E1B1E0DC
+:1000900001C01D92A731B107E1F70E9445010C9400
+:1000A0000C030C9400008230910561F083309105BF
+:1000B00099F00197C9F416BC80916E00826080931C
+:1000C0006E0016C0109285001092840080916F001F
+:1000D000826080936F000CC01092B200809170001B
+:1000E00082608093700004C081E090E00E940C0365
+:1000F00078949FB7F894809114019FBF8823C9F327
+:100100001092140108951F920F920FB60F921124AE
+:100110002F933F938F939F9380911201909113019E
+:100120000196909313018093120180911401813004
+:1001300091F020911201309113018091150190915D
+:1001400016012817390738F081E0809314011092C6
+:100150001301109212019F918F913F912F910F9057
+:100160000FBE0F901F9018951F920F920FB60F920F
+:1001700011242F933F938F939F938091120190911D
+:100180001301019690931301809312018091140141
+:10019000813091F02091120130911301809115016D
+:1001A000909116012817390738F081E080931401E7
+:1001B00010921301109212019F918F913F912F91F4
+:1001C0000F900FBE0F901F9018951F920F920FB6B1
+:1001D0000F9211242F933F938F939F93809112013D
+:1001E00090911301019690931301809312018091D5
+:1001F0001401813091F0209112013091130180910E
+:100200001501909116012817390738F081E0809385
+:10021000140110921301109212019F918F913F913E
+:100220002F910F900FBE0F901F901895FC01A1E821
+:10023000B0E08C918D608C9382E090E09387828710
+:10024000229AA0E8B0E08C9181628C93AAE8B0E099
+:1002500011961C921E921C92B587A48785B5836067
+:1002600085BD81E090E0978786872AE030E0309373
+:1002700016012093150124B5226024BD29EF27BD66
+:10028000918B808B80E090E00895CF92DF92EF9287
+:10029000FF9280E091E00E941601C12CD12C7601E2
+:1002A00060E070E0CB0160930001709301018093E6
+:1002B00002019093030120E030E040E85FE30E94F8
+:1002C000F30187FF03C08FEF90E002C080E090E071
+:1002D0009093050180930401809110019091110188
+:1002E0000E945300E0910C01F0910D0180910401F6
+:1002F00080838FEFC81AD80AE80AF80AC701B60146
+:100300000E94F7012FE632E143E05BE30E94A9027D
+:1003100020E030E0A9010E948F01C5CF5058BB27D3
+:10032000AA270ED0DCC0CDD030F0D2D020F031F4EE
+:100330009F3F11F41EF4C2C00EF4E095E7FBB8C075
+:10034000E92FDED080F3BA17620773078407950799
+:1003500018F071F49EF5F6C00EF4E0950B2EBA2F4E
+:10036000A02D0B01B90190010C01CA01A0011124BB
+:10037000FF27591B99F0593F50F4503E68F11A1667
+:10038000F040A22F232F342F4427585FF3CF4695F8
+:1003900037952795A795F0405395C9F77EF41F161A
+:1003A000BA0B620B730B840BBAF09150A1F0FF0FE4
+:1003B000BB1F661F771F881FC2F70EC0BA0F621FD0
+:1003C000731F841F48F4879577956795B795F795C0
+:1003D0009E3F08F0B3CF9395880F08F09927EE0F52
+:1003E00097958795089540D008F481E00895E894A2
+:1003F00009C097FB3EF490958095709561957F4F6D
+:100400008F4F9F4F9923A9F0F92F96E9BB2793951A
+:10041000F695879577956795B795F111F8CFFAF42A
+:10042000BB0F11F460FF1BC06F5F7F4F8F4F9F4F5B
+:1004300016C0882311F096E911C0772321F09EE8B9
+:10044000872F762F05C0662371F096E8862F70E01F
+:1004500060E02AF09A95660F771F881FDAF7880FF9
+:100460009695879597F90895990F0008550FAA0B4F
+:10047000E0E8FEEF16161706E807F907C0F01216B7
+:100480001306E407F50798F0621B730B840B950BBA
+:1004900039F40A2661F0232B242B252B21F408950F
+:1004A0000A2609F4A140A6958FEF811D811D0895AC
+:1004B00097F99F6780E870E060E008959FEF80EC17
+:1004C000089500240A9416161706180609060895BA
+:1004D00000240A9412161306140605060895092E20
+:1004E0000394000C11F4882352F0BB0F40F4BF2B8F
+:1004F00011F460FF04C06F5F7F4F8F4F9F4F0895CF
+:1005000057FD9058440F551F59F05F3F71F04795C4
+:10051000880F97FB991F61F09F3F79F087950895A9
+:10052000121613061406551FF2CF4695F1DF08C0C8
+:10053000161617061806991FF1CF869571056105E5
+:1005400008940895E894BB2766277727CB0197F98D
+:1005500008950BD0C4CFB5DF28F0BADF18F095238B
+:1005600009F0A6CFABCF1124EECFCADFA0F3959F41
+:10057000D1F3950F50E0551F629FF001729FBB278A
+:10058000F00DB11D639FAA27F00DB11DAA1F649F36
+:100590006627B00DA11D661F829F2227B00DA11DE9
+:1005A000621F739FB00DA11D621F839FA00D611D6F
+:1005B000221F749F3327A00D611D231F849F600D90
+:1005C000211D822F762F6A2F11249F5750408AF0C9
+:1005D000E1F088234AF0EE0FFF1FBB1F661F771F55
+:1005E000881F91505040A9F79E3F510570F060CF91
+:1005F000AACF5F3FECF3983EDCF38695779567953D
+:10060000B795F795E7959F5FC1F7FE2B880F911D72
+:0C0610009695879597F90895F894FFCF10
+:10061C0000000000FF000AD7233C0000000000008F
+:02062C000000CC
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.sh
new file mode 100755
index 0000000..9ef5c4d
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_dcmotor_clock.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_dcmotor_clock.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections dcmotor_clock_main.c -o dcmotor_clock -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom dcmotor_clock dcmotor_clock.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:dcmotor_clock.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock_main.c
new file mode 100755
index 0000000..ae3eff7
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_clock_main.c
@@ -0,0 +1,213 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct dcmotor_clock_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct dcmotor_clock_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[4];
+} dcmotor_clock_fmi2Component;
+
+dcmotor_clock_fmi2Component dcmotor_clock_component = {
+ .fmi2IntegerVars = {
+ 255 /*pwm._u[1]*/,
+ },
+ .fmi2RealParameter = {
+ 0.01 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component dcmotor_clock_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &dcmotor_clock_component;
+}
+
+fmi2Status dcmotor_clock_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_clock_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 2, 0, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 10);
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_clock_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status dcmotor_clock_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status dcmotor_clock_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */ = ((comp->currentTime)<(1.0)) ? (255) : (0); /* equation 3 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */);
+}
+
+fmi2Status dcmotor_clock_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ dcmotor_clock_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = dcmotor_clock_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ dcmotor_clock_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ dcmotor_clock_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ dcmotor_clock_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = dcmotor_clock_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop
new file mode 100755
index 0000000..36d8f3b
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.hex
new file mode 100755
index 0000000..119035b
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.hex
@@ -0,0 +1,135 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94380134
+:100020000C9451000C9451000C9451000C94070155
+:100030000C9451000C9451000C94D6000C94510077
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E8E3F8E002C0F0
+:1000800005900D92A831B107D9F711E0A8E1B1E0D0
+:1000900001C01D92AD31B107E1F70E94AE010C9491
+:1000A0001A040C940000CF92DF92EF92FF92CF934C
+:1000B000DF93EC01C880D980EA80FB8020E030E04B
+:1000C00040EC50E4C701B6010E9446020E94EB02D8
+:1000D00020E030E040EC50E40E94B7039B01AC010B
+:1000E000C701B6010E94DD016B017C0120E030E018
+:1000F00040E450E40E94420287FF03C08FEF90E08B
+:1001000002C080E090E09D838C8320E030E040E4FA
+:1001100050E4C701B6010E94B30318161CF48FEF18
+:1001200090E002C080E090E09F838E838E899F895B
+:100130008230910561F08330910599F00197C9F4FF
+:1001400016BC80916E00826080936E0016C0109283
+:1001500085001092840080916F00826080936F0010
+:100160000CC01092B2008091700082608093700089
+:1001700004C081E090E00E941A0478949FB7F8943C
+:1001800080911A019FBF8823C9F310921A01EE854E
+:10019000FF858C818083EA89FB898E818083DF9152
+:1001A000CF91FF90EF90DF90CF9008951F920F9224
+:1001B0000FB60F9211242F933F938F939F938091AB
+:1001C00018019091190101969093190180931801DB
+:1001D00080911A01813091F020911801309119011C
+:1001E00080911B0190911C012817390738F081E09C
+:1001F00080931A0110921901109218019F918F910A
+:100200003F912F910F900FBE0F901F9018951F9246
+:100210000F920FB60F9211242F933F938F939F93BA
+:100220008091180190911901019690931901809382
+:10023000180180911A01813091F0209118013091BC
+:10024000190180911B0190911C012817390738F082
+:1002500081E080931A0110921901109218019F9168
+:100260008F913F912F910F900FBE0F901F90189577
+:100270001F920F920FB60F9211242F933F938F93DB
+:100280009F93809118019091190101969093190103
+:100290008093180180911A01813091F0209118010A
+:1002A0003091190180911B0190911C012817390789
+:1002B00038F081E080931A01109219011092180110
+:1002C0009F918F913F912F910F900FBE0F901F9094
+:1002D0001895CF93DF93FC01C1E8D0E088818D6051
+:1002E000888382E090E0918B808B229A40E850E0F6
+:1002F000DA012C9121622C932AE830E0D901119681
+:100300001C921E921C92338B228B28812D60288395
+:1003100095878487219ADA012C9121682C93A8E88B
+:10032000B0E011961C921E921C92B787A68725B545
+:10033000236025BD21E030E0358B248B90931C0198
+:1003400080931B0184B5826084BD89EF87BD378BA4
+:10035000268B80E090E0DF91CF910895CF92DF92DD
+:10036000EF92FF9280E091E00E946901C12CD12CB4
+:10037000760160E070E0CB016093000170930101B1
+:10038000809302019093030180E091E00E9453006A
+:100390008FEFC81AD80AE80AF80AC701B6010E9406
+:1003A000AE022FE632E143E05BE30E94B70320E0B8
+:1003B00030E0A9010E94DE01DFCF5058BB27AA27F9
+:1003C0000ED080C171D130F076D120F031F49F3F52
+:1003D00011F41EF466C10EF4E095E7FB33C1E92F7A
+:1003E00082D180F3BA17620773078407950718F064
+:1003F00071F49EF5B1C10EF4E0950B2EBA2FA02D2D
+:100400000B01B90190010C01CA01A0011124FF27C1
+:10041000591B99F0593F50F4503E68F11A16F040BC
+:10042000A22F232F342F4427585FF3CF46953795BB
+:100430002795A795F0405395C9F77EF41F16BA0B80
+:10044000620B730B840BBAF09150A1F0FF0FBB1F2E
+:10045000661F771F881FC2F70EC0BA0F621F731F77
+:10046000841F48F4879577956795B795F7959E3FD4
+:1004700008F0B3CF9395880F08F09927EE0F979562
+:1004800087950895BBD008F481E008950CD01AC177
+:1004900012D140F009D130F021F45F3F19F0D2C001
+:1004A00051115BC1FEC01FD198F39923C9F35523A5
+:1004B000B1F3951B550BBB27AA2762177307840757
+:1004C00038F09F5F5F4F220F331F441FAA1FA9F30D
+:1004D00033D00E2E3AF0E0E830D091505040E695FF
+:1004E000001CCAF729D0FE2F27D0660F771F881F60
+:1004F000BB1F261737074807AB07B0E809F0BB0B4F
+:10050000802DBF01FF2793585F4F2AF09E3F510572
+:1005100068F098C022C15F3FECF3983EDCF386950B
+:1005200077956795B795F7959F5FC9F7880F911DE8
+:100530009695879597F90895E1E0660F771F881FD4
+:10054000BB1F621773078407BA0720F0621B730B87
+:10055000840BBA0BEE1F88F7E0950895E89409C064
+:1005600097FB3EF490958095709561957F4F8F4FE6
+:100570009F4F9923A9F0F92F96E9BB279395F695FC
+:10058000879577956795B795F111F8CFFAF4BB0F7A
+:1005900011F460FF1BC06F5F7F4F8F4F9F4F16C0DE
+:1005A000882311F096E911C0772321F09EE8872F68
+:1005B000762F05C0662371F096E8862F70E060E024
+:1005C0002AF09A95660F771F881FDAF7880F96959D
+:1005D000879597F90895A9D080F09F3740F491113D
+:1005E0000EF0BBC060E070E080E89FEB089526F459
+:1005F0001B16611D711D811D2BC045C0990F000880
+:10060000550FAA0BE0E8FEEF16161706E807F907E4
+:10061000C0F012161306E407F50798F0621B730B7F
+:10062000840B950B39F40A2661F0232B242B252B00
+:1006300021F408950A2609F4A140A6958FEF811DA3
+:10064000811D089597F99F6780E870E060E0089544
+:10065000882371F4772321F09850872B762F07C0D9
+:10066000662311F499270DC09051862B70E060E04D
+:100670002AF09A95660F771F881FDAF7880F9695EC
+:10068000879597F908959F3F31F0915020F4879511
+:1006900077956795B795880F911D9695879597F9EA
+:1006A00008959FEF80EC089500240A94161617060B
+:1006B00018060906089500240A9412161306140653
+:1006C00005060895092E0394000C11F4882352F0B6
+:1006D000BB0F40F4BF2B11F460FF04C06F5F7F4F6E
+:1006E0008F4F9F4F089557FD9058440F551F59F055
+:1006F0005F3F71F04795880F97FB991F61F09F3F0F
+:1007000079F087950895121613061406551FF2CF37
+:100710004695F1DF08C0161617061806991FF1CF87
+:1007200086957105610508940895E5DFA0F0BEE7A0
+:10073000B91788F4BB279F3860F41616B11D672FD0
+:10074000782F8827985FF7CF869577956795B11DA5
+:1007500093959639C8F30895E894BB2766277727C1
+:10076000CB0197F908954ADF08F48FEF08950BD075
+:10077000A9CF9ADF28F09FDF18F0952309F062CF08
+:1007800090CF1124EACFAFDFA0F3959FD1F3950F5F
+:1007900050E0551F629FF001729FBB27F00DB11D05
+:1007A000639FAA27F00DB11DAA1F649F6627B00D95
+:1007B000A11D661F829F2227B00DA11D621F739F7E
+:1007C000B00DA11D621F839FA00D611D221F749F8C
+:1007D0003327A00D611D231F849F600D211D822FD3
+:1007E000762F6A2F11249F5750408AF0E1F088231A
+:1007F0004AF0EE0FFF1FBB1F661F771F881F915027
+:100800005040A9F79E3F510570F01CCFA6CF5F3F27
+:10081000ECF3983EDCF3869577956795B795F79559
+:10082000E7959F5FC1F7FE2B880F911D96958795E1
+:0808300097F90895F894FFCF39
+:1008380000000000000000006F12033B00000000F1
+:080848000000000000000000A8
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.sh
new file mode 100755
index 0000000..38ca771
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_dcmotor_loop.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_dcmotor_loop.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections dcmotor_loop_main.c -o dcmotor_loop -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom dcmotor_loop dcmotor_loop.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:dcmotor_loop.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop_main.c
new file mode 100755
index 0000000..581a9d6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/dcmotor_loop_main.c
@@ -0,0 +1,217 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct dcmotor_loop_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct dcmotor_loop_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[2];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[6];
+} dcmotor_loop_fmi2Component;
+
+dcmotor_loop_fmi2Component dcmotor_loop_component = {
+ .fmi2IntegerVars = {
+ 0 /*pwm._u[1]*/,
+ 0 /*pwm1._u[1]*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component dcmotor_loop_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &dcmotor_loop_component;
+}
+
+fmi2Status dcmotor_loop_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_loop_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[2] /* pwm1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[3] /* pwm1._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[2] /* pwm1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 2, 0, fmi2False);
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status dcmotor_loop_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status dcmotor_loop_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status dcmotor_loop_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */ = ((om_mod(comp->currentTime,6.0))<(3.0)) ? (255) : (0); /* equation 4 */
+ comp->fmi2IntegerVars[1] /* pwm1._u[1] DISCRETE */ = ((om_mod(comp->currentTime,6.0))>(3.0)) ? (255) : (0); /* equation 5 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[3] /* pwm1._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[1] /* pwm1._u[1] DISCRETE */);
+}
+
+fmi2Status dcmotor_loop_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ dcmotor_loop_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = dcmotor_loop_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ dcmotor_loop_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ dcmotor_loop_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ dcmotor_loop_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = dcmotor_loop_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_both.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_both.mos
new file mode 100755
index 0000000..c776b9a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_both.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_dcmotor.MDD_dcmotor_both, fileNamePrefix="dcmotor_both");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_clock.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_clock.mos
new file mode 100755
index 0000000..4f2e6ed
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_clock.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_dcmotor.MDD_dcmotor_clock, fileNamePrefix="dcmotor_clock");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_loop.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_loop.mos
new file mode 100755
index 0000000..05800fc
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/dcmotor/runMDD_dcmotor_loop.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_dcmotor.MDD_dcmotor_loop, fileNamePrefix="dcmotor_loop");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led
new file mode 100755
index 0000000..08ef23c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.hex
new file mode 100755
index 0000000..cc58777
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.hex
@@ -0,0 +1,120 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C9431013B
+:100020000C9451000C9451000C9451000C9400015C
+:100030000C9451000C9451000C94CF000C9451007E
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E4E4F7E002C0F4
+:1000800005900D92AE31B107D9F711E0AEE1B1E0C4
+:1000900001C01D92A332B107E1F70E948B010C94BD
+:1000A000A0030C9400000F931F93CF93DF93EC01F8
+:1000B00080917C00857E856080937C0080917A00B1
+:1000C000806480937A0080917A0086FDFCCF6091F5
+:1000D00078007091790080E090E00E94870220E033
+:1000E00030E040E854E40E94190320E030EC4FE790
+:1000F00054E40E941F026C837D838E839F8301E002
+:1001000010E02E853F85488959890E9415031816ED
+:1001100014F000E010E01D870C878C8D9D8D8230DF
+:10012000910561F08330910599F00197C9F416BCEF
+:1001300080916E00826080936E0016C010928500E0
+:100140001092840080916F00826080936F000CC0D9
+:100150001092B2008091700082608093700004C0A1
+:1001600081E090E00E94A00378949FB7F89480917A
+:1001700020019FBF8823C9F310922001E88DF98DDB
+:100180008C859D85892B19F08081826002C08081D9
+:100190008D7F8083DF91CF911F910F9108951F92E2
+:1001A0000F920FB60F9211242F933F938F939F932B
+:1001B00080911E0190911F01019690931F018093E1
+:1001C0001E0180912001813091F020911E0130911B
+:1001D0001F0180912101909122012817390738F0E1
+:1001E00081E08093200110921F0110921E019F91C7
+:1001F0008F913F912F910F900FBE0F901F901895E8
+:100200001F920F920FB60F9211242F933F938F934B
+:100210009F9380911E0190911F01019690931F0161
+:1002200080931E0180912001813091F020911E0168
+:1002300030911F01809121019091220128173907E7
+:1002400038F081E08093200110921F0110921E016E
+:100250009F918F913F912F910F900FBE0F901F9004
+:1002600018951F920F920FB60F9211242F933F9360
+:100270008F939F9380911E0190911F0101969093FF
+:100280001F0180931E0180912001813091F0209107
+:100290001E0130911F0180912101909122012817A8
+:1002A000390738F081E08093200110921F011092ED
+:1002B0001E019F918F913F912F910F900FBE0F9034
+:1002C0001F901895FC01ACE7B0E08C91806C8C938A
+:1002D000AAE7B0E08C9187688C93178A168A219AD6
+:1002E00085E290E0918F808F85B5836085BD81E048
+:1002F00090E0938F828F22E030E0309322012093B0
+:10030000210124B5226024BD29EF27BD958F848F5C
+:1003100080E090E00895CF92DF92EF92FF9280E02C
+:1003200091E00E946201C12CD12C760160E070E066
+:10033000CB016093000170930101809302019093BF
+:10034000030180E091E00E9453008FEFC81AD80AA1
+:10035000E80AF80AC701B6010E9487022FE632E1D7
+:1003600043E05BE30E94190320E030E0A9010E9412
+:10037000BB01DFCF5058BB27AA270ED01CC10DD11F
+:1003800030F012D120F031F49F3F11F41EF402C17D
+:100390000EF4E095E7FBF8C0E92F1ED180F3BA1701
+:1003A000620773078407950718F071F49EF536C14C
+:1003B0000EF4E0950B2EBA2FA02D0B01B901900180
+:1003C0000C01CA01A0011124FF27591B99F0593FC4
+:1003D00050F4503E68F11A16F040A22F232F342F0C
+:1003E0004427585FF3CF469537952795A795F0405A
+:1003F0005395C9F77EF41F16BA0B620B730B840B6F
+:10040000BAF09150A1F0FF0FBB1F661F771F881F26
+:10041000C2F70EC0BA0F621F731F841F48F487957E
+:1004200077956795B795F7959E3F08F0B3CF93956D
+:10043000880F08F09927EE0F9795879508950CD0AF
+:10044000BAC0B2D040F0A9D030F021F45F3F19F02B
+:100450009BC05111E4C09EC0BFD098F39923C9F34B
+:100460005523B1F3951B550BBB27AA2762177307BA
+:10047000840738F09F5F5F4F220F331F441FAA1F6E
+:10048000A9F333D00E2E3AF0E0E830D0915050402E
+:10049000E695001CCAF729D0FE2F27D0660F771FDC
+:1004A000881FBB1F261737074807AB07B0E809F0BE
+:1004B000BB0B802DBF01FF2793585F4F2AF09E3F53
+:1004C000510568F061C0ABC05F3FECF3983EDCF3D0
+:1004D000869577956795B795F7959F5FC9F7880FCC
+:1004E000911D9695879597F90895E1E0660F771F1E
+:1004F000881FBB1F621773078407BA0720F0621BAF
+:10050000730B840BBA0BEE1F88F7E0950895E894FF
+:1005100009C097FB3EF490958095709561957F4F4B
+:100520008F4F9F4F9923A9F0F92F96E9BB279395F9
+:10053000F695879577956795B795F111F8CFFAF409
+:10054000BB0F11F460FF1BC06F5F7F4F8F4F9F4F3A
+:1005500016C0882311F096E911C0772321F09EE898
+:10056000872F762F05C0662371F096E8862F70E0FE
+:1005700060E02AF09A95660F771F881FDAF7880FD8
+:100580009695879597F9089597F99F6780E870E0A9
+:1005900060E008959FEF80EC089500240A941616F9
+:1005A000170618060906089500240A941216130661
+:1005B000140605060895092E0394000C11F48823EF
+:1005C00052F0BB0F40F4BF2B11F460FF04C06F5F0B
+:1005D0007F4F8F4F9F4F089557FD9058440F551FE1
+:1005E00059F05F3F71F04795880F97FB991F61F0B5
+:1005F0009F3F79F087950895121613061406551F2C
+:10060000F2CF4695F1DF08C0161617061806991F97
+:10061000F1CF86957105610508940895E894BB278C
+:1006200066277727CB0197F9089566D008F48FEFF6
+:1006300008950BD0C0CFB1DF28F0B6DF18F09523B6
+:1006400009F0A2CFA7CF1124EACFC6DFA0F3959F70
+:10065000D1F3950F50E0551F629FF001729FBB27A9
+:10066000F00DB11D639FAA27F00DB11DAA1F649F55
+:100670006627B00DA11D661F829F2227B00DA11D08
+:10068000621F739FB00DA11D621F839FA00D611D8E
+:10069000221F749F3327A00D611D231F849F600DAF
+:1006A000211D822F762F6A2F11249F5750408AF0E8
+:1006B000E1F088234AF0EE0FFF1FBB1F661F771F74
+:1006C000881F91505040A9F79E3F510570F05CCFB4
+:1006D000A6CF5F3FECF3983EDCF386957795679560
+:1006E000B795F795E7959F5FC1F7FE2B880F911D92
+:1006F0009695879597F90895990F0008550FAA0BBD
+:10070000E0E8FEEF16161706E807F907C0F0121624
+:100710001306E407F50798F0621B730B840B950B27
+:1007200039F40A2661F0232B242B252B21F408957C
+:100730000A2609F4A140A6958FEF811D811D089519
+:04074000F894FFCF5B
+:1007440000000000000000000000000000000000A5
+:0E07540016446F12033B00000000000000007E
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.sh
new file mode 100755
index 0000000..d968dcb
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_ldr_led.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_ldr_led.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections ldr_led_main.c -o ldr_led -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom ldr_led ldr_led.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:ldr_led.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led_main.c
new file mode 100755
index 0000000..3b4bcd7
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_led_main.c
@@ -0,0 +1,243 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct ldr_led_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct ldr_led_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Real fmi2RealVars[1];
+ fmi2Boolean fmi2BooleanVars[3];
+ fmi2Real fmi2RealParameter[2];
+ void* extObjs[4];
+} ldr_led_fmi2Component;
+
+ldr_led_fmi2Component ldr_led_component = {
+ .fmi2RealVars = {
+ 0.0 /*adc._y*/,
+ },
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ fmi2False /*booleanExpression2._y*/,
+ fmi2False /*digitalWriteBoolean1._u*/,
+ },
+ .fmi2RealParameter = {
+ 600.0 /*greaterThreshold1._threshold*/,
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+static const char * const OMCLIT0 = "ElectricPotential";
+static const char * const OMCLIT1 = "V";
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+#include "MDDAVRAnalog.h"
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution)
+{
+ fmi2Real om_value;
+ om_value = MDD_avr_analog_read(om_analogPort, om_vref, om_voltageResolution);
+ return om_value;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage)
+{
+ void* om_avr;
+ om_avr = MDD_avr_analog_init(om_divisionFactor, om_referenceVoltage);
+ return om_avr;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr)
+{
+ MDD_avr_analog_close(om_avr);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component ldr_led_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &ldr_led_component;
+}
+
+fmi2Status ldr_led_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status ldr_led_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* adc._analog EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Analog.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(comp, 7, 4);
+ comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status ldr_led_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status ldr_led_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status ldr_led_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2RealVars[0] /* adc._y variable */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(comp, 6, 1024.0, 10); /* equation 6 */
+ comp->fmi2BooleanVars[2] /* digitalWriteBoolean1._u DISCRETE */ = (comp->fmi2RealVars[0] /* adc._y variable */)>(comp->fmi2RealParameter[0] /* greaterThreshold1._threshold PARAM */); /* equation 7 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[2] /* digitalWriteBoolean1._u DISCRETE */);
+}
+
+fmi2Status ldr_led_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ ldr_led_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = ldr_led_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ ldr_led_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ ldr_led_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ ldr_led_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = ldr_led_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_read.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_read.sh
new file mode 100755
index 0000000..d465596
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/ldr_read.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_ldr_read.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_ldr_read.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections ldr_read_main.c -o ldr_read -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom ldr_read ldr_read.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:ldr_read.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_led.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_led.mos
new file mode 100755
index 0000000..76aef31
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_led.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_ldr.MDD_ldr_led, fileNamePrefix="ldr_led");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_read.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_read.mos
new file mode 100755
index 0000000..76aef31
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/ldr/runMDD_ldr_read.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_ldr.MDD_ldr_led, fileNamePrefix="ldr_led");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink
new file mode 100755
index 0000000..3953004
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.hex
new file mode 100755
index 0000000..89858ca
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.hex
@@ -0,0 +1,114 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C942A0142
+:100020000C9451000C9451000C9451000C94F90064
+:100030000C9451000C9451000C94C8000C94510085
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E4EFF6E002C0EA
+:1000800005900D92A031B107D9F711E0A0E1B1E0E0
+:1000900001C01D92A531B107E1F70E9478010C94CF
+:1000A00078030C940000CF92DF92EF92FF920F93AF
+:1000B0001F93CF93DF93EC01C880D980EA80FB8047
+:1000C00020E030E040E05FE3C701B6010E94F102AA
+:1000D0000E9449029B01AC010E94A8019B01AC0156
+:1000E000C701B6010E94A70101E010E020E030E066
+:1000F00040E85FE30E94ED0287FF02C000E010E0ED
+:100100001D830C838E859F858230910561F083303D
+:10011000910599F00197C9F416BC80916E00826038
+:1001200080936E0016C0109285001092840080911A
+:100130006F00826080936F000CC01092B2008091BB
+:10014000700082608093700004C081E090E00E94A3
+:10015000780378949FB7F894809112019FBF882309
+:10016000C9F310921201EA85FB858C819D81892B50
+:1001700019F08081806202C080818F7D8083DF9151
+:10018000CF911F910F91FF90EF90DF90CF90089546
+:100190001F920F920FB60F9211242F933F938F93BC
+:1001A0009F938091100190911101019690931101FC
+:1001B0008093100180911201813091F02091100103
+:1001C0003091110180911301909114012817390782
+:1001D00038F081E080931201109211011092100109
+:1001E0009F918F913F912F910F900FBE0F901F9075
+:1001F00018951F920F920FB60F9211242F933F93D1
+:100200008F939F938091100190911101019690938B
+:1002100011018093100180911201813091F02091A1
+:100220001001309111018091130190911401281750
+:10023000390738F081E08093120110921101109279
+:1002400010019F918F913F912F910F900FBE0F90B2
+:100250001F9018951F920F920FB60F9211242F9393
+:100260003F938F939F93809110019091110101967C
+:10027000909311018093100180911201813091F0CF
+:10028000209110013091110180911301909114017E
+:100290002817390738F081E080931201109211017C
+:1002A000109210019F918F913F912F910F900FBE4F
+:1002B0000F901F901895FC0185B5836085BD81E086
+:1002C00090E09587848722E030E0309314012093FA
+:1002D000130124B5226024BD29EF27BD97878687A7
+:1002E000259A85E290E09387828780E090E00895E8
+:1002F000CF92DF92EF92FF9280E091E00E945B014B
+:10030000C12CD12C760160E070E0CB01609300013C
+:1003100070930101809302019093030180E091E0CA
+:100320000E9453008FEFC81AD80AE80AF80AC701DA
+:10033000B6010E940C022FE632E143E05BE30E942B
+:10034000F10220E030E0A9010E94A801DFCF50585F
+:10035000BB27AA270ED0F0C0E1D030F0E6D020F0C5
+:1003600031F49F3F11F41EF4D6C00EF4E095E7FB84
+:10037000A3C0E92FF2D080F3BA176207730784078E
+:10038000950718F071F49EF521C10EF4E0950B2E3F
+:10039000BA2FA02D0B01B90190010C01CA01A001D7
+:1003A0001124FF27591B99F0593F50F4503E68F132
+:1003B0001A16F040A22F232F342F4427585FF3CF73
+:1003C000469537952795A795F0405395C9F77EF444
+:1003D0001F16BA0B620B730B840BBAF09150A1F08D
+:1003E000FF0FBB1F661F771F881FC2F70EC0BA0F13
+:1003F000621F731F841F48F4879577956795B7959B
+:10040000F7959E3F08F0B3CF9395880F08F0992792
+:10041000EE0F979587950895E89409C097FB3EF4F1
+:1004200090958095709561957F4F8F4F9F4F992341
+:10043000A9F0F92F96E9BB279395F69587957795BF
+:100440006795B795F111F8CFFAF4BB0F11F460FF7F
+:100450001BC06F5F7F4F8F4F9F4F16C0882311F0D7
+:1004600096E911C0772321F09EE8872F762F05C0EB
+:10047000662371F096E8862F70E060E02AF09A9586
+:10048000660F771F881FDAF7880F9695879597F97B
+:10049000089585D080F09F3740F491110EF097C0F9
+:1004A00060E070E080E89FEB089526F41B16611D64
+:1004B000711D811D07C021C097F99F6780E870E01A
+:1004C00060E00895882371F4772321F09850872BFA
+:1004D000762F07C0662311F499270DC09051862B03
+:1004E00070E060E02AF09A95660F771F881FDAF7B0
+:1004F000880F9695879597F908959F3F31F0915011
+:1005000020F4879577956795B795880F911D9695F7
+:10051000879597F908959FEF80EC089500240A9439
+:100520001616170618060906089500240A941216CE
+:100530001306140605060895092E0394000C11F401
+:10054000882352F0BB0F40F4BF2B11F460FF04C0AE
+:100550006F5F7F4F8F4F9F4F089557FD9058440F07
+:10056000551F59F05F3F71F04795880F97FB991F12
+:1005700061F09F3F79F087950895121613061406CF
+:10058000551FF2CF4695F1DF08C01616170618065C
+:10059000991FF1CF86957105610508940895E5DFEF
+:1005A000A0F0BEE7B91788F4BB279F3860F4161691
+:1005B000B11D672F782F8827985FF7CF869577959D
+:1005C0006795B11D93959639C8F30895E894BB27B4
+:1005D00066277727CB0197F9089566D008F48FEF47
+:1005E00008950BD0A9CF9ADF28F09FDF18F095234C
+:1005F00009F062CF90CF1124EACFAFDFA0F3959F2F
+:10060000D1F3950F50E0551F629FF001729FBB27F9
+:10061000F00DB11D639FAA27F00DB11DAA1F649FA5
+:100620006627B00DA11D661F829F2227B00DA11D58
+:10063000621F739FB00DA11D621F839FA00D611DDE
+:10064000221F749F3327A00D611D231F849F600DFF
+:10065000211D822F762F6A2F11249F5750408AF038
+:10066000E1F088234AF0EE0FFF1FBB1F661F771FC4
+:10067000881F91505040A9F79E3F510570F01CCF44
+:10068000A6CF5F3FECF3983EDCF3869577956795B0
+:10069000B795F795E7959F5FC1F7FE2B880F911DE2
+:1006A0009695879597F90895990F0008550FAA0B0D
+:1006B000E0E8FEEF16161706E807F907C0F0121675
+:1006C0001306E407F50798F0621B730B840B950B78
+:1006D00039F40A2661F0232B242B252B21F40895CD
+:1006E0000A2609F4A140A6958FEF811D811D08956A
+:0406F000F894FFCFAC
+:1006F4000000000000006F12033B00000000000037
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.sh
new file mode 100755
index 0000000..cd9e818
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_blink.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_blink.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_blink_main.c -o led_blink -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_blink led_blink.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_blink.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink_main.c
new file mode 100755
index 0000000..bcf2661
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blink_main.c
@@ -0,0 +1,212 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_blink_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_blink_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[3];
+} led_blink_fmi2Component;
+
+led_blink_fmi2Component led_blink_component = {
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_blink_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_blink_component;
+}
+
+fmi2Status led_blink_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_blink_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 6);
+ return fmi2OK;
+}
+
+fmi2Status led_blink_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_blink_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_blink_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */ = (om_mod(comp->currentTime,2.0))>=(1.0); /* equation 3 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 6, comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */);
+}
+
+fmi2Status led_blink_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_blink_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_blink_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_blink_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_blink_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_blink_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_blink_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue
new file mode 100755
index 0000000..75a1347
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.hex
new file mode 100755
index 0000000..05d7448
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.hex
@@ -0,0 +1,93 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E50088
+:100020000C9451000C9451000C9451000C94B400A9
+:100030000C9451000C9451000C9483000C945100CA
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0EAEAF5E002C0EA
+:1000800005900D92A031B107D9F721E0A0E1B1E0D0
+:1000900001C01D92A531B207E1F70E9433010C9413
+:1000A000D3020C9400008230910561F083309105F9
+:1000B00099F00197C9F416BC80916E00826080931C
+:1000C0006E0016C0109285001092840080916F001F
+:1000D000826080936F000CC01092B200809170001B
+:1000E00082608093700004C081E090E00E94D3029F
+:1000F00078949FB7F894809112019FBF8823C9F329
+:100100001092120108951F920F920FB60F921124B0
+:100110002F933F938F939F938091100190911101A2
+:10012000019690931101809310018091120181300A
+:1001300091F0209110013091110180911301909163
+:1001400014012817390738F081E0809312011092CA
+:100150001101109210019F918F913F912F910F905B
+:100160000FBE0F901F9018951F920F920FB60F920F
+:1001700011242F933F938F939F938091100190911F
+:100180001101019690931101809310018091120149
+:10019000813091F020911001309111018091130173
+:1001A000909114012817390738F081E080931201EB
+:1001B00010921101109210019F918F913F912F91F8
+:1001C0000F900FBE0F901F9018951F920F920FB6B1
+:1001D0000F9211242F933F938F939F93809110013F
+:1001E00090911101019690931101809310018091DB
+:1001F0001201813091F02091100130911101809114
+:100200001301909114012817390738F081E0809389
+:10021000120110921101109210019F918F913F9144
+:100220002F910F900FBE0F901F901895FC01219AEF
+:1002300085E290E09387828785B5836085BD21E064
+:1002400030E03587248782E090E09093140180931A
+:10025000130184B5826084BD89EF87BD3787268707
+:1002600080E090E00895CF92DF92EF92FF9280E0DD
+:1002700091E00E941601C12CD12C760160E070E063
+:10028000CB01609300017093010180930201909370
+:10029000030180910E0190910F010E945300E091A3
+:1002A0000A01F0910B018081826080838FEFC81A70
+:1002B000D80AE80AF80AC701B6010E94D8012FE659
+:1002C00032E143E05BE30E94660220E030E0A901F6
+:1002D0000E946C01D6CF5058BB27AA270E948301E9
+:1002E0000C942C020E941E0238F00E94250220F07D
+:1002F00039F49F3F19F426F40C941B020EF4E09598
+:10030000E7FB0C941502E92F0E943D0258F3BA173F
+:10031000620773078407950720F079F4A6F50C941B
+:100320005F020EF4E0950B2EBA2FA02D0B01B90140
+:1003300090010C01CA01A0011124FF27591B99F05B
+:10034000593F50F4503E68F11A16F040A22F232F67
+:10035000342F4427585FF3CF469537952795A795B7
+:10036000F0405395C9F77EF41F16BA0B620B730B5E
+:10037000840BBAF09150A1F0FF0FBB1F661F771FCF
+:10038000881FC2F70EC0BA0F621F731F841F48F484
+:10039000879577956795B795F7959E3F08F0B0CF0D
+:1003A0009395880F08F09927EE0F979587950895F4
+:1003B000E89409C097FB3EF49095809570956195FF
+:1003C0007F4F8F4F9F4F9923A9F0F92F96E9BB27B5
+:1003D0009395F695879577956795B795F111F8CF31
+:1003E000FAF4BB0F11F460FF1BC06F5F7F4F8F4F9C
+:1003F0009F4F16C0882311F096E911C0772321F092
+:100400009EE8872F762F05C0662371F096E8862F29
+:1004100070E060E02AF09A95660F771F881FDAF780
+:10042000880F9695879597F9089597F99F6780E8C3
+:1004300070E060E008959FEF80EC089500240A9436
+:100440001616170618060906089500240A941216AF
+:100450001306140605060895092E0394000C11F4E2
+:10046000882352F0BB0F40F4BF2B11F460FF04C08F
+:100470006F5F7F4F8F4F9F4F089557FD9058440FE8
+:10048000551F59F05F3F71F04795880F97FB991FF3
+:1004900061F09F3F79F087950895121613061406B0
+:1004A000551FF2CF4695F1DF08C01616170618063D
+:1004B000991FF1CF86957105610508940895E89418
+:1004C000BB2766277727CB0197F908950E94790209
+:1004D0000C942C020E941E0238F00E94250220F08B
+:1004E000952311F00C9415020C941B0211240C940A
+:1004F00060020E943D0270F3959FC1F3950F50E09A
+:10050000551F629FF001729FBB27F00DB11D639FC5
+:10051000AA27F00DB11DAA1F649F6627B00DA11D6B
+:10052000661F829F2227B00DA11D621F739FB00D11
+:10053000A11D621F839FA00D611D221F749F332781
+:10054000A00D611D231F849F600D211D822F762F1A
+:100550006A2F11249F5750409AF0F1F088234AF0F7
+:10056000EE0FFF1FBB1F661F771F881F9150504063
+:10057000A9F79E3F510580F00C9415020C9460027F
+:100580005F3FE4F3983ED4F3869577956795B795EA
+:10059000F795E7959F5FC1F7FE2B880F911D969504
+:0A05A000879597F90895F894FFCFAE
+:1005AA000000000000006F12033B00000000000082
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.sh
new file mode 100755
index 0000000..b2a9b7d
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_blue.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_blue.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_blue_main.c -o led_blue -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_blue led_blue.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_blue.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay
new file mode 100755
index 0000000..154b3fe
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.hex
new file mode 100755
index 0000000..eaa1eaa
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.hex
@@ -0,0 +1,100 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C940E015E
+:100020000C9451000C9451000C9451000C94DD0080
+:100030000C9451000C9451000C94AC000C945100A1
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E6E1F6E002C0F6
+:1000800005900D92A031B107D9F711E0A0E1B1E0E0
+:1000900001C01D92A531B107E1F70E945C010C94EB
+:1000A00009030C9400000F931F93CF93DF93EC018F
+:1000B00001E010E020E030E040EA50E4688179811E
+:1000C0008A819B810E94F00187FD02C000E010E060
+:1000D0001D830C838E859F858230910561F083306E
+:1000E000910599F00197C9F416BC80916E00826069
+:1000F00080936E0016C0109285001092840080914B
+:100100006F00826080936F000CC01092B2008091EB
+:10011000700082608093700004C081E090E00E94D3
+:10012000090378949FB7F894809112019FBF8823A8
+:10013000C9F310921201EA85FB858C819D81892B80
+:1001400019F08081826002C080818D7F8083DF9181
+:10015000CF911F910F9108951F920F920FB60F929A
+:1001600011242F933F938F939F938091100190912F
+:100170001101019690931101809310018091120159
+:10018000813091F020911001309111018091130183
+:10019000909114012817390738F081E080931201FB
+:1001A00010921101109210019F918F913F912F9108
+:1001B0000F900FBE0F901F9018951F920F920FB6C1
+:1001C0000F9211242F933F938F939F93809110014F
+:1001D00090911101019690931101809310018091EB
+:1001E0001201813091F02091100130911101809124
+:1001F0001301909114012817390738F081E080939A
+:10020000120110921101109210019F918F913F9154
+:100210002F910F900FBE0F901F9018951F920F9265
+:100220000FB60F9211242F933F938F939F9380913A
+:10023000100190911101019690931101809310018A
+:1002400080911201813091F02091100130911101C3
+:1002500080911301909114012817390738F081E03B
+:100260008093120110921101109210019F918F91B1
+:100270003F912F910F900FBE0F901F901895FC018A
+:10028000219A85E290E09387828785B5836085BD5A
+:1002900081E090E09587848722E030E0309314017C
+:1002A0002093130124B5226024BD29EF27BD978731
+:1002B000868780E090E00895CF92DF92EF92FF92E0
+:1002C00080E091E00E943F01C12CD12C760160E0DA
+:1002D00070E0CB01609300017093010180930201F3
+:1002E0009093030180E091E00E9453008FEFC81AC1
+:1002F000D80AE80AF80AC701B6010E94F4012FE6FD
+:1003000032E143E05BE30E94A60220E030E0A90175
+:100310000E948C01DFCF5058BB27AA270ED0DCC02B
+:10032000CDD030F0D2D020F031F49F3F11F41EF444
+:10033000C2C00EF4E095E7FBB8C0E92FDED080F331
+:10034000BA17620773078407950718F071F49EF5D2
+:10035000F6C00EF4E0950B2EBA2FA02D0B01B901BB
+:1003600090010C01CA01A0011124FF27591B99F02B
+:10037000593F50F4503E68F11A16F040A22F232F37
+:10038000342F4427585FF3CF469537952795A79587
+:10039000F0405395C9F77EF41F16BA0B620B730B2E
+:1003A000840BBAF09150A1F0FF0FBB1F661F771F9F
+:1003B000881FC2F70EC0BA0F621F731F841F48F454
+:1003C000879577956795B795F7959E3F08F0B3CFDA
+:1003D0009395880F08F09927EE0F979587950895C4
+:1003E00040D008F481E00895E89409C097FB3EF4FA
+:1003F00090958095709561957F4F8F4F9F4F992372
+:10040000A9F0F92F96E9BB279395F69587957795EF
+:100410006795B795F111F8CFFAF4BB0F11F460FFAF
+:100420001BC06F5F7F4F8F4F9F4F16C0882311F007
+:1004300096E911C0772321F09EE8872F762F05C01B
+:10044000662371F096E8862F70E060E02AF09A95B6
+:10045000660F771F881FDAF7880F9695879597F9AB
+:100460000895990F0008550FAA0BE0E8FEEF161645
+:100470001706E807F907C0F012161306E407F50798
+:1004800098F0621B730B840B950B39F40A2661F00C
+:10049000232B242B252B21F408950A2609F4A140AF
+:1004A000A6958FEF811D811D089597F99F6780E8BC
+:1004B00070E060E008959FEF80EC089500240A94B6
+:1004C0001616170618060906089500240A9412162F
+:1004D0001306140605060895092E0394000C11F462
+:1004E000882352F0BB0F40F4BF2B11F460FF04C00F
+:1004F0006F5F7F4F8F4F9F4F089557FD9058440F68
+:10050000551F59F05F3F71F04795880F97FB991F72
+:1005100061F09F3F79F0879508951216130614062F
+:10052000551FF2CF4695F1DF08C0161617061806BC
+:10053000991FF1CF86957105610508940895E89497
+:10054000BB2766277727CB0197F908950BD0C4CF37
+:10055000B5DF28F0BADF18F0952309F0A6CFABCFAE
+:100560001124EECFCADFA0F3959FD1F3950F50E091
+:10057000551F629FF001729FBB27F00DB11D639F55
+:10058000AA27F00DB11DAA1F649F6627B00DA11DFB
+:10059000661F829F2227B00DA11D621F739FB00DA1
+:1005A000A11D621F839FA00D611D221F749F332711
+:1005B000A00D611D231F849F600D211D822F762FAA
+:1005C0006A2F11249F5750408AF0E1F088234AF0A7
+:1005D000EE0FFF1FBB1F661F771F881F91505040F3
+:1005E000A9F79E3F510570F060CFAACF5F3FECF3B3
+:1005F000983EDCF3869577956795B795F795E795DF
+:100600009F5FC1F7FE2B880F911D9695879597F9EF
+:060610000895F894FFCFED
+:100616000000000001006F12033B00000000000014
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.sh
new file mode 100755
index 0000000..53c7838
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_blue_delay.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_blue_delay.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_blue_delay_main.c -o led_blue_delay -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_blue_delay led_blue_delay.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_blue_delay.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay_main.c
new file mode 100755
index 0000000..80930a6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_delay_main.c
@@ -0,0 +1,212 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_blue_delay_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_blue_delay_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[3];
+} led_blue_delay_fmi2Component;
+
+led_blue_delay_fmi2Component led_blue_delay_component = {
+ .fmi2BooleanVars = {
+ fmi2True /*booleanExpression1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_blue_delay_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_blue_delay_component;
+}
+
+fmi2Status led_blue_delay_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_blue_delay_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status led_blue_delay_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_blue_delay_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_blue_delay_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */ = (comp->currentTime)<(5.0); /* equation 3 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */);
+}
+
+fmi2Status led_blue_delay_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_blue_delay_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_blue_delay_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_blue_delay_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_blue_delay_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_blue_delay_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_blue_delay_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_main.c
new file mode 100755
index 0000000..048f6c8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_main.c
@@ -0,0 +1,212 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_blue_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_blue_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[3];
+} led_blue_fmi2Component;
+
+led_blue_fmi2Component led_blue_component = {
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_blue_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_blue_component;
+}
+
+fmi2Status led_blue_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_blue_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status led_blue_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_blue_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_blue_functionOutputs(fmi2Component comp)
+{
+ Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, fmi2True);
+}
+
+fmi2Status led_blue_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_blue_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_blue_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_blue_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_blue_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_blue_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_blue_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red
new file mode 100755
index 0000000..c608b41
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.hex
new file mode 100755
index 0000000..e95094d
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.hex
@@ -0,0 +1,108 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94340138
+:100020000C9451000C9451000C9451000C94030159
+:100030000C9451000C9451000C94D2000C9451007B
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0EEE8F6E002C0E7
+:1000800005900D92A431B107D9F721E0A4E1B1E0C8
+:1000900001C01D92A931B207E1F70E9485010C94BD
+:1000A00045030C940000CF92DF92EF92FF920F93E2
+:1000B0001F93CF93DF93EC01C880D980EA80FB8047
+:1000C00001E010E020E030E040EA50E4C701B60172
+:1000D0000E94210287FD02C000E010E01D830C8316
+:1000E00001E010E020E030E040E051E4C701B6015B
+:1000F0000E94210287FD02C000E010E01F830E83F2
+:100100008A899B898230910561F08330910599F04D
+:100110000197C9F416BC80916E00826080936E00D6
+:1001200016C0109285001092840080916F0082604A
+:1001300080936F000CC01092B200809170008260BA
+:100140008093700004C081E090E00E9445037894A1
+:100150009FB7F894809116019FBF8823C9F310922E
+:100160001601EC85FD858C819D81892B19F080819C
+:10017000826002C080818D7F8083EE85FF858E81C5
+:100180009F81892B19F08081886002C08081877FE0
+:100190008083DF91CF911F910F91FF90EF90DF90BF
+:1001A000CF9008951F920F920FB60F9211242F93A4
+:1001B0003F938F939F938091140190911501019625
+:1001C000909315018093140180911601813091F074
+:1001D000209114013091150180911701909118011F
+:1001E0002817390738F081E0809316011092150125
+:1001F000109214019F918F913F912F910F900FBEFC
+:100200000F901F9018951F920F920FB60F92112406
+:100210002F933F938F939F93809114019091150199
+:1002200001969093150180931401809116018130FD
+:1002300091F0209114013091150180911701909156
+:1002400018012817390738F081E0809316011092C1
+:100250001501109214019F918F913F912F910F9052
+:100260000FBE0F901F9018951F920F920FB60F920E
+:1002700011242F933F938F939F938091140190911A
+:100280001501019690931501809314018091160138
+:10029000813091F020911401309115018091170166
+:1002A000909118012817390738F081E080931601E2
+:1002B00010921501109214019F918F913F912F91EF
+:1002C0000F900FBE0F901F901895FC01239A25E206
+:1002D00030E03787268785B5836085BD41E050E0F3
+:1002E000518B408B82E090E090931801809317012E
+:1002F00084B5826084BD89EF87BD538B428B219A80
+:100300003587248780E090E00895CF92DF92EF92C6
+:10031000FF9280E091E00E946501C12CD12C760112
+:1003200060E070E0CB016093000170930101809365
+:1003300002019093030180E091E00E9453008FEF4F
+:10034000C81AD80AE80AF80AC701B6010E942602AC
+:100350002FE632E143E05BE30E94D80220E030E088
+:10036000A9010E94B501DFCF5058BB27AA270E94E0
+:10037000CC010C949E020E94900238F00E949702D9
+:1003800020F039F49F3F19F426F40C948D020EF4FA
+:10039000E095E7FB0C948702E92F0E94AF0258F327
+:1003A000BA17620773078407950720F079F4A6F55A
+:1003B0000C94D1020EF4E0950B2EBA2FA02D0B0158
+:1003C000B90190010C01CA01A0011124FF27591B9A
+:1003D00099F0593F50F4503E68F11A16F040A22FA0
+:1003E000232F342F4427585FF3CF46953795279511
+:1003F000A795F0405395C9F77EF41F16BA0B620B10
+:10040000730B840BBAF09150A1F0FF0FBB1F661F56
+:10041000771F881FC2F70EC0BA0F621F731F841F99
+:1004200048F4879577956795B795F7959E3F08F0BF
+:10043000B0CF9395880F08F09927EE0F9795879581
+:1004400008950E94630208F481E00895E89409C0C9
+:1004500097FB3EF490958095709561957F4F8F4FF7
+:100460009F4F9923A9F0F92F96E9BB279395F6950D
+:10047000879577956795B795F111F8CFFAF4BB0F8B
+:1004800011F460FF1BC06F5F7F4F8F4F9F4F16C0EF
+:10049000882311F096E911C0772321F09EE8872F79
+:1004A000762F05C0662371F096E8862F70E060E035
+:1004B0002AF09A95660F771F881FDAF7880F9695AE
+:1004C000879597F90895990F0008550FAA0BE0E852
+:1004D000FEEF16161706E807F907C0F01216130606
+:1004E000E407F50798F0621B730B840B950B39F446
+:1004F0000A2661F0232B242B252B21F408950A26AC
+:1005000009F4A140A6958FEF811D811D089597F9EB
+:100510009F6780E870E060E008959FEF80EC0895A9
+:1005200000240A94161617061806090608950024D2
+:100530000A9412161306140605060895092E03944C
+:10054000000C11F4882352F0BB0F40F4BF2B11F4C0
+:1005500060FF04C06F5F7F4F8F4F9F4F089557FD1F
+:100560009058440F551F59F05F3F71F04795880F21
+:1005700097FB991F61F09F3F79F0879508951216B8
+:1005800013061406551FF2CF4695F1DF08C0161664
+:1005900017061806991FF1CF869571056105089415
+:1005A0000895E894BB2766277727CB0197F908952C
+:1005B0000E94EB020C949E020E94900238F00E946E
+:1005C000970220F0952311F00C9487020C948D0271
+:1005D00011240C94D2020E94AF0270F3959FC1F3D4
+:1005E000950F50E0551F629FF001729FBB27F00DE1
+:1005F000B11D639FAA27F00DB11DAA1F649F662736
+:10060000B00DA11D661F829F2227B00DA11D621F84
+:10061000739FB00DA11D621F839FA00D611D221F3E
+:10062000749F3327A00D611D231F849F600D211D22
+:10063000822F762F6A2F11249F5750409AF0F1F0A5
+:1006400088234AF0EE0FFF1FBB1F661F771F881F0E
+:1006500091505040A9F79E3F510580F00C948702BD
+:100660000C94D2025F3FE4F3983ED4F386957795DD
+:100670006795B795F795E7959F5FC1F7FE2B880FB4
+:0E068000911D9695879597F90895F894FFCFF0
+:10068E0000000000010001006F12033B000000009B
+:04069E000000000058
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.sh
new file mode 100755
index 0000000..7de1e2c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_blue_red.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_blue_red.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_blue_red_main.c -o led_blue_red -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_blue_red led_blue_red.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_blue_red.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red_main.c
new file mode 100755
index 0000000..c9668e8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_blue_red_main.c
@@ -0,0 +1,215 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_blue_red_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_blue_red_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[2];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[4];
+} led_blue_red_fmi2Component;
+
+led_blue_red_fmi2Component led_blue_red_component = {
+ .fmi2BooleanVars = {
+ fmi2True /*booleanExpression1._y*/,
+ fmi2True /*booleanExpression2._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_blue_red_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_blue_red_component;
+}
+
+fmi2Status led_blue_red_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_blue_red_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* digitalWriteBoolean2._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 4);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ return fmi2OK;
+}
+
+fmi2Status led_blue_red_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_blue_red_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_blue_red_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */ = (comp->currentTime)<(5.0); /* equation 4 */
+ comp->fmi2BooleanVars[1] /* booleanExpression2._y DISCRETE */ = (comp->currentTime)<(8.0); /* equation 5 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[1] /* digitalWriteBoolean2._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 4, comp->fmi2BooleanVars[1] /* booleanExpression2._y DISCRETE */);
+}
+
+fmi2Status led_blue_red_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_blue_red_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_blue_red_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_blue_red_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_blue_red_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_blue_red_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_blue_red_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink
new file mode 100755
index 0000000..424aaf8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.hex
new file mode 100755
index 0000000..d512cd3
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.hex
@@ -0,0 +1,131 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C942C0140
+:100020000C9451000C9451000C9451000C94FB0062
+:100030000C9451000C9451000C94CA000C94510083
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0ECE0F8E002C0EF
+:1000800005900D92A031B107D9F721E0A0E1B1E0D0
+:1000900001C01D92A531B207E1F70E947A010C94CC
+:1000A00004040C940000CF92DF92EF92FF920F9322
+:1000B0001F93CF93DF93EC01C880D980EA80FB8047
+:1000C0002DEC3CEC4CE45EE3C701B6010E94160245
+:1000D0000E94C5022DEC3CEC4CE45EE30E947303ED
+:1000E0009B01AC01C701B6010E94A90101E010E02B
+:1000F0002DEC3CEC4CEC5DE30E946E0387FF02C0EC
+:1001000000E010E01D830C838E859F858230910571
+:1001100061F08330910599F00197C9F416BC809184
+:100120006E00826080936E0016C01092850010925F
+:10013000840080916F00826080936F000CC01092E9
+:10014000B2008091700082608093700004C081E0F2
+:1001500090E00E94040478949FB7F8948091120173
+:100160009FBF8823C9F310921201EA85FB858C8119
+:100170009D81892B19F08081826002C080818D7FF2
+:100180008083DF91CF911F910F91FF90EF90DF90CF
+:10019000CF9008951F920F920FB60F9211242F93B4
+:1001A0003F938F939F93809110019091110101963D
+:1001B000909311018093100180911201813091F090
+:1001C000209110013091110180911301909114013F
+:1001D0002817390738F081E080931201109211013D
+:1001E000109210019F918F913F912F910F900FBE10
+:1001F0000F901F9018951F920F920FB60F92112417
+:100200002F933F938F939F938091100190911101B1
+:100210000196909311018093100180911201813019
+:1002200091F0209110013091110180911301909172
+:1002300014012817390738F081E0809312011092D9
+:100240001101109210019F918F913F912F910F906A
+:100250000FBE0F901F9018951F920F920FB60F921E
+:1002600011242F933F938F939F938091100190912E
+:100270001101019690931101809310018091120158
+:10028000813091F020911001309111018091130182
+:10029000909114012817390738F081E080931201FA
+:1002A00010921101109210019F918F913F912F9107
+:1002B0000F900FBE0F901F901895FC0185B58360BD
+:1002C00085BD21E030E03587248782E090E090937F
+:1002D00014018093130184B5826084BD89EF87BDCA
+:1002E00037872687219A85E290E09387828780E08E
+:1002F00090E00895CF92DF92EF92FF9280E091E03C
+:100300000E945D01C12CD12C760160E070E0CB0130
+:1003100060930001709301018093020190930301A7
+:1003200080E091E00E9453008FEFC81AD80AE80AD3
+:10033000F80AC701B6010E9488022FE632E143E0C5
+:100340005BE30E94730320E030E0A9010E94AA0150
+:10035000DFCF5058BB27AA270E94C1010C941C0371
+:100360000E940E0338F00E94150320F039F49F3FDD
+:1003700019F426F40C940B030EF4E095E7FB0C94AF
+:10038000DC02E92F0E942D0358F3BA1762077307A6
+:100390008407950720F079F4A6F50C9467030EF412
+:1003A000E0950B2EBA2FA02D0B01B90190010C0185
+:1003B000CA01A0011124FF27591B99F0593F50F49D
+:1003C000503E68F11A16F040A22F232F342F4427F5
+:1003D000585FF3CF469537952795A795F0405395ED
+:1003E000C9F77EF41F16BA0B620B730B840BBAF0BD
+:1003F0009150A1F0FF0FBB1F661F771F881FC2F728
+:100400000EC0BA0F621F731F841F48F4879577953B
+:100410006795B795F7959E3F08F0B0CF9395880FF5
+:1004200008F09927EE0F9795879508950E942A0264
+:100430000C941C030E94150358F00E940E0340F018
+:1004400029F45F3F29F00C94DC0251110C946803ED
+:100450000C940B030E942D0368F39923B1F35523E9
+:1004600091F3951B550BBB27AA27621773078407C7
+:1004700038F09F5F5F4F220F331F441FAA1FA9F35D
+:1004800035D00E2E3AF0E0E832D091505040E6954B
+:10049000001CCAF72BD0FE2F29D0660F771F881FAC
+:1004A000BB1F261737074807AB07B0E809F0BB0B9F
+:1004B000802DBF01FF2793585F4F3AF09E3F5105B3
+:1004C00078F00C94DC020C9468035F3FE4F3983EF0
+:1004D000D4F3869577956795B795F7959F5FC9F79C
+:1004E000880F911D9695879597F90895E1E0660F1D
+:1004F000771F881FBB1F621773078407BA0720F096
+:10050000621B730B840BBA0BEE1F88F7E0950895FE
+:10051000E89409C097FB3EF490958095709561959D
+:100520007F4F8F4F9F4F9923A9F0F92F96E9BB2753
+:100530009395F695879577956795B795F111F8CFCF
+:10054000FAF4BB0F11F460FF1BC06F5F7F4F8F4F3A
+:100550009F4F16C0882311F096E911C0772321F030
+:100560009EE8872F762F05C0662371F096E8862FC8
+:1005700070E060E02AF09A95660F771F881FDAF71F
+:10058000880F9695879597F908950E944F0390F0EC
+:100590009F3748F4911116F00C94680360E070E006
+:1005A00080E89FEB089526F41B16611D711D811DC7
+:1005B0000C94E2020C94FD0297F99F6780E870E0CA
+:1005C00060E00895882371F4772321F09850872BF9
+:1005D000762F07C0662311F499270DC09051862B02
+:1005E00070E060E02AF09A95660F771F881FDAF7AF
+:1005F000880F9695879597F908959F3F31F0915010
+:1006000020F4879577956795B795880F911D9695F6
+:10061000879597F908959FEF80EC089500240A9438
+:100620001616170618060906089500240A941216CD
+:100630001306140605060895092E0394000C11F400
+:10064000882352F0BB0F40F4BF2B11F460FF04C0AD
+:100650006F5F7F4F8F4F9F4F089557FD9058440F06
+:10066000551F59F05F3F71F04795880F97FB991F11
+:1006700061F09F3F79F087950895121613061406CE
+:10068000551FF2CF4695F1DF08C01616170618065B
+:10069000991FF1CF869571056105089408950E9410
+:1006A0003503A0F0BEE7B91788F4BB279F3860F484
+:1006B0001616B11D672F782F8827985FF7CF86957C
+:1006C00077956795B11D93959639C8F30895E89489
+:1006D000BB2766277727CB0197F908950E94E0038F
+:1006E00008F48FEF08950E9486030C941C030E9467
+:1006F0000E0338F00E94150320F0952311F00C949E
+:10070000DC020C940B0311240C9468030E942D034B
+:1007100070F3959FC1F3950F50E0551F629FF00154
+:10072000729FBB27F00DB11D639FAA27F00DB11D6D
+:10073000AA1F649F6627B00DA11D661F829F2227F6
+:10074000B00DA11D621F739FB00DA11D621F839F7D
+:10075000A00D611D221F749F3327A00D611D231F53
+:10076000849F600D211D822F762F6A2F11249F57A1
+:1007700050409AF0F1F088234AF0EE0FFF1FBB1FA4
+:10078000661F771F881F91505040A9F79E3F510563
+:1007900080F00C94DC020C9468035F3FE4F3983E15
+:1007A000D4F3869577956795B795F795E7959F5F0D
+:1007B000C1F7FE2B880F911D9695879597F908959F
+:1007C000990F0008550FAA0BE0E8FEEF1616170662
+:1007D000E807F907C0F012161306E407F50798F0CA
+:1007E000621B730B840B950B39F40A2661F0232BE3
+:1007F000242B252B21F408950A2609F4A140A6955F
+:0C0800008FEF811D811D0895F894FFCF3B
+:10080C000000000000006F12033B0000000000001D
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.sh
new file mode 100755
index 0000000..a30543c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_green_blink.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_green_blink.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_green_blink_main.c -o led_green_blink -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_green_blink led_green_blink.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_green_blink.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink_main.c
new file mode 100755
index 0000000..5999083
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/led_green_blink_main.c
@@ -0,0 +1,212 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_green_blink_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_green_blink_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[3];
+} led_green_blink_fmi2Component;
+
+led_green_blink_fmi2Component led_green_blink_component = {
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_green_blink_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_green_blink_component;
+}
+
+fmi2Status led_green_blink_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_green_blink_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ return fmi2OK;
+}
+
+fmi2Status led_green_blink_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_green_blink_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_green_blink_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */ = (om_mod(comp->currentTime,0.2))>=(0.1); /* equation 3 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[0] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[0] /* booleanExpression1._y DISCRETE */);
+}
+
+fmi2Status led_green_blink_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_green_blink_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_green_blink_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_green_blink_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_green_blink_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_green_blink_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_green_blink_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blink.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blink.mos
new file mode 100755
index 0000000..0ff4be4
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blink.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_blink, fileNamePrefix="led_blink");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue.mos
new file mode 100755
index 0000000..8b26945
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_blue, fileNamePrefix="led_blue");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_delay.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_delay.mos
new file mode 100755
index 0000000..62b9250
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_delay.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_blue_delay, fileNamePrefix="led_blue_delay");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_red.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_red.mos
new file mode 100755
index 0000000..f60dfc6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_blue_red.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_blue_red, fileNamePrefix="led_blue_red");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_green_blink.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_green_blink.mos
new file mode 100755
index 0000000..eeb79c1
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/led/runMDD_led_green_blink.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_green_blink, fileNamePrefix="led_green_blink");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold
new file mode 100755
index 0000000..3b86efe
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.hex
new file mode 100755
index 0000000..2d477aa
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.hex
@@ -0,0 +1,150 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E30189
+:100020000C9451000C9451000C9451000C94B201AA
+:100030000C9451000C9451000C9481010C945100CB
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0ECEFF8E002C0E0
+:1000800005900D92A834B107D9F721E0A8E4B1E0BA
+:1000900001C01D92AD34B207E1F70E944A020C94F0
+:1000A0007C040C9400004F925F926F927F928F922B
+:1000B0009F92AF92BF92CF92DF92EF92FF920F93F7
+:1000C0001F93CF93DF93EC0180917C00857E82604B
+:1000D00080937C0080917A00806480937A00809184
+:1000E0007A0086FDFCCF609178007091790080E005
+:1000F00090E00E94580320E030E040E854E40E9481
+:10010000EB0320E030EC4FE754E40E94E6026B0181
+:100110007C016C837D838E839F8311E028A939A99C
+:100120004AA95BA90E94E60387FD10E0812F90E0B9
+:100130009FA38EA3111104C0812C912C540106C0E1
+:10014000812C912C90E8A92E9FE3B92E8C869D8658
+:10015000AE86BF8601E010E02CA93DA94EA95FA99B
+:10016000C501B4010E94E60387FF02C000E010E071
+:1001700019A308A311E02CA53DA54EA55FA5C701B5
+:10018000B6010E94E60387FD10E0812F90E09DA359
+:100190008CA3111104C0412C512C320106C0412CFA
+:1001A000512C80E8682E8FE3782E488659866A861F
+:1001B0007B8601E010E0A5019401C301B2010E9419
+:1001C000E603181614F000E010E01F8F0E8F11E008
+:1001D00028A539A54AA55BA5C701B6010E94E6037B
+:1001E00087FD10E0812F90E09BA38AA3111104C02A
+:1001F00060E070E0CB0104C060E070E080E89FE365
+:10020000688B798B8A8B9B8B01E010E0A3019201B4
+:100210000E94E603181614F000E010E01D8F0C8F0A
+:10022000FE01EA5BFF4F808191818230910561F090
+:100230008330910599F00197C9F416BC80916E0046
+:10024000826080936E0016C0109285001092840028
+:1002500080916F00826080936F000CC01092B2009A
+:100260008091700082608093700004C081E090E013
+:100270000E947C0478949FB7F89480914A019FBFB4
+:100280008823C9F310924A01EEADFFAD8C8D9D8D90
+:10029000892B19F08081826002C080818D7F8083EC
+:1002A000FE01E05CFF4F0190F081E02D8E8D9F8D6F
+:1002B000892B19F08081846002C080818B7F8083CC
+:1002C000FE01EE5BFF4F0190F081E02D88A199A126
+:1002D000892B19F08081886002C08081877F8083AC
+:1002E000DF91CF911F910F91FF90EF90DF90CF9012
+:1002F000BF90AF909F908F907F906F905F904F9046
+:1003000008951F920F920FB60F9211242F933F93CF
+:100310008F939F938091480190914901019690930A
+:1003200049018093480180914A01813091F02091E8
+:1003300048013091490180914B0190914C0128175F
+:10034000390738F081E080934A01109249011092F8
+:1003500048019F918F913F912F910F900FBE0F9069
+:100360001F9018951F920F920FB60F9211242F9382
+:100370003F938F939F9380914801909149010196FB
+:10038000909349018093480180914A01813091F016
+:10039000209148013091490180914B0190914C018D
+:1003A0002817390738F081E080934A0110924901FB
+:1003B000109248019F918F913F912F910F900FBE06
+:1003C0000F901F9018951F920F920FB60F92112445
+:1003D0002F933F938F939F93809148019091490170
+:1003E0000196909349018093480180914A018130A0
+:1003F00091F0209148013091490180914B019091F9
+:100400004C012817390738F081E080934A01109297
+:100410004901109248019F918F913F912F910F9028
+:100420000FBE0F901F901895ECE7F0E02081206C34
+:100430002083EAE7F0E0208127682083FC0115AEE5
+:1004400014AE239AEE5BFF4F25E230E03183208328
+:10045000229A329731832083219AFC0137AF26AF4D
+:1004600025B5236025BDEC5BFF4F41E050E0518393
+:10047000408322E030E030934C0120934B0124B5BF
+:10048000226024BD29EF27BD32965183408380E04E
+:1004900090E00895CF92DF92EF92FF9280E091E09A
+:1004A0000E941402C12CD12C760160E070E0CB01D7
+:1004B0006093000170930101809302019093030106
+:1004C00080E091E00E9453008FEFC81AD80AE80A32
+:1004D000F80AC701B6010E9458032FE632E143E053
+:1004E0005BE30E94EB0320E030E0A9010E947A0266
+:1004F000DFCF5058BB27AA270E9491020C94AC036F
+:100500000E949E0338F00E94A50320F039F49F3F1B
+:1005100019F426F40C949B030EF4E095E7FB0C947D
+:100520009503E92F0E94BD0358F3BA1762077307BA
+:100530008407950720F079F4A6F50C94DF030EF4F8
+:10054000E0950B2EBA2FA02D0B01B90190010C01E3
+:10055000CA01A0011124FF27591B99F0593F50F4FB
+:10056000503E68F11A16F040A22F232F342F442753
+:10057000585FF3CF469537952795A795F04053954B
+:10058000C9F77EF41F16BA0B620B730B840BBAF01B
+:100590009150A1F0FF0FBB1F661F771F881FC2F786
+:1005A0000EC0BA0F621F731F841F48F4879577959A
+:1005B0006795B795F7959E3F08F0B0CF9395880F54
+:1005C00008F09927EE0F9795879508950E94FA02F3
+:1005D0000C94AC030E94A50358F00E949E0340F0C7
+:1005E00029F45F3F29F00C94950351110C94E0031A
+:1005F0000C949B030E94BD0368F39923B1F3552328
+:1006000091F3951B550BBB27AA2762177307840725
+:1006100038F09F5F5F4F220F331F441FAA1FA9F3BB
+:1006200035D00E2E3AF0E0E832D091505040E695A9
+:10063000001CCAF72BD0FE2F29D0660F771F881F0A
+:10064000BB1F261737074807AB07B0E809F0BB0BFD
+:10065000802DBF01FF2793585F4F3AF09E3F510511
+:1006600078F00C9495030C94E0035F3FE4F3983E1C
+:10067000D4F3869577956795B795F7959F5FC9F7FA
+:10068000880F911D9695879597F90895E1E0660F7B
+:10069000771F881FBB1F621773078407BA0720F0F4
+:1006A000621B730B840BBA0BEE1F88F7E09508955D
+:1006B000E89409C097FB3EF49095809570956195FC
+:1006C0007F4F8F4F9F4F9923A9F0F92F96E9BB27B2
+:1006D0009395F695879577956795B795F111F8CF2E
+:1006E000FAF4BB0F11F460FF1BC06F5F7F4F8F4F99
+:1006F0009F4F16C0882311F096E911C0772321F08F
+:100700009EE8872F762F05C0662371F096E8862F26
+:1007100070E060E02AF09A95660F771F881FDAF77D
+:10072000880F9695879597F9089597F99F6780E8C0
+:1007300070E060E008959FEF80EC089500240A9433
+:100740001616170618060906089500240A941216AC
+:100750001306140605060895092E0394000C11F4DF
+:10076000882352F0BB0F40F4BF2B11F460FF04C08C
+:100770006F5F7F4F8F4F9F4F089557FD9058440FE5
+:10078000551F59F05F3F71F04795880F97FB991FF0
+:1007900061F09F3F79F087950895121613061406AD
+:1007A000551FF2CF4695F1DF08C01616170618063A
+:1007B000991FF1CF86957105610508940895E89415
+:1007C000BB2766277727CB0197F908950E94580425
+:1007D00008F48FEF08950E94FE030C94AC030E946E
+:1007E0009E0338F00E94A50320F0952311F00C948D
+:1007F00095030C949B0311240C94E0030E94BD0309
+:1008000070F3959FC1F3950F50E0551F629FF00163
+:10081000729FBB27F00DB11D639FAA27F00DB11D7C
+:10082000AA1F649F6627B00DA11D661F829F222705
+:10083000B00DA11D621F739FB00DA11D621F839F8C
+:10084000A00D611D221F749F3327A00D611D231F62
+:10085000849F600D211D822F762F6A2F11249F57B0
+:1008600050409AF0F1F088234AF0EE0FFF1FBB1FB3
+:10087000661F771F881F91505040A9F79E3F510572
+:1008800080F00C9495030C94E0035F3FE4F3983EF2
+:10089000D4F3869577956795B795F795E7959F5F1C
+:1008A000C1F7FE2B880F911D9695879597F90895AE
+:1008B000990F0008550FAA0BE0E8FEEF1616170671
+:1008C000E807F907C0F012161306E407F50798F0D9
+:1008D000621B730B840B950B39F40A2661F0232BF2
+:1008E000242B252B21F408950A2609F4A140A6956E
+:0C08F0008FEF811D811D0895F894FFCF4B
+:1008FC0000000000000000000000000000000000EC
+:10090C0000000000000000000000000000000000DB
+:10091C000000000000000000000000000000A043E8
+:10092C00000061440000003F6F12033B0000000018
+:08093C000000000000000000B3
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.sh
new file mode 100755
index 0000000..cbebfb4
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_pot_threshold.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_pot_threshold.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections pot_threshold_main.c -o pot_threshold -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom pot_threshold pot_threshold.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:pot_threshold.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold_main.c
new file mode 100755
index 0000000..537dcbd
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/pot_threshold_main.c
@@ -0,0 +1,264 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct pot_threshold_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct pot_threshold_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Real fmi2RealVars[6];
+ fmi2Boolean fmi2BooleanVars[6];
+ fmi2Real fmi2RealParameter[5];
+ void* extObjs[6];
+} pot_threshold_fmi2Component;
+
+pot_threshold_fmi2Component pot_threshold_component = {
+ .fmi2RealVars = {
+ 0.0 /*adc._y*/,
+ 0.0 /*greater1._u1*/,
+ 0.0 /*greater1._u2*/,
+ 0.0 /*greater2._u1*/,
+ 0.0 /*realExpression1._y*/,
+ 0.0 /*realExpression2._y*/,
+ },
+ .fmi2BooleanVars = {
+ fmi2False /*digitalWriteBoolean1._u*/,
+ fmi2False /*digitalWriteBoolean2._u*/,
+ fmi2False /*digitalWriteBoolean3._u*/,
+ fmi2False /*greaterEqualThreshold1._y*/,
+ fmi2False /*greaterEqualThreshold2._y*/,
+ fmi2False /*greaterEqualThreshold3._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.0 /*greaterEqualThreshold1._threshold*/,
+ 320.0 /*greaterEqualThreshold2._threshold*/,
+ 900.0 /*greaterEqualThreshold3._threshold*/,
+ 0.5 /*realToBoolean1._threshold*/,
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+static const char * const OMCLIT0 = "ElectricPotential";
+static const char * const OMCLIT1 = "V";
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+#include "MDDAVRAnalog.h"
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution)
+{
+ fmi2Real om_value;
+ om_value = MDD_avr_analog_read(om_analogPort, om_vref, om_voltageResolution);
+ return om_value;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage)
+{
+ void* om_avr;
+ om_avr = MDD_avr_analog_init(om_divisionFactor, om_referenceVoltage);
+ return om_avr;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr)
+{
+ MDD_avr_analog_close(om_avr);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component pot_threshold_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &pot_threshold_component;
+}
+
+fmi2Status pot_threshold_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status pot_threshold_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* adc._analog EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Analog.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(comp, 7, 4);
+ comp->extObjs[3] /* digitalWriteBoolean3._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 4);
+ comp->extObjs[2] /* digitalWriteBoolean2._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 3);
+ comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[4] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status pot_threshold_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status pot_threshold_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status pot_threshold_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2RealVars[0] /* adc._y variable */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(comp, 3, 1024.0, 10); /* equation 14 */
+ comp->fmi2BooleanVars[5] /* greaterEqualThreshold3._y DISCRETE */ = (comp->fmi2RealVars[0] /* adc._y variable */)>=(comp->fmi2RealParameter[2] /* greaterEqualThreshold3._threshold PARAM */); /* equation 15 */
+ comp->fmi2RealVars[2] /* greater1._u2 variable */ = (comp->fmi2BooleanVars[5] /* greaterEqualThreshold3._y DISCRETE */) ? (1.0) : (0.0); /* equation 16 */
+ comp->fmi2BooleanVars[2] /* digitalWriteBoolean3._u DISCRETE */ = (comp->fmi2RealVars[2] /* greater1._u2 variable */)>=(comp->fmi2RealParameter[3] /* realToBoolean1._threshold PARAM */); /* equation 17 */
+ comp->fmi2BooleanVars[4] /* greaterEqualThreshold2._y DISCRETE */ = (comp->fmi2RealVars[0] /* adc._y variable */)>=(comp->fmi2RealParameter[1] /* greaterEqualThreshold2._threshold PARAM */); /* equation 18 */
+ comp->fmi2RealVars[1] /* greater1._u1 variable */ = (comp->fmi2BooleanVars[4] /* greaterEqualThreshold2._y DISCRETE */) ? (1.0) : (0.0); /* equation 19 */
+ comp->fmi2BooleanVars[1] /* digitalWriteBoolean2._u DISCRETE */ = (comp->fmi2RealVars[1] /* greater1._u1 variable */)>(comp->fmi2RealVars[2] /* greater1._u2 variable */); /* equation 20 */
+ comp->fmi2BooleanVars[3] /* greaterEqualThreshold1._y DISCRETE */ = (comp->fmi2RealVars[0] /* adc._y variable */)>=(comp->fmi2RealParameter[0] /* greaterEqualThreshold1._threshold PARAM */); /* equation 21 */
+ comp->fmi2RealVars[3] /* greater2._u1 variable */ = (comp->fmi2BooleanVars[3] /* greaterEqualThreshold1._y DISCRETE */) ? (1.0) : (0.0); /* equation 22 */
+ comp->fmi2BooleanVars[0] /* digitalWriteBoolean1._u DISCRETE */ = (comp->fmi2RealVars[3] /* greater2._u1 variable */)>(comp->fmi2RealVars[1] /* greater1._u1 variable */); /* equation 23 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[5] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[0] /* digitalWriteBoolean1._u DISCRETE */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[2] /* digitalWriteBoolean2._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 3, comp->fmi2BooleanVars[1] /* digitalWriteBoolean2._u DISCRETE */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[3] /* digitalWriteBoolean3._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 4, comp->fmi2BooleanVars[2] /* digitalWriteBoolean3._u DISCRETE */);
+}
+
+fmi2Status pot_threshold_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ pot_threshold_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = pot_threshold_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ pot_threshold_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ pot_threshold_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ pot_threshold_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = pot_threshold_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/runMDD_pot_threshold.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/runMDD_pot_threshold.mos
new file mode 100755
index 0000000..457b89c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/pot/runMDD_pot_threshold.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_pot.MDD_pot_threshold, fileNamePrefix="pot_threshold");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button
new file mode 100755
index 0000000..a9402e5
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.hex
new file mode 100755
index 0000000..0059548
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.hex
@@ -0,0 +1,94 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94FB0072
+:100020000C9451000C9451000C9451000C94CA0093
+:100030000C9451000C9451000C9499000C945100B4
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E6EAF5E002C0EE
+:1000800005900D92A631B107D9F711E0A6E1B1E0D4
+:1000900001C01D92AB31B107E1F70E944C010C94F5
+:1000A000D1020C940000DC0154968D919C915597DF
+:1000B0008230910561F08330910599F00197C9F480
+:1000C00016BC80916E00826080936E0016C0109204
+:1000D00085001092840080916F00826080936F0091
+:1000E0000CC01092B200809170008260809370000A
+:1000F00004C081E090E00E94D10278949FB7F89408
+:10010000809118019FBF8823C9F31092180150965F
+:10011000ED91FC91519718968D919C9119970097AC
+:1001200021F0808182608083089580818D7F80832B
+:1001300008951F920F920FB60F9211242F933F93A1
+:100140008F939F9380911601909117010196909340
+:1001500017018093160180911801813091F0209150
+:100160001601309117018091190190911A012817F9
+:10017000390738F081E0809318011092170110922E
+:1001800016019F918F913F912F910F900FBE0F906D
+:100190001F9018951F920F920FB60F9211242F9354
+:1001A0003F938F939F938091160190911701019631
+:1001B000909317018093160180911801813091F07E
+:1001C00020911601309117018091190190911A0127
+:1001D0002817390738F081E0809318011092170131
+:1001E000109216019F918F913F912F910F900FBE0A
+:1001F0000F901F9018951F920F920FB60F92112417
+:100200002F933F938F939F938091160190911701A5
+:100210000196909317018093160180911801813007
+:1002200091F0209116013091170180911901909160
+:100230001A012817390738F081E0809318011092CD
+:100240001701109216019F918F913F912F910F905E
+:100250000FBE0F901F901895FC01219A85E290E047
+:10026000918B808B24989787868785B5836085BD21
+:1002700081E090E0938B828B22E030E030931A0192
+:100280002093190124B5226024BD29EF27BD958B49
+:10029000848B80E090E00895CF92DF92EF92FF92FE
+:1002A00080E091E00E942C01C12CD12C760160E00D
+:1002B00070E0CB0160930001709301018093020113
+:1002C0009093030180E091E00E9453008FEFC81AE1
+:1002D000D80AE80AF80AC701B6010E94E0012FE631
+:1002E00032E143E05BE30E946E0220E030E0A901CE
+:1002F0000E947C01DFCF5058BB27AA270ED0B4C084
+:10030000A5D030F0AAD020F031F49F3F11F41EF4B4
+:100310009AC00EF4E095E7FB90C0E92FB6D080F3C9
+:10032000BA17620773078407950718F071F49EF5F2
+:10033000CEC00EF4E0950B2EBA2FA02D0B01B90103
+:1003400090010C01CA01A0011124FF27591B99F04B
+:10035000593F50F4503E68F11A16F040A22F232F57
+:10036000342F4427585FF3CF469537952795A795A7
+:10037000F0405395C9F77EF41F16BA0B620B730B4E
+:10038000840BBAF09150A1F0FF0FBB1F661F771FBF
+:10039000881FC2F70EC0BA0F621F731F841F48F474
+:1003A000879577956795B795F7959E3F08F0B3CFFA
+:1003B0009395880F08F09927EE0F979587950895E4
+:1003C000E89409C097FB3EF49095809570956195EF
+:1003D0007F4F8F4F9F4F9923A9F0F92F96E9BB27A5
+:1003E0009395F695879577956795B795F111F8CF21
+:1003F000FAF4BB0F11F460FF1BC06F5F7F4F8F4F8C
+:100400009F4F16C0882311F096E911C0772321F081
+:100410009EE8872F762F05C0662371F096E8862F19
+:1004200070E060E02AF09A95660F771F881FDAF770
+:10043000880F9695879597F9089597F99F6780E8B3
+:1004400070E060E008959FEF80EC089500240A9426
+:100450001616170618060906089500240A9412169F
+:100460001306140605060895092E0394000C11F4D2
+:10047000882352F0BB0F40F4BF2B11F460FF04C07F
+:100480006F5F7F4F8F4F9F4F089557FD9058440FD8
+:10049000551F59F05F3F71F04795880F97FB991FE3
+:1004A00061F09F3F79F087950895121613061406A0
+:1004B000551FF2CF4695F1DF08C01616170618062D
+:1004C000991FF1CF86957105610508940895E89408
+:1004D000BB2766277727CB0197F908950BD0C4CFA8
+:1004E000B5DF28F0BADF18F0952309F0A6CFABCF1F
+:1004F0001124EECFCADFA0F3959FD1F3950F50E002
+:10050000551F629FF001729FBB27F00DB11D639FC5
+:10051000AA27F00DB11DAA1F649F6627B00DA11D6B
+:10052000661F829F2227B00DA11D621F739FB00D11
+:10053000A11D621F839FA00D611D221F749F332781
+:10054000A00D611D231F849F600D211D822F762F1A
+:100550006A2F11249F5750408AF0E1F088234AF017
+:10056000EE0FFF1FBB1F661F771F881F9150504063
+:10057000A9F79E3F510570F060CFAACF5F3FECF323
+:10058000983EDCF3869577956795B795F795E7954F
+:100590009F5FC1F7FE2B880F911D9695879597F960
+:0605A0000895F894FFCF5E
+:1005A600000000000000000000006F12033B000086
+:0605B6000000000000003F
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.sh
new file mode 100755
index 0000000..1428171
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_led_push_button.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_led_push_button.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections led_push_button_main.c -o led_push_button -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom led_push_button led_push_button.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:led_push_button.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button_main.c
new file mode 100755
index 0000000..7b155ad
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/led_push_button_main.c
@@ -0,0 +1,234 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct led_push_button_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct led_push_button_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[3];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[4];
+} led_push_button_fmi2Component;
+
+led_push_button_fmi2Component led_push_button_component = {
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ fmi2False /*booleanExpression2._y*/,
+ fmi2False /*digitalReadBoolean1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline fmi2Boolean Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_read(fmi2Component comp, void* om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_destructor(fmi2Component comp, void* om_digital);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Boolean Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_read(fmi2Component comp, void* om_port, fmi2Integer om_pin)
+{
+ fmi2Boolean om_b;
+ om_b = MDD_avr_digital_pin_read(om_port, om_pin);
+ return om_b;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2False);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component led_push_button_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &led_push_button_component;
+}
+
+fmi2Status led_push_button_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status led_push_button_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 2, 2);
+ comp->extObjs[0] /* digitalReadBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitRead */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(comp, 2, 5);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status led_push_button_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status led_push_button_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status led_push_button_functionOutputs(fmi2Component comp)
+{
+ Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 2, comp->fmi2BooleanVars[2] /* digitalReadBoolean1._y DISCRETE */);
+}
+
+fmi2Status led_push_button_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ led_push_button_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = led_push_button_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ led_push_button_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ led_push_button_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ led_push_button_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = led_push_button_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status
new file mode 100755
index 0000000..5b91980
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.hex
new file mode 100755
index 0000000..ab8dde5
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.hex
@@ -0,0 +1,91 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E50088
+:100020000C9451000C9451000C9451000C94B400A9
+:100030000C9451000C9451000C9483000C945100CA
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E8E7F5E002C0EF
+:1000800005900D92A431B107D9F711E0A4E1B1E0D8
+:1000900001C01D92A931B107E1F70E9433010C9410
+:1000A000BA020C9400008230910561F08330910512
+:1000B00099F00197C9F416BC80916E00826080931C
+:1000C0006E0016C0109285001092840080916F001F
+:1000D000826080936F000CC01092B200809170001B
+:1000E00082608093700004C081E090E00E94BA02B8
+:1000F00078949FB7F894809116019FBF8823C9F325
+:100100001092160108951F920F920FB60F921124AC
+:100110002F933F938F939F9380911401909115019A
+:1001200001969093150180931401809116018130FE
+:1001300091F0209114013091150180911701909157
+:1001400018012817390738F081E0809316011092C2
+:100150001501109214019F918F913F912F910F9053
+:100160000FBE0F901F9018951F920F920FB60F920F
+:1001700011242F933F938F939F938091140190911B
+:100180001501019690931501809314018091160139
+:10019000813091F020911401309115018091170167
+:1001A000909118012817390738F081E080931601E3
+:1001B00010921501109214019F918F913F912F91F0
+:1001C0000F900FBE0F901F9018951F920F920FB6B1
+:1001D0000F9211242F933F938F939F93809114013B
+:1001E00090911501019690931501809314018091CF
+:1001F0001601813091F02091140130911501809108
+:100200001701909118012817390738F081E0809381
+:10021000160110921501109214019F918F913F9138
+:100220002F910F900FBE0F901F901895FC012498EE
+:1002300083E290E09787868785B5836085BD81E0FE
+:1002400090E0918B808B22E030E030931801209376
+:10025000170124B5226024BD29EF27BD938B828B23
+:1002600080E090E00895CF92DF92EF92FF9280E0DD
+:1002700091E00E941601C12CD12C760160E070E063
+:10028000CB01609300017093010180930201909370
+:10029000030180911201909113010E9453008FEF8E
+:1002A000C81AD80AE80AF80AC701B6010E94C901AB
+:1002B0002FE632E143E05BE30E94570220E030E0AA
+:1002C000A9010E946501DDCF5058BB27AA270ED097
+:1002D000B4C0A5D030F0AAD020F031F49F3F11F483
+:1002E0001EF49AC00EF4E095E7FB90C0E92FB6D05B
+:1002F00080F3BA17620773078407950718F071F443
+:100300009EF5CEC00EF4E0950B2EBA2FA02D0B015A
+:10031000B90190010C01CA01A0011124FF27591B4A
+:1003200099F0593F50F4503E68F11A16F040A22F50
+:10033000232F342F4427585FF3CF469537952795C1
+:10034000A795F0405395C9F77EF41F16BA0B620BC0
+:10035000730B840BBAF09150A1F0FF0FBB1F661F07
+:10036000771F881FC2F70EC0BA0F621F731F841F4A
+:1003700048F4879577956795B795F7959E3F08F070
+:10038000B3CF9395880F08F09927EE0F979587952F
+:100390000895E89409C097FB3EF490958095709578
+:1003A00061957F4F8F4F9F4F9923A9F0F92F96E9C1
+:1003B000BB279395F695879577956795B795F11136
+:1003C000F8CFFAF4BB0F11F460FF1BC06F5F7F4FD3
+:1003D0008F4F9F4F16C0882311F096E911C07723E5
+:1003E00021F09EE8872F762F05C0662371F096E8EE
+:1003F000862F70E060E02AF09A95660F771F881FBD
+:10040000DAF7880F9695879597F9089597F99F677A
+:1004100080E870E060E008959FEF80EC089500248C
+:100420000A941616170618060906089500240A9459
+:1004300012161306140605060895092E0394000CDF
+:1004400011F4882352F0BB0F40F4BF2B11F460FF6E
+:1004500004C06F5F7F4F8F4F9F4F089557FD905897
+:10046000440F551F59F05F3F71F04795880F97FB78
+:10047000991F61F09F3F79F0879508951216130632
+:100480001406551FF2CF4695F1DF08C01616170661
+:100490001806991FF1CF8695710561050894089596
+:1004A000E894BB2766277727CB0197F908950BD0EF
+:1004B000C4CFB5DF28F0BADF18F0952309F0A6CF36
+:1004C000ABCF1124EECFCADFA0F3959FD1F3950FE8
+:1004D00050E0551F629FF001729FBB27F00DB11DC8
+:1004E000639FAA27F00DB11DAA1F649F6627B00D58
+:1004F000A11D661F829F2227B00DA11D621F739F41
+:10050000B00DA11D621F839FA00D611D221F749F4E
+:100510003327A00D611D231F849F600D211D822F95
+:10052000762F6A2F11249F5750408AF0E1F08823DC
+:100530004AF0EE0FFF1FBB1F661F771F881F9150E9
+:100540005040A9F79E3F510570F060CFAACF5F3FA2
+:10055000ECF3983EDCF3869577956795B795F7951C
+:10056000E7959F5FC1F7FE2B880F911D96958795A4
+:0805700097F90895F894FFCFFC
+:1005780000000000000000006F12033B01000000B3
+:04058800000000006F
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.sh
new file mode 100755
index 0000000..404eced
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_push_button_status.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_push_button_status.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections push_button_status_main.c -o push_button_status -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom push_button_status push_button_status.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:push_button_status.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status_main.c
new file mode 100755
index 0000000..f732e8a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/push_button_status_main.c
@@ -0,0 +1,219 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct push_button_status_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct push_button_status_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Boolean fmi2BooleanVars[2];
+ fmi2Real fmi2RealParameter[1];
+ fmi2Boolean fmi2BooleanParameter[1];
+ void* extObjs[3];
+} push_button_status_fmi2Component;
+
+push_button_status_fmi2Component push_button_status_component = {
+ .fmi2BooleanVars = {
+ fmi2False /*booleanValue1._active*/,
+ fmi2False /*digitalReadBoolean1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+ .fmi2BooleanParameter = {
+ fmi2True /*booleanValue1._use_activePort*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+
+static inline fmi2Boolean Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_read(fmi2Component comp, void* om_port, fmi2Integer om_pin);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Boolean Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_read(fmi2Component comp, void* om_port, fmi2Integer om_pin)
+{
+ fmi2Boolean om_b;
+ om_b = MDD_avr_digital_pin_read(om_port, om_pin);
+ return om_b;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2False);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component push_button_status_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &push_button_status_component;
+}
+
+fmi2Status push_button_status_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status push_button_status_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* digitalReadBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitRead */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitRead_constructor(comp, 2, 5);
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status push_button_status_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status push_button_status_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status push_button_status_functionOutputs(fmi2Component comp)
+{
+ Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);
+}
+
+fmi2Status push_button_status_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ push_button_status_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = push_button_status_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ push_button_status_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ push_button_status_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ push_button_status_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = push_button_status_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_led_push_button.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_led_push_button.mos
new file mode 100755
index 0000000..3e2d70f
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_led_push_button.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_push.MDD_led_push_button, fileNamePrefix="led_push_button");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_push_button_status.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_push_button_status.mos
new file mode 100755
index 0000000..c8b8d45
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/push/runMDD_push_button_status.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_push.MDD_push_button_status, fileNamePrefix="push_button_status");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_init.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_init.mos
new file mode 100755
index 0000000..be5ff81
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_init.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_servo.MDD_servo_init, fileNamePrefix="servo_init");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_loop.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_loop.mos
new file mode 100755
index 0000000..23b035f
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_loop.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_servo.MDD_servo_loop, fileNamePrefix="servo_loop");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_pot.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_pot.mos
new file mode 100755
index 0000000..a7e6ac1
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_pot.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_servo.MDD_servo_pot, fileNamePrefix="servo_pot");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_reverse.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_reverse.mos
new file mode 100755
index 0000000..4d6b950
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/runMDD_servo_reverse.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_servo.MDD_servo_reverse, fileNamePrefix="servo_reverse");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init
new file mode 100755
index 0000000..ba1b63b
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.hex
new file mode 100755
index 0000000..667f2cc
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.hex
@@ -0,0 +1,94 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E50088
+:100020000C9451000C9451000C9451000C94B400A9
+:100030000C9451000C9451000C9483000C945100CA
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E6EAF5E002C0EE
+:1000800005900D92A231B107D9F711E0A2E1B1E0DC
+:1000900001C01D92A731B107E1F70E9443010C9402
+:1000A000D1020C9400008230910561F083309105FB
+:1000B00099F00197C9F416BC80916E00826080931C
+:1000C0006E0016C0109285001092840080916F001F
+:1000D000826080936F000CC01092B200809170001B
+:1000E00082608093700004C081E090E00E94D102A1
+:1000F00078949FB7F894809114019FBF8823C9F327
+:100100001092140108951F920F920FB60F921124AE
+:100110002F933F938F939F9380911201909113019E
+:100120000196909313018093120180911401813004
+:1001300091F020911201309113018091150190915D
+:1001400016012817390738F081E0809314011092C6
+:100150001301109212019F918F913F912F910F9057
+:100160000FBE0F901F9018951F920F920FB60F920F
+:1001700011242F933F938F939F938091120190911D
+:100180001301019690931301809312018091140141
+:10019000813091F02091120130911301809115016D
+:1001A000909116012817390738F081E080931401E7
+:1001B00010921301109212019F918F913F912F91F4
+:1001C0000F900FBE0F901F9018951F920F920FB6B1
+:1001D0000F9211242F933F938F939F93809112013D
+:1001E00090911301019690931301809312018091D5
+:1001F0001401813091F0209112013091130180910E
+:100200001501909116012817390738F081E0809385
+:10021000140110921301109212019F918F913F913E
+:100220002F910F900FBE0F901F901895FC01A1E821
+:10023000B0E08C918D608C9322E030E03387228790
+:10024000219AA0E8B0E08C9181688C93A8E8B0E096
+:1002500011961C921E921C92B587A48785B5836067
+:1002600085BD81E090E097878687309316012093C3
+:10027000150124B5226024BD29EF27BD918B808B09
+:1002800080E090E00895CF92DF92EF92FF92CF93BB
+:1002900080E091E00E941601C12CD12C760160E033
+:1002A00070E0CB01CEE16093000170930101809377
+:1002B00002019093030180911001909111010E941D
+:1002C0005300E0910C01F0910D01C0838FEFC81A2B
+:1002D000D80AE80AF80AC701B6010E94E0012FE631
+:1002E00032E143E05BE30E946E0220E030E0A901CE
+:1002F0000E947C01D8CF5058BB27AA270ED0B4C08B
+:10030000A5D030F0AAD020F031F49F3F11F41EF4B4
+:100310009AC00EF4E095E7FB90C0E92FB6D080F3C9
+:10032000BA17620773078407950718F071F49EF5F2
+:10033000CEC00EF4E0950B2EBA2FA02D0B01B90103
+:1003400090010C01CA01A0011124FF27591B99F04B
+:10035000593F50F4503E68F11A16F040A22F232F57
+:10036000342F4427585FF3CF469537952795A795A7
+:10037000F0405395C9F77EF41F16BA0B620B730B4E
+:10038000840BBAF09150A1F0FF0FBB1F661F771FBF
+:10039000881FC2F70EC0BA0F621F731F841F48F474
+:1003A000879577956795B795F7959E3F08F0B3CFFA
+:1003B0009395880F08F09927EE0F979587950895E4
+:1003C000E89409C097FB3EF49095809570956195EF
+:1003D0007F4F8F4F9F4F9923A9F0F92F96E9BB27A5
+:1003E0009395F695879577956795B795F111F8CF21
+:1003F000FAF4BB0F11F460FF1BC06F5F7F4F8F4F8C
+:100400009F4F16C0882311F096E911C0772321F081
+:100410009EE8872F762F05C0662371F096E8862F19
+:1004200070E060E02AF09A95660F771F881FDAF770
+:10043000880F9695879597F9089597F99F6780E8B3
+:1004400070E060E008959FEF80EC089500240A9426
+:100450001616170618060906089500240A9412169F
+:100460001306140605060895092E0394000C11F4D2
+:10047000882352F0BB0F40F4BF2B11F460FF04C07F
+:100480006F5F7F4F8F4F9F4F089557FD9058440FD8
+:10049000551F59F05F3F71F04795880F97FB991FE3
+:1004A00061F09F3F79F087950895121613061406A0
+:1004B000551FF2CF4695F1DF08C01616170618062D
+:1004C000991FF1CF86957105610508940895E89408
+:1004D000BB2766277727CB0197F908950BD0C4CFA8
+:1004E000B5DF28F0BADF18F0952309F0A6CFABCF1F
+:1004F0001124EECFCADFA0F3959FD1F3950F50E002
+:10050000551F629FF001729FBB27F00DB11D639FC5
+:10051000AA27F00DB11DAA1F649F6627B00DA11D6B
+:10052000661F829F2227B00DA11D621F739FB00D11
+:10053000A11D621F839FA00D611D221F749F332781
+:10054000A00D611D231F849F600D211D822F762F1A
+:100550006A2F11249F5750408AF0E1F088234AF017
+:10056000EE0FFF1FBB1F661F771F881F9150504063
+:10057000A9F79E3F510570F060CFAACF5F3FECF323
+:10058000983EDCF3869577956795B795F795E7954F
+:100590009F5FC1F7FE2B880F911D9695879597F960
+:0605A0000895F894FFCF5E
+:1005A6000000000000006F12033B00000000000086
+:0205B600000043
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.sh
new file mode 100755
index 0000000..a8c1413
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_servo_init.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_servo_init.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections servo_init_main.c -o servo_init -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom servo_init servo_init.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:servo_init.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init_main.c
new file mode 100755
index 0000000..b10d9af
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_init_main.c
@@ -0,0 +1,213 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct servo_init_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct servo_init_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[4];
+} servo_init_fmi2Component;
+
+servo_init_fmi2Component servo_init_component = {
+ .fmi2IntegerVars = {
+ 0 /*integerExpression1._y*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component servo_init_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &servo_init_component;
+}
+
+fmi2Status servo_init_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status servo_init_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status servo_init_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status servo_init_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status servo_init_functionOutputs(fmi2Component comp)
+{
+ Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, 30);
+}
+
+fmi2Status servo_init_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ servo_init_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = servo_init_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ servo_init_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ servo_init_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ servo_init_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = servo_init_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop.sh
new file mode 100755
index 0000000..4be3b84
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_servo_loop.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_servo_loop.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections servo_loop_main.c -o servo_loop -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom servo_loop servo_loop.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:servo_loop.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop_main.c
new file mode 100755
index 0000000..2eb1630
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_loop_main.c
@@ -0,0 +1,235 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct servo_loop_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct servo_loop_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[3];
+ fmi2Boolean fmi2BooleanVars[3];
+ fmi2Real fmi2RealParameter[1];
+ fmi2Integer fmi2IntegerParameter[1];
+ fmi2Boolean fmi2BooleanParameter[2];
+ fmi2String fmi2StringParameter[1];
+ void* extObjs[4];
+} servo_loop_fmi2Component;
+
+servo_loop_fmi2Component servo_loop_component = {
+ .fmi2IntegerVars = {
+ 0 /*integerExpression1._y*/,
+ 0 /*triggeredAdd1._local_set*/,
+ 0 /*triggeredAdd1._y*/,
+ },
+ .fmi2BooleanVars = {
+ fmi2False /*$whenCondition1*/,
+ fmi2False /*booleanExpression1._y*/,
+ fmi2False /*triggeredAdd1._local_reset*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+ .fmi2IntegerParameter = {
+ 0 /*triggeredAdd1._y_start*/,
+ },
+ .fmi2BooleanParameter = {
+ fmi2False /*triggeredAdd1._use_reset*/,
+ fmi2False /*triggeredAdd1._use_set*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component servo_loop_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &servo_loop_component;
+}
+
+fmi2Status servo_loop_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status servo_loop_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status servo_loop_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status servo_loop_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status servo_loop_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2BooleanVars[0] /* $whenCondition1 DISCRETE */ = (om_mod(comp->currentTime,0.2))>(0.1); /* equation 9 */
+
+ #error "[CodegenEmbeddedC.tpl:346:14-346:14] Unsupported equation: ..."
+
+ comp->fmi2BooleanVars[1] /* booleanExpression1._y DISCRETE */ = comp->fmi2BooleanVars[0] /* $whenCondition1 DISCRETE */; /* equation 11 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[2] /* triggeredAdd1._y DISCRETE */);
+}
+
+fmi2Status servo_loop_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ servo_loop_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = servo_loop_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ servo_loop_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ servo_loop_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ servo_loop_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = servo_loop_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot.sh
new file mode 100755
index 0000000..41f9d90
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_servo_pot.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_servo_pot.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections servo_pot_main.c -o servo_pot -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom servo_pot servo_pot.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:servo_pot.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot_main.c
new file mode 100755
index 0000000..4cb1705
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_pot_main.c
@@ -0,0 +1,244 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct servo_pot_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct servo_pot_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Real fmi2RealVars[1];
+ fmi2Integer fmi2IntegerVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[5];
+} servo_pot_fmi2Component;
+
+servo_pot_fmi2Component servo_pot_component = {
+ .fmi2RealVars = {
+ 0.0 /*adc._y*/,
+ },
+ .fmi2IntegerVars = {
+ 0 /*pwm._u[1]*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+static const char * const OMCLIT0 = "ElectricPotential";
+static const char * const OMCLIT1 = "V";
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution)
+{
+ fmi2Real om_value;
+ om_value = MDD_avr_analog_read(om_analogPort, om_vref, om_voltageResolution);
+ return om_value;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage)
+{
+ void* om_avr;
+ om_avr = MDD_avr_analog_init(om_divisionFactor, om_referenceVoltage);
+ return om_avr;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr)
+{
+ MDD_avr_analog_close(om_avr);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component servo_pot_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &servo_pot_component;
+}
+
+fmi2Status servo_pot_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status servo_pot_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[2] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[1] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[0] /* adc._analog EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Analog.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(comp, 7, 4);
+ comp->extObjs[3] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[4] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[3] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status servo_pot_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status servo_pot_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status servo_pot_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2RealVars[0] /* adc._y variable */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(comp, 3, 180.0, 10); /* equation 4 */
+ comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */ = ((comp->fmi2RealVars[0] /* adc._y variable */)>(0.0)) ? (((int)
+ #error "[CodegenEmbeddedC.tpl:490:28-490:28] daeExpCallBuiltin: Not supported: floor(0.5 + adc.y, 1)"
+ )) : (((int)
+ #error "[CodegenEmbeddedC.tpl:490:28-490:28] daeExpCallBuiltin: Not supported: ceil(-0.5 + adc.y, 3)"
+ )); /* equation 5 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[4] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[2] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */);
+}
+
+fmi2Status servo_pot_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ servo_pot_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = servo_pot_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ servo_pot_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ servo_pot_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ servo_pot_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = servo_pot_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse
new file mode 100755
index 0000000..67359ad
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.hex
new file mode 100755
index 0000000..565bd99
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.hex
@@ -0,0 +1,101 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94E50088
+:100020000C9451000C9451000C9451000C94B400A9
+:100030000C9451000C9451000C9483000C945100CA
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0ECE1F6E002C0F0
+:1000800005900D92A231B107D9F711E0A2E1B1E0DC
+:1000900001C01D92A731B107E1F70E9445010C9400
+:1000A0000C030C9400008230910561F083309105BF
+:1000B00099F00197C9F416BC80916E00826080931C
+:1000C0006E0016C0109285001092840080916F001F
+:1000D000826080936F000CC01092B200809170001B
+:1000E00082608093700004C081E090E00E940C0365
+:1000F00078949FB7F894809114019FBF8823C9F327
+:100100001092140108951F920F920FB60F921124AE
+:100110002F933F938F939F9380911201909113019E
+:100120000196909313018093120180911401813004
+:1001300091F020911201309113018091150190915D
+:1001400016012817390738F081E0809314011092C6
+:100150001301109212019F918F913F912F910F9057
+:100160000FBE0F901F9018951F920F920FB60F920F
+:1001700011242F933F938F939F938091120190911D
+:100180001301019690931301809312018091140141
+:10019000813091F02091120130911301809115016D
+:1001A000909116012817390738F081E080931401E7
+:1001B00010921301109212019F918F913F912F91F4
+:1001C0000F900FBE0F901F9018951F920F920FB6B1
+:1001D0000F9211242F933F938F939F93809112013D
+:1001E00090911301019690931301809312018091D5
+:1001F0001401813091F0209112013091130180910E
+:100200001501909116012817390738F081E0809385
+:10021000140110921301109212019F918F913F913E
+:100220002F910F900FBE0F901F901895FC01A1E821
+:10023000B0E08C918D608C9382E090E09387828710
+:10024000219AA0E8B0E08C9181688C93A8E8B0E096
+:1002500011961C921E921C92B587A48785B5836067
+:1002600085BD81E090E0978786872AE030E0309373
+:1002700016012093150124B5226024BD29EF27BD66
+:10028000918B808B80E090E00895CF92DF92EF9287
+:10029000FF9280E091E00E941601C12CD12C7601E2
+:1002A00060E070E0CB0160930001709301018093E6
+:1002B0000201909303012DEC3CEC4CE45EE30E94C0
+:1002C000F30187FF03C086E190E002C08FE090E079
+:1002D0009093050180930401809110019091110188
+:1002E0000E945300E0910C01F0910D0180910401F6
+:1002F00080838FEFC81AD80AE80AF80AC701B60146
+:100300000E94F7012FE632E143E05BE30E94A9027D
+:1003100020E030E0A9010E948F01C5CF5058BB27D3
+:10032000AA270ED0DCC0CDD030F0D2D020F031F4EE
+:100330009F3F11F41EF4C2C00EF4E095E7FBB8C075
+:10034000E92FDED080F3BA17620773078407950799
+:1003500018F071F49EF5F6C00EF4E0950B2EBA2F4E
+:10036000A02D0B01B90190010C01CA01A0011124BB
+:10037000FF27591B99F0593F50F4503E68F11A1667
+:10038000F040A22F232F342F4427585FF3CF4695F8
+:1003900037952795A795F0405395C9F77EF41F161A
+:1003A000BA0B620B730B840BBAF09150A1F0FF0FE4
+:1003B000BB1F661F771F881FC2F70EC0BA0F621FD0
+:1003C000731F841F48F4879577956795B795F795C0
+:1003D0009E3F08F0B3CF9395880F08F09927EE0F52
+:1003E00097958795089540D008F481E00895E894A2
+:1003F00009C097FB3EF490958095709561957F4F6D
+:100400008F4F9F4F9923A9F0F92F96E9BB2793951A
+:10041000F695879577956795B795F111F8CFFAF42A
+:10042000BB0F11F460FF1BC06F5F7F4F8F4F9F4F5B
+:1004300016C0882311F096E911C0772321F09EE8B9
+:10044000872F762F05C0662371F096E8862F70E01F
+:1004500060E02AF09A95660F771F881FDAF7880FF9
+:100460009695879597F90895990F0008550FAA0B4F
+:10047000E0E8FEEF16161706E807F907C0F01216B7
+:100480001306E407F50798F0621B730B840B950BBA
+:1004900039F40A2661F0232B242B252B21F408950F
+:1004A0000A2609F4A140A6958FEF811D811D0895AC
+:1004B00097F99F6780E870E060E008959FEF80EC17
+:1004C000089500240A9416161706180609060895BA
+:1004D00000240A9412161306140605060895092E20
+:1004E0000394000C11F4882352F0BB0F40F4BF2B8F
+:1004F00011F460FF04C06F5F7F4F8F4F9F4F0895CF
+:1005000057FD9058440F551F59F05F3F71F04795C4
+:10051000880F97FB991F61F09F3F79F087950895A9
+:10052000121613061406551FF2CF4695F1DF08C0C8
+:10053000161617061806991FF1CF869571056105E5
+:1005400008940895E894BB2766277727CB0197F98D
+:1005500008950BD0C4CFB5DF28F0BADF18F095238B
+:1005600009F0A6CFABCF1124EECFCADFA0F3959F41
+:10057000D1F3950F50E0551F629FF001729FBB278A
+:10058000F00DB11D639FAA27F00DB11DAA1F649F36
+:100590006627B00DA11D661F829F2227B00DA11DE9
+:1005A000621F739FB00DA11D621F839FA00D611D6F
+:1005B000221F749F3327A00D611D231F849F600D90
+:1005C000211D822F762F6A2F11249F5750408AF0C9
+:1005D000E1F088234AF0EE0FFF1FBB1F661F771F55
+:1005E000881F91505040A9F79E3F510570F060CF91
+:1005F000AACF5F3FECF3983EDCF38695779567953D
+:10060000B795F795E7959F5FC1F7FE2B880F911D72
+:0C0610009695879597F90895F894FFCF10
+:10061C000000000016000AD7233C00000000000078
+:02062C000000CC
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.sh
new file mode 100755
index 0000000..9c5927d
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_servo_reverse.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_servo_reverse.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections servo_reverse_main.c -o servo_reverse -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom servo_reverse servo_reverse.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:servo_reverse.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse_main.c
new file mode 100755
index 0000000..5382666
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/servo/servo_reverse_main.c
@@ -0,0 +1,213 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct servo_reverse_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct servo_reverse_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Integer fmi2IntegerVars[1];
+ fmi2Real fmi2RealParameter[1];
+ void* extObjs[4];
+} servo_reverse_fmi2Component;
+
+servo_reverse_fmi2Component servo_reverse_component = {
+ .fmi2IntegerVars = {
+ 22 /*pwm._u[1]*/,
+ },
+ .fmi2RealParameter = {
+ 0.01 /*synchronizeRealtime1._actualInterval*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(fmi2Component comp, void* om_pwm, fmi2Integer om_value)
+{
+ MDD_avr_pwm_set(om_pwm, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_pin, fmi2Integer om_initialValue, fmi2Boolean om_inverted)
+{
+ void* om_pwm;
+ om_pwm = MDD_avr_pwm_init(om_timer, om_pin, om_initialValue, om_inverted);
+ return om_pwm;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_destructor(fmi2Component comp, void* om_pwm)
+{
+ MDD_avr_pwm_close(om_pwm);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component servo_reverse_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &servo_reverse_component;
+}
+
+fmi2Status servo_reverse_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status servo_reverse_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 2, 7, fmi2True);
+ comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_Init_constructor(comp, comp->extObjs[0] /* pwm._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 1, 0, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 10);
+ return fmi2OK;
+}
+
+fmi2Status servo_reverse_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status servo_reverse_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status servo_reverse_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */ = ((comp->currentTime)<(0.2)) ? (22) : (15); /* equation 3 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_PWM_set(comp, comp->extObjs[1] /* pwm._pwm[1] EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.PWM.Init */, comp->fmi2IntegerVars[0] /* pwm._u[1] DISCRETE */);
+}
+
+fmi2Status servo_reverse_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ servo_reverse_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = servo_reverse_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ servo_reverse_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ servo_reverse_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ servo_reverse_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = servo_reverse_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_buzzer.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_buzzer.mos
new file mode 100755
index 0000000..8164089
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_buzzer.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/souradip/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/souradip/OpenModelica/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_thermistor.MDD_therm_buzzer, fileNamePrefix="therm_buzzer");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_read.mos b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_read.mos
new file mode 100755
index 0000000..41b3c3a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/runMDD_therm_read.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/siddharth/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/siddharth/OpenModelica_Tasks/OpenModelica-Arduino-MDD_Arduino_Revised/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_thermistor.MDD_therm_read, fileNamePrefix="therm_read");
+getErrorString();
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer
new file mode 100755
index 0000000..4c841f2
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.hex
new file mode 100755
index 0000000..2517195
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.hex
@@ -0,0 +1,121 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C9431013B
+:100020000C9451000C9451000C9451000C9400015C
+:100030000C9451000C9451000C94CF000C9451007E
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E2E4F7E002C0F6
+:1000800005900D92A832B107D9F711E0A8E2B1E0CE
+:1000900001C01D92AD32B107E1F70E948A010C94B4
+:1000A0009F030C9400000F931F93CF93DF93EC01F9
+:1000B00080917C00857E846080937C0080917A00B2
+:1000C000806480937A0080917A0086FDFCCF6091F5
+:1000D00078007091790080E090E00E94860220E034
+:1000E00030E040E854E40E94180320E030EC4FE791
+:1000F00054E40E941E026C837D838E839F8301E003
+:1001000010E02A893B894C895D890E94140387FF8E
+:1001100002C000E010E0198B088B8EA19FA18230F5
+:10012000910561F08330910599F00197C9F416BCEF
+:1001300080916E00826080936E0016C010928500E0
+:100140001092840080916F00826080936F000CC0D9
+:100150001092B2008091700082608093700004C0A1
+:1001600081E090E00E949F0378949FB7F89480917B
+:100170002A019FBF8823C9F310922A01EAA1FBA19B
+:1001800088899989892B19F08081886002C08081D3
+:10019000877F8083DF91CF911F910F9108951F92E8
+:1001A0000F920FB60F9211242F933F938F939F932B
+:1001B00080912801909129010196909329018093C3
+:1001C000280180912A01813091F0209128013091FD
+:1001D000290180912B0190912C012817390738F0C3
+:1001E00081E080932A0110922901109228019F91A9
+:1001F0008F913F912F910F900FBE0F901F901895E8
+:100200001F920F920FB60F9211242F933F938F934B
+:100210009F93809128019091290101969093290143
+:100220008093280180912A01813091F0209128014A
+:100230003091290180912B0190912C0128173907C9
+:1002400038F081E080932A01109229011092280150
+:100250009F918F913F912F910F900FBE0F901F9004
+:1002600018951F920F920FB60F9211242F933F9360
+:100270008F939F93809128019091290101969093EB
+:1002800029018093280180912A01813091F02091E9
+:1002900028013091290180912B0190912C01281780
+:1002A000390738F081E080932A01109229011092D9
+:1002B00028019F918F913F912F910F900FBE0F902A
+:1002C0001F901895FC01539A8BE290E093A382A3B0
+:1002D00085B5836085BD81E090E095A384A32AE085
+:1002E00030E030932C0120932B0124B5226024BDF3
+:1002F00029EF27BD97A386A3ACE7B0E08C918C9340
+:10030000AAE7B0E08C9187688C9311A210A280E0DC
+:1003100090E00895CF92DF92EF92FF9280E091E01B
+:100320000E946201C12CD12C760160E070E0CB010B
+:100330006093000170930101809302019093030187
+:1003400080E091E00E9453008FEFC81AD80AE80AB3
+:10035000F80AC701B6010E9486022FE632E143E0A7
+:100360005BE30E94180320E030E0A9010E94BA017B
+:10037000DFCF5058BB27AA270ED01CC10DD130F0BB
+:1003800012D120F031F49F3F11F41EF402C10EF49B
+:10039000E095E7FBF8C0E92F1ED180F3BA1762079A
+:1003A00073078407950718F071F49EF536C10EF4B3
+:1003B000E0950B2EBA2FA02D0B01B90190010C0175
+:1003C000CA01A0011124FF27591B99F0593F50F48D
+:1003D000503E68F11A16F040A22F232F342F4427E5
+:1003E000585FF3CF469537952795A795F0405395DD
+:1003F000C9F77EF41F16BA0B620B730B840BBAF0AD
+:100400009150A1F0FF0FBB1F661F771F881FC2F717
+:100410000EC0BA0F621F731F841F48F4879577952B
+:100420006795B795F7959E3F08F0B3CF9395880FE2
+:1004300008F09927EE0F9795879508950CD0BAC0CC
+:10044000B2D040F0A9D030F021F45F3F19F09BC04A
+:100450005111E4C09EC0BFD098F39923C9F355232E
+:10046000B1F3951B550BBB27AA27621773078407A7
+:1004700038F09F5F5F4F220F331F441FAA1FA9F35D
+:1004800033D00E2E3AF0E0E830D091505040E6954F
+:10049000001CCAF729D0FE2F27D0660F771F881FB0
+:1004A000BB1F261737074807AB07B0E809F0BB0B9F
+:1004B000802DBF01FF2793585F4F2AF09E3F5105C3
+:1004C00068F061C0ABC05F3FECF3983EDCF386950B
+:1004D00077956795B795F7959F5FC9F7880F911D39
+:1004E0009695879597F90895E1E0660F771F881F25
+:1004F000BB1F621773078407BA0720F0621B730BD8
+:10050000840BBA0BEE1F88F7E0950895E89409C0B4
+:1005100097FB3EF490958095709561957F4F8F4F36
+:100520009F4F9923A9F0F92F96E9BB279395F6954C
+:10053000879577956795B795F111F8CFFAF4BB0FCA
+:1005400011F460FF1BC06F5F7F4F8F4F9F4F16C02E
+:10055000882311F096E911C0772321F09EE8872FB8
+:10056000762F05C0662371F096E8862F70E060E074
+:100570002AF09A95660F771F881FDAF7880F9695ED
+:10058000879597F9089597F99F6780E870E060E094
+:1005900008959FEF80EC089500240A94161617061C
+:1005A00018060906089500240A9412161306140664
+:1005B00005060895092E0394000C11F4882352F0C7
+:1005C000BB0F40F4BF2B11F460FF04C06F5F7F4F7F
+:1005D0008F4F9F4F089557FD9058440F551F59F066
+:1005E0005F3F71F04795880F97FB991F61F09F3F20
+:1005F00079F087950895121613061406551FF2CF49
+:100600004695F1DF08C0161617061806991FF1CF98
+:1006100086957105610508940895E894BB276627BF
+:100620007727CB0197F9089566D008F48FEF0895E6
+:100630000BD0C0CFB1DF28F0B6DF18F0952309F05A
+:10064000A2CFA7CF1124EACFC6DFA0F3959FD1F3A5
+:10065000950F50E0551F629FF001729FBB27F00D70
+:10066000B11D639FAA27F00DB11DAA1F649F6627C5
+:10067000B00DA11D661F829F2227B00DA11D621F14
+:10068000739FB00DA11D621F839FA00D611D221FCE
+:10069000749F3327A00D611D231F849F600D211DB2
+:1006A000822F762F6A2F11249F5750408AF0E1F055
+:1006B00088234AF0EE0FFF1FBB1F661F771F881F9E
+:1006C00091505040A9F79E3F510570F05CCFA6CFE6
+:1006D0005F3FECF3983EDCF3869577956795B79589
+:1006E000F795E7959F5FC1F7FE2B880F911D9695B3
+:1006F000879597F90895990F0008550FAA0BE0E820
+:10070000FEEF16161706E807F907C0F012161306D3
+:10071000E407F50798F0621B730B840B950B39F413
+:100720000A2661F0232B242B252B21F408950A2679
+:1007300009F4A140A6958FEF811D811D0895F894BD
+:02074000FFCFE9
+:1007420000000000000000000000000000000000A7
+:10075200000000806D440AD7233C02000100000023
+:0807620000000000000000008F
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.sh
new file mode 100755
index 0000000..b6782eb
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_therm_buzzer.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_therm_buzzer.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections therm_buzzer_main.c -o therm_buzzer -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom therm_buzzer therm_buzzer.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:therm_buzzer.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer_main.c
new file mode 100755
index 0000000..d729be2
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_buzzer_main.c
@@ -0,0 +1,253 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct therm_buzzer_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct therm_buzzer_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Real fmi2RealVars[2];
+ fmi2Boolean fmi2BooleanVars[3];
+ fmi2Real fmi2RealParameter[2];
+ fmi2Integer fmi2IntegerParameter[1];
+ fmi2Boolean fmi2BooleanParameter[1];
+ fmi2String fmi2StringParameter[1];
+ void* extObjs[4];
+} therm_buzzer_fmi2Component;
+
+therm_buzzer_fmi2Component therm_buzzer_component = {
+ .fmi2RealVars = {
+ 0.0 /*adc._y*/,
+ 0.0 /*realValue1._number*/,
+ },
+ .fmi2BooleanVars = {
+ fmi2False /*booleanExpression1._y*/,
+ fmi2False /*booleanExpression2._y*/,
+ fmi2False /*digitalWriteBoolean1._u*/,
+ },
+ .fmi2RealParameter = {
+ 950.0 /*greaterEqualThreshold1._threshold*/,
+ 0.01 /*synchronizeRealtime1._actualInterval*/,
+ },
+ .fmi2IntegerParameter = {
+ 2 /*realValue1._significantDigits*/,
+ },
+ .fmi2BooleanParameter = {
+ fmi2True /*realValue1._use_numberPort*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+static const char * const OMCLIT0 = "ElectricPotential";
+static const char * const OMCLIT1 = "V";
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRDigital.h"
+#include "MDDAVRAnalog.h"
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution)
+{
+ fmi2Real om_value;
+ om_value = MDD_avr_analog_read(om_analogPort, om_vref, om_voltageResolution);
+ return om_value;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage)
+{
+ void* om_avr;
+ om_avr = MDD_avr_analog_init(om_divisionFactor, om_referenceVoltage);
+ return om_avr;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr)
+{
+ MDD_avr_analog_close(om_avr);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(fmi2Component comp, void* om_port, fmi2Integer om_pin, fmi2Boolean om_value)
+{
+ MDD_avr_digital_pin_write(om_port, om_pin, om_value);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(fmi2Component comp, fmi2Integer om_port, fmi2Integer om_pin)
+{
+ void* om_dig;
+ om_dig = MDD_avr_digital_pin_init(om_port, om_pin, fmi2True);
+ return om_dig;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_destructor(fmi2Component comp, void* om_digital)
+{
+ MDD_avr_digital_pin_close(om_digital);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component therm_buzzer_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &therm_buzzer_component;
+}
+
+fmi2Status therm_buzzer_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status therm_buzzer_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_InitWrite_constructor(comp, 4, 4);
+ comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[2] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 10);
+ comp->extObjs[0] /* adc._analog EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Analog.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(comp, 7, 1);
+ return fmi2OK;
+}
+
+fmi2Status therm_buzzer_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status therm_buzzer_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status therm_buzzer_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2RealVars[0] /* adc._y variable */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(comp, 5, 1024.0, 10); /* equation 7 */
+ comp->fmi2BooleanVars[2] /* digitalWriteBoolean1._u DISCRETE */ = (comp->fmi2RealVars[0] /* adc._y variable */)>=(comp->fmi2RealParameter[0] /* greaterEqualThreshold1._threshold PARAM */); /* equation 8 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[3] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Digital_write(comp, comp->extObjs[1] /* digitalWriteBoolean1._digital EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Digital.InitWrite */, 4, comp->fmi2BooleanVars[2] /* digitalWriteBoolean1._u DISCRETE */);
+}
+
+fmi2Status therm_buzzer_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ therm_buzzer_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = therm_buzzer_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ therm_buzzer_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ therm_buzzer_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ therm_buzzer_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = therm_buzzer_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read
new file mode 100755
index 0000000..a70feab
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.hex b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.hex
new file mode 100755
index 0000000..c10a513
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.hex
@@ -0,0 +1,114 @@
+:100000000C9434000C9451000C9451000C94510049
+:100010000C9451000C9451000C9451000C94130159
+:100020000C9451000C9451000C9451000C94E2007B
+:100030000C9451000C9451000C94B1000C9451009C
+:100040000C9451000C9451000C9451000C945100EC
+:100050000C9451000C9451000C9451000C945100DC
+:100060000C9451000C94510011241FBECFEFD8E026
+:10007000DEBFCDBF11E0A0E0B1E0E6EEF6E002C0E9
+:1000800005900D92AC31B107D9F721E0ACE1B1E0B8
+:1000900001C01D92A132B207E1F70E9468010C94E1
+:1000A00071030C940000CF93DF93EC0190917C00DE
+:1000B000957E956090937C0080917A008064809317
+:1000C0007A0080917A0086FDFCCF60917800709173
+:1000D000790080E090E00E94760220E030E040E885
+:1000E00054E40E94040320E030EC4FE754E40E9403
+:1000F00004026C837D838E839F838A8D9B8D8230E7
+:10010000910561F08330910599F00197C9F416BC0F
+:1001100080916E00826080936E0016C01092850000
+:100120001092840080916F00826080936F000CC0F9
+:100130001092B2008091700082608093700004C0C1
+:1001400081E090E00E94710378949FB7F8948091C9
+:100150001E019FBF8823C9F310921E01DF91CF912A
+:1001600008951F920F920FB60F9211242F933F9371
+:100170008F939F9380911C0190911D010196909304
+:100180001D0180931C0180911E01813091F020910E
+:100190001C0130911D0180911F01909120012817B1
+:1001A000390738F081E080931E0110921D011092F2
+:1001B0001C019F918F913F912F910F900FBE0F9037
+:1001C0001F9018951F920F920FB60F9211242F9324
+:1001D0003F938F939F9380911C0190911D010196F5
+:1001E00090931D0180931C0180911E01813091F03C
+:1001F00020911C0130911D0180911F0190912001DF
+:100200002817390738F081E080931E0110921D01F4
+:1002100010921C019F918F913F912F910F900FBED3
+:100220000F901F9018951F920F920FB60F921124E6
+:100230002F933F938F939F9380911C0190911D0169
+:10024000019690931D0180931C0180911E018130C5
+:1002500091F020911C0130911D0180911F0190911E
+:1002600020012817390738F081E080931E01109291
+:100270001D0110921C019F918F913F912F910F9022
+:100280000FBE0F901F901895FC01ACE7B0E08C9169
+:10029000806C8C93AAE7B0E08C9187688C93178A66
+:1002A000168A85B5836085BD21E030E0318F208FCF
+:1002B00082E090E09093200180931F0184B58260DA
+:1002C00084BD89EF87BD338F228F80E090E0089551
+:1002D000CF92DF92EF92FF9280E091E00E94440182
+:1002E000C12CD12C760160E070E0CB01609300015D
+:1002F00070930101809302019093030180E091E0EB
+:100300000E9453008FEFC81AD80AE80AF80AC701FA
+:10031000B6010E9476022FE632E143E05BE30E94E1
+:10032000040320E030E0A9010E949801DFCF50587B
+:10033000BB27AA270E94AF010C94CA020E94BC02EC
+:1003400038F00E94C30220F039F49F3F19F426F4DC
+:100350000C94B9020EF4E095E7FB0C94B302E92F7C
+:100360000E94DB0258F3BA176207730784079507E8
+:1003700020F079F4A6F50C94FD020EF4E0950B2E16
+:10038000BA2FA02D0B01B90190010C01CA01A001E7
+:100390001124FF27591B99F0593F50F4503E68F142
+:1003A0001A16F040A22F232F342F4427585FF3CF83
+:1003B000469537952795A795F0405395C9F77EF454
+:1003C0001F16BA0B620B730B840BBAF09150A1F09D
+:1003D000FF0FBB1F661F771F881FC2F70EC0BA0F23
+:1003E000621F731F841F48F4879577956795B795AB
+:1003F000F7959E3F08F0B0CF9395880F08F09927A6
+:10040000EE0F9795879508950E9418020C94CA02E2
+:100410000E94C30258F00E94BC0240F029F45F3FE2
+:1004200029F00C94B30251110C94FE020C94B90201
+:100430000E94DB0268F39923B1F3552391F3951BD6
+:10044000550BBB27AA2762177307840738F09F5FF5
+:100450005F4F220F331F441FAA1FA9F335D00E2E62
+:100460003AF0E0E832D091505040E695001CCAF7CF
+:100470002BD0FE2F29D0660F771F881FBB1F261792
+:1004800037074807AB07B0E809F0BB0B802DBF0169
+:10049000FF2793585F4F3AF09E3F510578F00C9438
+:1004A000B3020C94FE025F3FE4F3983ED4F38695CA
+:1004B00077956795B795F7959F5FC9F7880F911D59
+:1004C0009695879597F90895E1E0660F771F881F45
+:1004D000BB1F621773078407BA0720F0621B730BF8
+:1004E000840BBA0BEE1F88F7E0950895E89409C0D5
+:1004F00097FB3EF490958095709561957F4F8F4F57
+:100500009F4F9923A9F0F92F96E9BB279395F6956C
+:10051000879577956795B795F111F8CFFAF4BB0FEA
+:1005200011F460FF1BC06F5F7F4F8F4F9F4F16C04E
+:10053000882311F096E911C0772321F09EE8872FD8
+:10054000762F05C0662371F096E8862F70E060E094
+:100550002AF09A95660F771F881FDAF7880F96950D
+:10056000879597F9089597F99F6780E870E060E0B4
+:1005700008959FEF80EC089500240A94161617063C
+:1005800018060906089500240A9412161306140684
+:1005900005060895092E0394000C11F4882352F0E7
+:1005A000BB0F40F4BF2B11F460FF04C06F5F7F4F9F
+:1005B0008F4F9F4F089557FD9058440F551F59F086
+:1005C0005F3F71F04795880F97FB991F61F09F3F40
+:1005D00079F087950895121613061406551FF2CF69
+:1005E0004695F1DF08C0161617061806991FF1CFB9
+:1005F00086957105610508940895E894BB276627E0
+:100600007727CB0197F908950E9417030C94CA022B
+:100610000E94BC0238F00E94C30220F0952311F022
+:100620000C94B3020C94B90211240C94FE020E94A3
+:10063000DB0270F3959FC1F3950F50E0551F629F49
+:10064000F001729FBB27F00DB11D639FAA27F00D2B
+:10065000B11DAA1F649F6627B00DA11D661F829F52
+:100660002227B00DA11D621F739FB00DA11D621F37
+:10067000839FA00D611D221F749F3327A00D611D54
+:10068000231F849F600D211D822F762F6A2F112436
+:100690009F5750409AF0F1F088234AF0EE0FFF1F69
+:1006A000BB1F661F771F881F91505040A9F79E3FC0
+:1006B000510580F00C94B3020C94FE025F3FE4F30A
+:1006C000983ED4F3869577956795B795F795E79516
+:1006D0009F5FC1F7FE2B880F911D9695879597F91F
+:0606E0000895F894FFCF1D
+:1006E6000000000000000000000000006F12033B45
+:0C06F600020001000000000000000000F5
+:00000001FF
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.sh b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.sh
new file mode 100755
index 0000000..2a02704
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read.sh
@@ -0,0 +1,61 @@
+#!/bin/bash
+clear
+if [ "$#" -ne 2 ]; then
+ echo "Usage: $0 port baudrate" >&2
+ exit 1
+fi
+
+re='^[0-9]+$'
+if ! [[ $1 =~ $re ]] ; then
+ echo "error: $1 -> Not a number" >&2; exit 1
+fi
+
+if ! [[ $2 =~ $re ]] ; then
+ echo "error: $2-> Not a number" >&2; exit 1
+fi
+
+b_rate=$2
+
+present=`pwd`
+unamestr=`uname`
+
+if [[ "$unamestr" == 'Linux' ]]; then
+ mdd_path=($(locate Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include))
+ om_path=($(locate /usr/include/omc/c))
+ port="/dev/ttyACM$1"
+ omc --simCodeTarget=ExperimentalEmbeddedC runMDD_therm_read.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+else
+ cd c:
+ om_path=($(dir -d OpenModelica*/include/omc/c/))
+ path_to_om="C:$om_path"
+ cd f:
+ mdd_path=($(dir -d */Modelica_DeviceDrivers/Modelica_DeviceDrivers/Resources/Include/))
+ if [ $? -eq 0 ]; then
+ path_to_mdd="F:/$mdd_path"
+ else
+ exit 1
+ fi
+
+ port="COM$1"
+ cd $present
+ omc --simCodeTarget=ExperimentalEmbeddedC run_therm_read.mos
+ if [ $? -ne 0 ]; then
+ exit 1
+ fi
+fi
+
+avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000UL -Wl,--gc-sections therm_read_main.c -o therm_read -I${mdd_path[0]} -I${path_to_om} -I${path_to_mdd} -I${om_path[0]}
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avr-objcopy -O ihex -R .eeprom therm_read therm_read.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
+avrdude -D -F -V -c arduino -p ATMEGA328P -P $port -b $b_rate -U flash:w:therm_read.hex
+if [ $? -ne 0 ]; then
+ exit 1
+fi
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read_main.c b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read_main.c
new file mode 100755
index 0000000..2b38516
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/MDD_build/thermistor/therm_read_main.c
@@ -0,0 +1,226 @@
+#define fmi2TypesPlatform_h
+
+#define fmi2TypesPlatform "default" /* Compatible */
+
+typedef struct therm_read_fmi2Component_s* fmi2Component;
+typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
+typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
+typedef unsigned int fmi2ValueReference;
+typedef double fmi2Real;
+typedef int fmi2Integer;
+typedef int fmi2Boolean;
+typedef char fmi2Char;
+typedef const fmi2Char* fmi2String;
+typedef char fmi2Byte;
+
+#define fmi2True 1
+#define fmi2False 0
+
+#include "fmi2/fmi2Functions.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+void ModelicaFormatMessage(const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ vprintf(fmt, args);
+ va_end(args);
+}
+
+typedef struct therm_read_fmi2Component_s {
+ fmi2Real currentTime;
+ fmi2Real fmi2RealVars[2];
+ fmi2Real fmi2RealParameter[1];
+ fmi2Integer fmi2IntegerParameter[1];
+ fmi2Boolean fmi2BooleanParameter[1];
+ fmi2String fmi2StringParameter[1];
+ void* extObjs[3];
+} therm_read_fmi2Component;
+
+therm_read_fmi2Component therm_read_component = {
+ .fmi2RealVars = {
+ 0.0 /*adc._y*/,
+ 0.0 /*realValue1._number*/,
+ },
+ .fmi2RealParameter = {
+ 0.002 /*synchronizeRealtime1._actualInterval*/,
+ },
+ .fmi2IntegerParameter = {
+ 2 /*realValue1._significantDigits*/,
+ },
+ .fmi2BooleanParameter = {
+ fmi2True /*realValue1._use_numberPort*/,
+ },
+};
+
+#include <math.h>
+/* TODO: Generate used builtin functions before SimCode */
+static inline double om_mod(double x, double y)
+{
+ return x-floor(x/y)*y;
+}
+
+static const char * const OMCLIT0 = "ElectricPotential";
+static const char * const OMCLIT1 = "V";
+#include "MDDAVRTimer.h"
+#include "MDDAVRRealTime.h"
+#include "MDDAVRAnalog.h"
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt);
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch);
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer);
+
+static inline fmi2Real Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(fmi2Component comp, fmi2Integer om_analogPort, fmi2Real om_vref, fmi2Integer om_voltageResolution)
+{
+ fmi2Real om_value;
+ om_value = MDD_avr_analog_read(om_analogPort, om_vref, om_voltageResolution);
+ return om_value;
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(fmi2Component comp, fmi2Integer om_divisionFactor, fmi2Integer om_referenceVoltage)
+{
+ void* om_avr;
+ om_avr = MDD_avr_analog_init(om_divisionFactor, om_referenceVoltage);
+ return om_avr;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_destructor(fmi2Component comp, void* om_avr)
+{
+ MDD_avr_analog_close(om_avr);
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_wait(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(fmi2Component comp, void* om_timer, fmi2Integer om_timerValue, fmi2Integer om_numTimerInterruptsPerCycle)
+{
+ void* om_rt;
+ om_rt = MDD_avr_rt_init(om_timer, om_timerValue, om_numTimerInterruptsPerCycle);
+ return om_rt;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_destructor(fmi2Component comp, void* om_rt)
+{
+ MDD_avr_rt_close(om_rt);
+}
+static inline void* Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(fmi2Component comp, fmi2Integer om_timerSelect, fmi2Integer om_clockSelect, fmi2Boolean om_clearTimerOnMatch)
+{
+ void* om_timer;
+ om_timer = MDD_avr_timer_init(om_timerSelect, om_clockSelect, om_clearTimerOnMatch);
+ return om_timer;
+}
+static inline void Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_destructor(fmi2Component comp, void* om_timer)
+{
+ MDD_avr_timer_close(om_timer);
+}
+
+fmi2Component therm_read_fmi2Instantiate(fmi2String name, fmi2Type ty, fmi2String GUID, fmi2String resources, const fmi2CallbackFunctions* functions, fmi2Boolean visible, fmi2Boolean loggingOn)
+{
+ static int initDone=0;
+ if (initDone) {
+ return NULL;
+ }
+ return &therm_read_component;
+}
+
+fmi2Status therm_read_fmi2SetupExperiment(fmi2Component comp, fmi2Boolean toleranceDefined, fmi2Real tolerance, fmi2Real startTime, fmi2Boolean stopTimeDefined, fmi2Real stopTime)
+{
+ return fmi2OK;
+}
+
+fmi2Status therm_read_fmi2EnterInitializationMode(fmi2Component comp)
+{
+ comp->extObjs[0] /* adc._analog EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Analog.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_Init_constructor(comp, 7, 4);
+ comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Timers_Timer_constructor(comp, 1, 4, fmi2False);
+ comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_Init_constructor(comp, comp->extObjs[1] /* synchronizeRealtime1._clock EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.Timers.Timer */, 249, 2);
+ return fmi2OK;
+}
+
+fmi2Status therm_read_fmi2ExitInitializationMode(fmi2Component comp)
+{
+ return fmi2OK;
+}
+
+static fmi2Status therm_read_functionODE(fmi2Component comp)
+{
+}
+
+static fmi2Status therm_read_functionOutputs(fmi2Component comp)
+{
+ comp->fmi2RealVars[0] /* adc._y variable */ = Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_Analog_read__voltage(comp, 6, 1024.0, 10); /* equation 4 */Modelica__DeviceDrivers_EmbeddedTargets_AVR_Functions_RealTimeSynchronization_wait(comp, comp->extObjs[2] /* synchronizeRealtime1._sync EXTOBJ: Modelica_DeviceDrivers.EmbeddedTargets.AVR.Functions.RealTimeSynchronization.Init */);
+}
+
+fmi2Status therm_read_fmi2DoStep(fmi2Component comp, fmi2Real currentCommunicationPoint, fmi2Real communicationStepSize, fmi2Boolean noSetFMUStatePriorToCurrentPoint)
+{
+ comp->currentTime = currentCommunicationPoint;
+ /* TODO: Calculate time/state-dependent variables here... */
+ therm_read_functionOutputs(comp);
+ return fmi2OK;
+}
+
+int main(int argc, char **argv)
+{
+ int terminateSimulation = 0;
+ fmi2Status status = fmi2OK;
+ fmi2CallbackFunctions cbf = {
+ .logger = NULL,
+ .allocateMemory = NULL /*calloc*/,
+ .freeMemory = NULL /*free*/,
+ .stepFinished = NULL, //synchronous execution
+ .componentEnvironment = NULL
+ };
+
+ fmi2Component comp = therm_read_fmi2Instantiate("", fmi2CoSimulation, "", "", &cbf, fmi2False, fmi2False);
+ if (comp==NULL) {
+ return 1;
+ }
+ therm_read_fmi2SetupExperiment(comp, fmi2False, 0.0, 0.0, fmi2False, 1.0);
+ therm_read_fmi2EnterInitializationMode(comp);
+ // Set start-values? Nah...
+ therm_read_fmi2ExitInitializationMode(comp);
+
+ double currentTime = 0.0;
+ double h = 0.002;
+ uint32_t i = 0;
+
+ while (status == fmi2OK) {
+ //retrieve outputs
+ // fmi2GetReal(m, ..., 1, &y1);
+ //set inputs
+ // fmi2SetReal(m, ..., 1, &y2);
+
+ //call slave and check status
+ status = therm_read_fmi2DoStep(comp, currentTime, h, fmi2True);
+ switch (status) {
+ case fmi2Discard:
+ case fmi2Error:
+ case fmi2Fatal:
+ case fmi2Pending /* Cannot happen */:
+ terminateSimulation = 1;
+ break;
+ case fmi2OK:
+ case fmi2Warning:
+ break;
+ }
+ if (terminateSimulation) {
+ break;
+ }
+ i++;
+ /* increment master time */
+ currentTime = 0.0 + h*i;
+ }
+
+#if 0
+ if ((status != fmi2Error) && (status != fmi2Fatal)) {
+ fmi2Terminate(m);
+ }
+ if (status != fmi2Fatal) {
+ fmi2FreeInstance(m);
+ }
+#endif
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/README.md b/Modelica-Arduino-MDD_Arduino_Revised/README.md
new file mode 100755
index 0000000..00cd430
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/README.md
@@ -0,0 +1,24 @@
+# OpenModelica-Arduino
+Free library for interfacing Arduino using Modelica and Modelica_DeviceDrivers models in Linux.
+There is support for serial port.
+
+## Library description
+The `OpenModelica-Arduino` library is an open source Modelica package.
+
+Main features:
+ * Support for Linux.
+ * (Soft) real-time synchronization of a simulation.
+
+Please note that the library is known to work with
+* OpenModelica (partial support starting with OpenModelica v1.11.0, e.g.serial port).
+
+## Development and contribution
+Main developers:
+* [Souradip Pal](https://github.com/Souradip-sopho), contribution to the Linux specific code
+* [Vanessa Singh](https://github.com/VanessaSingh), bug fixes.
+* [Disha Agarwal](https://github.com/disha4u), various documentation.
+
+Contributions in shape of [Pull Requests] are always welcome.
+
+The following people have directly contributed to the implementation of the library (many more have contributed by providing feedback and suggestions):
+* Manas Ranjan Das (project mentor), contribution in bug fixes,error removal etc.
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Images/Icons/tqfp32.png b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Images/Icons/tqfp32.png
new file mode 100755
index 0000000..f933f6a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Images/Icons/tqfp32.png
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analog.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analog.h
new file mode 100755
index 0000000..a761139
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analog.h
@@ -0,0 +1,2 @@
+int cmd_analog_out(int h,int pin_no,double val);
+uint16_t cmd_analog_in(int h,int pin_no); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analogv.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analogv.h
new file mode 100755
index 0000000..a761139
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/analogv.h
@@ -0,0 +1,2 @@
+int cmd_analog_out(int h,int pin_no,double val);
+uint16_t cmd_analog_in(int h,int pin_no); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/dcmotor.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/dcmotor.h
new file mode 100755
index 0000000..90314fc
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/dcmotor.h
@@ -0,0 +1,3 @@
+void cmd_dcmotor_setup(int h,int driver_type,int motor_no,int pin_no_1,int pin_no_2);
+void cmd_dcmotor_run(int h,int motor_no,int u1);
+void cmd_dcmotor_release(int h,int motor_no); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/digital.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/digital.h
new file mode 100755
index 0000000..c628bb8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/digital.h
@@ -0,0 +1,2 @@
+int cmd_digital_out(int h,int pin_no,int val);
+int cmd_digital_in(int h,int pin_no); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/encoder.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/encoder.h
new file mode 100755
index 0000000..2559766
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/encoder.h
@@ -0,0 +1 @@
+void cmd_encoder_init(int h,int enc_mode,int pin_no_1,int pin_no_2); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/ieeesingle2num.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/ieeesingle2num.h
new file mode 100755
index 0000000..27d701a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/ieeesingle2num.h
@@ -0,0 +1,3 @@
+long int hex2dec(char hexadecimal[]);
+void dec2hex(long int decimalnum,char hexadecimalnum[]);
+double ieeesingle2num(char hexa[]); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/modbus.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/modbus.h
new file mode 100755
index 0000000..7a5c8d1
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/modbus.h
@@ -0,0 +1,4 @@
+double read_val(int addr_byte);
+void read_voltage();
+void read_current();
+void read_active_power(); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/serial.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/serial.h
new file mode 100755
index 0000000..4588f04
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/serial.h
@@ -0,0 +1,30 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h> /* memset */
+#include <stdio.h>
+#include <signal.h>
+
+int set_interface_attribs (int fd, int speed, int parity);
+void set_blocking (int b, int should_block);
+int open_serial(int handle,int port, int baudrate);
+int close_serial(int handle);
+int write_serial(int handle, char str[],int size);
+int status_serial(int handle,int nb[]);
+int read_serial(int handle,char* buf,int size);
+//int read_serial(int *handle,char buf[],int *size);
+
+void delay(long int t);
+void interrupt();
+
+
+
+/*int set_interface_attribs (int fd, int speed, int parity);
+void set_blocking (int b, int should_block);
+void open_serial(int *handle,int *port, int *baudrate, int *OK);
+void close_serial(int *handle, int *OK);
+void write_serial(int *handle, char str[],int *size, int *OK);
+void status_serial(int *handle, int *OK,int *nbread, int *nbwrite);
+void read_serial(int *handle,char buf[],int *size);
+*/
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/servomotor.h b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/servomotor.h
new file mode 100755
index 0000000..53b7457
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Include/servomotor.h
@@ -0,0 +1,3 @@
+void cmd_servo_attach(int h,int servo_no);
+void cm_servo_move(int h,int servo_no,int u1);
+void cmd_servo_detach(int h,int servo_no); \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog.o
new file mode 100755
index 0000000..47df91e
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog_volt.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog_volt.o
new file mode 100755
index 0000000..0f94393
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_analog_volt.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_digital.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_digital.o
new file mode 100755
index 0000000..e05c668
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/cmd_digital.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/dcmotor.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/dcmotor.o
new file mode 100755
index 0000000..f86e9c6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/dcmotor.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/delay.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/delay.o
new file mode 100755
index 0000000..5aa9222
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/delay.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/ieeesingle2num.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/ieeesingle2num.o
new file mode 100755
index 0000000..9d35dc6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/ieeesingle2num.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalog.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalog.so
new file mode 100755
index 0000000..cefb472
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalog.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalogv.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalogv.so
new file mode 100755
index 0000000..c344625
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libAnalogv.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDCMotor.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDCMotor.so
new file mode 100755
index 0000000..e1be915
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDCMotor.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDigital.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDigital.so
new file mode 100755
index 0000000..8ae4c56
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libDigital.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libModbus.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libModbus.so
new file mode 100755
index 0000000..0247a2c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libModbus.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libSerialComm.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libSerialComm.so
new file mode 100755
index 0000000..e9e07c7
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libSerialComm.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libServoMotor.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libServoMotor.so
new file mode 100755
index 0000000..bd8977a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libServoMotor.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libdelay.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libdelay.so
new file mode 100755
index 0000000..65b5090
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libdelay.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libfloor.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libfloor.so
new file mode 100755
index 0000000..9550ad1
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libfloor.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libinterrupt.so b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libinterrupt.so
new file mode 100755
index 0000000..5900d62
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/libinterrupt.so
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/mfloor.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/mfloor.o
new file mode 100755
index 0000000..2785ec6
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/mfloor.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/modbus.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/modbus.o
new file mode 100755
index 0000000..d465071
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/modbus.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/noInterrupts.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/noInterrupts.o
new file mode 100755
index 0000000..e248aeb
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/noInterrupts.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/serialComm.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/serialComm.o
new file mode 100755
index 0000000..cf30ea8
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/serialComm.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/servomotor.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/servomotor.o
new file mode 100755
index 0000000..cdf0284
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/servomotor.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/wakeup.o b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/wakeup.o
new file mode 100755
index 0000000..f873e90
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/Library/wakeup.o
Binary files differ
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog.c
new file mode 100755
index 0000000..5a8cf2f
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog.c
@@ -0,0 +1,61 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h> /* memset */
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include "../Include/serial.h"
+#include "../Include/analog.h"
+
+uint16_t cmd_analog_in(int h,int pin_no)
+{
+ char pin[5],v1[2];
+ int stat;
+ int read[3];
+ sprintf(v1,"%c",pin_no+48);
+ strcpy(pin,"A");
+ strcat(pin,v1);
+ int wr=write_serial(h,pin,2);
+ stat=status_serial(h,read);
+ //printf("Read:%d\n",read[0] );
+ while (read[0] < 2)
+ stat=status_serial(h,read);
+ char values[5];
+ int a_rd=read_serial(h,values,2);
+ values[2]='\0';
+ printf("%s\n",values);
+ int l=strlen(values);
+ //printf("%d\n",l );
+ uint8_t temp[l+1];
+ int i;
+ for (i = 0; i < l; ++i)
+ {
+ temp[i]=(uint8_t)(values[i]);
+ }
+ //printf("%u %u\n",temp[0],temp[1]);
+ uint16_t result=(uint16_t)(256*temp[1]+temp[0]);
+ //printf("%u\n",result);
+ return result;
+}
+
+int cmd_analog_out(int h,int pin_no,double val)
+{
+ char v1[2],v2[2];
+ if(val > 255)
+ val = 255;
+ else if(val < 0)
+ val = 0;
+ //printf("%f\n",val);
+ char code_sent[10];
+ strcpy(code_sent,"W");
+ sprintf(v1,"%c",pin_no+48);
+ sprintf(v2,"%c",abs(ceil(val)));
+ strcat(code_sent,v1);
+ strcat(code_sent,v2);
+ //printf("%s\n",code_sent);
+ return write_serial(h,code_sent,3);
+
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog_volt.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog_volt.c
new file mode 100755
index 0000000..701c0c0
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_analog_volt.c
@@ -0,0 +1,63 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h> /* memset */
+#include <stdio.h>
+#include <math.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include "../Include/serial.h"
+#include "../Include/analogv.h"
+
+uint16_t cmd_analog_in_volt(int h,int pin_no)
+{
+ char pin[5]="A",v1[2];
+ int stat;
+ int read[3];
+ sprintf(v1,"%c",pin_no+48);
+ //strcpy(pin,"A");
+ strcat(pin,v1);
+ int wr=write_serial(h,pin,2);
+ stat=status_serial(h,read);
+ //printf("Read:%d\n",read[0] );
+ while (read[0] < 2)
+ stat=status_serial(h,read);
+ char values[5];
+ int a_rd=read_serial(h,values,2);
+ values[2]='\0';
+ printf("%s\n",values);
+ int l=strlen(values);
+ //printf("%d\n",l );
+ uint8_t temp[l+1];
+ int i;
+ for (i = 0; i < l; ++i)
+ {
+ temp[i]=(uint8_t)(values[i]);
+ }
+ //printf("%u %u\n",temp[0],temp[1]);
+ uint16_t result=(uint16_t)(256*temp[1]+temp[0]);
+ result/=1023;
+ //printf("%u\n",result);
+ return result;
+}
+
+int cmd_analog_out_volt(int h,int pin_no,double val)
+{
+ char v1[2],v2[2];
+ if(val > 5)
+ val = 5;
+ else if(val < 0)
+ val = 0;
+ val=val*255/5;
+ //printf("%f\n",val);
+ char code_sent[10];
+ strcpy(code_sent,"W");
+ sprintf(v1,"%c",pin_no+48);
+ sprintf(v2,"%c",abs(ceil(val)));
+ strcat(code_sent,v1);
+ strcat(code_sent,v2);
+ //printf("%s\n",code_sent);
+ return write_serial(h,code_sent,3);
+
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_digital.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_digital.c
new file mode 100755
index 0000000..f19d23b
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_digital.c
@@ -0,0 +1,63 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h> /* memset */
+#include <stdio.h>
+#include <stdlib.h>
+#include "../Include/serial.h"
+#include "../Include/digital.h"
+
+int cmd_digital_out(int h,int pin_no,int val)
+{
+ int wr;
+ char pin[6]="Da";
+ char v[2],temp[2];
+ sprintf(temp,"%c",pin_no+48);
+ strcat(pin,temp);
+ strcat(pin,"1");
+ //printf("%s",pin);
+ wr=write_serial(h,pin,4);
+ if (val > 0.5)
+ val = 1;
+ else
+ val = 0;
+
+ sprintf(v,"%d",val);
+ strcpy(pin,"Dw");
+ strcat(pin,temp);
+ strcat(pin,v);
+ //printf("%s",pin);
+ wr=write_serial(h,pin,4);
+ return wr;
+}
+
+int cmd_digital_in(int h,int pin_no)
+{
+ int value = 0;
+ char pin[6]="Da";
+ char v1[2],v2[2];
+ int wr1, wr2;
+ sprintf(v1,"%c",pin_no+48);
+ strcat(pin,v1);
+ strcat(pin,"0");
+ //printf("%s\n",pin);
+ wr1=write_serial(h,pin,4);
+
+ strcpy(pin,"Dr");
+ sprintf(v2,"%c",pin_no+48);
+ strcat(pin,v2);
+ wr2=write_serial(1,pin,3);
+ //binary transfer
+ int stat;
+ int num_bytes[2];
+ char st[10];
+ stat=status_serial(h,num_bytes);
+ while(num_bytes[0]<1)
+ stat=status_serial(h,num_bytes);
+ char* temp;
+ int wr=read_serial(h,st,1);
+ value=strtod(st,&temp);
+ //printf("%d\n",value);
+ return value;
+}
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_encoder_init.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_encoder_init.c
new file mode 100755
index 0000000..89a53dd
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/cmd_encoder_init.c
@@ -0,0 +1,39 @@
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include <stdlib.h>
+#include "../Include/encoder.h"
+#include "../Include/serial.h"
+
+void cmd_encoder_init(int h,int enc_mode,int pin_no_1,int pin_no_2)
+{
+
+ int wr;
+ char code_sent[10]="Ea";
+ char c[2];
+
+ sprintf(c,"%c",48+corresp[block->rpar[2]]);
+ strcat(code_sent,c);
+ if(block.rpar(2)==4)
+ {
+ char c1[2],c2[2],v[10];
+ sprintf(c1,"%c",48+0+corresp[block->rpar[3]]);
+ sprintf(v,"%s",(block->rpar[1]));
+ strcat(code_sent,c1);
+ strcat(code_sent,v);
+ }
+ else
+ {
+ char c2[2],v[10];
+ sprintf(c2,"%c",48+0+corresp[block->rpar[3]]);
+ sprintf(v,"%s",block->rpar[1]);
+ strcat(code_sent,c1);
+ strcat(code_sent,v);
+ }
+ wr=write_serial(1,code_sent,5);
+ strcpy(code_sent,"Ez");
+ sprintf(c,"%c",corresp[block->rpar[2]])
+ strcat(code_sent,c);
+ wr=write_serial(1,code_sent,3)
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/dcmotor.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/dcmotor.c
new file mode 100755
index 0000000..ac6775c
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/dcmotor.c
@@ -0,0 +1,117 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include "../Include/serial.h"
+#include "../Include/dcmotor.h"
+
+#define abs(x) (x>=0?x:-x)
+
+void cmd_dcmotor_setup(int h,int driver_type,int motor_no,int pin_no_1,int pin_no_2)
+{
+ printf("init DCmotor\n");
+ char code_sent[10]="C";
+ int wr;
+ char v1[2],v2[2],motor[2];
+ if(driver_type==1)
+ {
+ sprintf(v1,"%c",pin_no_1+48);
+ sprintf(v2,"%c",pin_no_2+48);
+ sprintf(motor,"%c",motor_no+48);
+ strcat(code_sent,motor);
+ strcat(code_sent,v1);
+ strcat(code_sent,v2);
+ strcat(code_sent,"1");
+ }
+ //code_sent="C"+string(motor_no)+ascii(48+pin_no_1)+ascii(48+pin_no_2)+"1"; //adafruit
+ else if(driver_type==2)
+ {
+ sprintf(v1,"%c",pin_no_1+48);
+ sprintf(v2,"%c",pin_no_2+48);
+ sprintf(motor,"%c",motor_no+48);
+ strcat(code_sent,motor);
+ strcat(code_sent,v1);
+ strcat(code_sent,v2);
+ strcat(code_sent,"1");
+ }
+ //code_sent="C"+string(motor_no)+ascii(48+pin_no_1)+ascii(48+pin_no_2)+"1"; //code pour initialiser L298
+ else if(driver_type==3)
+ {
+ sprintf(v1,"%c",pin_no_1+48);
+ sprintf(v2,"%c",pin_no_2+48);
+ sprintf(motor,"%c",motor_no+48);
+ strcat(code_sent,motor);
+ strcat(code_sent,v1);
+ strcat(code_sent,v2);
+ strcat(code_sent,"0");
+
+ }
+ // code_sent="C"+string(motor_no)+ascii(48+pin_no_1)+ascii(48+pin_no_2)+"0"; //code pour initialiser L293
+ //printf("%s\n",code_sent);
+ wr=write_serial(h,code_sent,5);
+
+ int stat;
+ int num_bytes[2];
+ //Attente que l'arduino reponde OK
+ stat=status_serial(1,num_bytes);
+ while (num_bytes[0] < 2)
+ stat=status_serial(1,num_bytes);
+ char values[5];
+ int dcm_rd=read_serial(1,values,2);
+ if (dcm_rd == 0)
+ printf("Init motor successful\n");
+ else
+ printf("Init motor unsuccessful\n");
+}
+
+void cmd_dcmotor_run(int h,int motor_no,int u1)
+{
+ char code_dir[2];
+ char code_sent[10]="M";
+ char motor[2];
+ int val;
+ char v[2];
+ if(u1>=0)
+ sprintf(code_dir,"%c",49);
+ //code_dir=ascii(49);
+ else
+ sprintf(code_dir,"%c",48);
+ //code_dir=ascii(48);
+ if(abs(u1)>255)
+ val=255;
+ else
+ val=abs(ceil(u1));
+ //printf("%d\n",val);
+ sprintf(motor,"%c",motor_no+48);
+ sprintf(v,"%c",val);
+ strcat(code_sent,motor);
+ strcat(code_sent,code_dir);
+ strcat(code_sent,v);
+ //printf("%s\n",code_sent);
+ //code_sent="M"+ascii(48+motor_no)+code_dir+ascii(val);
+ int wr=write_serial(h,code_sent,4);
+}
+
+void cmd_dcmotor_release(int h,int motor_no)
+{
+ char code_sent[6]="M";
+ char motor[2];
+ char v[2];
+ sprintf(motor,"%c",motor_no+48);
+ sprintf(v,"%c",0);
+ strcat(code_sent,motor);
+ strcat(code_sent,"1");
+ strcat(code_sent,v);
+ //code_sent="M"+ascii(48+motor_no)+"1"+ascii(0);
+ //printf("%s\n",code_sent);
+ int wr=write_serial(h,code_sent,4);
+ strcpy(code_sent,"M");
+ strcat(code_sent,motor);
+ strcat(code_sent,"r");
+ //printf("%s\n",code_sent);
+ //code_sent="M"+ascii(48+motor_no)+"r";
+ wr=write_serial(h,code_sent,3);
+}
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/delay.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/delay.c
new file mode 100755
index 0000000..db9c175
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/delay.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+#include <unistd.h>
+
+void delay(long int t)
+{
+ usleep(abs(t*1000));
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/ieeesingle2num.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/ieeesingle2num.c
new file mode 100755
index 0000000..7331193
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/ieeesingle2num.c
@@ -0,0 +1,87 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <ctype.h>
+#include "../Include/serial.h"
+
+#ifdef NAN
+/* NAN is supported */
+#endif
+#ifdef INFINITY
+/* INFINITY is supported */
+#endif
+
+
+long int hex2dec(char hexadecimal[])
+{
+ long int decimalNumber=0;
+ char hexDigits[16] = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
+ '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+ int i, j, power=0;
+
+ /* Converting hexadecimal number to decimal number */
+ for(i=strlen(hexadecimal)-1; i >= 0; i--) {
+ /*search currect character in hexDigits array */
+ if(isalpha(hexadecimal[i]))
+ hexadecimal[i]=toupper(hexadecimal[i]);
+ for(j=0; j<16; j++){
+ if(hexadecimal[i] == hexDigits[j]){
+ decimalNumber += j*pow(16, power);
+ }
+ // }
+ power++;
+ }
+ }
+ return decimalNumber;
+}
+
+void dec2hex(long int decimalnum,char hexadecimalnum[])
+{
+ long quotient, remainder;
+ int j = 1;
+ quotient = decimalnum;
+
+ while (quotient != 0)
+ {
+ remainder = quotient % 16;
+ if (remainder < 10)
+ hexadecimalnum[j--] = 48 + remainder;
+ else
+ hexadecimalnum[j--] = 55 + remainder;
+ quotient = quotient / 16;
+ }
+ hexadecimalnum[2]='\0';
+}
+
+double ieeesingle2num(char hexa[])
+{
+ long int x=hex2dec(hexa);
+ long int k =(long int)pow(2,31); //pow2(31);
+ int s = (x >= k);
+ if (s)
+ x = x - k;
+ //t = pow2(x,-23);
+ double t = x*pow(2,-23);
+ long int e = floor(t);
+ double f = t - e;
+ double y;
+ if (e == 255)
+ if(f == 0)
+ y = INFINITY;
+ else
+ y = NAN;
+ else if(e > 0)
+ y = (1+f)*pow(2,e-127);
+ //y = (1+f).*2.^(e-127);
+ else
+ y = f*pow(2,-126);
+ //y = f.*2.^-126;
+ if (s)
+ y = -y;
+ return y;
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/mfloor.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/mfloor.c
new file mode 100755
index 0000000..3c9e884
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/mfloor.c
@@ -0,0 +1,6 @@
+#include <math.h>
+
+int mfloor(double x)
+{
+ return floor(x);
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/modbus.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/modbus.c
new file mode 100755
index 0000000..160bfb5
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/modbus.c
@@ -0,0 +1,449 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <math.h>
+#include "../Include/serial.h"
+#include "../Include/ieeesingle2num.h"
+#include "../Include/modbus.h"
+
+char ascii_n(int num)
+{
+ return (char)num;
+}
+
+int ascii_c(char c)
+{
+ return (int)c;
+}
+
+void read_voltage()
+{
+ char arr[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(86),ascii_n(00),ascii_n(2),ascii_n(39),ascii_n(15),'\0'};
+
+ //printf("%s\n",arr);//debug
+
+ int x,wr,rd;
+ char buf[12];
+ for(x=0;x<5;x++)
+ {
+ wr=write_serial(1,arr,8);
+ rd = read_serial(1,buf,11);
+ usleep(500);
+ }
+ buf[11]='\0';
+
+ //printf("%s\n",buf );//debug
+
+ int b1=0,b2=0,b3=0,b4=0;
+ int myresult[12];
+ int i;
+ for (i = 0; i < 11; ++i)
+ {
+ myresult[i]=ascii_c(buf[i]);
+ //printf("%d",myresult[i]);//debug
+ }
+
+ //printf("%d %d %d %d\n",myresult[4],myresult[5],myresult[6],myresult[7]);//debug
+
+ int a1=myresult[4];
+ if (a1<16)
+ {
+ b1=1;
+ }
+ char v1[3];
+ dec2hex(a1,v1);
+ if (b1)
+ {
+ sprintf(v1,"0%s",v1);
+ }
+ else
+ {
+ sprintf(v1,"%s",v1);
+ }
+ int a2=myresult[5];
+ if (a2<16)
+ {
+ b2=1;
+ }
+ char v2[3];
+ dec2hex(a2,v2);
+ if (b2)
+ {
+ sprintf(v2,"0%s",v2);
+ }
+ else
+ {
+ sprintf(v2,"%s",v2);
+ }
+ int a3=myresult[6];
+ if (a3<16)
+ {
+ b3=1;
+ }
+ char v3[3];
+ dec2hex(a3,v3);
+ if (b3)
+ {
+ sprintf(v3,"0%s",v3);
+ }
+ else
+ {
+ sprintf(v3,"%s",v3);
+ }
+ int a4=myresult[7];
+ if (a4<16)
+ {
+ b4=1;
+ }
+ char v4[3];
+ dec2hex(a4,v4);
+ if (b4)
+ {
+ sprintf(v4,"0%s",v4);
+ }
+ else
+ {
+ sprintf(v4,"%s",v4);
+ }
+ char a6[20]="";
+ strcat(a6,v3);
+ strcat(a6,v4);
+ strcat(a6,v1);
+ strcat(a6,v2);
+ a6[8]='\0';
+
+ //printf("%s",a6);//debug
+
+ int cl=close_serial(1);
+ double p=ieeesingle2num(a6);
+ printf("Voltage(in V)=%f\n",p);
+}
+
+
+void read_current()
+{
+ char arr[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(88),ascii_n(00),ascii_n(2),ascii_n(70),ascii_n(204),'\0'};
+ //printf("%s\n",arr);//debug
+
+ int x,wr,rd;
+ char buf[12];
+ for(x=0;x<5;x++)
+ {
+ wr=write_serial(1,arr,8);
+ rd = read_serial(1,buf,11);
+ usleep(500);
+ }
+ buf[11]='\0';
+
+ //printf("%s\n",buf );//debug
+
+ int b1=0,b2=0,b3=0,b4=0;
+ int myresult[12];
+ int i;
+ for (i = 0; i < 11; ++i)
+ {
+ myresult[i]=ascii_c(buf[i]);
+ //printf("%d",myresult[i]);//debug
+ }
+
+ //printf("%d %d %d %d\n",myresult[4],myresult[5],myresult[6],myresult[7]);//debug
+
+ int a1=myresult[4];
+ if (a1<16)
+ {
+ b1=1;
+ }
+ char v1[3];
+ dec2hex(a1,v1);
+ if (b1)
+ {
+ sprintf(v1,"0%s",v1);
+ }
+ else
+ {
+ sprintf(v1,"%s",v1);
+ }
+ int a2=myresult[5];
+ if (a2<16)
+ {
+ b2=1;
+ }
+ char v2[3];
+ dec2hex(a2,v2);
+ if (b2)
+ {
+ sprintf(v2,"0%s",v2);
+ }
+ else
+ {
+ sprintf(v2,"%s",v2);
+ }
+ int a3=myresult[6];
+ if (a3<16)
+ {
+ b3=1;
+ }
+ char v3[3];
+ dec2hex(a3,v3);
+ if (b3)
+ {
+ sprintf(v3,"0%s",v3);
+ }
+ else
+ {
+ sprintf(v3,"%s",v3);
+ }
+ int a4=myresult[7];
+ if (a4<16)
+ {
+ b4=1;
+ }
+ char v4[3];
+ dec2hex(a4,v4);
+ if (b4)
+ {
+ sprintf(v4,"0%s",v4);
+ }
+ else
+ {
+ sprintf(v4,"%s",v4);
+ }
+ char a6[20]="";
+ strcat(a6,v3);
+ strcat(a6,v4);
+ strcat(a6,v1);
+ strcat(a6,v2);
+ a6[8]='\0';
+
+ //printf("%s",a6);//debug
+
+ int cl=close_serial(1);
+ double p=ieeesingle2num(a6);
+ printf("Current(in A)=%f\n",p);
+}
+
+void read_active_power()
+{
+ char arr[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(78),ascii_n(00),ascii_n(2),ascii_n(167),ascii_n(8),'\0'};
+ //printf("%s\n",arr);//debug
+
+ int x,wr,rd;
+ char buf[12];
+ for(x=0;x<5;x++)
+ {
+ wr=write_serial(1,arr,8);
+ rd = read_serial(1,buf,11);
+ usleep(500);
+ }
+ buf[11]='\0';
+
+ //printf("%s\n",buf );//debug
+
+ int b1=0,b2=0,b3=0,b4=0;
+ int myresult[12];
+ int i;
+ for (i = 0; i < 11; ++i)
+ {
+ myresult[i]=ascii_c(buf[i]);
+ //printf("%d",myresult[i]);//debug
+ }
+
+ //printf("%d %d %d %d\n",myresult[4],myresult[5],myresult[6],myresult[7]);//debug
+
+ int a1=myresult[4];
+ if (a1<16)
+ {
+ b1=1;
+ }
+ char v1[3];
+ dec2hex(a1,v1);
+ if (b1)
+ {
+ sprintf(v1,"0%s",v1);
+ }
+ else
+ {
+ sprintf(v1,"%s",v1);
+ }
+ int a2=myresult[5];
+ if (a2<16)
+ {
+ b2=1;
+ }
+ char v2[3];
+ dec2hex(a2,v2);
+ if (b2)
+ {
+ sprintf(v2,"0%s",v2);
+ }
+ else
+ {
+ sprintf(v2,"%s",v2);
+ }
+ int a3=myresult[6];
+ if (a3<16)
+ {
+ b3=1;
+ }
+ char v3[3];
+ dec2hex(a3,v3);
+ if (b3)
+ {
+ sprintf(v3,"0%s",v3);
+ }
+ else
+ {
+ sprintf(v3,"%s",v3);
+ }
+ int a4=myresult[7];
+ if (a4<16)
+ {
+ b4=1;
+ }
+ char v4[3];
+ dec2hex(a4,v4);
+ if (b4)
+ {
+ sprintf(v4,"0%s",v4);
+ }
+ else
+ {
+ sprintf(v4,"%s",v4);
+ }
+ char a6[20]="";
+ strcat(a6,v3);
+ strcat(a6,v4);
+ strcat(a6,v1);
+ strcat(a6,v2);
+ a6[8]='\0';
+
+ //printf("%s",a6);//debug
+
+ int cl=close_serial(1);
+ double p=ieeesingle2num(a6);
+ printf("Active Power(in W)=%f\n",p);
+}
+
+double read_val(int addr_byte)
+{
+ char* arr;
+ if(addr_byte==86)
+ {
+ char code[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(86),ascii_n(00),ascii_n(2),ascii_n(39),ascii_n(15),'\0'};
+ arr = code;
+ printf("Voltage(in V)=");
+ }
+ else if(addr_byte==88)
+ {
+ char code[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(88),ascii_n(00),ascii_n(2),ascii_n(70),ascii_n(204),'\0'};
+ arr =code;
+ printf("Current(in A)=");
+ }
+ else if(addr_byte==78)
+ {
+ char code[9]={ascii_n(1),ascii_n(3),ascii_n(15),ascii_n(78),ascii_n(00),ascii_n(2),ascii_n(167),ascii_n(8),'\0'};
+ arr = code;
+ printf("Active Power(in W)=");
+ }
+ //printf("%s\n",arr);//debug
+
+ int x,wr,rd;
+ char buf[12];
+ for(x=0;x<5;x++)
+ {
+ wr=write_serial(1,arr,8);
+ rd = read_serial(1,buf,11);
+ usleep(500);
+ }
+ buf[11]='\0';
+
+ //printf("%s\n",buf );//debug
+
+ int b1=0,b2=0,b3=0,b4=0;
+ int myresult[12];
+ int i;
+ for (i = 0; i < 11; ++i)
+ {
+ myresult[i]=ascii_c(buf[i]);
+ //printf("%d",myresult[i]);//debug
+ }
+
+ //printf("%d %d %d %d\n",myresult[4],myresult[5],myresult[6],myresult[7]);//debug
+
+ int a1=myresult[4];
+ if (a1<16)
+ {
+ b1=1;
+ }
+ char v1[3];
+ dec2hex(a1,v1);
+ if (b1)
+ {
+ sprintf(v1,"0%s",v1);
+ }
+ else
+ {
+ sprintf(v1,"%s",v1);
+ }
+ int a2=myresult[5];
+ if (a2<16)
+ {
+ b2=1;
+ }
+ char v2[3];
+ dec2hex(a2,v2);
+ if (b2)
+ {
+ sprintf(v2,"0%s",v2);
+ }
+ else
+ {
+ sprintf(v2,"%s",v2);
+ }
+ int a3=myresult[6];
+ if (a3<16)
+ {
+ b3=1;
+ }
+ char v3[3];
+ dec2hex(a3,v3);
+ if (b3)
+ {
+ sprintf(v3,"0%s",v3);
+ }
+ else
+ {
+ sprintf(v3,"%s",v3);
+ }
+ int a4=myresult[7];
+ if (a4<16)
+ {
+ b4=1;
+ }
+ char v4[3];
+ dec2hex(a4,v4);
+ if (b4)
+ {
+ sprintf(v4,"0%s",v4);
+ }
+ else
+ {
+ sprintf(v4,"%s",v4);
+ }
+ char a6[20]="";
+ strcat(a6,v3);
+ strcat(a6,v4);
+ strcat(a6,v1);
+ strcat(a6,v2);
+ a6[8]='\0';
+
+ //printf("%s",a6);//debug
+
+ int cl=close_serial(1);
+ double p=ieeesingle2num(a6);
+ printf("%f\n",p);
+ return p;
+}
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/nointerrupts.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/nointerrupts.c
new file mode 100755
index 0000000..d8f26dd
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/nointerrupts.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+#include <math.h>
+#include <unistd.h>
+#include </home/mr_robot/arduino-1.8.5/hardware/arduino/avr/cores/arduino/Arduino.h>
+void nointerrupts()
+{
+ noInterrupts();
+}
+
+int main (void)
+{
+ return 0;
+}
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/serialComm.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/serialComm.c
new file mode 100755
index 0000000..6fd915a
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/serialComm.c
@@ -0,0 +1,156 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h> /* memset */
+#include <stdio.h>
+#include <stropts.h>
+#include "../Include/serial.h"
+#define MAXPORTS 5
+static int fd;
+
+int set_interface_attribs (int fd, int speed, int parity)
+{
+ struct termios tty;
+ memset (&tty, 0, sizeof(tty));
+ if (tcgetattr (fd, &tty) != 0)
+ {
+ return -1;
+ }
+ int posix_baudrate=0;
+
+ switch(speed) {
+ case 115200: posix_baudrate = B115200; break;
+ //default: return -1;
+ }
+ cfsetospeed (&tty, posix_baudrate);
+ cfsetispeed (&tty, posix_baudrate);
+
+ tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; // 8-bit chars
+ // disable IGNBRK for mismatched speed tests; otherwise receive break
+ // as \000 chars
+ tty.c_iflag &= ~IGNBRK; // disable break processing
+ tty.c_lflag = 0; // no signaling chars, no echo,
+ // no canonical processing
+ tty.c_oflag = 0; // no remapping, no delays
+ tty.c_cc[VMIN] = 0; // read doesn't block
+ tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout
+
+ tty.c_iflag &= ~(IXON | IXOFF | IXANY); // shut off xon/xoff ctrl
+
+ tty.c_cflag |= (CLOCAL | CREAD);// ignore modem controls,
+ // enable reading
+ tty.c_cflag &= ~(PARENB | PARODD); // shut off parity
+ tty.c_cflag |= parity;
+ tty.c_cflag &= ~CSTOPB;
+ tty.c_cflag &= ~CRTSCTS;
+
+ if (tcsetattr (fd, TCSANOW, &tty) != 0)
+ {
+ return -1;
+ }
+ return 0;
+}
+
+
+void set_blocking (int b, int should_block)
+{
+ struct termios tty;
+ memset (&tty, 0, sizeof tty);
+ if (tcgetattr (b, &tty) != 0)
+ {
+ return;
+ }
+
+ tty.c_cc[VMIN] = should_block ? 1 : 0;
+ tty.c_cc[VTIME] = 5; // 0.5 seconds read timeout
+
+ //if (tcsetattr (fd, TCSANOW, &tty) != 0)
+ // error_message ("error %d setting term attributes", errno);
+}
+
+int open_serial(int handle,int port, int baudrate){
+ char* portname;
+ //printf("%d\n",port);
+ int OK;
+ switch(port){
+ case 0: portname = "//dev/ttyACM0";break;
+ case 1: portname = "//dev/ttyACM1";break;
+ case 2: portname = "//dev/ttyACM2";break;
+ case 3: portname = "//dev/ttyACM3";break;
+ case 4: portname = "//dev/ttyACM4";break;
+ case 5: portname = "//dev/ttyACM5";break;
+ case 6: portname = "//dev/ttyACM6";break;
+ case 7: portname = "//dev/ttyACM7";break;
+ //default : return 2;
+ }
+ OK = 0;
+ //printf("%s\n",portname);
+ fd = open (portname, O_RDWR | O_NOCTTY | O_SYNC);
+ //fd = open (portname, O_RDWR | O_NOCTTY); //srikant
+ //printf("%d\n",fd);
+ if (fd < 0)
+ {
+ OK=2;
+ return OK;
+ }
+ set_interface_attribs (fd, baudrate, 0);
+ set_blocking (fd, 0); // set no blocking
+ //printf("Program running with status : %d\n",OK);
+ return OK;
+}
+
+int close_serial(int handle){
+ //usleep(1000);
+ close(fd);
+ //printf("Program closing....\n");
+ return 0;
+}
+
+int write_serial(int handle, char str[],int size){
+ if(write(fd, str, size)!=-1)
+ {
+ //printf("serial write started.\n");
+ //printf("%s\n",str );
+ //printf("%d\n",(int)str[0] );
+ }
+ usleep(size*100);
+ return 0;
+}
+
+
+int status_serial(int handle,int nb[]){
+ nb[0] = 2;
+ nb[1] = 2;
+ int OK=0;
+ //printf("Getting status.....\n");
+ return OK;
+}
+
+int read_serial(int handle,char buf[],int size){
+
+ char readbuf[size+1];
+ //int fl=tcflush(fd,TCOFLUSH);
+ //int fl=ioctl(fd,I_FLUSH,FLUSHW);
+ if(read(fd, readbuf, size)!=-1)
+ {
+ readbuf[size]='\0';
+ int i;
+ for (i = 0; i < size; ++i)
+ {
+ buf[i]=(readbuf[i]);
+ //printf("%u\n",buf[i] );
+ }
+ buf[size]='\0';
+ //printf("Reading has commenced..\n");
+ //printf("%d\n",(int)strlen(readbuf));
+ //printf("%s\n",readbuf);
+ return 0;
+ }
+ else
+ return 2 ;
+}
+/*void read_serial(int *handle,char buf[],int *size){
+ read(fd, buf, *size);
+ printf("Reading has commenced..\n");
+}*/
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/servomotor.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/servomotor.c
new file mode 100755
index 0000000..74048a3
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/servomotor.c
@@ -0,0 +1,87 @@
+#include <errno.h>
+#include <termios.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <math.h>
+#include "../Include/serial.h"
+#include "../Include/servomotor.h"
+
+void cmd_servo_attach(int h,int servo_no)
+{
+ char pin[5];
+ int wr;
+ printf("init servo write\n");
+ if(servo_no==1)//servo 1 on pin 9
+ {
+ strcpy(pin,"Sa1");
+ //printf("%s\n",pin);
+ wr=write_serial(h,pin,3);
+ }
+ else if(servo_no==2)//servo 2 on pin 10
+ {
+ strcpy(pin,"Sa2");
+ wr=write_serial(h,pin,3);
+ }
+ else
+ perror("Error.");
+}
+
+
+void cmd_servo_move(int h,int servo_no,int u1)
+{
+ int wr;
+ char servo[2];
+ char v[2];
+ char pin[5]="Sw";
+ if (u1<0)
+ {
+ sprintf(servo,"%c",48+servo_no);
+ sprintf(v,"%c",0);
+ strcat(pin,servo);
+ strcat(pin,v);
+ //printf("%s\n",pin );
+ //pin="Sw"+ascii(48+servo_no)+ascii(0);
+ }
+ else if(u1>180)
+ {
+ sprintf(servo,"%c",48+servo_no);
+ sprintf(v,"%c",180);
+ strcat(pin,servo);
+ strcat(pin,v);
+ //printf("%s\n",pin );
+ } //pin="Sw"+ascii(48+servo_no)+ascii(180);
+ else
+ {
+ sprintf(servo,"%c",48+servo_no);
+ sprintf(v,"%c",(uint8_t)u1);
+ strcat(pin,servo);
+ strcat(pin,v);
+ //printf("%s\n",pin );
+ } //pin="Sw"+ascii(48+servo_no)+ascii(uint8(u1));
+ wr=write_serial(1,pin,4);
+}
+
+
+void cmd_servo_detach(int h,int servo_no)
+{
+ int wr;
+ char pin[5]="Sd";
+ if(servo_no==1) //servo 1 on pin 10
+ {
+ strcat(pin,"1");
+ //pin="Sd1"
+ wr=write_serial(h,pin,3);
+ }
+ else if(servo_no==2) //servo 2 on pin 9
+ {
+ strcat(pin,"2");
+ //pin="Sd2"
+ wr=write_serial(h,pin,3);
+ }
+ else
+ perror("Error.");
+
+} \ No newline at end of file
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/wakeup.c b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/wakeup.c
new file mode 100755
index 0000000..43ceb48
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/Resources/src/wakeup.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include "../Include/serial.h"
+
+
+
+void wakeup()
+{
+ /* Set signal to this function. */
+ signal(SIGALRM, wakeup);
+ /* Set alarm clock for 5 seconds. */
+ alarm(2);
+}
+
diff --git a/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo b/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo
new file mode 100755
index 0000000..854d60f
--- /dev/null
+++ b/Modelica-Arduino-MDD_Arduino_Revised/test_firmware.mo
@@ -0,0 +1,20 @@
+model test_firmware "Testing SerialCommunication with Arduino"
+
+import sComm=Arduino.SerialCommunication.Functions;
+Integer h(fixed = false);
+Integer byte_read(fixed = false);
+//String str(fixed =false);
+Integer wr(fixed =false);
+Integer c_OK(fixed =false);
+algorithm
+ when initial() then
+ h:=sComm.open_serial(1,0,115200);
+ sComm.delay(2000);
+ wr:=sComm.write_serial(1,"v",1);
+ byte_read:= sComm.read_serial(1,2);
+ c_OK := sComm.close_serial(1) "To close the connection safely";
+ end when;
+ annotation(
+ experiment(StartTime = 0, StopTime = 10, Tolerance = 1e-6, Interval = 10));
+
+end test_firmware; \ No newline at end of file
diff --git a/Modelica_DeviceDrivers b/Modelica_DeviceDrivers
new file mode 160000
+Subproject 057b97983fd7a8d987e98fcbf549a79342cff93
diff --git a/Modelica_LinearSystems2 b/Modelica_LinearSystems2
new file mode 160000
+Subproject 165795f8d23137e726188db21bc1229129ba5e3
diff --git a/OM_Arduino_doc/IMG_20180427_131831.jpg b/OM_Arduino_doc/IMG_20180427_131831.jpg
new file mode 100755
index 0000000..9943274
--- /dev/null
+++ b/OM_Arduino_doc/IMG_20180427_131831.jpg
Binary files differ
diff --git a/OM_Arduino_doc/Image_Of_Shield.jpg b/OM_Arduino_doc/Image_Of_Shield.jpg
new file mode 100755
index 0000000..99b717c
--- /dev/null
+++ b/OM_Arduino_doc/Image_Of_Shield.jpg
Binary files differ
diff --git a/OM_Arduino_doc/Model.png b/OM_Arduino_doc/Model.png
new file mode 100755
index 0000000..8169021
--- /dev/null
+++ b/OM_Arduino_doc/Model.png
Binary files differ
diff --git a/OM_Arduino_doc/OM_Arduino.aux b/OM_Arduino_doc/OM_Arduino.aux
new file mode 100755
index 0000000..ea4ab10
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.aux
@@ -0,0 +1,25 @@
+\relax
+\providecommand\hyper@newdestlabel[2]{}
+\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
+\HyperFirstAtBeginDocument{\ifx\hyper@anchor\@undefined
+\global\let\oldcontentsline\contentsline
+\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
+\global\let\oldnewlabel\newlabel
+\gdef\newlabel#1#2{\newlabelxx{#1}#2}
+\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
+\AtEndDocument{\ifx\hyper@anchor\@undefined
+\let\contentsline\oldcontentsline
+\let\newlabel\oldnewlabel
+\fi}
+\fi}
+\global\let\hyper@last\relax
+\gdef\HyperFirstAtBeginDocument#1{#1}
+\providecommand\HyField@AuxAddToFields[1]{}
+\providecommand\HyField@AuxAddToCoFields[2]{}
+\providecommand\tcolorbox@label[2]{}
+\select@language{english}
+\@writefile{toc}{\select@language{english}}
+\@writefile{lof}{\select@language{english}}
+\@writefile{lot}{\select@language{english}}
+\@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}{section.1}}
+\@writefile{toc}{\contentsline {section}{\numberline {2}Usage}{1}{section.2}}
diff --git a/OM_Arduino_doc/OM_Arduino.log b/OM_Arduino_doc/OM_Arduino.log
new file mode 100755
index 0000000..5ce9ec9
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.log
@@ -0,0 +1,1488 @@
+This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2018.2.19) 27 APR 2018 14:15
+entering extended mode
+ restricted \write18 enabled.
+ %&-line parsing enabled.
+**OM_Arduino.tex
+(./OM_Arduino.tex
+LaTeX2e <2017-04-15>
+Babel <3.12> and hyphenation patterns for 84 language(s) loaded.
+(/usr/share/texlive/texmf-dist/tex/latex/hitec/hitec.cls
+Document Class: hitec 2001/08/22 v0.0(beta) Hi-tec style document class
+(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
+File: size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
+)
+\leftmarginwidth=\dimen102
+\fullwidth=\dimen103
+\emptyfoottopmargin=\dimen104
+\emptyheadtopmargin=\dimen105
+\c@part=\count79
+\c@section=\count80
+\c@subsection=\count81
+\c@subsubsection=\count82
+\c@paragraph=\count83
+\c@subparagraph=\count84
+\c@figure=\count85
+\c@table=\count86
+\abovecaptionskip=\skip41
+\belowcaptionskip=\skip42
+\bibindent=\dimen106
+)
+(/usr/share/texlive/texmf-dist/tex/latex/forest/forest.sty
+Package: forest 2017/07/14 v2.1.5 Drawing (linguistic) trees
+
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/frontendlayer/tikz.sty
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgf.sty
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex
+\pgfutil@everybye=\toks14
+\pgfutil@tempdima=\dimen107
+\pgfutil@tempdimb=\dimen108
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.t
+ex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def
+\pgfutil@abb=\box26
+(/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty
+Package: everyshi 2001/05/15 v3.00 EveryShipout Package (MS)
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex
+Package: pgfrcs 2015/08/07 v3.0.1a (rcs-revision 1.31)
+))
+Package: pgf 2015/08/07 v3.0.1a (rcs-revision 1.15)
+
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty
+(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
+Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
+
+(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty
+Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
+\KV@toks@=\toks15
+)
+(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
+Package: graphics 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
+
+(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty
+Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
+)
+(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
+File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
+)
+Package graphics Info: Driver file: pdftex.def on input line 99.
+
+(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def
+File: pdftex.def 2017/06/24 v1.0g Graphics/color driver for pdftex
+))
+\Gin@req@height=\dimen109
+\Gin@req@width=\dimen110
+)
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex
+Package: pgfsys 2014/07/09 v3.0.1a (rcs-revision 1.48)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex
+\pgfkeys@pathtoks=\toks16
+\pgfkeys@temptoks=\toks17
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.t
+ex
+\pgfkeys@tmptoks=\toks18
+))
+\pgf@x=\dimen111
+\pgf@y=\dimen112
+\pgf@xa=\dimen113
+\pgf@ya=\dimen114
+\pgf@xb=\dimen115
+\pgf@yb=\dimen116
+\pgf@xc=\dimen117
+\pgf@yc=\dimen118
+\w@pgf@writea=\write3
+\r@pgf@reada=\read1
+\c@pgf@counta=\count87
+\c@pgf@countb=\count88
+\c@pgf@countc=\count89
+\c@pgf@countd=\count90
+\t@pgf@toka=\toks19
+\t@pgf@tokb=\toks20
+\t@pgf@tokc=\toks21
+ (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg
+File: pgf.cfg 2008/05/14 (rcs-revision 1.7)
+)
+Driver file for pgf: pgfsys-pdftex.def
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
+File: pgfsys-pdftex.def 2014/10/11 (rcs-revision 1.35)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.de
+f
+File: pgfsys-common-pdf.def 2013/10/10 (rcs-revision 1.13)
+)))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.
+tex
+File: pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9)
+\pgfsyssoftpath@smallbuffer@items=\count91
+\pgfsyssoftpath@bigbuffer@items=\count92
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.
+tex
+File: pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4)
+)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
+Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)
+
+(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg
+File: color.cfg 2016/01/02 v1.6 sample color configuration
+)
+Package xcolor Info: Driver file: pdftex.def on input line 225.
+Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1348.
+Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352.
+Package xcolor Info: Model `RGB' extended on input line 1364.
+Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
+Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
+Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
+Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
+Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
+Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex
+Package: pgfcore 2010/04/11 v3.0.1a (rcs-revision 1.7)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex
+\pgfmath@dimen=\dimen119
+\pgfmath@count=\count93
+\pgfmath@box=\box27
+\pgfmath@toks=\toks22
+\pgfmath@stack@operand=\toks23
+\pgfmath@stack@operation=\toks24
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code
+.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonomet
+ric.code.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.cod
+e.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison
+.code.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.
+tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code
+.tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.
+tex)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerari
+thmetics.code.tex)))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex
+\c@pgfmathroundto@lastzeros=\count94
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.te
+x
+File: pgfcorepoints.code.tex 2013/10/07 (rcs-revision 1.27)
+\pgf@picminx=\dimen120
+\pgf@picmaxx=\dimen121
+\pgf@picminy=\dimen122
+\pgf@picmaxy=\dimen123
+\pgf@pathminx=\dimen124
+\pgf@pathmaxx=\dimen125
+\pgf@pathminy=\dimen126
+\pgf@pathmaxy=\dimen127
+\pgf@xx=\dimen128
+\pgf@xy=\dimen129
+\pgf@yx=\dimen130
+\pgf@yy=\dimen131
+\pgf@zx=\dimen132
+\pgf@zy=\dimen133
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.
+code.tex
+File: pgfcorepathconstruct.code.tex 2013/10/07 (rcs-revision 1.29)
+\pgf@path@lastx=\dimen134
+\pgf@path@lasty=\dimen135
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code
+.tex
+File: pgfcorepathusage.code.tex 2014/11/02 (rcs-revision 1.24)
+\pgf@shorten@end@additional=\dimen136
+\pgf@shorten@start@additional=\dimen137
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.te
+x
+File: pgfcorescopes.code.tex 2015/05/08 (rcs-revision 1.46)
+\pgfpic=\box28
+\pgf@hbox=\box29
+\pgf@layerbox@main=\box30
+\pgf@picture@serial@count=\count95
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.c
+ode.tex
+File: pgfcoregraphicstate.code.tex 2014/11/02 (rcs-revision 1.12)
+\pgflinewidth=\dimen138
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformation
+s.code.tex
+File: pgfcoretransformations.code.tex 2015/08/07 (rcs-revision 1.20)
+\pgf@pt@x=\dimen139
+\pgf@pt@y=\dimen140
+\pgf@pt@temp=\dimen141
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex
+File: pgfcorequick.code.tex 2008/10/09 (rcs-revision 1.3)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.t
+ex
+File: pgfcoreobjects.code.tex 2006/10/11 (rcs-revision 1.2)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing
+.code.tex
+File: pgfcorepathprocessing.code.tex 2013/09/09 (rcs-revision 1.9)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.te
+x
+File: pgfcorearrows.code.tex 2015/05/14 (rcs-revision 1.43)
+\pgfarrowsep=\dimen142
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex
+File: pgfcoreshade.code.tex 2013/07/15 (rcs-revision 1.15)
+\pgf@max=\dimen143
+\pgf@sys@shading@range@num=\count96
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex
+File: pgfcoreimage.code.tex 2013/07/15 (rcs-revision 1.18)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.
+tex
+File: pgfcoreexternal.code.tex 2014/07/09 (rcs-revision 1.21)
+\pgfexternal@startupbox=\box31
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.te
+x
+File: pgfcorelayers.code.tex 2013/07/18 (rcs-revision 1.7)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.c
+ode.tex
+File: pgfcoretransparency.code.tex 2013/09/30 (rcs-revision 1.5)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.
+tex
+File: pgfcorepatterns.code.tex 2013/11/07 (rcs-revision 1.5)
+)))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleshapes.code.tex
+File: pgfmoduleshapes.code.tex 2014/03/21 (rcs-revision 1.35)
+\pgfnodeparttextbox=\box32
+) (/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmoduleplot.code.tex
+File: pgfmoduleplot.code.tex 2015/08/03 (rcs-revision 1.13)
+)
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-0-65
+.sty
+Package: pgfcomp-version-0-65 2007/07/03 v3.0.1a (rcs-revision 1.7)
+\pgf@nodesepstart=\dimen144
+\pgf@nodesepend=\dimen145
+)
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/compatibility/pgfcomp-version-1-18
+.sty
+Package: pgfcomp-version-1-18 2007/07/23 v3.0.1a (rcs-revision 1.1)
+)) (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgffor.sty
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfkeys.sty
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex))
+(/usr/share/texlive/texmf-dist/tex/latex/pgf/math/pgfmath.sty
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgffor.code.tex
+Package: pgffor 2013/12/13 v3.0.1a (rcs-revision 1.25)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex)
+\pgffor@iter=\dimen146
+\pgffor@skip=\dimen147
+\pgffor@stack=\toks25
+\pgffor@toks=\toks26
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/tikz.code.tex
+Package: tikz 2015/08/07 v3.0.1a (rcs-revision 1.151)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryplothandlers
+.code.tex
+File: pgflibraryplothandlers.code.tex 2013/08/31 v3.0.1a (rcs-revision 1.20)
+\pgf@plot@mark@count=\count97
+\pgfplotmarksize=\dimen148
+)
+\tikz@lastx=\dimen149
+\tikz@lasty=\dimen150
+\tikz@lastxsaved=\dimen151
+\tikz@lastysaved=\dimen152
+\tikzleveldistance=\dimen153
+\tikzsiblingdistance=\dimen154
+\tikz@figbox=\box33
+\tikz@figbox@bg=\box34
+\tikz@tempbox=\box35
+\tikz@tempbox@bg=\box36
+\tikztreelevel=\count98
+\tikznumberofchildren=\count99
+\tikznumberofcurrentchild=\count100
+\tikz@fig@count=\count101
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/modules/pgfmodulematrix.code.tex
+File: pgfmodulematrix.code.tex 2013/09/17 (rcs-revision 1.8)
+\pgfmatrixcurrentrow=\count102
+\pgfmatrixcurrentcolumn=\count103
+\pgf@matrix@numberofcolumns=\count104
+)
+\tikz@expandcount=\count105
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibrarytopaths.code.tex
+File: tikzlibrarytopaths.code.tex 2008/06/17 v3.0.1a (rcs-revision 1.2)
+)))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.code.tex
+File: tikzlibraryshapes.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.geometric.code.tex
+File: tikzlibraryshapes.geometric.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1
+)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.geometric.code.tex
+File: pgflibraryshapes.geometric.code.tex 2008/06/26 v3.0.1a (rcs-revision 1.1)
+
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.misc.code.tex
+File: tikzlibraryshapes.misc.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.misc.code.tex
+File: pgflibraryshapes.misc.code.tex 2013/07/18 v3.0.1a (rcs-revision 1.5)
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.symbols.code.tex
+File: tikzlibraryshapes.symbols.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.symbols.code.tex
+File: pgflibraryshapes.symbols.code.tex 2013/09/11 v3.0.1a (rcs-revision 1.6)
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.arrows.code.tex
+File: tikzlibraryshapes.arrows.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.arrows.code.tex
+File: pgflibraryshapes.arrows.code.tex 2008/06/26 v3.0.1a (rcs-revision 1.1)
+))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.callouts.code.tex
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.callouts.code.tex))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryshapes.multipart.code.tex
+File: tikzlibraryshapes.multipart.code.tex 2008/01/09 v3.0.1a (rcs-revision 1.1
+)
+
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/shapes/pgflibraryshape
+s.multipart.code.tex
+File: pgflibraryshapes.multipart.code.tex 2010/01/07 v3.0.1a (rcs-revision 1.2)
+
+\pgfnodepartlowerbox=\box37
+\pgfnodeparttwobox=\box38
+\pgfnodepartthreebox=\box39
+\pgfnodepartfourbox=\box40
+\pgfnodeparttwentybox=\box41
+\pgfnodepartnineteenbox=\box42
+\pgfnodeparteighteenbox=\box43
+\pgfnodepartseventeenbox=\box44
+\pgfnodepartsixteenbox=\box45
+\pgfnodepartfifteenbox=\box46
+\pgfnodepartfourteenbox=\box47
+\pgfnodepartthirteenbox=\box48
+\pgfnodeparttwelvebox=\box49
+\pgfnodepartelevenbox=\box50
+\pgfnodeparttenbox=\box51
+\pgfnodepartninebox=\box52
+\pgfnodeparteightbox=\box53
+\pgfnodepartsevenbox=\box54
+\pgfnodepartsixbox=\box55
+\pgfnodepartfivebox=\box56
+)))
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibraryfit.code.tex
+File: tikzlibraryfit.code.tex 2013/07/12 v3.0.1a (rcs-revision 1.5)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/frontendlayer/tikz/libraries/tik
+zlibrarycalc.code.tex
+File: tikzlibrarycalc.code.tex 2013/07/15 v3.0.1a (rcs-revision 1.9)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryintersection
+s.code.tex
+(/usr/share/texlive/texmf-dist/tex/generic/pgf/libraries/pgflibraryfpu.code.tex
+)
+\pgf@intersect@solutions=\count106
+) (/usr/share/texlive/texmf-dist/tex/latex/pgfopts/pgfopts.sty
+Package: pgfopts 2014/07/10 v2.1a LaTeX package options with pgfkeys
+\pgfopts@list@add@a@toks=\toks27
+\pgfopts@list@add@b@toks=\toks28
+)
+(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty
+Package: etoolbox 2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
+\etb@tempcnta=\count107
+)
+(/usr/share/texlive/texmf-dist/tex/latex/elocalloc/elocalloc.sty
+Package: elocalloc 2016/12/15 v0.03 local allocation for LaTeX 2015+ (DPC)
+)
+(/usr/share/texlive/texmf-dist/tex/latex/environ/environ.sty
+Package: environ 2014/05/04 v0.3 A new way to define environments
+
+(/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty
+Package: trimspaces 2009/09/17 v1.1 Trim spaces around a token list
+)
+\@envbody=\toks29
+)
+(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
+(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
+Package: expl3 2017/07/19 L3 programming layer (loader)
+
+(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex
+Package: expl3 2017/07/19 L3 programming layer (code)
+\c_max_int=\count108
+\l_tmpa_int=\count109
+\l_tmpb_int=\count110
+\g_tmpa_int=\count111
+\g_tmpb_int=\count112
+\g__intarray_font_int=\count113
+\g__prg_map_int=\count114
+\c_log_iow=\count115
+\l_iow_line_count_int=\count116
+\l__iow_line_target_int=\count117
+\l__iow_one_indent_int=\count118
+\l__iow_indent_int=\count119
+\c_zero_dim=\dimen155
+\c_max_dim=\dimen156
+\l_tmpa_dim=\dimen157
+\l_tmpb_dim=\dimen158
+\g_tmpa_dim=\dimen159
+\g_tmpb_dim=\dimen160
+\c_zero_skip=\skip43
+\c_max_skip=\skip44
+\l_tmpa_skip=\skip45
+\l_tmpb_skip=\skip46
+\g_tmpa_skip=\skip47
+\g_tmpb_skip=\skip48
+\c_zero_muskip=\muskip10
+\c_max_muskip=\muskip11
+\l_tmpa_muskip=\muskip12
+\l_tmpb_muskip=\muskip13
+\g_tmpa_muskip=\muskip14
+\g_tmpb_muskip=\muskip15
+\l_keys_choice_int=\count120
+\c__fp_leading_shift_int=\count121
+\c__fp_middle_shift_int=\count122
+\c__fp_trailing_shift_int=\count123
+\c__fp_big_leading_shift_int=\count124
+\c__fp_big_middle_shift_int=\count125
+\c__fp_big_trailing_shift_int=\count126
+\c__fp_Bigg_leading_shift_int=\count127
+\c__fp_Bigg_middle_shift_int=\count128
+\c__fp_Bigg_trailing_shift_int=\count129
+\c__fp_rand_size_int=\count130
+\c__fp_rand_four_int=\count131
+\c__fp_rand_eight_int=\count132
+\l__sort_length_int=\count133
+\l__sort_min_int=\count134
+\l__sort_top_int=\count135
+\l__sort_max_int=\count136
+\l__sort_true_max_int=\count137
+\l__sort_block_int=\count138
+\l__sort_begin_int=\count139
+\l__sort_end_int=\count140
+\l__sort_A_int=\count141
+\l__sort_B_int=\count142
+\l__sort_C_int=\count143
+\l__tl_build_start_index_int=\count144
+\l__tl_build_index_int=\count145
+\l__tl_analysis_normal_int=\count146
+\l__tl_analysis_index_int=\count147
+\l__tl_analysis_nesting_int=\count148
+\l__tl_analysis_type_int=\count149
+\l__regex_internal_a_int=\count150
+\l__regex_internal_b_int=\count151
+\l__regex_internal_c_int=\count152
+\l__regex_balance_int=\count153
+\l__regex_group_level_int=\count154
+\l__regex_mode_int=\count155
+\c__regex_cs_in_class_mode_int=\count156
+\c__regex_cs_mode_int=\count157
+\l__regex_catcodes_int=\count158
+\l__regex_default_catcodes_int=\count159
+\c__regex_catcode_D_int=\count160
+\c__regex_catcode_S_int=\count161
+\c__regex_catcode_L_int=\count162
+\c__regex_catcode_O_int=\count163
+\c__regex_catcode_A_int=\count164
+\c__regex_all_catcodes_int=\count165
+\l__regex_show_lines_int=\count166
+\l__regex_min_state_int=\count167
+\l__regex_max_state_int=\count168
+\l__regex_left_state_int=\count169
+\l__regex_right_state_int=\count170
+\l__regex_capturing_group_int=\count171
+\l__regex_min_pos_int=\count172
+\l__regex_max_pos_int=\count173
+\l__regex_curr_pos_int=\count174
+\l__regex_start_pos_int=\count175
+\l__regex_success_pos_int=\count176
+\l__regex_curr_char_int=\count177
+\l__regex_curr_catcode_int=\count178
+\l__regex_last_char_int=\count179
+\l__regex_case_changed_char_int=\count180
+\l__regex_curr_state_int=\count181
+\l__regex_step_int=\count182
+\l__regex_min_active_int=\count183
+\l__regex_max_active_int=\count184
+\l__regex_replacement_csnames_int=\count185
+\l__regex_match_count_int=\count186
+\l__regex_min_submatch_int=\count187
+\l__regex_submatch_int=\count188
+\l__regex_zeroth_submatch_int=\count189
+\g__debug_trace_regex_int=\count190
+\c_empty_box=\box57
+\l_tmpa_box=\box58
+\l_tmpb_box=\box59
+\g_tmpa_box=\box60
+\g_tmpb_box=\box61
+\l__box_top_dim=\dimen161
+\l__box_bottom_dim=\dimen162
+\l__box_left_dim=\dimen163
+\l__box_right_dim=\dimen164
+\l__box_top_new_dim=\dimen165
+\l__box_bottom_new_dim=\dimen166
+\l__box_left_new_dim=\dimen167
+\l__box_right_new_dim=\dimen168
+\l__box_internal_box=\box62
+\l__coffin_internal_box=\box63
+\l__coffin_internal_dim=\dimen169
+\l__coffin_offset_x_dim=\dimen170
+\l__coffin_offset_y_dim=\dimen171
+\l__coffin_x_dim=\dimen172
+\l__coffin_y_dim=\dimen173
+\l__coffin_x_prime_dim=\dimen174
+\l__coffin_y_prime_dim=\dimen175
+\c_empty_coffin=\box64
+\l__coffin_aligned_coffin=\box65
+\l__coffin_aligned_internal_coffin=\box66
+\l_tmpa_coffin=\box67
+\l_tmpb_coffin=\box68
+\l__coffin_display_coffin=\box69
+\l__coffin_display_coord_coffin=\box70
+\l__coffin_display_pole_coffin=\box71
+\l__coffin_display_offset_dim=\dimen176
+\l__coffin_display_x_dim=\dimen177
+\l__coffin_display_y_dim=\dimen178
+\l__coffin_bounding_shift_dim=\dimen179
+\l__coffin_left_corner_dim=\dimen180
+\l__coffin_right_corner_dim=\dimen181
+\l__coffin_bottom_corner_dim=\dimen182
+\l__coffin_top_corner_dim=\dimen183
+\l__coffin_scaled_total_height_dim=\dimen184
+\l__coffin_scaled_width_dim=\dimen185
+)
+(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3pdfmode.def
+File: l3pdfmode.def 2017/03/18 v L3 Experimental driver: PDF mode
+\l__driver_color_stack_int=\count191
+\l__driver_tmp_box=\box72
+))
+Package: xparse 2017/07/19 L3 Experimental document command parser
+\l__xparse_current_arg_int=\count192
+\g__xparse_grabber_int=\count193
+\l__xparse_m_args_int=\count194
+\l__xparse_mandatory_args_int=\count195
+\l__xparse_v_nesting_int=\count196
+)
+(/usr/share/texlive/texmf-dist/tex/latex/inlinedef/inlinedef.sty
+Package: inlinedef 2008/07/10 v1.0 Inlined expansions within definitions
+\ID@toks=\toks30
+\ID@count=\count197
+)
+\ID@usercommands=\toks31
+.................................................
+. LaTeX info: "xparse/define-command"
+.
+. Defining command \useforestlibrary with sig. 's O{} m' on line 166.
+.................................................
+.................................................
+. LaTeX info: "xparse/define-command"
+.
+. Defining command \ProvidesForestLibrary with sig. 'm O{}' on line 176.
+.................................................
+\safeloop@depth=\count198
+\safeRKloop@depth=\count199
+\forest@temp@dimen=\dimen186
+\forest@temp@count=\count266
+\forest@n=\count267
+\forest@temp@global@count=\count268
+\forest@temp@toks=\toks32
+\forest@temparray@M=\count269
+\forest@temparray@N=\count270
+\forest@global@temparray@M=\count271
+\forest@global@temparray@N=\count272
+\forest@isnum@count=\count273
+\forest@isdim@nonintpart=\count274
+\forest@isdim@dimen=\dimen187
+\forest@sort@m=\count275
+\forest@sort@k=\count276
+\forest@sort@p=\count277
+\bracket@content=\toks33
+\bracket@afterthought=\toks34
+\forest@node@maxid=\count278
+.................................................
+. LaTeX info: "xparse/define-command"
+.
+. Defining command \forestdebugtypeouttrees with sig. 'o' on line 2303.
+.................................................
+.................................................
+. LaTeX info: "xparse/define-command"
+.
+. Defining command \forestdebugtypeouttree with sig. 'd() O{\forest@cn }' on
+. line 2348.
+.................................................
+\forest@process@left@M=\count279
+\forest@process@left@N=\count280
+\forest@process@right@M=\count281
+\forest@process@right@N=\count282
+\forest@process@saved@M=\count283
+\forest@process@saved@N=\count284
+\forest@process@result@M=\count285
+\forest@process@result@N=\count286
+\forest@process@n=\count287
+\forest@nodewalk@branch@toks=\toks35
+\forest@nodewalk@shortsteps@resolution=\toks36
+\forest@do@dynamics=\toks37
+\forest@box=\box73
+\forest@xg=\dimen188
+\forest@yg=\dimen189
+\forest@xs=\dimen190
+\forest@ys=\dimen191
+\forest@pi@toks=\toks38
+\forest@segment@toks=\toks39
+\forest@PIi@toks=\toks40
+\forest@PIii@toks=\toks41
+\forest@copy@in=\read2
+\forest@copy@out=\write4
+.................................................
+. LaTeX info: "xparse/define-environment"
+.
+. Defining environment 'forest' with sig. 'D(){}' on line 8510.
+.................................................
+.................................................
+. LaTeX info: "xparse/define-command"
+.
+. Defining command \Forest with sig. 's D(){} m' on line 8515.
+.................................................
+\forest@externalize@max@outer@n=\count288
+\forest@externalize@inner@n=\count289
+)
+(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
+Package: fontenc 2017/04/05 v2.0i Standard LaTeX package
+
+(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.def
+File: t1enc.def 2017/04/05 v2.0i Standard LaTeX file
+LaTeX Font Info: Redeclaring font encoding T1 on input line 48.
+))
+(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
+Package: inputenc 2015/03/17 v1.2c Input encoding file
+\inpenc@prehook=\toks42
+\inpenc@posthook=\toks43
+
+(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
+File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
+Now handling font encoding OML ...
+... no UTF-8 mapping file for font encoding OML
+Now handling font encoding T1 ...
+... processing UTF-8 mapping file for font encoding T1
+
+(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu
+File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
+ defining Unicode char U+00A0 (decimal 160)
+ defining Unicode char U+00A1 (decimal 161)
+ defining Unicode char U+00A3 (decimal 163)
+ defining Unicode char U+00AB (decimal 171)
+ defining Unicode char U+00AD (decimal 173)
+ defining Unicode char U+00BB (decimal 187)
+ defining Unicode char U+00BF (decimal 191)
+ defining Unicode char U+00C0 (decimal 192)
+ defining Unicode char U+00C1 (decimal 193)
+ defining Unicode char U+00C2 (decimal 194)
+ defining Unicode char U+00C3 (decimal 195)
+ defining Unicode char U+00C4 (decimal 196)
+ defining Unicode char U+00C5 (decimal 197)
+ defining Unicode char U+00C6 (decimal 198)
+ defining Unicode char U+00C7 (decimal 199)
+ defining Unicode char U+00C8 (decimal 200)
+ defining Unicode char U+00C9 (decimal 201)
+ defining Unicode char U+00CA (decimal 202)
+ defining Unicode char U+00CB (decimal 203)
+ defining Unicode char U+00CC (decimal 204)
+ defining Unicode char U+00CD (decimal 205)
+ defining Unicode char U+00CE (decimal 206)
+ defining Unicode char U+00CF (decimal 207)
+ defining Unicode char U+00D0 (decimal 208)
+ defining Unicode char U+00D1 (decimal 209)
+ defining Unicode char U+00D2 (decimal 210)
+ defining Unicode char U+00D3 (decimal 211)
+ defining Unicode char U+00D4 (decimal 212)
+ defining Unicode char U+00D5 (decimal 213)
+ defining Unicode char U+00D6 (decimal 214)
+ defining Unicode char U+00D8 (decimal 216)
+ defining Unicode char U+00D9 (decimal 217)
+ defining Unicode char U+00DA (decimal 218)
+ defining Unicode char U+00DB (decimal 219)
+ defining Unicode char U+00DC (decimal 220)
+ defining Unicode char U+00DD (decimal 221)
+ defining Unicode char U+00DE (decimal 222)
+ defining Unicode char U+00DF (decimal 223)
+ defining Unicode char U+00E0 (decimal 224)
+ defining Unicode char U+00E1 (decimal 225)
+ defining Unicode char U+00E2 (decimal 226)
+ defining Unicode char U+00E3 (decimal 227)
+ defining Unicode char U+00E4 (decimal 228)
+ defining Unicode char U+00E5 (decimal 229)
+ defining Unicode char U+00E6 (decimal 230)
+ defining Unicode char U+00E7 (decimal 231)
+ defining Unicode char U+00E8 (decimal 232)
+ defining Unicode char U+00E9 (decimal 233)
+ defining Unicode char U+00EA (decimal 234)
+ defining Unicode char U+00EB (decimal 235)
+ defining Unicode char U+00EC (decimal 236)
+ defining Unicode char U+00ED (decimal 237)
+ defining Unicode char U+00EE (decimal 238)
+ defining Unicode char U+00EF (decimal 239)
+ defining Unicode char U+00F0 (decimal 240)
+ defining Unicode char U+00F1 (decimal 241)
+ defining Unicode char U+00F2 (decimal 242)
+ defining Unicode char U+00F3 (decimal 243)
+ defining Unicode char U+00F4 (decimal 244)
+ defining Unicode char U+00F5 (decimal 245)
+ defining Unicode char U+00F6 (decimal 246)
+ defining Unicode char U+00F8 (decimal 248)
+ defining Unicode char U+00F9 (decimal 249)
+ defining Unicode char U+00FA (decimal 250)
+ defining Unicode char U+00FB (decimal 251)
+ defining Unicode char U+00FC (decimal 252)
+ defining Unicode char U+00FD (decimal 253)
+ defining Unicode char U+00FE (decimal 254)
+ defining Unicode char U+00FF (decimal 255)
+ defining Unicode char U+0100 (decimal 256)
+ defining Unicode char U+0101 (decimal 257)
+ defining Unicode char U+0102 (decimal 258)
+ defining Unicode char U+0103 (decimal 259)
+ defining Unicode char U+0104 (decimal 260)
+ defining Unicode char U+0105 (decimal 261)
+ defining Unicode char U+0106 (decimal 262)
+ defining Unicode char U+0107 (decimal 263)
+ defining Unicode char U+0108 (decimal 264)
+ defining Unicode char U+0109 (decimal 265)
+ defining Unicode char U+010A (decimal 266)
+ defining Unicode char U+010B (decimal 267)
+ defining Unicode char U+010C (decimal 268)
+ defining Unicode char U+010D (decimal 269)
+ defining Unicode char U+010E (decimal 270)
+ defining Unicode char U+010F (decimal 271)
+ defining Unicode char U+0110 (decimal 272)
+ defining Unicode char U+0111 (decimal 273)
+ defining Unicode char U+0112 (decimal 274)
+ defining Unicode char U+0113 (decimal 275)
+ defining Unicode char U+0114 (decimal 276)
+ defining Unicode char U+0115 (decimal 277)
+ defining Unicode char U+0116 (decimal 278)
+ defining Unicode char U+0117 (decimal 279)
+ defining Unicode char U+0118 (decimal 280)
+ defining Unicode char U+0119 (decimal 281)
+ defining Unicode char U+011A (decimal 282)
+ defining Unicode char U+011B (decimal 283)
+ defining Unicode char U+011C (decimal 284)
+ defining Unicode char U+011D (decimal 285)
+ defining Unicode char U+011E (decimal 286)
+ defining Unicode char U+011F (decimal 287)
+ defining Unicode char U+0120 (decimal 288)
+ defining Unicode char U+0121 (decimal 289)
+ defining Unicode char U+0122 (decimal 290)
+ defining Unicode char U+0123 (decimal 291)
+ defining Unicode char U+0124 (decimal 292)
+ defining Unicode char U+0125 (decimal 293)
+ defining Unicode char U+0128 (decimal 296)
+ defining Unicode char U+0129 (decimal 297)
+ defining Unicode char U+012A (decimal 298)
+ defining Unicode char U+012B (decimal 299)
+ defining Unicode char U+012C (decimal 300)
+ defining Unicode char U+012D (decimal 301)
+ defining Unicode char U+012E (decimal 302)
+ defining Unicode char U+012F (decimal 303)
+ defining Unicode char U+0130 (decimal 304)
+ defining Unicode char U+0131 (decimal 305)
+ defining Unicode char U+0132 (decimal 306)
+ defining Unicode char U+0133 (decimal 307)
+ defining Unicode char U+0134 (decimal 308)
+ defining Unicode char U+0135 (decimal 309)
+ defining Unicode char U+0136 (decimal 310)
+ defining Unicode char U+0137 (decimal 311)
+ defining Unicode char U+0139 (decimal 313)
+ defining Unicode char U+013A (decimal 314)
+ defining Unicode char U+013B (decimal 315)
+ defining Unicode char U+013C (decimal 316)
+ defining Unicode char U+013D (decimal 317)
+ defining Unicode char U+013E (decimal 318)
+ defining Unicode char U+0141 (decimal 321)
+ defining Unicode char U+0142 (decimal 322)
+ defining Unicode char U+0143 (decimal 323)
+ defining Unicode char U+0144 (decimal 324)
+ defining Unicode char U+0145 (decimal 325)
+ defining Unicode char U+0146 (decimal 326)
+ defining Unicode char U+0147 (decimal 327)
+ defining Unicode char U+0148 (decimal 328)
+ defining Unicode char U+014A (decimal 330)
+ defining Unicode char U+014B (decimal 331)
+ defining Unicode char U+014C (decimal 332)
+ defining Unicode char U+014D (decimal 333)
+ defining Unicode char U+014E (decimal 334)
+ defining Unicode char U+014F (decimal 335)
+ defining Unicode char U+0150 (decimal 336)
+ defining Unicode char U+0151 (decimal 337)
+ defining Unicode char U+0152 (decimal 338)
+ defining Unicode char U+0153 (decimal 339)
+ defining Unicode char U+0154 (decimal 340)
+ defining Unicode char U+0155 (decimal 341)
+ defining Unicode char U+0156 (decimal 342)
+ defining Unicode char U+0157 (decimal 343)
+ defining Unicode char U+0158 (decimal 344)
+ defining Unicode char U+0159 (decimal 345)
+ defining Unicode char U+015A (decimal 346)
+ defining Unicode char U+015B (decimal 347)
+ defining Unicode char U+015C (decimal 348)
+ defining Unicode char U+015D (decimal 349)
+ defining Unicode char U+015E (decimal 350)
+ defining Unicode char U+015F (decimal 351)
+ defining Unicode char U+0160 (decimal 352)
+ defining Unicode char U+0161 (decimal 353)
+ defining Unicode char U+0162 (decimal 354)
+ defining Unicode char U+0163 (decimal 355)
+ defining Unicode char U+0164 (decimal 356)
+ defining Unicode char U+0165 (decimal 357)
+ defining Unicode char U+0168 (decimal 360)
+ defining Unicode char U+0169 (decimal 361)
+ defining Unicode char U+016A (decimal 362)
+ defining Unicode char U+016B (decimal 363)
+ defining Unicode char U+016C (decimal 364)
+ defining Unicode char U+016D (decimal 365)
+ defining Unicode char U+016E (decimal 366)
+ defining Unicode char U+016F (decimal 367)
+ defining Unicode char U+0170 (decimal 368)
+ defining Unicode char U+0171 (decimal 369)
+ defining Unicode char U+0172 (decimal 370)
+ defining Unicode char U+0173 (decimal 371)
+ defining Unicode char U+0174 (decimal 372)
+ defining Unicode char U+0175 (decimal 373)
+ defining Unicode char U+0176 (decimal 374)
+ defining Unicode char U+0177 (decimal 375)
+ defining Unicode char U+0178 (decimal 376)
+ defining Unicode char U+0179 (decimal 377)
+ defining Unicode char U+017A (decimal 378)
+ defining Unicode char U+017B (decimal 379)
+ defining Unicode char U+017C (decimal 380)
+ defining Unicode char U+017D (decimal 381)
+ defining Unicode char U+017E (decimal 382)
+ defining Unicode char U+01CD (decimal 461)
+ defining Unicode char U+01CE (decimal 462)
+ defining Unicode char U+01CF (decimal 463)
+ defining Unicode char U+01D0 (decimal 464)
+ defining Unicode char U+01D1 (decimal 465)
+ defining Unicode char U+01D2 (decimal 466)
+ defining Unicode char U+01D3 (decimal 467)
+ defining Unicode char U+01D4 (decimal 468)
+ defining Unicode char U+01E2 (decimal 482)
+ defining Unicode char U+01E3 (decimal 483)
+ defining Unicode char U+01E6 (decimal 486)
+ defining Unicode char U+01E7 (decimal 487)
+ defining Unicode char U+01E8 (decimal 488)
+ defining Unicode char U+01E9 (decimal 489)
+ defining Unicode char U+01EA (decimal 490)
+ defining Unicode char U+01EB (decimal 491)
+ defining Unicode char U+01F0 (decimal 496)
+ defining Unicode char U+01F4 (decimal 500)
+ defining Unicode char U+01F5 (decimal 501)
+ defining Unicode char U+0218 (decimal 536)
+ defining Unicode char U+0219 (decimal 537)
+ defining Unicode char U+021A (decimal 538)
+ defining Unicode char U+021B (decimal 539)
+ defining Unicode char U+0232 (decimal 562)
+ defining Unicode char U+0233 (decimal 563)
+ defining Unicode char U+1E02 (decimal 7682)
+ defining Unicode char U+1E03 (decimal 7683)
+ defining Unicode char U+200C (decimal 8204)
+ defining Unicode char U+2010 (decimal 8208)
+ defining Unicode char U+2011 (decimal 8209)
+ defining Unicode char U+2012 (decimal 8210)
+ defining Unicode char U+2013 (decimal 8211)
+ defining Unicode char U+2014 (decimal 8212)
+ defining Unicode char U+2015 (decimal 8213)
+ defining Unicode char U+2018 (decimal 8216)
+ defining Unicode char U+2019 (decimal 8217)
+ defining Unicode char U+201A (decimal 8218)
+ defining Unicode char U+201C (decimal 8220)
+ defining Unicode char U+201D (decimal 8221)
+ defining Unicode char U+201E (decimal 8222)
+ defining Unicode char U+2030 (decimal 8240)
+ defining Unicode char U+2031 (decimal 8241)
+ defining Unicode char U+2039 (decimal 8249)
+ defining Unicode char U+203A (decimal 8250)
+ defining Unicode char U+2423 (decimal 9251)
+ defining Unicode char U+1E20 (decimal 7712)
+ defining Unicode char U+1E21 (decimal 7713)
+)
+Now handling font encoding OT1 ...
+... processing UTF-8 mapping file for font encoding OT1
+
+(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu
+File: ot1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
+ defining Unicode char U+00A0 (decimal 160)
+ defining Unicode char U+00A1 (decimal 161)
+ defining Unicode char U+00A3 (decimal 163)
+ defining Unicode char U+00AD (decimal 173)
+ defining Unicode char U+00B8 (decimal 184)
+ defining Unicode char U+00BF (decimal 191)
+ defining Unicode char U+00C5 (decimal 197)
+ defining Unicode char U+00C6 (decimal 198)
+ defining Unicode char U+00D8 (decimal 216)
+ defining Unicode char U+00DF (decimal 223)
+ defining Unicode char U+00E6 (decimal 230)
+ defining Unicode char U+00EC (decimal 236)
+ defining Unicode char U+00ED (decimal 237)
+ defining Unicode char U+00EE (decimal 238)
+ defining Unicode char U+00EF (decimal 239)
+ defining Unicode char U+00F8 (decimal 248)
+ defining Unicode char U+0131 (decimal 305)
+ defining Unicode char U+0141 (decimal 321)
+ defining Unicode char U+0142 (decimal 322)
+ defining Unicode char U+0152 (decimal 338)
+ defining Unicode char U+0153 (decimal 339)
+ defining Unicode char U+0174 (decimal 372)
+ defining Unicode char U+0175 (decimal 373)
+ defining Unicode char U+0176 (decimal 374)
+ defining Unicode char U+0177 (decimal 375)
+ defining Unicode char U+0218 (decimal 536)
+ defining Unicode char U+0219 (decimal 537)
+ defining Unicode char U+021A (decimal 538)
+ defining Unicode char U+021B (decimal 539)
+ defining Unicode char U+2013 (decimal 8211)
+ defining Unicode char U+2014 (decimal 8212)
+ defining Unicode char U+2018 (decimal 8216)
+ defining Unicode char U+2019 (decimal 8217)
+ defining Unicode char U+201C (decimal 8220)
+ defining Unicode char U+201D (decimal 8221)
+)
+Now handling font encoding OMS ...
+... processing UTF-8 mapping file for font encoding OMS
+
+(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu
+File: omsenc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
+ defining Unicode char U+00A7 (decimal 167)
+ defining Unicode char U+00B6 (decimal 182)
+ defining Unicode char U+00B7 (decimal 183)
+ defining Unicode char U+2020 (decimal 8224)
+ defining Unicode char U+2021 (decimal 8225)
+ defining Unicode char U+2022 (decimal 8226)
+)
+Now handling font encoding OMX ...
+... no UTF-8 mapping file for font encoding OMX
+Now handling font encoding U ...
+... no UTF-8 mapping file for font encoding U
+ defining Unicode char U+00A9 (decimal 169)
+ defining Unicode char U+00AA (decimal 170)
+ defining Unicode char U+00AE (decimal 174)
+ defining Unicode char U+00BA (decimal 186)
+ defining Unicode char U+02C6 (decimal 710)
+ defining Unicode char U+02DC (decimal 732)
+ defining Unicode char U+200C (decimal 8204)
+ defining Unicode char U+2026 (decimal 8230)
+ defining Unicode char U+2122 (decimal 8482)
+ defining Unicode char U+2423 (decimal 9251)
+))
+(/usr/share/texmf/tex/latex/lm/lmodern.sty
+Package: lmodern 2009/10/30 v1.6 Latin Modern Fonts
+LaTeX Font Info: Overwriting symbol font `operators' in version `normal'
+(Font) OT1/cmr/m/n --> OT1/lmr/m/n on input line 22.
+LaTeX Font Info: Overwriting symbol font `letters' in version `normal'
+(Font) OML/cmm/m/it --> OML/lmm/m/it on input line 23.
+LaTeX Font Info: Overwriting symbol font `symbols' in version `normal'
+(Font) OMS/cmsy/m/n --> OMS/lmsy/m/n on input line 24.
+LaTeX Font Info: Overwriting symbol font `largesymbols' in version `normal'
+(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 25.
+LaTeX Font Info: Overwriting symbol font `operators' in version `bold'
+(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 26.
+LaTeX Font Info: Overwriting symbol font `letters' in version `bold'
+(Font) OML/cmm/b/it --> OML/lmm/b/it on input line 27.
+LaTeX Font Info: Overwriting symbol font `symbols' in version `bold'
+(Font) OMS/cmsy/b/n --> OMS/lmsy/b/n on input line 28.
+LaTeX Font Info: Overwriting symbol font `largesymbols' in version `bold'
+(Font) OMX/cmex/m/n --> OMX/lmex/m/n on input line 29.
+LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `normal'
+(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 31.
+LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `normal'
+(Font) OT1/cmss/m/n --> OT1/lmss/m/n on input line 32.
+LaTeX Font Info: Overwriting math alphabet `\mathit' in version `normal'
+(Font) OT1/cmr/m/it --> OT1/lmr/m/it on input line 33.
+LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `normal'
+(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 34.
+LaTeX Font Info: Overwriting math alphabet `\mathbf' in version `bold'
+(Font) OT1/cmr/bx/n --> OT1/lmr/bx/n on input line 35.
+LaTeX Font Info: Overwriting math alphabet `\mathsf' in version `bold'
+(Font) OT1/cmss/bx/n --> OT1/lmss/bx/n on input line 36.
+LaTeX Font Info: Overwriting math alphabet `\mathit' in version `bold'
+(Font) OT1/cmr/bx/it --> OT1/lmr/bx/it on input line 37.
+LaTeX Font Info: Overwriting math alphabet `\mathtt' in version `bold'
+(Font) OT1/cmtt/m/n --> OT1/lmtt/m/n on input line 38.
+)
+(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty
+Package: hyperref 2017/03/14 v6.85a Hypertext links for LaTeX
+
+(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty
+Package: hobsub-hyperref 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
+
+
+(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty
+Package: hobsub-generic 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
+Package: hobsub 2016/05/16 v1.14 Construct package bundles (HO)
+Package: infwarerr 2016/05/16 v1.4 Providing info/warning/error messages (HO)
+Package: ltxcmds 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
+Package: ifluatex 2016/05/16 v1.4 Provides the ifluatex switch (HO)
+Package ifluatex Info: LuaTeX not detected.
+Package: ifvtex 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
+Package ifvtex Info: VTeX not detected.
+Package: intcalc 2016/05/16 v1.2 Expandable calculations with integers (HO)
+Package: ifpdf 2017/03/15 v3.2 Provides the ifpdf switch
+Package: etexcmds 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
+Package etexcmds Info: Could not find \expanded.
+(etexcmds) That can mean that you are not using pdfTeX 1.50 or
+(etexcmds) that some package has redefined \expanded.
+(etexcmds) In the latter case, load this package earlier.
+Package: kvsetkeys 2016/05/16 v1.17 Key value parser (HO)
+Package: kvdefinekeys 2016/05/16 v1.4 Define keys (HO)
+Package: pdftexcmds 2017/03/19 v0.25 Utility functions of pdfTeX for LuaTeX (HO
+)
+Package pdftexcmds Info: LuaTeX not detected.
+Package pdftexcmds Info: \pdf@primitive is available.
+Package pdftexcmds Info: \pdf@ifprimitive is available.
+Package pdftexcmds Info: \pdfdraftmode found.
+Package: pdfescape 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
+Package: bigintcalc 2016/05/16 v1.4 Expandable calculations on big integers (HO
+)
+Package: bitset 2016/05/16 v1.2 Handle bit-vector datatype (HO)
+Package: uniquecounter 2016/05/16 v1.3 Provide unlimited unique counter (HO)
+)
+Package hobsub Info: Skipping package `hobsub' (already loaded).
+Package: letltxmacro 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
+Package: hopatch 2016/05/16 v1.3 Wrapper for package hooks (HO)
+Package: xcolor-patch 2016/05/16 xcolor patch
+Package: atveryend 2016/05/16 v1.9 Hooks at the very end of document (HO)
+Package: atbegshi 2016/06/09 v1.18 At begin shipout hook (HO)
+Package: refcount 2016/05/16 v3.5 Data extraction from label references (HO)
+Package: hycolor 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
+)
+(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty
+Package: ifxetex 2010/09/12 v0.6 Provides ifxetex conditional
+)
+(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty
+Package: auxhook 2016/05/16 v1.4 Hooks for auxiliary files (HO)
+)
+(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty
+Package: kvoptions 2016/05/16 v3.12 Key value format for package options (HO)
+)
+\@linkdim=\dimen192
+\Hy@linkcounter=\count290
+\Hy@pagecounter=\count291
+
+(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def
+File: pd1enc.def 2017/03/14 v6.85a Hyperref: PDFDocEncoding definition (HO)
+Now handling font encoding PD1 ...
+... no UTF-8 mapping file for font encoding PD1
+)
+\Hy@SavedSpaceFactor=\count292
+
+(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg
+File: hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
+)
+Package hyperref Info: Hyper figures OFF on input line 4498.
+Package hyperref Info: Link nesting OFF on input line 4503.
+Package hyperref Info: Hyper index ON on input line 4506.
+Package hyperref Info: Plain pages OFF on input line 4513.
+Package hyperref Info: Backreferencing OFF on input line 4518.
+Package hyperref Info: Implicit mode ON; LaTeX internals redefined.
+Package hyperref Info: Bookmarks ON on input line 4751.
+\c@Hy@tempcnt=\count293
+
+(/usr/share/texlive/texmf-dist/tex/latex/url/url.sty
+\Urlmuskip=\muskip16
+Package: url 2013/09/16 ver 3.4 Verb mode for urls, etc.
+)
+LaTeX Info: Redefining \url on input line 5104.
+\XeTeXLinkMargin=\dimen193
+\Fld@menulength=\count294
+\Field@Width=\dimen194
+\Fld@charsize=\dimen195
+Package hyperref Info: Hyper figures OFF on input line 6358.
+Package hyperref Info: Link nesting OFF on input line 6363.
+Package hyperref Info: Hyper index ON on input line 6366.
+Package hyperref Info: backreferencing OFF on input line 6373.
+Package hyperref Info: Link coloring OFF on input line 6378.
+Package hyperref Info: Link coloring with OCG OFF on input line 6383.
+Package hyperref Info: PDF/A mode OFF on input line 6388.
+LaTeX Info: Redefining \ref on input line 6428.
+LaTeX Info: Redefining \pageref on input line 6432.
+\Hy@abspage=\count295
+\c@Item=\count296
+\c@Hfootnote=\count297
+)
+
+Package hyperref Message: Driver (autodetected): hpdftex.
+
+(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
+File: hpdftex.def 2017/03/14 v6.85a Hyperref driver for pdfTeX
+\Fld@listcount=\count298
+\c@bookmark@seq@number=\count299
+
+(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty
+Package: rerunfilecheck 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
+Package uniquecounter Info: New unique counter `rerunfilecheck' on input line 2
+82.
+)
+\Hy@SectionHShift=\skip49
+)
+(/usr/share/texlive/texmf-dist/tex/latex/tcolorbox/tcolorbox.sty
+Package: tcolorbox 2017/07/05 version 4.10 text color boxes
+
+(/usr/share/texlive/texmf-dist/tex/latex/tools/verbatim.sty
+Package: verbatim 2014/10/28 v1.5q LaTeX2e package for verbatim enhancements
+\every@verbatim=\toks44
+\verbatim@line=\toks45
+\verbatim@in@stream=\read3
+)
+\tcb@titlebox=\box74
+\tcb@upperbox=\box75
+\tcb@lowerbox=\box76
+\tcb@phantombox=\box77
+\c@tcbbreakpart=\count300
+\c@tcblayer=\count301
+\tcolorbox@number=\count302
+\tcb@temp=\box78
+\tcb@temp=\box79
+\tcb@temp=\box80
+\tcb@temp=\box81
+\tcb@out=\write5
+\tcb@record@out=\write6
+)
+(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.sty
+\lst@mode=\count303
+\lst@gtempboxa=\box82
+\lst@token=\toks46
+\lst@length=\count304
+\lst@currlwidth=\dimen196
+\lst@column=\count305
+\lst@pos=\count306
+\lst@lostspace=\dimen197
+\lst@width=\dimen198
+\lst@newlines=\count307
+\lst@lineno=\count308
+\lst@maxwidth=\dimen199
+
+(/usr/share/texlive/texmf-dist/tex/latex/listings/lstmisc.sty
+File: lstmisc.sty 2015/06/04 1.6 (Carsten Heinz)
+\c@lstnumber=\count309
+\lst@skipnumbers=\count310
+\lst@framebox=\box83
+)
+(/usr/share/texlive/texmf-dist/tex/latex/listings/listings.cfg
+File: listings.cfg 2015/06/04 1.6 listings configuration
+))
+Package: listings 2015/06/04 1.6 (Carsten Heinz)
+
+(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty
+Package: fancyhdr 2017/06/30 v3.9a Extensive control of page headers and footer
+s
+\f@nch@headwidth=\skip50
+\f@nch@O@elh=\skip51
+\f@nch@O@erh=\skip52
+\f@nch@O@olh=\skip53
+\f@nch@O@orh=\skip54
+\f@nch@O@elf=\skip55
+\f@nch@O@erf=\skip56
+\f@nch@O@olf=\skip57
+\f@nch@O@orf=\skip58
+)
+(/usr/share/texlive/texmf-dist/tex/latex/tools/longtable.sty
+Package: longtable 2014/10/28 v4.11 Multi-page Table package (DPC)
+\LTleft=\skip59
+\LTright=\skip60
+\LTpre=\skip61
+\LTpost=\skip62
+\LTchunksize=\count311
+\LTcapwidth=\dimen256
+\LT@head=\box84
+\LT@firsthead=\box85
+\LT@foot=\box86
+\LT@lastfoot=\box87
+\LT@cols=\count312
+\LT@rows=\count313
+\c@LT@tables=\count314
+\c@LT@chunks=\count315
+\LT@p@ftn=\toks47
+)
+(/usr/share/texlive/texmf-dist/tex/latex/caption/caption.sty
+Package: caption 2016/02/21 v3.3-144 Customizing captions (AR)
+
+(/usr/share/texlive/texmf-dist/tex/latex/caption/caption3.sty
+Package: caption3 2016/05/22 v1.7-166 caption3 kernel (AR)
+Package caption3 Info: TeX engine: e-TeX on input line 67.
+\captionmargin=\dimen257
+\captionmargin@=\dimen258
+\captionwidth=\dimen259
+\caption@tempdima=\dimen260
+\caption@indent=\dimen261
+\caption@parindent=\dimen262
+\caption@hangindent=\dimen263
+)
+\c@ContinuedFloat=\count316
+Package caption Info: hyperref package is loaded.
+Package caption Info: listings package is loaded.
+Package caption Info: longtable package is loaded.
+
+(/usr/share/texlive/texmf-dist/tex/latex/caption/ltcaption.sty
+Package: ltcaption 2013/06/09 v1.4-94 longtable captions (AR)
+))
+(/usr/share/texlive/texmf-dist/tex/latex/yafoot/dblfnote.sty
+Package: dblfnote 1999/07/14 v1.0
+\c@DFNsloppiness=\count317
+\DFNcolumnsep=\dimen264
+\DFNcolumnwidth=\dimen265
+\dfn@fnht=\dimen266
+\dfn@fnmaxdp=\dimen267
+\dfn@dima=\dimen268
+\dfn@dimb=\dimen269
+\dfn@ins=\box88
+\dfn@boxa=\box89
+\dfn@boxb=\box90
+\dfn@output=\toks48
+)
+(/usr/share/texlive/texmf-dist/tex/latex/appendix/appendix.sty
+Package: appendix 2009/09/02 v1.2b extra appendix facilities
+\c@@pps=\count318
+\c@@ppsavesec=\count319
+\c@@ppsaveapp=\count320
+)
+(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
+Package: babel 2017/06/29 3.12 The Babel package
+
+(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def
+File: switch.def 2017/06/29 3.12 Babel switching mechanism
+)
+(/usr/share/texlive/texmf-dist/tex/generic/babel-english/english.ldf
+Language: english 2017/06/06 v3.3r English support from the babel system
+
+(/usr/share/texlive/texmf-dist/tex/generic/babel/babel.def
+File: babel.def 2017/06/29 3.12 Babel common definitions
+
+(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def
+File: switch.def 2017/06/29 3.12 Babel switching mechanism
+)
+\babel@savecnt=\count321
+\U@D=\dimen270
+)
+\l@canadian = a dialect from \language\l@american
+\l@australian = a dialect from \language\l@british
+\l@newzealand = a dialect from \language\l@british
+))
+(./OM_Arduino.aux)
+\openout1 = `OM_Arduino.aux'.
+
+LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Checking defaults for PD1/pdf/m/n on input line 13.
+LaTeX Font Info: ... okay on input line 13.
+LaTeX Font Info: Try loading font information for T1+lmr on input line 13.
+ (/usr/share/texmf/tex/latex/lm/t1lmr.fd
+File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
+)
+ABD: EveryShipout initializing macros
+(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
+[Loading MPS to PDF converter (version 2006.09.02).]
+\scratchcounter=\count322
+\scratchdimen=\dimen271
+\scratchbox=\box91
+\nofMPsegments=\count323
+\nofMParguments=\count324
+\everyMPshowfont=\toks49
+\MPscratchCnt=\count325
+\MPscratchDim=\dimen272
+\MPnumerator=\count326
+\makeMPintoPDFobject=\count327
+\everyMPtoPDFconversion=\toks50
+) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty
+Package: epstopdf-base 2016/05/15 v2.6 Base part for package epstopdf
+
+(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty
+Package: grfext 2016/05/16 v1.2 Manage graphics extensions (HO)
+)
+Package epstopdf-base Info: Redefining graphics rule for `.eps' on input line 4
+38.
+Package grfext Info: Graphics extension search list:
+(grfext) [.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,.PDF,.PNG,.JPG,.JPE
+G,.JBIG2,.JB2,.eps]
+(grfext) \AppendGraphicsExtensions on input line 456.
+
+(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
+File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Liv
+e
+))
+\AtBeginShipoutBox=\box92
+Package hyperref Info: Link coloring OFF on input line 13.
+
+(/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty
+Package: nameref 2016/05/21 v2.44 Cross-referencing by name of section
+
+(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty
+Package: gettitlestring 2016/05/16 v1.5 Cleanup title references (HO)
+)
+\c@section@level=\count328
+)
+LaTeX Info: Redefining \ref on input line 13.
+LaTeX Info: Redefining \pageref on input line 13.
+LaTeX Info: Redefining \nameref on input line 13.
+
+(./OM_Arduino.out) (./OM_Arduino.out)
+\@outlinefile=\write7
+\openout7 = `OM_Arduino.out'.
+
+\c@lstlisting=\count329
+Package caption Info: Begin \AtBeginDocument code.
+Package caption Info: End \AtBeginDocument code.
+LaTeX Font Info: Try loading font information for OMS+lmr on input line 26.
+ (/usr/share/texmf/tex/latex/lm/omslmr.fd
+File: omslmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
+)
+LaTeX Font Info: Try loading font information for OMS+lmsy on input line 26.
+
+(/usr/share/texmf/tex/latex/lm/omslmsy.fd
+File: omslmsy.fd 2009/10/30 v1.6 Font defs for Latin Modern
+)
+LaTeX Font Info: Font shape `OMS/lmr/m/n' in size <10> not available
+(Font) Font shape `OMS/lmsy/m/n' tried instead on input line 26.
+<Image_Of_Shield.jpg, id=15, 4111.36pt x 2312.64pt>
+File: Image_Of_Shield.jpg Graphic file (type jpg)
+<use Image_Of_Shield.jpg>
+Package pdftex.def Info: Image_Of_Shield.jpg used on input line 32. on input l
+ine 32.
+Package pdftex.def Info: Requested size: 411.1601pt x 231.27754pt on input line
+ 32.
+
+Overfull \hbox (36.1601pt too wide) in paragraph at lines 31--33
+[]
+ []
+
+[1
+
+{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
+<Model.png, id=25, 1117.17375pt x 532.99126pt>
+File: Model.png Graphic file (type png)
+<use Model.png>
+Package pdftex.def Info: Model.png used on input line 36. on input line 36.
+Package pdftex.def Info: Requested size: 279.29276pt x 133.24748pt on input lin
+e 36.
+
+Underfull \hbox (badness 10000) in paragraph at lines 39--46
+
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 39--46
+
+ []
+
+[2 <./Image_Of_Shield.jpg> <./Model.png>]
+Overfull \hbox (135.00519pt too wide) in paragraph at lines 50--51
+[][][][][][][][][][][][][][][][][][][]
+ []
+
+
+Overfull \hbox (69.00452pt too wide) in paragraph at lines 53--54
+[][][][][][][][][][][][][][][][][][][][][][][][][]
+ []
+
+
+Overfull \hbox (135.00519pt too wide) in paragraph at lines 56--57
+[][][][][][][][][][][][][][][][]
+ []
+
+
+Underfull \hbox (badness 10000) in paragraph at lines 60--62
+
+ []
+
+<IMG_20180427_131831.jpg, id=33, 4111.36pt x 2312.64pt>
+File: IMG_20180427_131831.jpg Graphic file (type jpg)
+<use IMG_20180427_131831.jpg>
+Package pdftex.def Info: IMG_20180427_131831.jpg used on input line 74. on inp
+ut line 74.
+Package pdftex.def Info: Requested size: 411.1601pt x 231.27754pt on input line
+ 74.
+<Shield_With_Code.jpg, id=34, 4111.36pt x 2312.64pt>
+File: Shield_With_Code.jpg Graphic file (type jpg)
+<use Shield_With_Code.jpg>
+Package pdftex.def Info: Shield_With_Code.jpg used on input line 75. on input
+line 75.
+Package pdftex.def Info: Requested size: 411.1601pt x 231.27754pt on input line
+ 75.
+
+Overfull \hbox (36.1601pt too wide) in paragraph at lines 74--76
+ []
+ []
+
+
+Overfull \hbox (36.1601pt too wide) in paragraph at lines 74--76
+ []
+ []
+
+[3] [4 <./IMG_20180427_131831.jpg> <./Shield_With_Code.jpg>]
+Package atveryend Info: Empty hook `BeforeClearDocument' on input line 79.
+Package atveryend Info: Empty hook `AfterLastShipout' on input line 79.
+ (./OM_Arduino.aux)
+Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 79.
+Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 79.
+Package rerunfilecheck Info: File `OM_Arduino.out' has not changed.
+(rerunfilecheck) Checksum: CB903A940E1F05BFBE68850AABD7B4CE;87.
+ )
+Here is how much of TeX's memory you used:
+ 38409 strings out of 492990
+ 838526 string characters out of 6135005
+ 904015 words of memory out of 5000000
+ 41540 multiletter control sequences out of 15000+600000
+ 548377 words of font info for 30 fonts, out of 8000000 for 9000
+ 1141 hyphenation exceptions out of 8191
+ 61i,11n,73p,10383b,979s stack positions out of 5000i,500n,10000p,200000b,80000s
+{/usr/share/texmf/fonts/enc/dvips/lm/lm-ec.enc}{/usr/share/texmf/fonts/enc/dv
+ips/lm/lm-mathsy.enc}</usr/share/texmf/fonts/type1/public/lm/lmbx12.pfb></usr/s
+hare/texmf/fonts/type1/public/lm/lmr10.pfb></usr/share/texmf/fonts/type1/public
+/lm/lmri10.pfb></usr/share/texmf/fonts/type1/public/lm/lmro10.pfb></usr/share/t
+exmf/fonts/type1/public/lm/lmsy10.pfb>
+Output written on OM_Arduino.pdf (4 pages, 6241281 bytes).
+PDF statistics:
+ 81 PDF objects out of 1000 (max. 8388607)
+ 64 compressed objects within 1 object stream
+ 19 named destinations out of 1000 (max. 500000)
+ 49 words of extra memory for PDF output out of 10000 (max. 10000000)
+
diff --git a/OM_Arduino_doc/OM_Arduino.out b/OM_Arduino_doc/OM_Arduino.out
new file mode 100755
index 0000000..01f3e64
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.out
@@ -0,0 +1,2 @@
+\BOOKMARK [1][-]{section.1}{Introduction}{}% 1
+\BOOKMARK [1][-]{section.2}{Usage}{}% 2
diff --git a/OM_Arduino_doc/OM_Arduino.pdf b/OM_Arduino_doc/OM_Arduino.pdf
new file mode 100755
index 0000000..d56e48c
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.pdf
Binary files differ
diff --git a/OM_Arduino_doc/OM_Arduino.synctex.gz b/OM_Arduino_doc/OM_Arduino.synctex.gz
new file mode 100755
index 0000000..c056247
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.synctex.gz
Binary files differ
diff --git a/OM_Arduino_doc/OM_Arduino.tex b/OM_Arduino_doc/OM_Arduino.tex
new file mode 100755
index 0000000..acfe93c
--- /dev/null
+++ b/OM_Arduino_doc/OM_Arduino.tex
@@ -0,0 +1,80 @@
+\documentclass{hitec}
+\author{FOSSEE, IIT Bombay}
+\title{Flashing Modelica Code to and Arduino using MDD}
+
+\usepackage{forest}
+\usepackage{graphicx}
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+\usepackage{lmodern,hyperref,graphicx,tcolorbox,listings,fancyhdr,longtable,caption,color,dblfnote}
+\usepackage[titletoc]{appendix}
+\usepackage[english]{babel}
+
+\begin{document}
+\maketitle
+\section{Introduction}
+This document has been written with the intent of familiarising a user with the aspects of the Modelica Device Drivers (MDD) package that allow one to flash OpenModelica code directly to an Arduino.
+
+This article will briefly cover the usage of the Embedded Targets subpackage within Modelica Device Drivers package and will then detail a specific example.
+\
+\section{Usage}
+MDD consists of a variety of ways of communicating with external devices, but one of its most powerful utilities is the ability to create flashable C files for AVR and STM microcontrollers. This allows users with little experience in AVR C to code instructions to the microcontroller. While the steps for this haven't entirely been integrated within OpenModelica itself, they are fairly straightforward and with the usage of an example, we will explain them below.
+\\
+Before we begin, we will need the following tools. This doc assumes that the user is using a linux based system. If the user has Ubuntu installed, they should run the following commands to install the relevant tools for the task.
+
+\begin{itemize}
+\item sudo apt-get install gcc-avr
+\item sudo apt-get install avr-libc
+\item sudo apt-get install avrdude
+\end{itemize}
+
+The experiment being done is that of turning an LED on with two different colours within a 10 second interval. The shield being used for this looks as given below:
+\includegraphics[scale=0.1]{Image_Of_Shield.jpg}
+
+The model that will be uploaded looks as given below:
+\begin{center}
+\includegraphics[scale=0.25]{Model.png}
+\end{center}
+
+The model consists of an embedded block with pre-defined parameters for the ATmega328P microcontroller. It can be modified to suit any ATMel controller, provided the user knows its characteristics. This block is unconnected to any other in the model.
+\\
+\\
+Now we look at the blocks that specify the task to be done. The boolean expression blocks have fairly simple utility here. They are just modifying their state based on the time. The Digital Write Boolean pins communicate the state of the Boolean expression blocks to the pins specified, which are in turn connected to the shield and allow for the LED light colour to change.
+\\
+\\
+Next, we create a .mos file for the problem at hand. As we mentioned before, we can't directly flash the model to the arduino, so we will be doing it via the terminal. The first step involves creating a .mos file that will load the relevant files in memory and then translate the model into a C file. A generic .mos script is shown below
+\begin{lstlisting}
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/[path to Modelica_DeviceDrivers]/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/[path to the package containing the example]/package.mo");
+getErrorString();
+
+translateModel(package.subpackage.example, fileNamePrefix="[file_prefix_of_choice]");
+getErrorString();
+\end{lstlisting}
+
+After the file is created, execute the following steps. Since the example we are using here is called led\_ blue \_red, that is the name we are going with in the steps.
+\\
+\begin{itemize}
+\item omc --simCodeTarget=ExperimentalEmbeddedC runMDD\_ led\_ blue\_ red.mos
+\item avr-gcc -Os -std=c11 -ffunction-sections -fdata-sections -mmcu=atmega328p -DF\_ CPU=16000000UL -Wl,--gc-sections led\_ blue\_ red\_ main.c -o led\_ blue\_ red -I /path\_ to\_ MDD/Modelica\_ DeviceDrivers/Resources/Include -I /usr/include/omc/c
+\item avr-objcopy -O ihex -R .eeprom led\_ blue\_ red led\_ blue\_ red.hex
+\item avrdude -F -V -c arduino -p ATMEGA328P -P /dev/ttyACM0 -b 115200 -U flash:w:led\_ blue\_ red.hex
+
+\end{itemize}
+
+On doing so, the LED on the shield will light up, first with a bluish colour and then with a red colour as shown in the images below.
+
+
+\begin{center}
+\includegraphics[scale=0.1]{IMG_20180427_131831.jpg}
+\includegraphics[scale=0.1]{Shield_With_Code.jpg}
+\end{center}
+
+
+\end{document}
+
diff --git a/OM_Arduino_doc/Shield_With_Code.jpg b/OM_Arduino_doc/Shield_With_Code.jpg
new file mode 100755
index 0000000..d91baa4
--- /dev/null
+++ b/OM_Arduino_doc/Shield_With_Code.jpg
Binary files differ
diff --git a/PID_Practice_Cases/PulseDCMotorPID.mo b/PID_Practice_Cases/PulseDCMotorPID.mo
new file mode 100644
index 0000000..be2c6b8
--- /dev/null
+++ b/PID_Practice_Cases/PulseDCMotorPID.mo
@@ -0,0 +1,37 @@
+model PulseDCMotorPID"PID and Motor combine model with Pulse input"
+ Modelica.Blocks.Continuous.PID PID( Td = 0, Ti = 10 ^ 20, k = 15) annotation(
+ Placement(visible = true, transformation(origin = {-30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-60, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Sources.Torque torque1 annotation(
+ Placement(visible = true, transformation(origin = {30, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Components.Inertia inertia1(J = 5) annotation(
+ Placement(visible = true, transformation(origin = {70, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Rotational.Sensors.SpeedSensor speedSensor1 annotation(
+ Placement(visible = true, transformation(origin = {90, -28}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica.Blocks.Sources.Pulse pulse1(amplitude = 833, offset = 0, period = 20, startTime = 0) annotation(
+ Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(pulse1.y,feedback1.u1) annotation(
+ Line(points = {{-78, 10}, {-68, 10}}, color = {0, 0, 127}));
+ connect(PID.y, torque1.tau) annotation(
+ Line(points = {{-18, 10}, {16, 10}, {16, 10}, {18, 10}}, color = {0, 0, 127}));
+ connect(inertia1.flange_b, speedSensor1.flange) annotation(
+ Line(points = {{80, 10}, {90, 10}, {90, -18}, {90, -18}}));
+ connect(feedback1.u2, speedSensor1.w) annotation(
+ Line(points = {{-60, 2}, {-60, -46}, {90, -46}, {90, -38}}, color = {0, 0, 127}));
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{-51, 10}, {-42, 10}}, color = {0, 0, 127}));
+ connect(torque1.flange, inertia1.flange_a) annotation(
+ Line(points = {{40, 10}, {60, 10}, {60, 10}, {60, 10}}));
+ annotation (Documentation(info= "<html>
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+This is a combined model for PID and Motor model with square pulse input.
+</p>
+<p>
+<b>License:</b> OSMC-PL v1.2 2017<br /><br />
+</p>
+</html>"));
+
+end PulseDCMotorPID; \ No newline at end of file
diff --git a/PID_Practice_Cases/RLC_ckt.mo b/PID_Practice_Cases/RLC_ckt.mo
new file mode 100644
index 0000000..2caffad
--- /dev/null
+++ b/PID_Practice_Cases/RLC_ckt.mo
@@ -0,0 +1,43 @@
+model RLC_ckt
+ Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 10) annotation(
+ Placement(visible = true, transformation(origin = {-14, 34}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Electrical.Analog.Basic.Capacitor capacitor1 annotation(
+ Placement(visible = true, transformation(origin = {24, 34}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Electrical.Analog.Basic.Inductor inductor1(L = 1) annotation(
+ Placement(visible = true, transformation(origin = {54, 34}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Electrical.Analog.Basic.Ground ground1 annotation(
+ Placement(visible = true, transformation(origin = {26, -58}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage1 annotation(
+ Placement(visible = true, transformation(origin = {-44, 34}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Electrical.Analog.Sensors.VoltageSensor voltageSensor1 annotation(
+ Placement(visible = true, transformation(origin = {22, -16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PID PID(Td = 1, Ti = 0.5, k = 1) annotation(
+ Placement(visible = true, transformation(origin = {-72, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-100, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Step step1(startTime = 50) annotation(
+ Placement(visible = true, transformation(origin = {-128, 62}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(feedback1.u1, step1.y) annotation(
+ Line(points = {{-108, 62}, {-116, 62}, {-116, 62}, {-116, 62}}, color = {0, 0, 127}));
+ connect(voltageSensor1.v, feedback1.u2) annotation(
+ Line(points = {{22, -26}, {-96, -26}, {-96, 52}, {-100, 52}, {-100, 54}}, color = {0, 0, 127}));
+ connect(PID.y, signalVoltage1.v) annotation(
+ Line(points = {{-60, 62}, {-44, 62}, {-44, 42}, {-44, 42}}, color = {0, 0, 127}));
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{-90, 62}, {-84, 62}, {-84, 62}, {-84, 62}}, color = {0, 0, 127}));
+ connect(voltageSensor1.n, ground1.p) annotation(
+ Line(points = {{32, -16}, {26, -16}, {26, -48}, {26, -48}}, color = {0, 0, 255}));
+ connect(voltageSensor1.p, signalVoltage1.p) annotation(
+ Line(points = {{12, -16}, {-74, -16}, {-74, 32}, {-54, 32}, {-54, 34}, {-54, 34}}, color = {0, 0, 255}));
+ connect(inductor1.n, voltageSensor1.n) annotation(
+ Line(points = {{64, 34}, {74, 34}, {74, -14}, {32, -14}, {32, -16}, {32, -16}}, color = {0, 0, 255}));
+ connect(resistor1.p, signalVoltage1.n) annotation(
+ Line(points = {{-24, 34}, {-34, 34}, {-34, 34}, {-34, 34}}, color = {0, 0, 255}));
+ connect(capacitor1.n, inductor1.p) annotation(
+ Line(points = {{34, 34}, {44, 34}, {44, 34}, {44, 34}, {44, 34}, {44, 34}}, color = {0, 0, 255}));
+ connect(resistor1.n, capacitor1.p) annotation(
+ Line(points = {{-4, 34}, {14, 34}, {14, 34}, {14, 34}}, color = {0, 0, 255}));
+
+annotation(
+ uses(Modelica(version = "3.2.2")));end RLC_ckt; \ No newline at end of file
diff --git a/PID_Practice_Cases/SpringMassHIl.mo b/PID_Practice_Cases/SpringMassHIl.mo
new file mode 100755
index 0000000..6cc16dc
--- /dev/null
+++ b/PID_Practice_Cases/SpringMassHIl.mo
@@ -0,0 +1,75 @@
+model SpringMassHIl
+import InterProcessCommunication.SharedMemory.*;
+ Modelica.Mechanics.Translational.Components.Mass mass1(L = 1, m = 1) annotation(
+ Placement(visible = true, transformation(origin = {36, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Sources.Force force1 annotation(
+ Placement(visible = true, transformation(origin = {6, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Components.Fixed fixed1 annotation(
+ Placement(visible = true, transformation(origin = {94, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Interfaces.RealOutput y annotation(
+ Placement(visible = true, transformation(origin = {-28, -36}, extent = {{10, -10}, {-10, 10}}, rotation = 0), iconTransformation(origin = {80, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+
+ // Declaration of variables and constants
+ Real motorInputValue "Value of input to the Discrete PID Controller" ;
+ Real motorOutputValue "Value of output of Discrete PID Controller" ;
+ Integer motorInputIndex = 1;
+ Real ReferenceOp "Reference Output";
+ //Address from where to read, can be any number between 0 to 10, it must match the address given to output value in second model i.e. DiscretePID_SM_Example in this case
+ Integer motorOutputIndex = 1;//Address where to write, can be any number between 0 to 10
+ Real motorOutputDummy "Dummy value to be returned by the SharedMemoryWrite function";
+ //Functions from serial_read
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.UnpackUnsignedInteger unpackInt(nu = 1, width = 8) annotation(
+ Placement(visible = true, transformation(extent = {{-90, -6}, {-70, 14}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetInteger getInteger annotation(
+ Placement(visible = true, transformation(extent = {{-90, -62}, {-70, -42}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortReceive serialReceive(Serial_Port = "/dev/ttyACM1", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B115200, enableExternalTrigger = false, sampleTime = 0.01) annotation(
+ Placement(visible = true, transformation(origin = {-80, 58}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica.Mechanics.Translational.Components.SpringDamper springDamper1(c = 100, d = 10, s_rel0 = 1) annotation(
+ Placement(visible = true, transformation(origin = {66, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor1 annotation(
+ Placement(visible = true, transformation(origin = {16, -36}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+equation
+ connect(mass1.flange_b, positionSensor1.flange) annotation(
+ Line(points = {{46, 4}, {48, 4}, {48, -36}, {26, -36}, {26, -36}}, color = {0, 127, 0}));
+ connect(positionSensor1.s, y) annotation(
+ Line(points = {{4, -36}, {-20, -36}, {-20, -36}, {-28, -36}}, color = {0, 0, 127}));
+ connect(springDamper1.flange_b, fixed1.flange) annotation(
+ Line(points = {{76, 4}, {92, 4}, {92, 4}, {94, 4}}, color = {0, 127, 0}));
+ connect(mass1.flange_b, springDamper1.flange_a) annotation(
+ Line(points = {{46, 4}, {56, 4}, {56, 4}, {56, 4}}, color = {0, 127, 0}));
+ connect(unpackInt.pkgOut[1], getInteger.pkgIn) annotation(
+ Line(points = {{-80, -7}, {-80, -41}}, thickness = 0.5));
+ connect(serialReceive.pkgOut, unpackInt.pkgIn) annotation(
+ Line(points = {{-80, 47}, {-80, 15}}));
+ connect(force1.flange, mass1.flange_a) annotation(
+ Line(points = {{16, 4}, {26, 4}, {26, 4}, {26, 4}}, color = {0, 127, 0}));
+ force1.f = motorInputValue "The value of control signal (pidOutputValue) is acquired by the SharedMemoryRead function and it is assigned to the input of the system";
+ motorOutputValue = y "The measured speed of the system is assigned to pidInputValue, which is written into the shared memory using SharedMemoryWrite Function";
+ when sample(0, 0.05) then
+ motorInputValue = InterProcessCommunication.SharedMemory.SharedMemoryRead(motorInputIndex) "SharedMemoryRead Function reads the value from the shared memory, pointed by pidOutputIndex tag and assigns it to the input of the system";
+ motorOutputDummy = InterProcessCommunication.SharedMemory.SharedMemoryWrite(motorOutputIndex, motorOutputValue) "SharedMemoryWrite Function writes the value of measured speed into the shared memory, pointed by pidInputIndex tag";
+ end when;
+ ReferenceOp= unpackInt.y;
+//equations from serial_read
+ annotation(
+ Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-140, -100}, {140, 100}}, initialScale = 0.1), graphics = {Text(lineColor = {255, 0, 0}, extent = {{40, 37}, {90, 31}}, textString = "plant"), Rectangle(origin = {-12, -2},lineColor = {255, 0, 0}, extent = {{0, 68}, {140, -54}})}),
+ Icon(coordinateSystem(preserveAspectRatio = true, extent = {{-100, -100}, {100, 100}}, grid = {2, 2})),
+ Documentation(info = "<html>
+
+<p>
+<b>Inter Process Communication Library V1.0</b><br /><br />
+The <b>DCMotor</b> model contains the DC motor, which reads the control signal from shared memory (given by discrete PID controller) and the speed sensor measures the resulting rotation. The measured speed from speed sensor is written into the shared memory.
+
+ </p>
+
+ <p>
+The values of control signal and speed of the spring mass system are read from and written into the shared memory at sampling interval of 0.05 seconds. <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> and <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> functions are used to read the control signal from the shared memory and write the measured speed into the shared memory respectively. The motorOutputIndex and motorInputIndex variables serve as index of the tag i.e. motorInputIndex points to the value of control signal and motorOutputIndex points to the value of speed of the DC motor. The value of the control signal, returned by the <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryRead\"> SharedMemoryRead </a> function is stored in the motorInputValue variable. The value of the motorInputValue is in turn assigned to the force.u variable, which serves as an input to the spring-mass system. Similarly, the value of the measured speed is assigned to motorOutputvalue variable. Therefore, the value of the motorOutputvalue is written into shared memory using <a href=\"modelica://InterProcessCommunication.SharedMemory.SharedMemoryWrite\"> SharedMemoryWrite </a> function.
+</p>
+
+
+</html>"),
+ experiment(StopTime = 60, StartTime = 0, Tolerance = 1e-06, Interval = 0.01),
+ __OpenModelica_simulationFlags(jacobian = "coloredNumerical", s = "dassl", lv = "LOG_STATS", nls = "homotopy", clock = "RT"),
+ uses(Modelica(version = "3.2.2")));
+
+end SpringMassHIl; \ No newline at end of file
diff --git a/PID_Practice_Cases/SpringMassPID.mo b/PID_Practice_Cases/SpringMassPID.mo
new file mode 100755
index 0000000..36f48de
--- /dev/null
+++ b/PID_Practice_Cases/SpringMassPID.mo
@@ -0,0 +1,38 @@
+model SpringMassPID
+ import Modelica.Mechanics.*;
+ Modelica.Mechanics.Translational.Components.Mass mass1(L = 1, m = 1) annotation(
+ Placement(visible = true, transformation(origin = {36, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Sources.Force force1 annotation(
+ Placement(visible = true, transformation(origin = {0, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Components.Fixed fixed1 annotation(
+ Placement(visible = true, transformation(origin = {94, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Pulse pulse1(amplitude = 158, period = 20, startTime = 10) annotation(
+ Placement(visible = true, transformation(origin = {-88, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Sensors.PositionSensor positionSensor1 annotation(
+ Placement(visible = true, transformation(origin = {-12, -56}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+ Modelica.Mechanics.Translational.Components.SpringDamper springDamper1(c = 100, d = 10, s_rel0 = 1) annotation(
+ Placement(visible = true, transformation(origin = {66, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-61, 5}, extent = {{-5, -5}, {5, 5}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PID PID(Nd = 20, Td = 0.05, Ti = 0.1, k = 50) annotation(
+ Placement(visible = true, transformation(origin = {-34, 6}, extent = {{-8, -8}, {8, 8}}, rotation = 0)));
+equation
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{-56.5, 5}, {-55.25, 5}, {-55.25, 4}, {-44, 4}}, color = {0, 0, 127}));
+ connect(PID.y, force1.f) annotation(
+ Line(points = {{-25, 4}, {-12, 4}}, color = {0, 0, 127}));
+ connect(positionSensor1.s, feedback1.u2) annotation(
+ Line(points = {{-23, -56}, {-61, -56}, {-61, 1}}, color = {0, 0, 127}));
+ connect(pulse1.y, feedback1.u1) annotation(
+ Line(points = {{-76, 4}, {-72, 4}, {-72, 5}, {-65, 5}}, color = {0, 0, 127}));
+ connect(mass1.flange_b, positionSensor1.flange) annotation(
+ Line(points = {{46, 4}, {46, 4}, {46, -56}, {-2, -56}, {-2, -56}}, color = {0, 127, 0}));
+ connect(force1.flange, mass1.flange_a) annotation(
+ Line(points = {{10, 4}, {26, 4}}, color = {0, 127, 0}));
+ connect(springDamper1.flange_b, fixed1.flange) annotation(
+ Line(points = {{76, 4}, {92, 4}, {92, 4}, {94, 4}}, color = {0, 127, 0}));
+ connect(mass1.flange_b, springDamper1.flange_a) annotation(
+ Line(points = {{46, 4}, {56, 4}, {56, 4}, {56, 4}}, color = {0, 127, 0}));
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+end SpringMassPID; \ No newline at end of file
diff --git a/PID_Practice_Cases/Virtual_PID.mo b/PID_Practice_Cases/Virtual_PID.mo
new file mode 100755
index 0000000..e7c1ac7
--- /dev/null
+++ b/PID_Practice_Cases/Virtual_PID.mo
@@ -0,0 +1,23 @@
+//Provides a virtual PID against which the arduino PID can be compared.
+class Virtual_PID
+ Modelica.Blocks.Math.Feedback feedback1 annotation(
+ Placement(visible = true, transformation(origin = {-44, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.FirstOrder firstOrder1(T = 1, initType = Modelica.Blocks.Types.Init.NoInit, k = 1, y_start = 1) annotation(
+ Placement(visible = true, transformation(origin = {54, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Sources.Sine sine1(amplitude = 50, freqHz = 0.5, offset = 150) annotation(
+ Placement(visible = true, transformation(origin = {-88, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica.Blocks.Continuous.PID PID(Nd = 0.5, Td = 10 ^ 10, Ti = 10 ^ 10, k = 2) annotation(
+ Placement(visible = true, transformation(origin = {0, 22}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(PID.y, firstOrder1.u) annotation(
+ Line(points = {{12, 22}, {42, 22}, {42, 22}, {42, 22}}, color = {0, 0, 127}));
+ connect(feedback1.y, PID.u) annotation(
+ Line(points = {{-34, 22}, {-12, 22}, {-12, 22}, {-12, 22}}, color = {0, 0, 127}));
+ connect(sine1.y, feedback1.u1) annotation(
+ Line(points = {{-76, 22}, {-52, 22}, {-52, 22}, {-52, 22}}, color = {0, 0, 127}));
+ connect(firstOrder1.y, feedback1.u2) annotation(
+ Line(points = {{66, 22}, {80, 22}, {80, 0}, {-46, 0}, {-46, 14}, {-44, 14}, {-44, 14}}, color = {0, 0, 127}));
+ annotation(
+ uses(Modelica(version = "3.2.2")),
+ Diagram);
+end Virtual_PID; \ No newline at end of file
diff --git a/PID_Practice_Cases/tank_model.mo b/PID_Practice_Cases/tank_model.mo
new file mode 100644
index 0000000..8e57dc9
--- /dev/null
+++ b/PID_Practice_Cases/tank_model.mo
@@ -0,0 +1,205 @@
+model tank_model
+ package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater;
+
+ Modelica.Fluid.Examples.ControlledTankSystem.Utilities.TankController
+ tankController(
+ waitTime=50,
+ maxLevel=0.9*tank1.height,
+ minLevel=0.01)
+ annotation (Placement(transformation(extent={{-60,-20},{-20,20}})));
+ Modelica.Fluid.Examples.ControlledTankSystem.Utilities.RadioButton start(
+ reset={stop.on,shut.on},
+ buttonTimeTable={20,280})
+ annotation (Placement(transformation(extent={{-100,20},{-80,40}})));
+ Modelica.Fluid.Examples.ControlledTankSystem.Utilities.RadioButton stop(
+ reset={start.on,shut.on},
+ buttonTimeTable={220,650})
+ annotation (Placement(transformation(extent={{-100,-10},{-80,10}})));
+ Modelica.Fluid.Examples.ControlledTankSystem.Utilities.RadioButton shut(
+ reset={start.on,stop.on},
+ buttonTimeTable={700})
+ annotation (Placement(transformation(extent={{-100,-40},{-80,-20}})));
+ Modelica.Fluid.Valves.ValveDiscrete valve1( redeclare
+ package Medium = Medium,
+ m_flow_nominal=40,
+ dp_nominal=100000)
+ annotation (Placement(transformation(
+ origin={-10,70},
+ extent={{10,-10},{-10,10}},
+ rotation=180)));
+ Modelica.Fluid.Vessels.OpenTank tank1(
+ level_start=0.05,
+ redeclare package Medium = Medium,
+ crossArea=6,
+ height=4,
+ nPorts=2,
+ portsData={Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(
+ diameter=0.2,
+ height=4,
+ zeta_out=0,
+ zeta_in=1),Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(
+ diameter=0.2,
+ height=0,
+ zeta_out=0,
+ zeta_in=1)}) annotation (Placement(transformation(extent={{10,30},
+ {50,70}})));
+ Modelica.Blocks.Sources.RealExpression level1(y=tank1.level)
+ annotation (Placement(transformation(extent={{-90,-60},{-55,-40}})));
+ Modelica.Fluid.Valves.ValveDiscrete valve2( redeclare package Medium
+ = Medium,
+ dp_nominal(displayUnit="Pa") = 1,
+ m_flow_nominal=100)
+ annotation (Placement(transformation(
+ origin={34,0},
+ extent={{10,-10},{-10,10}},
+ rotation=90)));
+ Modelica.Fluid.Valves.ValveDiscrete valve3( redeclare package Medium
+ = Medium,
+ dp_nominal(displayUnit="Pa") = 1,
+ m_flow_nominal=10)
+ annotation (Placement(transformation(
+ origin={35,-80},
+ extent={{10,-10},{-10,10}})));
+ Modelica.Fluid.Vessels.OpenTank tank2(
+ level_start=0.05,
+ redeclare package Medium = Medium,
+ height=5,
+ crossArea=6,
+ nPorts=2,
+ portsData={Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(
+ diameter=0.2,
+ height=5,
+ zeta_out=0,
+ zeta_in=1),Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(
+ diameter=0.2,
+ height=0,
+ zeta_out=0,
+ zeta_in=1)}) annotation (Placement(transformation(extent={{50,-60},
+ {90,-20}})));
+ Modelica.Fluid.Sources.Boundary_pT ambient1(redeclare package Medium =
+ Medium,nPorts=1,
+ p=system.p_ambient,
+ T=system.T_ambient)
+ annotation (Placement(transformation(extent={{-10,-90},{10,-70}})));
+ Modelica.Blocks.Sources.RealExpression level2(y=tank2.level)
+ annotation (Placement(transformation(extent={{-70,-80},{-33,-60}})));
+ Modelica.Fluid.Sources.Boundary_pT source(redeclare package Medium =
+ Medium, p=2.5e6,nPorts=1,
+ T=system.T_ambient)
+ annotation (Placement(transformation(
+ origin={-40,70},
+ extent={{-10,-10},{10,10}})));
+ inner Modelica.Fluid.System system(energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
+ annotation (Placement(transformation(extent={{-90,70},
+ {-70,90}})));
+equation
+ connect(shut.on, tankController.shut) annotation (Line(points={{-79,-30},{
+ -72,-30},{-72,-12},{-62,-12}}, color={255,0,255}));
+ connect(stop.on, tankController.stop) annotation (Line(points={{-79,0},{-62,
+ 0}}, color={255,0,255}));
+ connect(start.on, tankController.start) annotation (Line(points={{-79,30},{
+ -70,30},{-70,12},{-62,12}}, color={255,0,255}));
+ connect(tankController.valve1, valve1.open) annotation (Line(points={{-19,12},
+ {-10,12},{-10,62}}, color={255,0,255}));
+ connect(level1.y, tankController.level1) annotation (Line(points={{-53.25,
+ -50},{-52,-50},{-52,-22}}, color={0,0,127}));
+ connect(tankController.valve2, valve2.open) annotation (Line(points={{-19,0},
+ {-5,0},{26,0}}, color={255,0,255}));
+ connect(tankController.valve3, valve3.open) annotation (Line(points={{-19,-12},
+ {-10,-12},{-10,-50},{35,-50},{35,-72}},
+ color={255,0,255}));
+ connect(level2.y, tankController.level2) annotation (Line(points={{-31.15,
+ -70},{-28,-70},{-28,-22}}, color={0,0,127}));
+
+ connect(source.ports[1], valve1.port_a) annotation (Line(
+ points={{-30,70},{-20,70}},
+ color={0,127,255}));
+ connect(valve3.port_b, ambient1.ports[1]) annotation (Line(
+ points={{25,-80},{10,-80}},
+ color={0,127,255}));
+ connect(tank2.ports[2], valve3.port_a) annotation (Line(
+ points={{74,-60},{74,-80},{45,-80}},
+ color={0,127,255}));
+ connect(valve2.port_b, tank2.ports[1]) annotation (Line(
+ points={{34,-10},{34,-20},{50,-20},{50,-60},{66,-60}},
+ color={0,127,255}));
+ connect(valve1.port_b, tank1.ports[1]) annotation (Line(
+ points={{0,70},{10,70},{10,30},{26,30}},
+ color={0,127,255}));
+ connect(tank1.ports[2], valve2.port_a) annotation (Line(
+ points={{34,30},{34,10}},
+ color={0,127,255}));
+ annotation (
+ experiment(StopTime=900),
+ Documentation(info="<html>
+<p>
+With this example, the controller of a tank filling/emptying system
+is demonstrated.
+</p>
+
+<p>
+The basic operation is to fill and empty the two tanks:
+</p>
+<ol>
+<li> Valve 1 is opened and tank 1 is filled.</li>
+<li> When tank 1 reaches its fill level limit,
+ valve 1 is closed. </li>
+<li> After a waiting time, valve 2 is
+ opened and the fluid flows from tank 1 into tank 2.</li>
+<li> When tank 1 reaches its minimum level, valve 2 is closed. </li>
+<li> After a waiting time, valve 3 is opened and
+ the fluid flows out of tank 2</li>
+<li> When tank 2 reaches its minimum level, valve 3 is closed</li>
+</ol>
+<p>
+The above \"normal\" process can be influenced by three
+buttons:
+</p>
+<ul>
+<li> Button <b>start</b> starts the above process.
+ When this button is pressed after a \"stop\" or
+ \"shut\" operation, the process operation continues.
+ </li>
+<li> Button <b>stop</b> stops the above process by
+ closing all valves. Then, the controller waits for
+ further input (either \"start\" or \"shut\" operation).</li>
+<li> Button <b>shut</b> is used to shutdown the process,
+ by emptying at once both tanks by opening valve 2 and
+ valve 3. When this is achieved,
+ the process goes back to its start configuration
+ where all 3 valves are closed.
+ Clicking on \"start\", restarts the process.</li>
+</ul>
+
+<p>
+The demo-run uses the following button presses:
+</p>
+
+<ul>
+<li> Button <b>start</b> pressed at 20 s.</li>
+<li> Button <b>stop</b> pressed at 220 s </li>
+<li> Button <b>start</b> pressed at 280 s </li>
+<li> Button <b>stop</b> pressed at 650 s </li>
+<li> Button <b>shut</b> pressed at 700 s </li>
+<li> Simulate for 900 s</li>
+</ul>
+
+<p>
+This example is based on
+</p>
+
+<dl>
+<dt>Dressler I. (2004):</dt>
+<dd> <b>Code Generation From JGrafchart to Modelica</b>.
+ Master thesis, supervisor: Karl-Erik Arzen,
+ Department of Automatic Control, Lund Institute of Technology,
+ Lund, Sweden, March 30, 2004<br>&nbsp;</dd>
+</dl>
+
+<img src=\"modelica://Modelica/Resources/Images/Fluid/Examples/ControlledTanks.png\" border=\"1\"
+ alt=\"ControlledTanks.png\">
+</html>"),
+ __Dymola_Commands(file=
+ "modelica://Modelica/Resources/Scripts/Dymola/Fluid/ControlledTanks/plot level and ports.m_flow.mos"
+ "plot level and ports.m_flow"));
+end tank_model; \ No newline at end of file
diff --git a/Prof_Arya/Cessna_6DOF.mdl b/Prof_Arya/Cessna_6DOF.mdl
new file mode 100644
index 0000000..3d57cf7
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF.mdl
@@ -0,0 +1,2069 @@
+Model {
+ Name "Cessna_6DOF"
+ Version 8.3
+ MdlSubVersion 0
+ SavedCharacterEncoding "windows-1252"
+ GraphicalInterface {
+ NumRootInports 0
+ NumRootOutports 0
+ ParameterArgumentNames ""
+ ComputedModelVersion "1.16"
+ NumModelReferences 0
+ NumTestPointedSignals 0
+ }
+ SaveDefaultBlockParams on
+ ScopeRefreshTime 0.035000
+ OverrideScopeRefreshTime on
+ DisableAllScopes off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ MinMaxOverflowArchiveMode "Overwrite"
+ FPTRunName "Run 1"
+ MaxMDLFileLineLength 120
+ Object {
+ $PropName "BdWindowsInfo"
+ $ObjectID 1
+ $ClassName "Simulink.BDWindowsInfo"
+ Object {
+ $PropName "WindowsInfo"
+ $ObjectID 2
+ $ClassName "Simulink.WindowInfo"
+ IsActive [1]
+ Location [-8.0, -8.0, 1382.0, 754.0]
+ Object {
+ $PropName "ModelBrowserInfo"
+ $ObjectID 3
+ $ClassName "Simulink.ModelBrowserInfo"
+ Visible [0]
+ DockPosition "Left"
+ Width [50]
+ Height [50]
+ Filter [8]
+ }
+ Object {
+ $PropName "ExplorerBarInfo"
+ $ObjectID 4
+ $ClassName "Simulink.ExplorerBarInfo"
+ Visible [1]
+ }
+ Object {
+ $PropName "EditorsInfo"
+ $ObjectID 5
+ $ClassName "Simulink.EditorInfo"
+ IsActive [1]
+ ViewObjType "SimulinkTopLevel"
+ LoadSaveID "0"
+ Extents [1332.0, 580.0]
+ ZoomFactor [1.0]
+ Offset [0.0, 0.0]
+ }
+ }
+ }
+ Created "Sat Dec 20 14:26:50 2014"
+ Creator "Pranav"
+ UpdateHistory "UpdateHistoryNever"
+ ModifiedByFormat "%<Auto>"
+ LastModifiedBy "Pranav"
+ ModifiedDateFormat "%<Auto>"
+ LastModifiedDate "Wed Mar 30 16:47:01 2016"
+ RTWModifiedTimeStamp 381257210
+ ModelVersionFormat "1.%<AutoIncrement:16>"
+ ConfigurationManager "none"
+ SampleTimeColors off
+ SampleTimeAnnotations off
+ LibraryLinkDisplay "none"
+ WideLines off
+ ShowLineDimensions off
+ ShowPortDataTypes off
+ ShowDesignRanges off
+ ShowLoopsOnError on
+ IgnoreBidirectionalLines off
+ ShowStorageClass off
+ ShowTestPointIcons on
+ ShowSignalResolutionIcons on
+ ShowViewerIcons on
+ SortedOrder off
+ ExecutionContextIcon off
+ ShowLinearizationAnnotations on
+ BlockNameDataTip off
+ BlockParametersDataTip off
+ BlockDescriptionStringDataTip off
+ ToolBar on
+ StatusBar on
+ BrowserShowLibraryLinks off
+ BrowserLookUnderMasks off
+ SimulationMode "normal"
+ PauseTimes "5"
+ NumberOfSteps 1
+ SnapshotBufferSize 10
+ SnapshotInterval 10
+ NumberOfLastSnapshots 0
+ LinearizationMsg "none"
+ Profile off
+ ParamWorkspaceSource "MATLABWorkspace"
+ AccelSystemTargetFile "accel.tlc"
+ AccelTemplateMakefile "accel_default_tmf"
+ AccelMakeCommand "make_rtw"
+ TryForcingSFcnDF off
+ Object {
+ $PropName "DataLoggingOverride"
+ $ObjectID 6
+ $ClassName "Simulink.SimulationData.ModelLoggingInfo"
+ model_ "Cessna_6DOF"
+ overrideMode_ [0.0]
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell "Cessna_6DOF"
+ PropName "logAsSpecifiedByModels_"
+ }
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell []
+ PropName "logAsSpecifiedByModelsSSIDs_"
+ }
+ }
+ RecordCoverage off
+ CovPath "/"
+ CovSaveName "covdata"
+ CovMetricSettings "dw"
+ CovNameIncrementing off
+ CovHtmlReporting on
+ CovForceBlockReductionOff on
+ CovEnableCumulative on
+ covSaveCumulativeToWorkspaceVar on
+ CovSaveSingleToWorkspaceVar on
+ CovCumulativeVarName "covCumulativeData"
+ CovCumulativeReport off
+ CovReportOnPause on
+ CovModelRefEnable "Off"
+ CovExternalEMLEnable off
+ CovSFcnEnable off
+ CovBoundaryAbsTol 0.000010
+ CovBoundaryRelTol 0.010000
+ ExtModeBatchMode off
+ ExtModeEnableFloating on
+ ExtModeTrigType "manual"
+ ExtModeTrigMode "normal"
+ ExtModeTrigPort "1"
+ ExtModeTrigElement "any"
+ ExtModeTrigDuration 1000
+ ExtModeTrigDurationFloating "auto"
+ ExtModeTrigHoldOff 0
+ ExtModeTrigDelay 0
+ ExtModeTrigDirection "rising"
+ ExtModeTrigLevel 0
+ ExtModeArchiveMode "off"
+ ExtModeAutoIncOneShot off
+ ExtModeIncDirWhenArm off
+ ExtModeAddSuffixToVar off
+ ExtModeWriteAllDataToWs off
+ ExtModeArmWhenConnect on
+ ExtModeSkipDownloadWhenConnect off
+ ExtModeLogAll on
+ ExtModeAutoUpdateStatusClock on
+ BufferReuse on
+ ShowModelReferenceBlockVersion off
+ ShowModelReferenceBlockIO off
+ Array {
+ Type "Handle"
+ Dimension 1
+ Simulink.ConfigSet {
+ $ObjectID 7
+ Version "1.14.2"
+ Array {
+ Type "Handle"
+ Dimension 9
+ Simulink.SolverCC {
+ $ObjectID 8
+ Version "1.14.2"
+ StartTime "0.0"
+ StopTime "1000"
+ AbsTol "auto"
+ FixedStep "auto"
+ InitialStep "auto"
+ MaxNumMinSteps "-1"
+ MaxOrder 5
+ ZcThreshold "auto"
+ ConsecutiveZCsStepRelTol "10*128*eps"
+ MaxConsecutiveZCs "1000"
+ ExtrapolationOrder 4
+ NumberNewtonIterations 1
+ MaxStep "auto"
+ MinStep "auto"
+ MaxConsecutiveMinStep "1"
+ RelTol "1e-3"
+ SolverMode "Auto"
+ EnableConcurrentExecution off
+ ConcurrentTasks off
+ Solver "ode45"
+ SolverName "ode45"
+ SolverJacobianMethodControl "auto"
+ ShapePreserveControl "DisableAll"
+ ZeroCrossControl "UseLocalSettings"
+ ZeroCrossAlgorithm "Nonadaptive"
+ AlgebraicLoopSolver "TrustRegion"
+ SolverResetMethod "Fast"
+ PositivePriorityOrder off
+ AutoInsertRateTranBlk off
+ SampleTimeConstraint "Unconstrained"
+ InsertRTBMode "Whenever possible"
+ }
+ Simulink.DataIOCC {
+ $ObjectID 9
+ Version "1.14.2"
+ Decimation "1"
+ ExternalInput "[t, u]"
+ FinalStateName "xFinal"
+ InitialState "xInitial"
+ LimitDataPoints on
+ MaxDataPoints "1000"
+ LoadExternalInput off
+ LoadInitialState off
+ SaveFinalState off
+ SaveCompleteFinalSimState off
+ SaveFormat "Array"
+ SignalLoggingSaveFormat "ModelDataLogs"
+ SaveOutput on
+ SaveState off
+ SignalLogging on
+ DSMLogging on
+ InspectSignalLogs off
+ VisualizeSimOutput on
+ SaveTime on
+ ReturnWorkspaceOutputs off
+ StateSaveName "xout"
+ TimeSaveName "tout"
+ OutputSaveName "yout"
+ SignalLoggingName "logsout"
+ DSMLoggingName "dsmout"
+ OutputOption "RefineOutputTimes"
+ OutputTimes "[]"
+ ReturnWorkspaceOutputsName "out"
+ Refine "1"
+ }
+ Simulink.OptimizationCC {
+ $ObjectID 10
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "BooleansAsBitfields"
+ Cell "PassReuseOutputArgsAs"
+ Cell "PassReuseOutputArgsThreshold"
+ Cell "ZeroExternalMemoryAtStartup"
+ Cell "ZeroInternalMemoryAtStartup"
+ Cell "OptimizeModelRefInitCode"
+ Cell "NoFixptDivByZeroProtection"
+ Cell "UseSpecifiedMinMax"
+ PropName "DisabledProps"
+ }
+ BlockReduction on
+ BooleanDataType on
+ ConditionallyExecuteInputs on
+ InlineParams off
+ UseIntDivNetSlope off
+ UseFloatMulNetSlope off
+ DefaultUnderspecifiedDataType "double"
+ UseSpecifiedMinMax off
+ InlineInvariantSignals off
+ OptimizeBlockIOStorage on
+ BufferReuse on
+ EnhancedBackFolding off
+ CachingGlobalReferences off
+ GlobalBufferReuse on
+ StrengthReduction off
+ ExpressionFolding on
+ BooleansAsBitfields off
+ BitfieldContainerType "uint_T"
+ EnableMemcpy on
+ MemcpyThreshold 64
+ PassReuseOutputArgsAs "Structure reference"
+ ExpressionDepthLimit 2147483647
+ FoldNonRolledExpr on
+ LocalBlockOutputs on
+ RollThreshold 5
+ SystemCodeInlineAuto off
+ StateBitsets off
+ DataBitsets off
+ ActiveStateOutputEnumStorageType "Native Integer"
+ UseTempVars off
+ ZeroExternalMemoryAtStartup on
+ ZeroInternalMemoryAtStartup on
+ InitFltsAndDblsToZero off
+ NoFixptDivByZeroProtection off
+ EfficientFloat2IntCast off
+ EfficientMapNaN2IntZero on
+ OptimizeModelRefInitCode off
+ LifeSpan "inf"
+ MaxStackSize "Inherit from target"
+ BufferReusableBoundary on
+ SimCompilerOptimization "Off"
+ AccelVerboseBuild off
+ ParallelExecutionInRapidAccelerator on
+ }
+ Simulink.DebuggingCC {
+ $ObjectID 11
+ Version "1.14.2"
+ RTPrefix "error"
+ ConsistencyChecking "none"
+ ArrayBoundsChecking "none"
+ SignalInfNanChecking "none"
+ SignalRangeChecking "none"
+ ReadBeforeWriteMsg "UseLocalSettings"
+ WriteAfterWriteMsg "UseLocalSettings"
+ WriteAfterReadMsg "UseLocalSettings"
+ AlgebraicLoopMsg "warning"
+ ArtificialAlgebraicLoopMsg "warning"
+ SaveWithDisabledLinksMsg "warning"
+ SaveWithParameterizedLinksMsg "warning"
+ CheckSSInitialOutputMsg on
+ UnderspecifiedInitializationDetection "Classic"
+ MergeDetectMultiDrivingBlocksExec "none"
+ CheckExecutionContextPreStartOutputMsg off
+ CheckExecutionContextRuntimeOutputMsg off
+ SignalResolutionControl "UseLocalSettings"
+ BlockPriorityViolationMsg "warning"
+ MinStepSizeMsg "warning"
+ TimeAdjustmentMsg "none"
+ MaxConsecutiveZCsMsg "error"
+ MaskedZcDiagnostic "warning"
+ IgnoredZcDiagnostic "warning"
+ SolverPrmCheckMsg "warning"
+ InheritedTsInSrcMsg "warning"
+ DiscreteInheritContinuousMsg "warning"
+ MultiTaskDSMMsg "error"
+ MultiTaskCondExecSysMsg "error"
+ MultiTaskRateTransMsg "error"
+ SingleTaskRateTransMsg "none"
+ TasksWithSamePriorityMsg "warning"
+ SigSpecEnsureSampleTimeMsg "warning"
+ CheckMatrixSingularityMsg "none"
+ IntegerOverflowMsg "warning"
+ Int32ToFloatConvMsg "warning"
+ ParameterDowncastMsg "error"
+ ParameterOverflowMsg "error"
+ ParameterUnderflowMsg "none"
+ ParameterPrecisionLossMsg "warning"
+ ParameterTunabilityLossMsg "warning"
+ FixptConstUnderflowMsg "none"
+ FixptConstOverflowMsg "none"
+ FixptConstPrecisionLossMsg "none"
+ UnderSpecifiedDataTypeMsg "none"
+ UnnecessaryDatatypeConvMsg "none"
+ VectorMatrixConversionMsg "none"
+ InvalidFcnCallConnMsg "error"
+ FcnCallInpInsideContextMsg "UseLocalSettings"
+ SignalLabelMismatchMsg "none"
+ UnconnectedInputMsg "warning"
+ UnconnectedOutputMsg "warning"
+ UnconnectedLineMsg "warning"
+ SFcnCompatibilityMsg "none"
+ FrameProcessingCompatibilityMsg "warning"
+ UniqueDataStoreMsg "none"
+ BusObjectLabelMismatch "warning"
+ RootOutportRequireBusObject "warning"
+ AssertControl "UseLocalSettings"
+ EnableOverflowDetection off
+ ModelReferenceIOMsg "none"
+ ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error"
+ ModelReferenceVersionMismatchMessage "none"
+ ModelReferenceIOMismatchMessage "none"
+ ModelReferenceCSMismatchMessage "none"
+ UnknownTsInhSupMsg "warning"
+ ModelReferenceDataLoggingMessage "warning"
+ ModelReferenceSymbolNameMessage "warning"
+ ModelReferenceExtraNoncontSigs "error"
+ StateNameClashWarn "warning"
+ SimStateInterfaceChecksumMismatchMsg "warning"
+ SimStateOlderReleaseMsg "error"
+ InitInArrayFormatMsg "warning"
+ StrictBusMsg "ErrorLevel1"
+ BusNameAdapt "WarnAndRepair"
+ NonBusSignalsTreatedAsBus "none"
+ LoggingUnavailableSignals "error"
+ BlockIODiagnostic "none"
+ SFUnusedDataAndEventsDiag "warning"
+ SFUnexpectedBacktrackingDiag "warning"
+ SFInvalidInputDataAccessInChartInitDiag "warning"
+ SFNoUnconditionalDefaultTransitionDiag "warning"
+ SFTransitionOutsideNaturalParentDiag "warning"
+ SFUnconditionalTransitionShadowingDiag "warning"
+ SFUndirectedBroadcastEventsDiag "warning"
+ SFTransitionActionBeforeConditionDiag "warning"
+ }
+ Simulink.HardwareCC {
+ $ObjectID 12
+ Version "1.14.2"
+ ProdBitPerChar 8
+ ProdBitPerShort 16
+ ProdBitPerInt 32
+ ProdBitPerLong 32
+ ProdBitPerLongLong 64
+ ProdBitPerFloat 32
+ ProdBitPerDouble 64
+ ProdBitPerPointer 32
+ ProdLargestAtomicInteger "Char"
+ ProdLargestAtomicFloat "None"
+ ProdIntDivRoundTo "Undefined"
+ ProdEndianess "Unspecified"
+ ProdWordSize 32
+ ProdShiftRightIntArith on
+ ProdLongLongMode off
+ ProdHWDeviceType "32-bit Generic"
+ TargetBitPerChar 8
+ TargetBitPerShort 16
+ TargetBitPerInt 32
+ TargetBitPerLong 32
+ TargetBitPerLongLong 64
+ TargetBitPerFloat 32
+ TargetBitPerDouble 64
+ TargetBitPerPointer 32
+ TargetLargestAtomicInteger "Char"
+ TargetLargestAtomicFloat "None"
+ TargetShiftRightIntArith on
+ TargetLongLongMode off
+ TargetIntDivRoundTo "Undefined"
+ TargetEndianess "Unspecified"
+ TargetWordSize 32
+ TargetTypeEmulationWarnSuppressLevel 0
+ TargetPreprocMaxBitsSint 32
+ TargetPreprocMaxBitsUint 32
+ TargetHWDeviceType "Specified"
+ TargetUnknown off
+ ProdEqTarget on
+ }
+ Simulink.ModelReferenceCC {
+ $ObjectID 13
+ Version "1.14.2"
+ UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
+ CheckModelReferenceTargetMessage "error"
+ EnableParallelModelReferenceBuilds off
+ ParallelModelReferenceErrorOnInvalidPool on
+ ParallelModelReferenceMATLABWorkerInit "None"
+ ModelReferenceNumInstancesAllowed "Multi"
+ PropagateVarSize "Infer from blocks in model"
+ ModelReferencePassRootInputsByReference on
+ ModelReferenceMinAlgLoopOccurrences off
+ PropagateSignalLabelsOutOfModel off
+ SupportModelReferenceSimTargetCustomCode off
+ }
+ Simulink.SFSimCC {
+ $ObjectID 14
+ Version "1.14.2"
+ SFSimEnableDebug on
+ SFSimOverflowDetection on
+ SFSimEcho on
+ SimBlas on
+ SimCtrlC on
+ SimExtrinsic on
+ SimIntegrity on
+ SimUseLocalCustomCode off
+ SimParseCustomCode on
+ SimBuildMode "sf_incremental_build"
+ SimGenImportedTypeDefs off
+ }
+ Simulink.RTWCC {
+ $BackupClass "Simulink.RTWCC"
+ $ObjectID 15
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "IncludeHyperlinkInReport"
+ Cell "GenerateTraceInfo"
+ Cell "GenerateTraceReport"
+ Cell "GenerateTraceReportSl"
+ Cell "GenerateTraceReportSf"
+ Cell "GenerateTraceReportEml"
+ Cell "GenerateSLWebview"
+ Cell "GenerateCodeMetricsReport"
+ PropName "DisabledProps"
+ }
+ SystemTargetFile "grt.tlc"
+ TLCOptions ""
+ GenCodeOnly off
+ MakeCommand "make_rtw"
+ GenerateMakefile on
+ PackageGeneratedCodeAndArtifacts off
+ PackageName ""
+ TemplateMakefile "grt_default_tmf"
+ PostCodeGenCommand ""
+ Description ""
+ GenerateReport off
+ SaveLog off
+ RTWVerbose on
+ RetainRTWFile off
+ ProfileTLC off
+ TLCDebug off
+ TLCCoverage off
+ TLCAssert off
+ ProcessScriptMode "Default"
+ ConfigurationMode "Optimized"
+ ProcessScript ""
+ ConfigurationScript ""
+ ConfigAtBuild off
+ RTWUseLocalCustomCode off
+ RTWUseSimCustomCode off
+ CustomSourceCode ""
+ CustomHeaderCode ""
+ CustomInclude ""
+ CustomSource ""
+ CustomLibrary ""
+ CustomInitializer ""
+ CustomTerminator ""
+ Toolchain "Automatically locate an installed toolchain"
+ BuildConfiguration "Faster Builds"
+ IncludeHyperlinkInReport off
+ LaunchReport off
+ PortableWordSizes off
+ CreateSILPILBlock "None"
+ CodeExecutionProfiling off
+ CodeExecutionProfileVariable "executionProfile"
+ CodeProfilingSaveOptions "SummaryOnly"
+ CodeProfilingInstrumentation off
+ SILDebugging off
+ TargetLang "C"
+ IncludeBusHierarchyInRTWFileBlockHierarchyMap off
+ IncludeERTFirstTime off
+ GenerateTraceInfo off
+ GenerateTraceReport off
+ GenerateTraceReportSl off
+ GenerateTraceReportSf off
+ GenerateTraceReportEml off
+ GenerateCodeInfo off
+ GenerateWebview off
+ GenerateCodeMetricsReport off
+ GenerateCodeReplacementReport off
+ RTWCompilerOptimization "Off"
+ RTWCustomCompilerOptimizations ""
+ CheckMdlBeforeBuild "Off"
+ CustomRebuildMode "OnUpdate"
+ DataInitializer ""
+ SharedConstantsCachingThreshold 1024
+ Array {
+ Type "Handle"
+ Dimension 2
+ Simulink.CodeAppCC {
+ $ObjectID 16
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 21
+ Cell "IgnoreCustomStorageClasses"
+ Cell "IgnoreTestpoints"
+ Cell "InsertBlockDesc"
+ Cell "InsertPolySpaceComments"
+ Cell "SFDataObjDesc"
+ Cell "MATLABFcnDesc"
+ Cell "SimulinkDataObjDesc"
+ Cell "DefineNamingRule"
+ Cell "SignalNamingRule"
+ Cell "ParamNamingRule"
+ Cell "InlinedPrmAccess"
+ Cell "CustomSymbolStr"
+ Cell "CustomSymbolStrGlobalVar"
+ Cell "CustomSymbolStrType"
+ Cell "CustomSymbolStrField"
+ Cell "CustomSymbolStrFcn"
+ Cell "CustomSymbolStrFcnArg"
+ Cell "CustomSymbolStrBlkIO"
+ Cell "CustomSymbolStrTmpVar"
+ Cell "CustomSymbolStrMacro"
+ Cell "ReqsInCode"
+ PropName "DisabledProps"
+ }
+ ForceParamTrailComments off
+ GenerateComments on
+ CommentStyle "Auto"
+ IgnoreCustomStorageClasses on
+ IgnoreTestpoints off
+ IncHierarchyInIds off
+ MaxIdLength 31
+ PreserveName off
+ PreserveNameWithParent off
+ ShowEliminatedStatement off
+ OperatorAnnotations off
+ IncAutoGenComments off
+ SimulinkDataObjDesc off
+ SFDataObjDesc off
+ MATLABFcnDesc off
+ IncDataTypeInIds off
+ MangleLength 1
+ CustomSymbolStrGlobalVar "$R$N$M"
+ CustomSymbolStrType "$N$R$M_T"
+ CustomSymbolStrField "$N$M"
+ CustomSymbolStrFcn "$R$N$M$F"
+ CustomSymbolStrFcnArg "rt$I$N$M"
+ CustomSymbolStrBlkIO "rtb_$N$M"
+ CustomSymbolStrTmpVar "$N$M"
+ CustomSymbolStrMacro "$R$N$M"
+ CustomSymbolStrUtil "$N$C"
+ DefineNamingRule "None"
+ ParamNamingRule "None"
+ SignalNamingRule "None"
+ InsertBlockDesc off
+ InsertPolySpaceComments off
+ SimulinkBlockComments on
+ MATLABSourceComments off
+ EnableCustomComments off
+ InternalIdentifier "Shortened"
+ InlinedPrmAccess "Literals"
+ ReqsInCode off
+ UseSimReservedNames off
+ }
+ Simulink.GRTTargetCC {
+ $BackupClass "Simulink.TargetCC"
+ $ObjectID 17
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 16
+ Cell "GeneratePreprocessorConditionals"
+ Cell "IncludeMdlTerminateFcn"
+ Cell "CombineOutputUpdateFcns"
+ Cell "SuppressErrorStatus"
+ Cell "ERTCustomFileBanners"
+ Cell "GenerateSampleERTMain"
+ Cell "GenerateTestInterfaces"
+ Cell "ModelStepFunctionPrototypeControlCompliant"
+ Cell "CPPClassGenCompliant"
+ Cell "PortableWordSizes"
+ Cell "PurelyIntegerCode"
+ Cell "SupportComplex"
+ Cell "SupportAbsoluteTime"
+ Cell "SupportContinuousTime"
+ Cell "SupportNonInlinedSFcns"
+ Cell "GenerateAllocFcn"
+ PropName "DisabledProps"
+ }
+ TargetFcnLib "ansi_tfl_table_tmw.mat"
+ TargetLibSuffix ""
+ TargetPreCompLibLocation ""
+ GenFloatMathFcnCalls "NOT IN USE"
+ TargetLangStandard "C89/C90 (ANSI)"
+ CodeReplacementLibrary "None"
+ UtilityFuncGeneration "Auto"
+ ERTMultiwordTypeDef "System defined"
+ ERTMultiwordLength 256
+ MultiwordLength 2048
+ GenerateFullHeader on
+ GenerateSampleERTMain off
+ GenerateTestInterfaces off
+ ModelReferenceCompliant on
+ ParMdlRefBuildCompliant on
+ CompOptLevelCompliant on
+ ConcurrentExecutionCompliant on
+ IncludeMdlTerminateFcn on
+ GeneratePreprocessorConditionals "Disable all"
+ CombineOutputUpdateFcns off
+ CombineSignalStateStructs off
+ SuppressErrorStatus off
+ ERTFirstTimeCompliant off
+ IncludeFileDelimiter "Auto"
+ ERTCustomFileBanners off
+ SupportAbsoluteTime on
+ LogVarNameModifier "rt_"
+ MatFileLogging on
+ MultiInstanceERTCode off
+ CodeInterfacePackaging "Nonreusable function"
+ SupportNonFinite on
+ SupportComplex on
+ PurelyIntegerCode off
+ SupportContinuousTime on
+ SupportNonInlinedSFcns on
+ SupportVariableSizeSignals off
+ EnableShiftOperators on
+ ParenthesesLevel "Nominal"
+ MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization"
+ ModelStepFunctionPrototypeControlCompliant off
+ CPPClassGenCompliant on
+ AutosarCompliant off
+ GRTInterface on
+ GenerateAllocFcn off
+ UseMalloc off
+ ExtMode off
+ ExtModeStaticAlloc off
+ ExtModeTesting off
+ ExtModeStaticAllocSize 1000000
+ ExtModeTransport 0
+ ExtModeMexFile "ext_comm"
+ ExtModeIntrfLevel "Level1"
+ RTWCAPISignals off
+ RTWCAPIParams off
+ RTWCAPIStates off
+ RTWCAPIRootIO off
+ GenerateASAP2 off
+ MultiInstanceErrorCode "Error"
+ }
+ PropName "Components"
+ }
+ }
+ hdlcoderui.hdlcc {
+ $ObjectID 18
+ Version "1.14.2"
+ Description "HDL Coder custom configuration component"
+ Name "HDL Coder"
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell ""
+ PropName "HDLConfigFile"
+ }
+ HDLCActiveTab "0"
+ }
+ PropName "Components"
+ }
+ Name "Configuration"
+ CurrentDlgPage "Solver"
+ ConfigPrmDlgPosition [ 243, 69, 1123, 699 ]
+ }
+ PropName "ConfigurationSets"
+ }
+ Simulink.ConfigSet {
+ $PropName "ActiveConfigurationSet"
+ $ObjectID 7
+ }
+ Object {
+ $PropName "DataTransfer"
+ $ObjectID 19
+ $ClassName "Simulink.GlobalDataTransfer"
+ DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)"
+ DefaultTransitionBetweenAsyncTasks "Ensure data integrity only"
+ DefaultTransitionBetweenContTasks "Ensure deterministic transfer (minimum delay)"
+ DefaultExtrapolationMethodBetweenContTasks "None"
+ AutoInsertRateTranBlk [0]
+ }
+ ExplicitPartitioning off
+ BlockDefaults {
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ NamePlacement "normal"
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ ShowName on
+ BlockRotation 0
+ BlockMirror off
+ }
+ AnnotationDefaults {
+ HorizontalAlignment "center"
+ VerticalAlignment "middle"
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ UseDisplayTextAsClickCallback off
+ }
+ LineDefaults {
+ FontName "Helvetica"
+ FontSize 9
+ FontWeight "normal"
+ FontAngle "normal"
+ }
+ MaskDefaults {
+ SelfModifiable "off"
+ IconFrame "on"
+ IconOpaque "on"
+ RunInitForIconRedraw "off"
+ IconRotate "none"
+ PortRotate "default"
+ IconUnits "autoscale"
+ }
+ MaskParameterDefaults {
+ Evaluate "on"
+ Tunable "on"
+ NeverSave "off"
+ Internal "off"
+ ReadOnly "off"
+ Enabled "on"
+ Visible "on"
+ ToolTip "on"
+ }
+ BlockParameterDefaults {
+ Block {
+ BlockType Demux
+ Outputs "4"
+ DisplayOption "none"
+ BusSelectionMode off
+ }
+ Block {
+ BlockType Derivative
+ CoefficientInTFapproximation "inf"
+ }
+ Block {
+ BlockType Gain
+ Gain "1"
+ Multiplication "Element-wise(K.*u)"
+ ParamMin "[]"
+ ParamMax "[]"
+ ParamDataTypeStr "Inherit: Same as input"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: Same as input"
+ LockScale off
+ RndMeth "Floor"
+ SaturateOnIntegerOverflow on
+ SampleTime "-1"
+ }
+ Block {
+ BlockType Inport
+ Port "1"
+ OutputFunctionCall off
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ LatchByDelayingOutsideSignal off
+ LatchInputForFeedbackSignals off
+ Interpolate on
+ }
+ Block {
+ BlockType Outport
+ Port "1"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ SourceOfInitialOutputValue "Dialog"
+ OutputWhenDisabled "held"
+ InitialOutput "[]"
+ }
+ Block {
+ BlockType S-Function
+ FunctionName "system"
+ SFunctionModules "''"
+ PortCounts "[]"
+ SFunctionDeploymentMode off
+ }
+ Block {
+ BlockType Scope
+ ModelBased off
+ TickLabels "OneTimeTick"
+ ZoomMode "on"
+ Grid "on"
+ TimeRange "auto"
+ YMin "-5"
+ YMax "5"
+ SaveToWorkspace off
+ SaveName "ScopeData"
+ DataFormat "Array"
+ LimitDataPoints on
+ MaxDataPoints "5000"
+ Decimation "1"
+ SampleInput off
+ SampleTime "-1"
+ }
+ Block {
+ BlockType SubSystem
+ ShowPortLabels "FromPortIcon"
+ Permissions "ReadWrite"
+ PermitHierarchicalResolution "All"
+ TreatAsAtomicUnit off
+ MinAlgLoopOccurrences off
+ PropExecContextOutsideSubsystem off
+ CheckFcnCallInpInsideContextMsg off
+ SystemSampleTime "-1"
+ RTWSystemCode "Auto"
+ RTWFcnNameOpts "Auto"
+ RTWFileNameOpts "Auto"
+ FunctionInterfaceSpec "void_void"
+ FunctionWithSeparateData off
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ SimViewingDevice off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ Opaque off
+ MaskHideContents off
+ SFBlockType "NONE"
+ Variant off
+ GeneratePreprocessorConditionals off
+ ContentPreviewEnabled off
+ }
+ Block {
+ BlockType Terminator
+ }
+ }
+ System {
+ Name "Cessna_6DOF"
+ Location [-8, -8, 1374, 746]
+ Open on
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ ReportName "simulink-default.rpt"
+ SIDHighWatermark "23"
+ Block {
+ BlockType Reference
+ Name "6DoF (Euler Angles)"
+ SID "1"
+ Ports [2, 8]
+ Position [235, 187, 435, 388]
+ ZOrder -1
+ LibraryVersion "1.44"
+ SourceBlock "aerolibobsolete/6DoF (Euler Angles)"
+ SourceType "6DoF EoM (Body Axis)"
+ ContentPreviewEnabled off
+ units "Metric (MKS)"
+ mtype "Fixed"
+ rep "Euler Angles"
+ xme_0 "[x y z]"
+ Vm_0 "[u v w]"
+ eul_0 "[phi theta psi]"
+ pm_0 "[p q r]"
+ mass_0 "m"
+ mass_e "0.5"
+ mass_f "2.0"
+ inertia "diag([I_xx I_yy I_zz])"
+ inertia_e "eye(3)"
+ inertia_f "2*eye(3)"
+ k_quat "1.0"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux"
+ SID "7"
+ Ports [1, 3]
+ Position [655, 321, 660, 359]
+ ZOrder -2
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux1"
+ SID "12"
+ Ports [1, 3]
+ Position [485, 126, 490, 164]
+ ZOrder -3
+ BlockMirror on
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux2"
+ SID "15"
+ Ports [1, 3]
+ Position [485, 71, 490, 109]
+ ZOrder -4
+ BlockMirror on
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Derivative
+ Name "Derivative"
+ SID "6"
+ Position [615, 235, 645, 265]
+ ZOrder -5
+ }
+ Block {
+ BlockType Gain
+ Name "Gain"
+ SID "17"
+ Position [385, 65, 415, 95]
+ ZOrder -6
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain1"
+ SID "18"
+ Position [430, 75, 460, 105]
+ ZOrder -7
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain2"
+ SID "19"
+ Position [385, 85, 415, 115]
+ ZOrder -8
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain3"
+ SID "20"
+ Position [615, 125, 645, 155]
+ ZOrder -9
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain4"
+ SID "21"
+ Position [700, 135, 730, 165]
+ ZOrder -10
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Reference
+ Name "Incidence, Sideslip,\n& Airspeed"
+ SID "3"
+ Ports [1, 3]
+ Position [525, 275, 585, 325]
+ ZOrder -11
+ LibraryVersion "1.133"
+ SourceBlock "aerolibasang/Incidence, Sideslip,\n& Airspeed"
+ SourceType "Incidence,Sideslip,&Airspeed"
+ ContentPreviewEnabled off
+ }
+ Block {
+ BlockType SubSystem
+ Name "MATLAB Function1"
+ SID "5"
+ Ports [8, 2]
+ Position [715, 195, 830, 390]
+ ZOrder -12
+ LibraryVersion "1.32"
+ ErrorFcn "Stateflow.Translate.translate"
+ PermitHierarchicalResolution "ExplicitOnly"
+ TreatAsAtomicUnit on
+ RequestExecContextInheritance off
+ SFBlockType "MATLAB Function"
+ System {
+ Name "MATLAB Function1"
+ Location [227, 345, 838, 789]
+ Open off
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ SIDHighWatermark "29"
+ Block {
+ BlockType Inport
+ Name "V"
+ SID "5::1"
+ Position [20, 101, 40, 119]
+ ZOrder -1
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha"
+ SID "5::18"
+ Position [20, 136, 40, 154]
+ ZOrder -2
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha_dot"
+ SID "5::25"
+ Position [20, 171, 40, 189]
+ ZOrder -3
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "beta"
+ SID "5::19"
+ Position [20, 206, 40, 224]
+ ZOrder -4
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "p"
+ SID "5::20"
+ Position [20, 246, 40, 264]
+ ZOrder -5
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "q"
+ SID "5::21"
+ Position [20, 281, 40, 299]
+ ZOrder -6
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "r"
+ SID "5::22"
+ Position [20, 316, 40, 334]
+ ZOrder -7
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "theta"
+ SID "5::23"
+ Position [20, 351, 40, 369]
+ ZOrder -8
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Demux
+ Name " Demux "
+ SID "5::27"
+ Ports [1, 1]
+ Position [270, 230, 320, 270]
+ ZOrder 2
+ Outputs "1"
+ }
+ Block {
+ BlockType S-Function
+ Name " SFunction "
+ SID "5::26"
+ Tag "Stateflow S-Function Cessna_6DOF 1"
+ Ports [8, 3]
+ Position [180, 100, 230, 280]
+ ZOrder 1
+ FunctionName "sf_sfun"
+ PortCounts "[8 3]"
+ EnableBusSupport on
+ Port {
+ PortNumber 2
+ Name "F"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ Port {
+ PortNumber 3
+ Name "M"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name " Terminator "
+ SID "5::28"
+ Position [460, 241, 480, 259]
+ ZOrder 3
+ }
+ Block {
+ BlockType Outport
+ Name "F"
+ SID "5::5"
+ Position [460, 101, 480, 119]
+ ZOrder -12
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "M"
+ SID "5::24"
+ Position [460, 136, 480, 154]
+ ZOrder -13
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Line {
+ ZOrder 38
+ SrcBlock "V"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 1
+ }
+ Line {
+ ZOrder 39
+ SrcBlock "alpha"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 2
+ }
+ Line {
+ ZOrder 40
+ SrcBlock "alpha_dot"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 3
+ }
+ Line {
+ ZOrder 41
+ SrcBlock "beta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 4
+ }
+ Line {
+ ZOrder 42
+ SrcBlock "p"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 5
+ }
+ Line {
+ ZOrder 43
+ SrcBlock "q"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 6
+ }
+ Line {
+ ZOrder 44
+ SrcBlock "r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 7
+ }
+ Line {
+ ZOrder 45
+ SrcBlock "theta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 8
+ }
+ Line {
+ Name "F"
+ ZOrder 46
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 2
+ DstBlock "F"
+ DstPort 1
+ }
+ Line {
+ Name "M"
+ ZOrder 47
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 3
+ DstBlock "M"
+ DstPort 1
+ }
+ Line {
+ ZOrder 48
+ SrcBlock " Demux "
+ SrcPort 1
+ DstBlock " Terminator "
+ DstPort 1
+ }
+ Line {
+ ZOrder 49
+ SrcBlock " SFunction "
+ SrcPort 1
+ DstBlock " Demux "
+ DstPort 1
+ }
+ }
+ }
+ Block {
+ BlockType Scope
+ Name "Scope"
+ SID "13"
+ Ports [3]
+ Position [765, 124, 795, 156]
+ ZOrder -13
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ ShowLegends off
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope1"
+ SID "14"
+ Ports [3]
+ Position [410, 129, 440, 161]
+ ZOrder -14
+ BlockMirror on
+ Floating off
+ Location [1, 48, 1025, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ List {
+ ListType ScopeGraphics
+ FigureColor "[0.5 0.5 0.5]"
+ AxesColor "[0 0 0]"
+ AxesTickColor "[1 1 1]"
+ LineColors "[1 1 0;1 0 1;0 1 1;1 0 0;0 1 0;0 0 1]"
+ LineStyles "-|-|-|-|-|-"
+ LineWidths "[0.5 0.5 0.5 0.5 0.5 0.5]"
+ MarkerStyles "none|none|none|none|none|none"
+ }
+ ShowLegends off
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData1"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope2"
+ SID "16"
+ Ports [3]
+ Position [330, 74, 360, 106]
+ ZOrder -15
+ BlockMirror on
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ ShowLegends off
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData2"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope3"
+ SID "22"
+ Ports [3]
+ Position [755, 424, 785, 456]
+ ZOrder -16
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ ShowLegends off
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData3"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator"
+ SID "8"
+ Position [475, 375, 495, 395]
+ ZOrder -17
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator1"
+ SID "9"
+ Position [550, 375, 570, 395]
+ ZOrder -18
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator2"
+ SID "10"
+ Position [460, 190, 480, 210]
+ ZOrder -19
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator3"
+ SID "11"
+ Position [460, 265, 480, 285]
+ ZOrder -20
+ }
+ Line {
+ ZOrder 1
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 5
+ DstBlock "Incidence, Sideslip,\n& Airspeed"
+ DstPort 1
+ }
+ Line {
+ ZOrder 2
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 3
+ Points [0, -115]
+ Branch {
+ ZOrder 3
+ Points [110, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 4
+ Points [0, -70]
+ DstBlock "Scope"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 5
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 1
+ Points [10, 0; 0, -35]
+ Branch {
+ ZOrder 6
+ DstBlock "Derivative"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 7
+ Points [0, -25]
+ Branch {
+ ZOrder 8
+ Points [100, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 2
+ }
+ Branch {
+ ZOrder 9
+ DstBlock "Gain3"
+ DstPort 1
+ }
+ }
+ }
+ Line {
+ ZOrder 10
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 2
+ Points [75, 0; 0, -25]
+ Branch {
+ ZOrder 11
+ Points [35, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 4
+ }
+ Branch {
+ ZOrder 12
+ Points [0, -125]
+ DstBlock "Gain4"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 13
+ SrcBlock "Derivative"
+ SrcPort 1
+ Points [50, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 3
+ }
+ Line {
+ ZOrder 14
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [25, 0]
+ Branch {
+ ZOrder 15
+ Points [0, -25]
+ DstBlock "MATLAB Function1"
+ DstPort 5
+ }
+ Branch {
+ ZOrder 16
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 17
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [35, 0]
+ Branch {
+ ZOrder 18
+ DstBlock "MATLAB Function1"
+ DstPort 6
+ }
+ Branch {
+ ZOrder 19
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 2
+ }
+ }
+ Line {
+ ZOrder 20
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [15, 0]
+ Branch {
+ ZOrder 21
+ Points [20, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 7
+ }
+ Branch {
+ ZOrder 22
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 3
+ }
+ }
+ Line {
+ ZOrder 23
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 6
+ Points [25, 0; 0, 35; 175, 0]
+ DstBlock "Demux"
+ DstPort 1
+ }
+ Line {
+ ZOrder 24
+ SrcBlock "MATLAB Function1"
+ SrcPort 1
+ Points [9, 0; 0, -70; -624, 0]
+ DstBlock "6DoF (Euler Angles)"
+ DstPort 1
+ }
+ Line {
+ ZOrder 25
+ SrcBlock "MATLAB Function1"
+ SrcPort 2
+ Points [9, 0; 0, 70; -624, 0]
+ DstBlock "6DoF (Euler Angles)"
+ DstPort 2
+ }
+ Line {
+ ZOrder 26
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 7
+ Points [20, 0; 0, 20; 75, 0]
+ DstBlock "Terminator1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 27
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 8
+ Points [10, 0; 0, 10]
+ DstBlock "Terminator"
+ DstPort 1
+ }
+ Line {
+ ZOrder 28
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 1
+ DstBlock "Terminator2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 29
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 4
+ DstBlock "Terminator3"
+ DstPort 1
+ }
+ Line {
+ ZOrder 30
+ SrcBlock "Demux1"
+ SrcPort 1
+ DstBlock "Scope1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 31
+ SrcBlock "Demux1"
+ SrcPort 2
+ DstBlock "Scope1"
+ DstPort 2
+ }
+ Line {
+ ZOrder 32
+ SrcBlock "Demux1"
+ SrcPort 3
+ DstBlock "Scope1"
+ DstPort 3
+ }
+ Line {
+ ZOrder 33
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 2
+ Points [0, 5; 65, 0]
+ DstBlock "Demux1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 34
+ SrcBlock "Demux2"
+ SrcPort 1
+ DstBlock "Gain"
+ DstPort 1
+ }
+ Line {
+ ZOrder 35
+ SrcBlock "Demux2"
+ SrcPort 2
+ Points [-5, 0]
+ Branch {
+ ZOrder 36
+ Points [0, -30; 40, 0; 0, 305; 185, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 8
+ }
+ Branch {
+ ZOrder 37
+ DstBlock "Gain1"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 38
+ SrcBlock "Demux2"
+ SrcPort 3
+ DstBlock "Gain2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 39
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 3
+ Points [70, 0; 0, -160]
+ DstBlock "Demux2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 40
+ SrcBlock "Gain"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 41
+ SrcBlock "Gain1"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 2
+ }
+ Line {
+ ZOrder 42
+ SrcBlock "Gain2"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 3
+ }
+ Line {
+ ZOrder 43
+ SrcBlock "Gain3"
+ SrcPort 1
+ DstBlock "Scope"
+ DstPort 2
+ }
+ Line {
+ ZOrder 44
+ SrcBlock "Gain4"
+ SrcPort 1
+ DstBlock "Scope"
+ DstPort 3
+ }
+ }
+}
+#Finite State Machines
+#
+# Stateflow Version 8.1 (R2014a) dated Feb 8 2014, 02:29:12
+#
+#
+Stateflow {
+ machine {
+ id 1
+ name "Cessna_6DOF"
+ created "20-Dec-2014 14:27:29"
+ isLibrary 0
+ firstTarget 17
+ sfVersion 76014001.002
+ }
+ chart {
+ id 2
+ name "MATLAB Function1"
+ windowPosition [315.596 52 213 385]
+ viewLimits [0 156.75 0 153.75]
+ screen [1 1 1024 768 1.333333333333333]
+ treeNode [0 3 0 0]
+ firstTransition 15
+ firstJunction 14
+ viewObj 2
+ visible 1
+ machine 1
+ subviewS {
+ }
+ ssIdHighWaterMark 14
+ decomposition CLUSTER_CHART
+ type EML_CHART
+ firstData 4
+ chartFileNumber 1
+ disableImplicitCasting 1
+ eml {
+ name "FM_Cessna"
+ }
+ }
+ state {
+ id 3
+ labelString "eML_blk_kernel()"
+ position [18 64.5 118 66]
+ fontSize 12
+ chart 2
+ treeNode [2 0 0 0]
+ superState SUBCHART
+ subviewer 2
+ ssIdNumber 1
+ type FUNC_STATE
+ decomposition CLUSTER_STATE
+ eml {
+ isEML 1
+ script "function [F, M] = FM_Cessna(V, alpha, alpha_dot, beta, p, q, r, theta)\n\ng = 9.8;\nrho = 1.225;\n"
+ "\nm = 1043.26;\nC_bar = 1.493;\nb = 10.911;\nS_ref = 16.1651;\n\nC_L_0 = 0.25;\nC_L_alpha = 4.47;\nC_L_q = 1.7;\n"
+ "C_L_delta_e = 0.3476;\n\n% Ignore all other C_D derivatives excluding C_D_0\n% Use C_D = C_D_0 + k*C_L^2\n\nC_D_"
+ "0 = 0.036;\nk = 0.3;\n\nC_Y_beta = -0.31;\nC_Y_p = -0.037;\nC_Y_r = 0.21;\nC_Y_delta_a = 0;\n\nC_l_beta = -0.089"
+ ";\nC_l_p = -0.47;\nC_l_r = 0.096;\nC_l_delta_a = -0.09;\nC_l_delta_r = 0.0147;\n\nC_M_0 = -0.02;\nC_M_alpha = -1"
+ ".8;\nC_M_alpha_dot = -12.4;\nC_M_delta_e = -1.28;\n\nC_N_beta = 0.065;\nC_N_p = -0.03;\nC_N_r = -0.99;\nC_N_delt"
+ "a_a = -0.0053;\nC_N_delta_r = -0.0657;\n\n% Use delta_e and thrust value from output of fsolve(@Trim_function)\n"
+ "\ndelta_e = 0.0338;\ndelta_a = 0;\ndelta_r = 0;\nthrust = 4219.6;\n\nC_L = C_L_0 + C_L_alpha*alpha + C_L_q*(q*C_"
+ "bar/(2*V)) + C_L_delta_e*delta_e;\nC_D = C_D_0 + k*C_L^2;\nC_Y = C_Y_beta*beta + C_Y_p*(p*b/(2*V)) + C_Y_r*(r*b/"
+ "(2*V)) + C_Y_delta_a*delta_a;\n\nC_l = C_l_beta*beta + C_l_p*(p*b/(2*V)) + C_l_r*(r*b/(2*V)) + C_l_delta_a*delta"
+ "_a + C_l_delta_r*delta_r;\nC_M = C_M_0 + C_M_alpha*alpha + C_M_alpha_dot*(alpha_dot*C_bar/(2*V)) + C_M_delta_e*d"
+ "elta_e;\nC_N = C_N_beta*beta + C_N_p*(p*b/(2*V)) + C_N_r*(r*b/(2*V)) + C_N_delta_a*delta_a + C_N_delta_r*delta_r"
+ ";\n\nC_X = -C_D*cos(alpha) + C_L*sin(alpha);\nC_Z = -C_D*sin(alpha) - C_L*cos(alpha);\n\nF = zeros(3,1);\nM = ze"
+ "ros(3,1);\n\nq_bar = 0.5*rho*V*V;\n\nF(1,1) = q_bar*S_ref*C_X - m*g*sin(theta) + thrust;\nF(2,1) = q_bar*S_ref*C"
+ "_Y;\nF(3,1) = q_bar*S_ref*C_Z + m*g*cos(theta);\n\nM(1,1) = q_bar*b*S_ref*C_l;\nM(2,1) = q_bar*C_bar*S_ref*C_M;\n"
+ "M(3,1) = q_bar*b*S_ref*C_N;"
+ editorLayout "100 M4x1[10 5 700 500]"
+ }
+ }
+ data {
+ id 4
+ ssIdNumber 4
+ name "V"
+ linkNode [2 0 5]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 5
+ ssIdNumber 5
+ name "F"
+ linkNode [2 4 6]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 6
+ ssIdNumber 6
+ name "alpha"
+ linkNode [2 5 7]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 7
+ ssIdNumber 13
+ name "alpha_dot"
+ linkNode [2 6 8]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 8
+ ssIdNumber 7
+ name "beta"
+ linkNode [2 7 9]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 9
+ ssIdNumber 8
+ name "p"
+ linkNode [2 8 10]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 10
+ ssIdNumber 9
+ name "q"
+ linkNode [2 9 11]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 11
+ ssIdNumber 10
+ name "r"
+ linkNode [2 10 12]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 12
+ ssIdNumber 11
+ name "theta"
+ linkNode [2 11 13]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 13
+ ssIdNumber 12
+ name "M"
+ linkNode [2 12 0]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ junction {
+ id 14
+ position [23.5747 49.5747 7]
+ chart 2
+ linkNode [2 0 0]
+ subviewer 2
+ ssIdNumber 3
+ type CONNECTIVE_JUNCTION
+ }
+ transition {
+ id 15
+ labelString "{eML_blk_kernel();}"
+ labelPosition [36.125 25.875 102.544 14.964]
+ fontSize 12
+ src {
+ intersection [0 0 1 0 23.5747 14.625 0 0]
+ }
+ dst {
+ id 14
+ intersection [1 0 -1 0 23.5747 42.5747 0 0]
+ }
+ midPoint [23.5747 24.9468]
+ chart 2
+ linkNode [2 0 0]
+ dataLimits [21.175 25.975 14.625 42.575]
+ subviewer 2
+ drawStyle SMART
+ slide {
+ sticky BOTH_STICK
+ }
+ executionOrder 1
+ ssIdNumber 2
+ }
+ instance {
+ id 16
+ name "MATLAB Function1"
+ machine 1
+ chart 2
+ }
+ target {
+ id 17
+ name "sfun"
+ description "Default Simulink S-Function Target."
+ machine 1
+ linkNode [1 0 0]
+ }
+}
diff --git a/Prof_Arya/Cessna_6DOF.mdl.r2011a b/Prof_Arya/Cessna_6DOF.mdl.r2011a
new file mode 100644
index 0000000..4be6b03
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF.mdl.r2011a
@@ -0,0 +1,1849 @@
+Model {
+ Name "Cessna_6DOF"
+ Version 7.7
+ MdlSubVersion 0
+ GraphicalInterface {
+ NumRootInports 0
+ NumRootOutports 0
+ ParameterArgumentNames ""
+ ComputedModelVersion "1.8"
+ NumModelReferences 0
+ NumTestPointedSignals 0
+ }
+ SavedCharacterEncoding "windows-1252"
+ SaveDefaultBlockParams on
+ ScopeRefreshTime 0.035000
+ OverrideScopeRefreshTime on
+ DisableAllScopes off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ MinMaxOverflowArchiveMode "Overwrite"
+ MaxMDLFileLineLength 120
+ Created "Sat Dec 20 14:26:50 2014"
+ Creator "Pranav"
+ UpdateHistory "UpdateHistoryNever"
+ ModifiedByFormat "%<Auto>"
+ LastModifiedBy "Pranav"
+ ModifiedDateFormat "%<Auto>"
+ LastModifiedDate "Mon Dec 22 10:00:17 2014"
+ RTWModifiedTimeStamp 341142813
+ ModelVersionFormat "1.%<AutoIncrement:8>"
+ ConfigurationManager "None"
+ SampleTimeColors off
+ SampleTimeAnnotations off
+ LibraryLinkDisplay "none"
+ WideLines off
+ ShowLineDimensions off
+ ShowPortDataTypes off
+ ShowLoopsOnError on
+ IgnoreBidirectionalLines off
+ ShowStorageClass off
+ ShowTestPointIcons on
+ ShowSignalResolutionIcons on
+ ShowViewerIcons on
+ SortedOrder off
+ ExecutionContextIcon off
+ ShowLinearizationAnnotations on
+ BlockNameDataTip off
+ BlockParametersDataTip off
+ BlockDescriptionStringDataTip off
+ ToolBar on
+ StatusBar on
+ BrowserShowLibraryLinks off
+ BrowserLookUnderMasks off
+ SimulationMode "normal"
+ LinearizationMsg "none"
+ Profile off
+ ParamWorkspaceSource "MATLABWorkspace"
+ AccelSystemTargetFile "accel.tlc"
+ AccelTemplateMakefile "accel_default_tmf"
+ AccelMakeCommand "make_rtw"
+ TryForcingSFcnDF off
+ Object {
+ $PropName "DataLoggingOverride"
+ $ObjectID 1
+ $ClassName "Simulink.SimulationData.ModelLoggingInfo"
+ model_ "Cessna_6DOF"
+ overrideMode_ [0.0]
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell "Cessna_6DOF"
+ PropName "logAsSpecifiedByModels_"
+ }
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell []
+ PropName "logAsSpecifiedByModelsSSIDs_"
+ }
+ }
+ RecordCoverage off
+ CovPath "/"
+ CovSaveName "covdata"
+ CovMetricSettings "dw"
+ CovNameIncrementing off
+ CovHtmlReporting on
+ CovForceBlockReductionOff on
+ covSaveCumulativeToWorkspaceVar on
+ CovSaveSingleToWorkspaceVar on
+ CovCumulativeVarName "covCumulativeData"
+ CovCumulativeReport off
+ CovReportOnPause on
+ CovModelRefEnable "Off"
+ CovExternalEMLEnable off
+ ExtModeBatchMode off
+ ExtModeEnableFloating on
+ ExtModeTrigType "manual"
+ ExtModeTrigMode "normal"
+ ExtModeTrigPort "1"
+ ExtModeTrigElement "any"
+ ExtModeTrigDuration 1000
+ ExtModeTrigDurationFloating "auto"
+ ExtModeTrigHoldOff 0
+ ExtModeTrigDelay 0
+ ExtModeTrigDirection "rising"
+ ExtModeTrigLevel 0
+ ExtModeArchiveMode "off"
+ ExtModeAutoIncOneShot off
+ ExtModeIncDirWhenArm off
+ ExtModeAddSuffixToVar off
+ ExtModeWriteAllDataToWs off
+ ExtModeArmWhenConnect on
+ ExtModeSkipDownloadWhenConnect off
+ ExtModeLogAll on
+ ExtModeAutoUpdateStatusClock on
+ BufferReuse on
+ ShowModelReferenceBlockVersion off
+ ShowModelReferenceBlockIO off
+ Array {
+ Type "Handle"
+ Dimension 1
+ Simulink.ConfigSet {
+ $ObjectID 2
+ Version "1.11.0"
+ Array {
+ Type "Handle"
+ Dimension 9
+ Simulink.SolverCC {
+ $ObjectID 3
+ Version "1.11.0"
+ StartTime "0.0"
+ StopTime "1000"
+ AbsTol "auto"
+ FixedStep "auto"
+ InitialStep "auto"
+ MaxNumMinSteps "-1"
+ MaxOrder 5
+ ZcThreshold "auto"
+ ConsecutiveZCsStepRelTol "10*128*eps"
+ MaxConsecutiveZCs "1000"
+ ExtrapolationOrder 4
+ NumberNewtonIterations 1
+ MaxStep "auto"
+ MinStep "auto"
+ MaxConsecutiveMinStep "1"
+ RelTol "1e-3"
+ SolverMode "Auto"
+ ConcurrentTasks off
+ Solver "ode45"
+ SolverName "ode45"
+ SolverJacobianMethodControl "auto"
+ ShapePreserveControl "DisableAll"
+ ZeroCrossControl "UseLocalSettings"
+ ZeroCrossAlgorithm "Nonadaptive"
+ AlgebraicLoopSolver "TrustRegion"
+ SolverResetMethod "Fast"
+ PositivePriorityOrder off
+ AutoInsertRateTranBlk off
+ SampleTimeConstraint "Unconstrained"
+ InsertRTBMode "Whenever possible"
+ }
+ Simulink.DataIOCC {
+ $ObjectID 4
+ Version "1.11.0"
+ Decimation "1"
+ ExternalInput "[t, u]"
+ FinalStateName "xFinal"
+ InitialState "xInitial"
+ LimitDataPoints on
+ MaxDataPoints "1000"
+ LoadExternalInput off
+ LoadInitialState off
+ SaveFinalState off
+ SaveCompleteFinalSimState off
+ SaveFormat "Array"
+ SignalLoggingSaveFormat "ModelDataLogs"
+ SaveOutput on
+ SaveState off
+ SignalLogging on
+ DSMLogging on
+ InspectSignalLogs off
+ SaveTime on
+ ReturnWorkspaceOutputs off
+ StateSaveName "xout"
+ TimeSaveName "tout"
+ OutputSaveName "yout"
+ SignalLoggingName "logsout"
+ DSMLoggingName "dsmout"
+ OutputOption "RefineOutputTimes"
+ OutputTimes "[]"
+ ReturnWorkspaceOutputsName "out"
+ Refine "1"
+ }
+ Simulink.OptimizationCC {
+ $ObjectID 5
+ Version "1.11.0"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "BooleansAsBitfields"
+ Cell "PassReuseOutputArgsAs"
+ Cell "PassReuseOutputArgsThreshold"
+ Cell "ZeroExternalMemoryAtStartup"
+ Cell "ZeroInternalMemoryAtStartup"
+ Cell "OptimizeModelRefInitCode"
+ Cell "NoFixptDivByZeroProtection"
+ Cell "UseSpecifiedMinMax"
+ PropName "DisabledProps"
+ }
+ BlockReduction on
+ BooleanDataType on
+ ConditionallyExecuteInputs on
+ InlineParams off
+ UseIntDivNetSlope off
+ UseSpecifiedMinMax off
+ InlineInvariantSignals off
+ OptimizeBlockIOStorage on
+ BufferReuse on
+ EnhancedBackFolding off
+ StrengthReduction off
+ ExpressionFolding on
+ BooleansAsBitfields off
+ BitfieldContainerType "uint_T"
+ EnableMemcpy on
+ MemcpyThreshold 64
+ PassReuseOutputArgsAs "Structure reference"
+ ExpressionDepthLimit 2147483647
+ FoldNonRolledExpr on
+ LocalBlockOutputs on
+ RollThreshold 5
+ SystemCodeInlineAuto off
+ StateBitsets off
+ DataBitsets off
+ UseTempVars off
+ ZeroExternalMemoryAtStartup on
+ ZeroInternalMemoryAtStartup on
+ InitFltsAndDblsToZero off
+ NoFixptDivByZeroProtection off
+ EfficientFloat2IntCast off
+ EfficientMapNaN2IntZero on
+ OptimizeModelRefInitCode off
+ LifeSpan "inf"
+ MaxStackSize "Inherit from target"
+ BufferReusableBoundary on
+ SimCompilerOptimization "Off"
+ AccelVerboseBuild off
+ AccelParallelForEachSubsystem on
+ }
+ Simulink.DebuggingCC {
+ $ObjectID 6
+ Version "1.11.0"
+ RTPrefix "error"
+ ConsistencyChecking "none"
+ ArrayBoundsChecking "none"
+ SignalInfNanChecking "none"
+ SignalRangeChecking "none"
+ ReadBeforeWriteMsg "UseLocalSettings"
+ WriteAfterWriteMsg "UseLocalSettings"
+ WriteAfterReadMsg "UseLocalSettings"
+ AlgebraicLoopMsg "warning"
+ ArtificialAlgebraicLoopMsg "warning"
+ SaveWithDisabledLinksMsg "warning"
+ SaveWithParameterizedLinksMsg "warning"
+ CheckSSInitialOutputMsg on
+ UnderspecifiedInitializationDetection "Classic"
+ MergeDetectMultiDrivingBlocksExec "none"
+ CheckExecutionContextPreStartOutputMsg off
+ CheckExecutionContextRuntimeOutputMsg off
+ SignalResolutionControl "UseLocalSettings"
+ BlockPriorityViolationMsg "warning"
+ MinStepSizeMsg "warning"
+ TimeAdjustmentMsg "none"
+ MaxConsecutiveZCsMsg "error"
+ MaskedZcDiagnostic "warning"
+ IgnoredZcDiagnostic "warning"
+ SolverPrmCheckMsg "warning"
+ InheritedTsInSrcMsg "warning"
+ DiscreteInheritContinuousMsg "warning"
+ MultiTaskDSMMsg "error"
+ MultiTaskCondExecSysMsg "error"
+ MultiTaskRateTransMsg "error"
+ SingleTaskRateTransMsg "none"
+ TasksWithSamePriorityMsg "warning"
+ SigSpecEnsureSampleTimeMsg "warning"
+ CheckMatrixSingularityMsg "none"
+ IntegerOverflowMsg "warning"
+ Int32ToFloatConvMsg "warning"
+ ParameterDowncastMsg "error"
+ ParameterOverflowMsg "error"
+ ParameterUnderflowMsg "none"
+ ParameterPrecisionLossMsg "warning"
+ ParameterTunabilityLossMsg "warning"
+ FixptConstUnderflowMsg "none"
+ FixptConstOverflowMsg "none"
+ FixptConstPrecisionLossMsg "none"
+ UnderSpecifiedDataTypeMsg "none"
+ UnnecessaryDatatypeConvMsg "none"
+ VectorMatrixConversionMsg "none"
+ InvalidFcnCallConnMsg "error"
+ FcnCallInpInsideContextMsg "Use local settings"
+ SignalLabelMismatchMsg "none"
+ UnconnectedInputMsg "warning"
+ UnconnectedOutputMsg "warning"
+ UnconnectedLineMsg "warning"
+ SFcnCompatibilityMsg "none"
+ UniqueDataStoreMsg "none"
+ BusObjectLabelMismatch "warning"
+ RootOutportRequireBusObject "warning"
+ AssertControl "UseLocalSettings"
+ EnableOverflowDetection off
+ ModelReferenceIOMsg "none"
+ ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error"
+ ModelReferenceVersionMismatchMessage "none"
+ ModelReferenceIOMismatchMessage "none"
+ ModelReferenceCSMismatchMessage "none"
+ UnknownTsInhSupMsg "warning"
+ ModelReferenceDataLoggingMessage "warning"
+ ModelReferenceSymbolNameMessage "warning"
+ ModelReferenceExtraNoncontSigs "error"
+ StateNameClashWarn "warning"
+ SimStateInterfaceChecksumMismatchMsg "warning"
+ SimStateOlderReleaseMsg "error"
+ InitInArrayFormatMsg "warning"
+ StrictBusMsg "ErrorLevel1"
+ BusNameAdapt "WarnAndRepair"
+ NonBusSignalsTreatedAsBus "none"
+ LoggingUnavailableSignals "error"
+ BlockIODiagnostic "none"
+ SFUnusedDataAndEventsDiag "warning"
+ SFUnexpectedBacktrackingDiag "warning"
+ SFInvalidInputDataAccessInChartInitDiag "warning"
+ SFNoUnconditionalDefaultTransitionDiag "warning"
+ SFTransitionOutsideNaturalParentDiag "warning"
+ }
+ Simulink.HardwareCC {
+ $ObjectID 7
+ Version "1.11.0"
+ ProdBitPerChar 8
+ ProdBitPerShort 16
+ ProdBitPerInt 32
+ ProdBitPerLong 32
+ ProdBitPerFloat 32
+ ProdBitPerDouble 64
+ ProdBitPerPointer 32
+ ProdLargestAtomicInteger "Char"
+ ProdLargestAtomicFloat "None"
+ ProdIntDivRoundTo "Undefined"
+ ProdEndianess "Unspecified"
+ ProdWordSize 32
+ ProdShiftRightIntArith on
+ ProdHWDeviceType "32-bit Generic"
+ TargetBitPerChar 8
+ TargetBitPerShort 16
+ TargetBitPerInt 32
+ TargetBitPerLong 32
+ TargetBitPerFloat 32
+ TargetBitPerDouble 64
+ TargetBitPerPointer 32
+ TargetLargestAtomicInteger "Char"
+ TargetLargestAtomicFloat "None"
+ TargetShiftRightIntArith on
+ TargetIntDivRoundTo "Undefined"
+ TargetEndianess "Unspecified"
+ TargetWordSize 32
+ TargetTypeEmulationWarnSuppressLevel 0
+ TargetPreprocMaxBitsSint 32
+ TargetPreprocMaxBitsUint 32
+ TargetHWDeviceType "Specified"
+ TargetUnknown off
+ ProdEqTarget on
+ }
+ Simulink.ModelReferenceCC {
+ $ObjectID 8
+ Version "1.11.0"
+ UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
+ CheckModelReferenceTargetMessage "error"
+ EnableParallelModelReferenceBuilds off
+ ParallelModelReferenceErrorOnInvalidPool on
+ ParallelModelReferenceMATLABWorkerInit "None"
+ ModelReferenceNumInstancesAllowed "Multi"
+ PropagateVarSize "Infer from blocks in model"
+ ModelReferencePassRootInputsByReference on
+ ModelReferenceMinAlgLoopOccurrences off
+ PropagateSignalLabelsOutOfModel off
+ SupportModelReferenceSimTargetCustomCode off
+ }
+ Simulink.SFSimCC {
+ $ObjectID 9
+ Version "1.11.0"
+ SFSimEnableDebug on
+ SFSimOverflowDetection on
+ SFSimEcho on
+ SimBlas on
+ SimCtrlC on
+ SimExtrinsic on
+ SimIntegrity on
+ SimUseLocalCustomCode off
+ SimParseCustomCode on
+ SimBuildMode "sf_incremental_build"
+ }
+ Simulink.RTWCC {
+ $BackupClass "Simulink.RTWCC"
+ $ObjectID 10
+ Version "1.11.0"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "IncludeHyperlinkInReport"
+ Cell "GenerateTraceInfo"
+ Cell "GenerateTraceReport"
+ Cell "GenerateTraceReportSl"
+ Cell "GenerateTraceReportSf"
+ Cell "GenerateTraceReportEml"
+ Cell "GenerateSLWebview"
+ Cell "GenerateCodeMetricsReport"
+ PropName "DisabledProps"
+ }
+ SystemTargetFile "grt.tlc"
+ GenCodeOnly off
+ MakeCommand "make_rtw"
+ GenerateMakefile on
+ TemplateMakefile "grt_default_tmf"
+ GenerateReport off
+ SaveLog off
+ RTWVerbose on
+ RetainRTWFile off
+ ProfileTLC off
+ TLCDebug off
+ TLCCoverage off
+ TLCAssert off
+ ProcessScriptMode "Default"
+ ConfigurationMode "Optimized"
+ ConfigAtBuild off
+ RTWUseLocalCustomCode off
+ RTWUseSimCustomCode off
+ IncludeHyperlinkInReport off
+ LaunchReport off
+ TargetLang "C"
+ IncludeBusHierarchyInRTWFileBlockHierarchyMap off
+ IncludeERTFirstTime off
+ GenerateTraceInfo off
+ GenerateTraceReport off
+ GenerateTraceReportSl off
+ GenerateTraceReportSf off
+ GenerateTraceReportEml off
+ GenerateCodeInfo off
+ GenerateSLWebview off
+ GenerateCodeMetricsReport off
+ RTWCompilerOptimization "Off"
+ CheckMdlBeforeBuild "Off"
+ CustomRebuildMode "OnUpdate"
+ Array {
+ Type "Handle"
+ Dimension 2
+ Simulink.CodeAppCC {
+ $ObjectID 11
+ Version "1.11.0"
+ Array {
+ Type "Cell"
+ Dimension 21
+ Cell "IgnoreCustomStorageClasses"
+ Cell "IgnoreTestpoints"
+ Cell "InsertBlockDesc"
+ Cell "InsertPolySpaceComments"
+ Cell "SFDataObjDesc"
+ Cell "MATLABFcnDesc"
+ Cell "SimulinkDataObjDesc"
+ Cell "DefineNamingRule"
+ Cell "SignalNamingRule"
+ Cell "ParamNamingRule"
+ Cell "InlinedPrmAccess"
+ Cell "CustomSymbolStr"
+ Cell "CustomSymbolStrGlobalVar"
+ Cell "CustomSymbolStrType"
+ Cell "CustomSymbolStrField"
+ Cell "CustomSymbolStrFcn"
+ Cell "CustomSymbolStrFcnArg"
+ Cell "CustomSymbolStrBlkIO"
+ Cell "CustomSymbolStrTmpVar"
+ Cell "CustomSymbolStrMacro"
+ Cell "ReqsInCode"
+ PropName "DisabledProps"
+ }
+ ForceParamTrailComments off
+ GenerateComments on
+ IgnoreCustomStorageClasses on
+ IgnoreTestpoints off
+ IncHierarchyInIds off
+ MaxIdLength 31
+ PreserveName off
+ PreserveNameWithParent off
+ ShowEliminatedStatement off
+ IncAutoGenComments off
+ SimulinkDataObjDesc off
+ SFDataObjDesc off
+ MATLABFcnDesc off
+ IncDataTypeInIds off
+ MangleLength 1
+ CustomSymbolStrGlobalVar "$R$N$M"
+ CustomSymbolStrType "$N$R$M"
+ CustomSymbolStrField "$N$M"
+ CustomSymbolStrFcn "$R$N$M$F"
+ CustomSymbolStrFcnArg "rt$I$N$M"
+ CustomSymbolStrBlkIO "rtb_$N$M"
+ CustomSymbolStrTmpVar "$N$M"
+ CustomSymbolStrMacro "$R$N$M"
+ DefineNamingRule "None"
+ ParamNamingRule "None"
+ SignalNamingRule "None"
+ InsertBlockDesc off
+ InsertPolySpaceComments off
+ SimulinkBlockComments on
+ MATLABSourceComments off
+ EnableCustomComments off
+ InlinedPrmAccess "Literals"
+ ReqsInCode off
+ UseSimReservedNames off
+ }
+ Simulink.GRTTargetCC {
+ $BackupClass "Simulink.TargetCC"
+ $ObjectID 12
+ Version "1.11.0"
+ Array {
+ Type "Cell"
+ Dimension 16
+ Cell "GeneratePreprocessorConditionals"
+ Cell "IncludeMdlTerminateFcn"
+ Cell "CombineOutputUpdateFcns"
+ Cell "SuppressErrorStatus"
+ Cell "ERTCustomFileBanners"
+ Cell "GenerateSampleERTMain"
+ Cell "GenerateTestInterfaces"
+ Cell "ModelStepFunctionPrototypeControlCompliant"
+ Cell "CPPClassGenCompliant"
+ Cell "MultiInstanceERTCode"
+ Cell "PurelyIntegerCode"
+ Cell "SupportComplex"
+ Cell "SupportAbsoluteTime"
+ Cell "SupportContinuousTime"
+ Cell "SupportNonInlinedSFcns"
+ Cell "PortableWordSizes"
+ PropName "DisabledProps"
+ }
+ TargetFcnLib "ansi_tfl_table_tmw.mat"
+ TargetLibSuffix ""
+ TargetPreCompLibLocation ""
+ TargetFunctionLibrary "ANSI_C"
+ UtilityFuncGeneration "Auto"
+ ERTMultiwordTypeDef "System defined"
+ FunctionExecutionProfile off
+ CodeExecutionProfiling off
+ ERTCodeCoverageTool "None"
+ ERTMultiwordLength 256
+ MultiwordLength 2048
+ GenerateFullHeader on
+ GenerateSampleERTMain off
+ GenerateTestInterfaces off
+ IsPILTarget off
+ ModelReferenceCompliant on
+ ParMdlRefBuildCompliant on
+ CompOptLevelCompliant on
+ IncludeMdlTerminateFcn on
+ GeneratePreprocessorConditionals "Disable all"
+ CombineOutputUpdateFcns off
+ CombineSignalStateStructs off
+ SuppressErrorStatus off
+ ERTFirstTimeCompliant off
+ IncludeFileDelimiter "Auto"
+ ERTCustomFileBanners off
+ SupportAbsoluteTime on
+ LogVarNameModifier "rt_"
+ MatFileLogging on
+ MultiInstanceERTCode off
+ SupportNonFinite on
+ SupportComplex on
+ PurelyIntegerCode off
+ SupportContinuousTime on
+ SupportNonInlinedSFcns on
+ SupportVariableSizeSignals off
+ EnableShiftOperators on
+ ParenthesesLevel "Nominal"
+ PortableWordSizes off
+ ModelStepFunctionPrototypeControlCompliant off
+ CPPClassGenCompliant off
+ AutosarCompliant off
+ UseMalloc off
+ ExtMode off
+ ExtModeStaticAlloc off
+ ExtModeTesting off
+ ExtModeStaticAllocSize 1000000
+ ExtModeTransport 0
+ ExtModeMexFile "ext_comm"
+ ExtModeIntrfLevel "Level1"
+ RTWCAPISignals off
+ RTWCAPIParams off
+ RTWCAPIStates off
+ RTWCAPIRootIO off
+ GenerateASAP2 off
+ }
+ PropName "Components"
+ }
+ }
+ hdlcoderui.hdlcc {
+ $ObjectID 13
+ Version "1.11.0"
+ Description "HDL Coder custom configuration component"
+ Name "HDL Coder"
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell ""
+ PropName "HDLConfigFile"
+ }
+ HDLCActiveTab "0"
+ }
+ PropName "Components"
+ }
+ Name "Configuration"
+ CurrentDlgPage "Solver"
+ ConfigPrmDlgPosition [ 243, 69, 1123, 699 ]
+ }
+ PropName "ConfigurationSets"
+ }
+ Simulink.ConfigSet {
+ $PropName "ActiveConfigurationSet"
+ $ObjectID 2
+ }
+ BlockDefaults {
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ NamePlacement "normal"
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ ShowName on
+ BlockRotation 0
+ BlockMirror off
+ }
+ AnnotationDefaults {
+ HorizontalAlignment "center"
+ VerticalAlignment "middle"
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ UseDisplayTextAsClickCallback off
+ }
+ LineDefaults {
+ FontName "Helvetica"
+ FontSize 9
+ FontWeight "normal"
+ FontAngle "normal"
+ }
+ BlockParameterDefaults {
+ Block {
+ BlockType Demux
+ Outputs "4"
+ DisplayOption "none"
+ BusSelectionMode off
+ }
+ Block {
+ BlockType Derivative
+ LinearizePole "inf"
+ }
+ Block {
+ BlockType Gain
+ Gain "1"
+ Multiplication "Element-wise(K.*u)"
+ ParamMin "[]"
+ ParamMax "[]"
+ ParamDataTypeStr "Inherit: Same as input"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: Same as input"
+ LockScale off
+ RndMeth "Floor"
+ SaturateOnIntegerOverflow on
+ SampleTime "-1"
+ }
+ Block {
+ BlockType Inport
+ Port "1"
+ OutputFunctionCall off
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ LatchByDelayingOutsideSignal off
+ LatchInputForFeedbackSignals off
+ Interpolate on
+ }
+ Block {
+ BlockType Outport
+ Port "1"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ SourceOfInitialOutputValue "Dialog"
+ OutputWhenDisabled "held"
+ InitialOutput "[]"
+ }
+ Block {
+ BlockType S-Function
+ FunctionName "system"
+ SFunctionModules "''"
+ PortCounts "[]"
+ SFunctionDeploymentMode off
+ }
+ Block {
+ BlockType Scope
+ ModelBased off
+ TickLabels "OneTimeTick"
+ ZoomMode "on"
+ Grid "on"
+ TimeRange "auto"
+ YMin "-5"
+ YMax "5"
+ SaveToWorkspace off
+ SaveName "ScopeData"
+ LimitDataPoints on
+ MaxDataPoints "5000"
+ Decimation "1"
+ SampleInput off
+ SampleTime "-1"
+ }
+ Block {
+ BlockType SubSystem
+ ShowPortLabels "FromPortIcon"
+ Permissions "ReadWrite"
+ PermitHierarchicalResolution "All"
+ TreatAsAtomicUnit off
+ CheckFcnCallInpInsideContextMsg off
+ SystemSampleTime "-1"
+ RTWFcnNameOpts "Auto"
+ RTWFileNameOpts "Auto"
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ SimViewingDevice off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ Variant off
+ GeneratePreprocessorConditionals off
+ }
+ Block {
+ BlockType Terminator
+ }
+ }
+ System {
+ Name "Cessna_6DOF"
+ Location [2, 74, 1364, 717]
+ Open on
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ ReportName "simulink-default.rpt"
+ SIDHighWatermark "22"
+ Block {
+ BlockType Reference
+ Name "6DoF (Euler Angles)"
+ SID "1"
+ Ports [2, 8]
+ Position [235, 187, 435, 388]
+ LibraryVersion "1.246"
+ SourceBlock "aerolib6dof2/6DoF (Euler Angles)"
+ SourceType "6DoF EoM (Body Axis)"
+ ShowPortLabels "FromPortIcon"
+ SystemSampleTime "-1"
+ FunctionWithSeparateData off
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ GeneratePreprocessorConditionals off
+ units "Metric (MKS)"
+ mtype "Fixed"
+ rep "Euler Angles"
+ xme_0 "[x y z]"
+ Vm_0 "[u v w]"
+ eul_0 "[phi theta psi]"
+ pm_0 "[p q r]"
+ mass_0 "m"
+ mass_e "0.5"
+ mass_f "2.0"
+ inertia "diag([I_xx I_yy I_zz])"
+ inertia_e "eye(3)"
+ inertia_f "2*eye(3)"
+ k_quat "1.0"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux"
+ SID "7"
+ Ports [1, 3]
+ Position [655, 321, 660, 359]
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux1"
+ SID "12"
+ Ports [1, 3]
+ Position [485, 126, 490, 164]
+ BlockMirror on
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux2"
+ SID "15"
+ Ports [1, 3]
+ Position [485, 71, 490, 109]
+ BlockMirror on
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Derivative
+ Name "Derivative"
+ SID "6"
+ Position [615, 235, 645, 265]
+ }
+ Block {
+ BlockType Gain
+ Name "Gain"
+ SID "17"
+ Position [385, 65, 415, 95]
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain1"
+ SID "18"
+ Position [430, 75, 460, 105]
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain2"
+ SID "19"
+ Position [385, 85, 415, 115]
+ BlockMirror on
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain3"
+ SID "20"
+ Position [615, 125, 645, 155]
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Gain
+ Name "Gain4"
+ SID "21"
+ Position [700, 135, 730, 165]
+ Gain "180/pi"
+ ParamDataTypeStr "Inherit: Inherit via internal rule"
+ OutDataTypeStr "Inherit: Inherit via internal rule"
+ SaturateOnIntegerOverflow off
+ }
+ Block {
+ BlockType Reference
+ Name "Incidence, Sideslip,\n& Airspeed"
+ SID "3"
+ Ports [1, 3]
+ Position [525, 275, 585, 325]
+ LibraryVersion "1.124"
+ SourceBlock "aerolibasang/Incidence, Sideslip,\n& Airspeed"
+ SourceType "Incidence,Sideslip,&Airspeed"
+ ShowPortLabels "FromPortIcon"
+ SystemSampleTime "-1"
+ FunctionWithSeparateData off
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ GeneratePreprocessorConditionals off
+ }
+ Block {
+ BlockType SubSystem
+ Name "MATLAB Function1"
+ SID "5"
+ Ports [8, 2]
+ Position [715, 189, 785, 386]
+ LibraryVersion "1.32"
+ ErrorFcn "Stateflow.Translate.translate"
+ PermitHierarchicalResolution "ExplicitOnly"
+ TreatAsAtomicUnit on
+ MinAlgLoopOccurrences off
+ PropExecContextOutsideSubsystem off
+ RTWSystemCode "Auto"
+ FunctionWithSeparateData off
+ Opaque off
+ RequestExecContextInheritance off
+ MaskHideContents off
+ MaskType "Stateflow"
+ MaskDescription "Embedded MATLAB block"
+ MaskSelfModifiable on
+ MaskDisplay "bgColor = Simulink.Root.ColorString2Rgb(get_param(gcbh, 'BackgroundColor')); image(imread('pr"
+ "ivate/eml_membrane_16.png','png','BackgroundColor',bgColor(1:3)),'center'); disp([10 10 'FM_Cessna']);"
+ MaskIconFrame on
+ MaskIconOpaque off
+ MaskIconRotate "none"
+ MaskPortRotate "default"
+ MaskIconUnits "normalized"
+ System {
+ Name "MATLAB Function1"
+ Location [257, 457, 812, 717]
+ Open off
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ SIDHighWatermark "25"
+ Block {
+ BlockType Inport
+ Name "V"
+ SID "5::1"
+ Position [20, 101, 40, 119]
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha"
+ SID "5::18"
+ Position [20, 136, 40, 154]
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha_dot"
+ SID "5::25"
+ Position [20, 171, 40, 189]
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "beta"
+ SID "5::19"
+ Position [20, 206, 40, 224]
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "p"
+ SID "5::20"
+ Position [20, 246, 40, 264]
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "q"
+ SID "5::21"
+ Position [20, 281, 40, 299]
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "r"
+ SID "5::22"
+ Position [20, 316, 40, 334]
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "theta"
+ SID "5::23"
+ Position [20, 351, 40, 369]
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Demux
+ Name " Demux "
+ SID "5::15"
+ Ports [1, 1]
+ Position [270, 285, 320, 325]
+ Outputs "1"
+ }
+ Block {
+ BlockType S-Function
+ Name " SFunction "
+ SID "5::14"
+ Tag "Stateflow S-Function Cessna_6DOF 1"
+ Ports [8, 3]
+ Position [180, 105, 230, 285]
+ FunctionName "sf_sfun"
+ PortCounts "[8 3]"
+ EnableBusSupport on
+ Port {
+ PortNumber 2
+ Name "F"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ Port {
+ PortNumber 3
+ Name "M"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name " Terminator "
+ SID "5::17"
+ Position [460, 296, 480, 314]
+ }
+ Block {
+ BlockType Outport
+ Name "F"
+ SID "5::5"
+ Position [460, 101, 480, 119]
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "M"
+ SID "5::24"
+ Position [460, 136, 480, 154]
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Line {
+ SrcBlock "V"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 1
+ }
+ Line {
+ SrcBlock "alpha"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 2
+ }
+ Line {
+ SrcBlock "alpha_dot"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 3
+ }
+ Line {
+ SrcBlock "beta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 4
+ }
+ Line {
+ SrcBlock "p"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 5
+ }
+ Line {
+ SrcBlock "q"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 6
+ }
+ Line {
+ SrcBlock "r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 7
+ }
+ Line {
+ SrcBlock "theta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 8
+ }
+ Line {
+ Name "F"
+ Labels [0, 0; 0, 0]
+ SrcBlock " SFunction "
+ SrcPort 2
+ DstBlock "F"
+ DstPort 1
+ }
+ Line {
+ Name "M"
+ Labels [0, 0; 0, 0]
+ SrcBlock " SFunction "
+ SrcPort 3
+ DstBlock "M"
+ DstPort 1
+ }
+ Line {
+ SrcBlock " Demux "
+ SrcPort 1
+ DstBlock " Terminator "
+ DstPort 1
+ }
+ Line {
+ SrcBlock " SFunction "
+ SrcPort 1
+ DstBlock " Demux "
+ DstPort 1
+ }
+ }
+ }
+ Block {
+ BlockType Scope
+ Name "Scope"
+ SID "13"
+ Ports [3]
+ Position [765, 124, 795, 156]
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope1"
+ SID "14"
+ Ports [3]
+ Position [410, 129, 440, 161]
+ BlockMirror on
+ Floating off
+ Location [5, 48, 1367, 737]
+ Open on
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData1"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope2"
+ SID "16"
+ Ports [3]
+ Position [330, 74, 360, 106]
+ BlockMirror on
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData2"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Scope
+ Name "Scope3"
+ SID "22"
+ Ports [3]
+ Position [755, 424, 785, 456]
+ Floating off
+ Location [1, 48, 1367, 737]
+ Open off
+ NumInputPorts "3"
+ List {
+ ListType AxesTitles
+ axes1 "%<SignalLabel>"
+ axes2 "%<SignalLabel>"
+ axes3 "%<SignalLabel>"
+ }
+ YMin "-5~-5~-5"
+ YMax "5~5~5"
+ SaveName "ScopeData3"
+ DataFormat "StructureWithTime"
+ SampleTime "0"
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator"
+ SID "8"
+ Position [475, 375, 495, 395]
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator1"
+ SID "9"
+ Position [550, 375, 570, 395]
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator2"
+ SID "10"
+ Position [460, 190, 480, 210]
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator3"
+ SID "11"
+ Position [460, 265, 480, 285]
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 5
+ DstBlock "Incidence, Sideslip,\n& Airspeed"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 3
+ Points [0, -115]
+ Branch {
+ DstBlock "MATLAB Function1"
+ DstPort 1
+ }
+ Branch {
+ Points [0, -70]
+ DstBlock "Scope"
+ DstPort 1
+ }
+ }
+ Line {
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 1
+ Points [10, 0; 0, -35]
+ Branch {
+ DstBlock "Derivative"
+ DstPort 1
+ }
+ Branch {
+ Points [0, -25]
+ Branch {
+ DstBlock "MATLAB Function1"
+ DstPort 2
+ }
+ Branch {
+ DstBlock "Gain3"
+ DstPort 1
+ }
+ }
+ }
+ Line {
+ SrcBlock "Incidence, Sideslip,\n& Airspeed"
+ SrcPort 2
+ Points [75, 0; 0, -25]
+ Branch {
+ DstBlock "MATLAB Function1"
+ DstPort 4
+ }
+ Branch {
+ Points [0, -125]
+ DstBlock "Gain4"
+ DstPort 1
+ }
+ }
+ Line {
+ SrcBlock "Derivative"
+ SrcPort 1
+ DstBlock "MATLAB Function1"
+ DstPort 3
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [25, 0]
+ Branch {
+ Points [0, -30]
+ DstBlock "MATLAB Function1"
+ DstPort 5
+ }
+ Branch {
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 1
+ }
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [35, 0]
+ Branch {
+ DstBlock "MATLAB Function1"
+ DstPort 6
+ }
+ Branch {
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 2
+ }
+ }
+ Line {
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [15, 0]
+ Branch {
+ DstBlock "MATLAB Function1"
+ DstPort 7
+ }
+ Branch {
+ Points [0, 100]
+ DstBlock "Scope3"
+ DstPort 3
+ }
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 6
+ Points [25, 0; 0, 35; 175, 0]
+ DstBlock "Demux"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "MATLAB Function1"
+ SrcPort 1
+ Points [0, -65; -570, 0]
+ DstBlock "6DoF (Euler Angles)"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "MATLAB Function1"
+ SrcPort 2
+ Points [10, 0; 0, 70; -580, 0]
+ DstBlock "6DoF (Euler Angles)"
+ DstPort 2
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 7
+ Points [20, 0; 0, 20; 75, 0]
+ DstBlock "Terminator1"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 8
+ Points [10, 0; 0, 10]
+ DstBlock "Terminator"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 1
+ DstBlock "Terminator2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 4
+ DstBlock "Terminator3"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 1
+ DstBlock "Scope1"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 2
+ DstBlock "Scope1"
+ DstPort 2
+ }
+ Line {
+ SrcBlock "Demux1"
+ SrcPort 3
+ DstBlock "Scope1"
+ DstPort 3
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 2
+ Points [0, 5; 65, 0]
+ DstBlock "Demux1"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux2"
+ SrcPort 1
+ DstBlock "Gain"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Demux2"
+ SrcPort 2
+ Points [-5, 0]
+ Branch {
+ Points [0, -30; 40, 0; 0, 305; 185, 0]
+ DstBlock "MATLAB Function1"
+ DstPort 8
+ }
+ Branch {
+ DstBlock "Gain1"
+ DstPort 1
+ }
+ }
+ Line {
+ SrcBlock "Demux2"
+ SrcPort 3
+ DstBlock "Gain2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "6DoF (Euler Angles)"
+ SrcPort 3
+ Points [70, 0; 0, -160]
+ DstBlock "Demux2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Gain"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 1
+ }
+ Line {
+ SrcBlock "Gain1"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 2
+ }
+ Line {
+ SrcBlock "Gain2"
+ SrcPort 1
+ DstBlock "Scope2"
+ DstPort 3
+ }
+ Line {
+ SrcBlock "Gain3"
+ SrcPort 1
+ DstBlock "Scope"
+ DstPort 2
+ }
+ Line {
+ SrcBlock "Gain4"
+ SrcPort 1
+ DstBlock "Scope"
+ DstPort 3
+ }
+ }
+}
+# Finite State Machines
+#
+# Stateflow Version 7.5 (R2010a) dated Mar 4 2011, 22:36:02
+#
+#
+
+
+Stateflow {
+ machine {
+ id 1
+ name "Cessna_6DOF"
+ created "20-Dec-2014 14:27:29"
+ isLibrary 0
+ firstTarget 17
+ sfVersion 75014001
+ }
+ chart {
+ id 2
+ name "MATLAB Function1"
+ windowPosition [315.747 315 200.25 189.75]
+ viewLimits [0 156.75 0 153.75]
+ screen [1 1 1366 768 1.333333333333333]
+ treeNode [0 3 0 0]
+ firstTransition 5
+ firstJunction 4
+ viewObj 2
+ machine 1
+ toolbarMode LIBRARY_TOOLBAR
+ ssIdHighWaterMark 13
+ decomposition CLUSTER_CHART
+ type EML_CHART
+ firstData 6
+ chartFileNumber 1
+ disableImplicitCasting 1
+ eml {
+ name "FM_Cessna"
+ }
+ }
+ state {
+ id 3
+ labelString "eML_blk_kernel()"
+ position [18 64.5 118 66]
+ fontSize 12
+ chart 2
+ treeNode [2 0 0 0]
+ superState SUBCHART
+ subviewer 2
+ ssIdNumber 1
+ type FUNC_STATE
+ decomposition CLUSTER_STATE
+ eml {
+ isEML 1
+ script "function [F, M] = FM_Cessna(V, alpha, alpha_dot, beta, p, q, r, theta)\n\nm = 1043.26;\nC_bar = 1"
+ ".493;\nb = 10.911;\nS_ref = 16.1651;\n\ng = 9.8;\nrho = 1.225;\n\nC_L_0 = 0.25;\nC_L_alpha = 4.47;\nC_L_q = 1.7;"
+ "\nC_L_delta_e = 0.3476;\n\nC_D_0 = 0.036;\nC_D_alpha = 0.13;\nC_D_beta = 0.17;\nC_D_delta_e = 0.06;\n\nC_Y_beta "
+ "= -0.31;\nC_Y_p = -0.037;\nC_Y_r = 0.21;\nC_Y_delta_a = 0;\n\nC_l_beta = -0.089;\nC_l_p = -0.47;\nC_l_r = 0.096;"
+ "\nC_l_delta_a = -0.09;\nC_l_delta_r = 0.0147;\n\nC_M_0 = -0.02;\nC_M_alpha = -1.8;\nC_M_alpha_dot = -12.4;\nC_M_"
+ "delta_e = -1.28;\n\nC_N_beta = 0.065;\nC_N_p = -0.03;\nC_N_r = -0.99;\nC_N_delta_a = -0.0053;\nC_N_delta_r = -0."
+ "0657;\n\ndelta_e = 0.03376; %-0.0304;\ndelta_a = 0;\ndelta_r = 0;\nthrust = 4219.6; %1397;\n\nC_L = C_L_0 + C_L_"
+ "alpha*alpha + C_L_q*(q*C_bar/(2*V)) + C_L_delta_e*delta_e;\nC_D = C_D_0 + C_D_alpha*abs(alpha) + C_D_beta*abs(be"
+ "ta) + C_D_delta_e*abs(delta_e);\nC_Y = C_Y_beta*beta + C_Y_p*(p*b/(2*V)) + C_Y_r*(r*b/(2*V)) + C_Y_delta_a*delta"
+ "_a;\n\nC_l = C_l_beta*beta + C_l_p*(p*b/(2*V)) + C_l_r*(r*b/(2*V)) + C_l_delta_a*delta_a + C_l_delta_r*delta_r;\n"
+ "C_M = C_M_0 + C_M_alpha*alpha + C_M_alpha_dot*(alpha_dot*C_bar/(2*V)) + C_M_delta_e*delta_e;\nC_N = C_N_beta*bet"
+ "a + C_N_p*(p*b/(2*V)) + C_N_r*(r*b/(2*V)) + C_N_delta_a*delta_a + C_N_delta_r*delta_r;\n\nC_X = -C_D*cos(alpha) "
+ "+ C_L*sin(alpha);\nC_Z = -C_D*sin(alpha) - C_L*cos(alpha);\n\nF = zeros(3,1);\nM = zeros(3,1);\n\nq_bar = 0.5*rh"
+ "o*V*V;\n\nF(1,1) = q_bar*S_ref*C_X - m*g*sin(theta) + thrust;\nF(2,1) = q_bar*S_ref*C_Y;\nF(3,1) = q_bar*S_ref*C"
+ "_Z + m*g*cos(theta);\n\nM(1,1) = q_bar*b*S_ref*C_l;\nM(2,1) = q_bar*C_bar*S_ref*C_M;\nM(3,1) = q_bar*b*S_ref*C_N"
+ ";"
+ editorLayout "100 M4x1[205 227 1382 754]"
+ }
+ }
+ junction {
+ id 4
+ position [23.5747 49.5747 7]
+ chart 2
+ linkNode [2 0 0]
+ subviewer 2
+ ssIdNumber 3
+ type CONNECTIVE_JUNCTION
+ }
+ transition {
+ id 5
+ labelString "{eML_blk_kernel();}"
+ labelPosition [32.125 19.875 102.544 14.964]
+ fontSize 12
+ src {
+ intersection [0 0 1 0 23.5747 14.625 0 0]
+ }
+ dst {
+ id 4
+ intersection [7 0 -1 -1 23.5747 42.5747 0 0]
+ }
+ midPoint [23.5747 24.9468]
+ chart 2
+ linkNode [2 0 0]
+ dataLimits [23.575 23.575 14.625 34.575]
+ subviewer 2
+ drawStyle SMART
+ executionOrder 1
+ ssIdNumber 2
+ }
+ data {
+ id 6
+ ssIdNumber 4
+ name "V"
+ linkNode [2 0 7]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 7
+ ssIdNumber 5
+ name "F"
+ linkNode [2 6 8]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 8
+ ssIdNumber 6
+ name "alpha"
+ linkNode [2 7 9]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 9
+ ssIdNumber 13
+ name "alpha_dot"
+ linkNode [2 8 10]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 10
+ ssIdNumber 7
+ name "beta"
+ linkNode [2 9 11]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 11
+ ssIdNumber 8
+ name "p"
+ linkNode [2 10 12]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 12
+ ssIdNumber 9
+ name "q"
+ linkNode [2 11 13]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 13
+ ssIdNumber 10
+ name "r"
+ linkNode [2 12 14]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 14
+ ssIdNumber 11
+ name "theta"
+ linkNode [2 13 15]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 15
+ ssIdNumber 12
+ name "M"
+ linkNode [2 14 0]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ instance {
+ id 16
+ name "MATLAB Function1"
+ machine 1
+ chart 2
+ }
+ target {
+ id 17
+ name "sfun"
+ description "Default Simulink S-Function Target."
+ machine 1
+ linkNode [1 0 0]
+ }
+}
diff --git a/Prof_Arya/Cessna_6DOF_Wind_trim.mdl b/Prof_Arya/Cessna_6DOF_Wind_trim.mdl
new file mode 100644
index 0000000..08a6980
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF_Wind_trim.mdl
@@ -0,0 +1,2310 @@
+Model {
+ Name "Cessna_6DOF_Wind_trim"
+ Version 8.6
+ MdlSubVersion 0
+ SavedCharacterEncoding "UTF-8"
+ GraphicalInterface {
+ NumRootInports 4
+ Inport {
+ Name "In1"
+ BusObject ""
+ OutputFunctionCall "off"
+ }
+ Inport {
+ Name "In2"
+ BusObject ""
+ OutputFunctionCall "off"
+ }
+ Inport {
+ Name "In3"
+ BusObject ""
+ OutputFunctionCall "off"
+ }
+ Inport {
+ Name "In4"
+ BusObject ""
+ OutputFunctionCall "off"
+ }
+ NumRootOutports 12
+ Outport {
+ Name "Out1"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out2"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out3"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out4"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out5"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out6"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out7"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out8"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out9"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out10"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out11"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ Outport {
+ Name "Out12"
+ BusObject ""
+ BusOutputAsStruct "off"
+ }
+ ParameterArgumentNames ""
+ ComputedModelVersion "1.6"
+ NumModelReferences 0
+ NumTestPointedSignals 0
+ }
+ ScopeRefreshTime 0.035000
+ OverrideScopeRefreshTime on
+ DisableAllScopes off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ MinMaxOverflowArchiveMode "Overwrite"
+ FPTRunName "Run 1"
+ MaxMDLFileLineLength 120
+ Object {
+ $PropName "BdWindowsInfo"
+ $ObjectID 1
+ $ClassName "Simulink.BDWindowsInfo"
+ Object {
+ $PropName "WindowsInfo"
+ $ObjectID 2
+ $ClassName "Simulink.WindowInfo"
+ IsActive [1]
+ Location [-8.0, 27.0, 1382.0, 754.0]
+ Object {
+ $PropName "ModelBrowserInfo"
+ $ObjectID 3
+ $ClassName "Simulink.ModelBrowserInfo"
+ Visible [0]
+ DockPosition "Left"
+ Width [50]
+ Height [50]
+ Filter [8]
+ }
+ Object {
+ $PropName "ExplorerBarInfo"
+ $ObjectID 4
+ $ClassName "Simulink.ExplorerBarInfo"
+ Visible [1]
+ }
+ Object {
+ $PropName "EditorsInfo"
+ $ObjectID 5
+ $ClassName "Simulink.EditorInfo"
+ IsActive [1]
+ ViewObjType "SimulinkTopLevel"
+ LoadSaveID "0"
+ Extents [1348.0, 581.0]
+ ZoomFactor [0.8]
+ Offset [118.4499999999997, -52.828571428571422]
+ }
+ }
+ }
+ Created "Tue Dec 23 15:02:08 2014"
+ Creator "Pranav"
+ UpdateHistory "UpdateHistoryNever"
+ ModifiedByFormat "%<Auto>"
+ LastModifiedBy "siddharth"
+ ModifiedDateFormat "%<Auto>"
+ LastModifiedDate "Mon Aug 06 17:12:47 2018"
+ RTWModifiedTimeStamp 455475849
+ ModelVersionFormat "1.%<AutoIncrement:6>"
+ ConfigurationManager "none"
+ SampleTimeColors off
+ SampleTimeAnnotations off
+ LibraryLinkDisplay "none"
+ WideLines off
+ ShowLineDimensions off
+ ShowPortDataTypes off
+ ShowDesignRanges off
+ ShowLoopsOnError on
+ IgnoreBidirectionalLines off
+ ShowStorageClass off
+ ShowTestPointIcons on
+ ShowSignalResolutionIcons on
+ ShowViewerIcons on
+ SortedOrder off
+ ExecutionContextIcon off
+ ShowLinearizationAnnotations on
+ ShowVisualizeInsertedRTB on
+ ShowMarkup on
+ BlockNameDataTip off
+ BlockParametersDataTip off
+ BlockDescriptionStringDataTip off
+ ToolBar on
+ StatusBar on
+ BrowserShowLibraryLinks off
+ BrowserLookUnderMasks off
+ SimulationMode "normal"
+ PauseTimes "5"
+ NumberOfSteps 1
+ SnapshotBufferSize 10
+ SnapshotInterval 10
+ NumberOfLastSnapshots 0
+ LinearizationMsg "none"
+ Profile off
+ ParamWorkspaceSource "MATLABWorkspace"
+ AccelSystemTargetFile "accel.tlc"
+ AccelTemplateMakefile "accel_default_tmf"
+ AccelMakeCommand "make_rtw"
+ TryForcingSFcnDF off
+ Object {
+ $PropName "DataLoggingOverride"
+ $ObjectID 6
+ $ClassName "Simulink.SimulationData.ModelLoggingInfo"
+ model_ "Cessna_6DOF_Wind_trim"
+ signals_ []
+ overrideMode_ [0.0]
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell "Cessna_6DOF_Wind_trim"
+ PropName "logAsSpecifiedByModels_"
+ }
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell []
+ PropName "logAsSpecifiedByModelsSSIDs_"
+ }
+ }
+ ExtModeBatchMode off
+ ExtModeEnableFloating on
+ ExtModeTrigType "manual"
+ ExtModeTrigMode "normal"
+ ExtModeTrigPort "1"
+ ExtModeTrigElement "any"
+ ExtModeTrigDuration 1000
+ ExtModeTrigDurationFloating "auto"
+ ExtModeTrigHoldOff 0
+ ExtModeTrigDelay 0
+ ExtModeTrigDirection "rising"
+ ExtModeTrigLevel 0
+ ExtModeArchiveMode "off"
+ ExtModeAutoIncOneShot off
+ ExtModeIncDirWhenArm off
+ ExtModeAddSuffixToVar off
+ ExtModeWriteAllDataToWs off
+ ExtModeArmWhenConnect on
+ ExtModeSkipDownloadWhenConnect off
+ ExtModeLogAll on
+ ExtModeAutoUpdateStatusClock on
+ ShowModelReferenceBlockVersion off
+ ShowModelReferenceBlockIO off
+ Array {
+ Type "Handle"
+ Dimension 1
+ Simulink.ConfigSet {
+ $ObjectID 7
+ Version "1.15.1"
+ Array {
+ Type "Handle"
+ Dimension 10
+ Simulink.SolverCC {
+ $ObjectID 8
+ Version "1.15.1"
+ StartTime "0.0"
+ StopTime "10.0"
+ AbsTol "auto"
+ FixedStep "auto"
+ InitialStep "auto"
+ MaxNumMinSteps "-1"
+ MaxOrder 5
+ ZcThreshold "auto"
+ ConsecutiveZCsStepRelTol "10*128*eps"
+ MaxConsecutiveZCs "1000"
+ ExtrapolationOrder 4
+ NumberNewtonIterations 1
+ MaxStep "auto"
+ MinStep "auto"
+ MaxConsecutiveMinStep "1"
+ RelTol "1e-3"
+ SolverMode "Auto"
+ EnableConcurrentExecution off
+ ConcurrentTasks off
+ Solver "ode45"
+ SolverName "ode45"
+ SolverJacobianMethodControl "auto"
+ ShapePreserveControl "DisableAll"
+ ZeroCrossControl "UseLocalSettings"
+ ZeroCrossAlgorithm "Nonadaptive"
+ AlgebraicLoopSolver "TrustRegion"
+ SolverInfoToggleStatus off
+ IsAutoAppliedInSIP off
+ SolverResetMethod "Fast"
+ PositivePriorityOrder off
+ AutoInsertRateTranBlk off
+ SampleTimeConstraint "Unconstrained"
+ InsertRTBMode "Whenever possible"
+ }
+ Simulink.DataIOCC {
+ $ObjectID 9
+ Version "1.15.1"
+ Decimation "1"
+ ExternalInput "[t, u]"
+ FinalStateName "xFinal"
+ InitialState "xInitial"
+ LimitDataPoints on
+ MaxDataPoints "1000"
+ LoadExternalInput off
+ LoadInitialState off
+ SaveFinalState off
+ SaveCompleteFinalSimState off
+ SaveFormat "Array"
+ SignalLoggingSaveFormat "ModelDataLogs"
+ SaveOutput on
+ SaveState off
+ SignalLogging on
+ DSMLogging on
+ InspectSignalLogs off
+ VisualizeSimOutput on
+ StreamToWorkspace off
+ StreamVariableName "streamout"
+ SaveTime on
+ ReturnWorkspaceOutputs off
+ StateSaveName "xout"
+ TimeSaveName "tout"
+ OutputSaveName "yout"
+ SignalLoggingName "logsout"
+ DSMLoggingName "dsmout"
+ OutputOption "RefineOutputTimes"
+ OutputTimes "[]"
+ ReturnWorkspaceOutputsName "out"
+ Refine "1"
+ LoggingIntervals "[-inf, inf]"
+ }
+ Simulink.OptimizationCC {
+ $ObjectID 10
+ Version "1.15.1"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "BooleansAsBitfields"
+ Cell "PassReuseOutputArgsAs"
+ Cell "PassReuseOutputArgsThreshold"
+ Cell "ZeroExternalMemoryAtStartup"
+ Cell "ZeroInternalMemoryAtStartup"
+ Cell "OptimizeModelRefInitCode"
+ Cell "NoFixptDivByZeroProtection"
+ Cell "UseSpecifiedMinMax"
+ PropName "DisabledProps"
+ }
+ BlockReduction on
+ BooleanDataType on
+ ConditionallyExecuteInputs on
+ DefaultParameterBehavior "Tunable"
+ UseDivisionForNetSlopeComputation "off"
+ UseFloatMulNetSlope off
+ DefaultUnderspecifiedDataType "double"
+ UseSpecifiedMinMax off
+ InlineInvariantSignals off
+ OptimizeBlockIOStorage on
+ BufferReuse on
+ EnhancedBackFolding off
+ CachingGlobalReferences off
+ GlobalBufferReuse on
+ StrengthReduction off
+ ExpressionFolding on
+ BooleansAsBitfields off
+ BitfieldContainerType "uint_T"
+ EnableMemcpy on
+ MemcpyThreshold 64
+ PassReuseOutputArgsAs "Structure reference"
+ PassReuseOutputArgsThreshold 12
+ ExpressionDepthLimit 2147483647
+ LocalBlockOutputs on
+ RollThreshold 5
+ StateBitsets off
+ DataBitsets off
+ ActiveStateOutputEnumStorageType "Native Integer"
+ ZeroExternalMemoryAtStartup on
+ ZeroInternalMemoryAtStartup on
+ InitFltsAndDblsToZero off
+ NoFixptDivByZeroProtection off
+ EfficientFloat2IntCast off
+ EfficientMapNaN2IntZero on
+ OptimizeModelRefInitCode off
+ LifeSpan "inf"
+ MaxStackSize "Inherit from target"
+ BufferReusableBoundary on
+ SimCompilerOptimization "off"
+ AccelVerboseBuild off
+ }
+ Simulink.DebuggingCC {
+ $ObjectID 11
+ Version "1.15.1"
+ RTPrefix "error"
+ ConsistencyChecking "none"
+ ArrayBoundsChecking "none"
+ SignalInfNanChecking "none"
+ SignalRangeChecking "none"
+ ReadBeforeWriteMsg "UseLocalSettings"
+ WriteAfterWriteMsg "UseLocalSettings"
+ WriteAfterReadMsg "UseLocalSettings"
+ AlgebraicLoopMsg "warning"
+ ArtificialAlgebraicLoopMsg "warning"
+ SaveWithDisabledLinksMsg "warning"
+ SaveWithParameterizedLinksMsg "warning"
+ CheckSSInitialOutputMsg on
+ UnderspecifiedInitializationDetection "Classic"
+ MergeDetectMultiDrivingBlocksExec "none"
+ CheckExecutionContextPreStartOutputMsg off
+ CheckExecutionContextRuntimeOutputMsg off
+ SignalResolutionControl "UseLocalSettings"
+ BlockPriorityViolationMsg "warning"
+ MinStepSizeMsg "warning"
+ TimeAdjustmentMsg "none"
+ MaxConsecutiveZCsMsg "error"
+ MaskedZcDiagnostic "warning"
+ IgnoredZcDiagnostic "warning"
+ SolverPrmCheckMsg "warning"
+ InheritedTsInSrcMsg "warning"
+ MultiTaskDSMMsg "error"
+ MultiTaskCondExecSysMsg "error"
+ MultiTaskRateTransMsg "error"
+ SingleTaskRateTransMsg "none"
+ TasksWithSamePriorityMsg "warning"
+ SigSpecEnsureSampleTimeMsg "warning"
+ CheckMatrixSingularityMsg "none"
+ IntegerOverflowMsg "warning"
+ Int32ToFloatConvMsg "warning"
+ ParameterDowncastMsg "error"
+ ParameterOverflowMsg "error"
+ ParameterUnderflowMsg "none"
+ ParameterPrecisionLossMsg "warning"
+ ParameterTunabilityLossMsg "warning"
+ FixptConstUnderflowMsg "none"
+ FixptConstOverflowMsg "none"
+ FixptConstPrecisionLossMsg "none"
+ UnderSpecifiedDataTypeMsg "none"
+ UnnecessaryDatatypeConvMsg "none"
+ VectorMatrixConversionMsg "none"
+ InvalidFcnCallConnMsg "error"
+ FcnCallInpInsideContextMsg "UseLocalSettings"
+ SignalLabelMismatchMsg "none"
+ UnconnectedInputMsg "warning"
+ UnconnectedOutputMsg "warning"
+ UnconnectedLineMsg "warning"
+ SFcnCompatibilityMsg "none"
+ FrameProcessingCompatibilityMsg "error"
+ UniqueDataStoreMsg "none"
+ BusObjectLabelMismatch "warning"
+ RootOutportRequireBusObject "warning"
+ AssertControl "UseLocalSettings"
+ AllowSymbolicDim off
+ ModelReferenceIOMsg "none"
+ ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error"
+ ModelReferenceVersionMismatchMessage "none"
+ ModelReferenceIOMismatchMessage "none"
+ UnknownTsInhSupMsg "warning"
+ ModelReferenceDataLoggingMessage "warning"
+ ModelReferenceSymbolNameMessage "warning"
+ ModelReferenceExtraNoncontSigs "error"
+ StateNameClashWarn "warning"
+ SimStateInterfaceChecksumMismatchMsg "warning"
+ SimStateOlderReleaseMsg "error"
+ InitInArrayFormatMsg "warning"
+ StrictBusMsg "ErrorLevel1"
+ BusNameAdapt "WarnAndRepair"
+ NonBusSignalsTreatedAsBus "none"
+ SymbolicDimMinMaxWarning "warning"
+ BlockIODiagnostic "none"
+ SFUnusedDataAndEventsDiag "warning"
+ SFUnexpectedBacktrackingDiag "warning"
+ SFInvalidInputDataAccessInChartInitDiag "warning"
+ SFNoUnconditionalDefaultTransitionDiag "warning"
+ SFTransitionOutsideNaturalParentDiag "warning"
+ SFUnconditionalTransitionShadowingDiag "warning"
+ SFUndirectedBroadcastEventsDiag "warning"
+ SFTransitionActionBeforeConditionDiag "warning"
+ SFOutputUsedAsStateInMooreChartDiag "error"
+ IntegerSaturationMsg "warning"
+ }
+ Simulink.HardwareCC {
+ $ObjectID 12
+ Version "1.15.1"
+ ProdBitPerChar 8
+ ProdBitPerShort 16
+ ProdBitPerInt 32
+ ProdBitPerLong 32
+ ProdBitPerLongLong 64
+ ProdBitPerFloat 32
+ ProdBitPerDouble 64
+ ProdBitPerPointer 32
+ ProdLargestAtomicInteger "Char"
+ ProdLargestAtomicFloat "None"
+ ProdIntDivRoundTo "Undefined"
+ ProdEndianess "Unspecified"
+ ProdWordSize 32
+ ProdShiftRightIntArith on
+ ProdLongLongMode off
+ ProdHWDeviceType "32-bit Generic"
+ TargetBitPerChar 8
+ TargetBitPerShort 16
+ TargetBitPerInt 32
+ TargetBitPerLong 32
+ TargetBitPerLongLong 64
+ TargetBitPerFloat 32
+ TargetBitPerDouble 64
+ TargetBitPerPointer 32
+ TargetLargestAtomicInteger "Char"
+ TargetLargestAtomicFloat "None"
+ TargetShiftRightIntArith on
+ TargetLongLongMode off
+ TargetIntDivRoundTo "Undefined"
+ TargetEndianess "Unspecified"
+ TargetWordSize 32
+ TargetPreprocMaxBitsSint 32
+ TargetPreprocMaxBitsUint 32
+ TargetHWDeviceType "Specified"
+ TargetUnknown off
+ ProdEqTarget on
+ }
+ Simulink.ModelReferenceCC {
+ $ObjectID 13
+ Version "1.15.1"
+ UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
+ EnableRefExpFcnMdlSchedulingChecks on
+ CheckModelReferenceTargetMessage "error"
+ EnableParallelModelReferenceBuilds off
+ ParallelModelReferenceErrorOnInvalidPool on
+ ParallelModelReferenceMATLABWorkerInit "None"
+ ModelReferenceNumInstancesAllowed "Multi"
+ PropagateVarSize "Infer from blocks in model"
+ ModelReferencePassRootInputsByReference on
+ ModelReferenceMinAlgLoopOccurrences off
+ PropagateSignalLabelsOutOfModel off
+ SupportModelReferenceSimTargetCustomCode off
+ }
+ Simulink.SFSimCC {
+ $ObjectID 14
+ Version "1.15.1"
+ SFSimEcho on
+ SimCtrlC on
+ SimIntegrity on
+ SimUseLocalCustomCode off
+ SimParseCustomCode on
+ SimBuildMode "sf_incremental_build"
+ SimGenImportedTypeDefs off
+ }
+ Simulink.RTWCC {
+ $BackupClass "Simulink.RTWCC"
+ $ObjectID 15
+ Version "1.15.1"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "IncludeHyperlinkInReport"
+ Cell "GenerateTraceInfo"
+ Cell "GenerateTraceReport"
+ Cell "GenerateTraceReportSl"
+ Cell "GenerateTraceReportSf"
+ Cell "GenerateTraceReportEml"
+ Cell "GenerateSLWebview"
+ Cell "GenerateCodeMetricsReport"
+ PropName "DisabledProps"
+ }
+ SystemTargetFile "grt.tlc"
+ TLCOptions ""
+ GenCodeOnly off
+ MakeCommand "make_rtw"
+ GenerateMakefile on
+ PackageGeneratedCodeAndArtifacts off
+ TemplateMakefile "grt_default_tmf"
+ PostCodeGenCommand ""
+ Description ""
+ GenerateReport off
+ SaveLog off
+ RTWVerbose on
+ RetainRTWFile off
+ ProfileTLC off
+ TLCDebug off
+ TLCCoverage off
+ TLCAssert off
+ RTWUseLocalCustomCode off
+ RTWUseSimCustomCode off
+ Toolchain "Automatically locate an installed toolchain"
+ BuildConfiguration "Faster Builds"
+ IncludeHyperlinkInReport off
+ LaunchReport off
+ PortableWordSizes off
+ CreateSILPILBlock "None"
+ CodeExecutionProfiling off
+ CodeExecutionProfileVariable "executionProfile"
+ CodeProfilingSaveOptions "SummaryOnly"
+ CodeProfilingInstrumentation off
+ SILDebugging off
+ TargetLang "C"
+ IncludeBusHierarchyInRTWFileBlockHierarchyMap off
+ GenerateTraceInfo off
+ GenerateTraceReport off
+ GenerateTraceReportSl off
+ GenerateTraceReportSf off
+ GenerateTraceReportEml off
+ GenerateWebview off
+ GenerateCodeMetricsReport off
+ GenerateCodeReplacementReport off
+ GenerateMissedCodeReplacementReport off
+ RTWCompilerOptimization "off"
+ RTWCustomCompilerOptimizations ""
+ CheckMdlBeforeBuild "Off"
+ SharedConstantsCachingThreshold 1024
+ Array {
+ Type "Handle"
+ Dimension 2
+ Simulink.CodeAppCC {
+ $ObjectID 16
+ Version "1.15.1"
+ Array {
+ Type "Cell"
+ Dimension 21
+ Cell "IgnoreCustomStorageClasses"
+ Cell "IgnoreTestpoints"
+ Cell "InsertBlockDesc"
+ Cell "InsertPolySpaceComments"
+ Cell "SFDataObjDesc"
+ Cell "MATLABFcnDesc"
+ Cell "SimulinkDataObjDesc"
+ Cell "DefineNamingRule"
+ Cell "SignalNamingRule"
+ Cell "ParamNamingRule"
+ Cell "InlinedPrmAccess"
+ Cell "CustomSymbolStr"
+ Cell "CustomSymbolStrGlobalVar"
+ Cell "CustomSymbolStrType"
+ Cell "CustomSymbolStrField"
+ Cell "CustomSymbolStrFcn"
+ Cell "CustomSymbolStrFcnArg"
+ Cell "CustomSymbolStrBlkIO"
+ Cell "CustomSymbolStrTmpVar"
+ Cell "CustomSymbolStrMacro"
+ Cell "ReqsInCode"
+ PropName "DisabledProps"
+ }
+ ForceParamTrailComments off
+ GenerateComments on
+ CommentStyle "Auto"
+ IgnoreCustomStorageClasses on
+ IgnoreTestpoints off
+ IncHierarchyInIds off
+ MaxIdLength 31
+ PreserveName off
+ PreserveNameWithParent off
+ ShowEliminatedStatement off
+ OperatorAnnotations off
+ IncAutoGenComments off
+ SimulinkDataObjDesc off
+ SFDataObjDesc off
+ MATLABFcnDesc off
+ IncDataTypeInIds off
+ MangleLength 1
+ CustomSymbolStrGlobalVar "$R$N$M"
+ CustomSymbolStrType "$N$R$M_T"
+ CustomSymbolStrField "$N$M"
+ CustomSymbolStrFcn "$R$N$M$F"
+ CustomSymbolStrFcnArg "rt$I$N$M"
+ CustomSymbolStrBlkIO "rtb_$N$M"
+ CustomSymbolStrTmpVar "$N$M"
+ CustomSymbolStrMacro "$R$N$M"
+ CustomSymbolStrUtil "$N$C"
+ DefineNamingRule "None"
+ ParamNamingRule "None"
+ SignalNamingRule "None"
+ InsertBlockDesc off
+ InsertPolySpaceComments off
+ SimulinkBlockComments on
+ MATLABSourceComments off
+ EnableCustomComments off
+ InternalIdentifier "Shortened"
+ InlinedPrmAccess "Literals"
+ ReqsInCode off
+ UseSimReservedNames off
+ }
+ Simulink.GRTTargetCC {
+ $BackupClass "Simulink.TargetCC"
+ $ObjectID 17
+ Version "1.15.1"
+ Array {
+ Type "Cell"
+ Dimension 15
+ Cell "GeneratePreprocessorConditionals"
+ Cell "IncludeMdlTerminateFcn"
+ Cell "GenerateAllocFcn"
+ Cell "SuppressErrorStatus"
+ Cell "ERTCustomFileBanners"
+ Cell "GenerateSampleERTMain"
+ Cell "GenerateTestInterfaces"
+ Cell "ModelStepFunctionPrototypeControlCompliant"
+ Cell "CPPClassGenCompliant"
+ Cell "PortableWordSizes"
+ Cell "PurelyIntegerCode"
+ Cell "SupportComplex"
+ Cell "SupportAbsoluteTime"
+ Cell "SupportContinuousTime"
+ Cell "SupportNonInlinedSFcns"
+ PropName "DisabledProps"
+ }
+ TargetFcnLib "ansi_tfl_table_tmw.mat"
+ TargetLibSuffix ""
+ TargetPreCompLibLocation ""
+ GenFloatMathFcnCalls "NOT IN USE"
+ TargetLangStandard "C89/C90 (ANSI)"
+ CodeReplacementLibrary "None"
+ UtilityFuncGeneration "Auto"
+ ERTMultiwordTypeDef "System defined"
+ ERTMultiwordLength 256
+ MultiwordLength 2048
+ GenerateFullHeader on
+ InferredTypesCompatibility off
+ GenerateSampleERTMain off
+ GenerateTestInterfaces off
+ ModelReferenceCompliant on
+ ParMdlRefBuildCompliant on
+ CompOptLevelCompliant on
+ ConcurrentExecutionCompliant on
+ IncludeMdlTerminateFcn on
+ GeneratePreprocessorConditionals "Disable all"
+ CombineOutputUpdateFcns off
+ CombineSignalStateStructs off
+ SuppressErrorStatus off
+ ERTFirstTimeCompliant off
+ IncludeFileDelimiter "Auto"
+ ERTCustomFileBanners off
+ SupportAbsoluteTime on
+ LogVarNameModifier "rt_"
+ MatFileLogging on
+ MultiInstanceERTCode off
+ CodeInterfacePackaging "Nonreusable function"
+ SupportNonFinite on
+ SupportComplex on
+ PurelyIntegerCode off
+ SupportContinuousTime on
+ SupportNonInlinedSFcns on
+ SupportVariableSizeSignals off
+ ParenthesesLevel "Nominal"
+ CastingMode "Nominal"
+ MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization"
+ ModelStepFunctionPrototypeControlCompliant off
+ CPPClassGenCompliant on
+ AutosarCompliant off
+ GRTInterface on
+ GenerateAllocFcn off
+ UseToolchainInfoCompliant on
+ GenerateSharedConstants on
+ UseMalloc off
+ ExtMode off
+ ExtModeStaticAlloc off
+ ExtModeTesting off
+ ExtModeStaticAllocSize 1000000
+ ExtModeTransport 0
+ ExtModeMexFile "ext_comm"
+ ExtModeIntrfLevel "Level1"
+ RTWCAPISignals off
+ RTWCAPIParams off
+ RTWCAPIStates off
+ RTWCAPIRootIO off
+ GenerateASAP2 off
+ MultiInstanceErrorCode "Error"
+ }
+ PropName "Components"
+ }
+ }
+ SlCovCC.ConfigComp {
+ $ObjectID 18
+ Version "1.15.1"
+ Description "Simulink Coverage Configuration Component"
+ Name "Simulink Coverage"
+ RecordCoverage off
+ CovPath "/"
+ CovSaveName "covdata"
+ CovMetricSettings "dw"
+ CovNameIncrementing off
+ CovHtmlReporting on
+ CovForceBlockReductionOff on
+ CovEnableCumulative on
+ CovSaveCumulativeToWorkspaceVar on
+ CovSaveSingleToWorkspaceVar on
+ CovCumulativeVarName "covCumulativeData"
+ CovCumulativeReport off
+ CovReportOnPause on
+ CovModelRefEnable "Off"
+ CovExternalEMLEnable off
+ CovSFcnEnable off
+ CovBoundaryAbsTol 1e-05
+ CovBoundaryRelTol 0.01
+ CovUseTimeInterval off
+ CovStartTime 0
+ CovStopTime 0
+ }
+ hdlcoderui.hdlcc {
+ $ObjectID 19
+ Version "1.15.1"
+ Description "HDL Coder custom configuration component"
+ Name "HDL Coder"
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell ""
+ PropName "HDLConfigFile"
+ }
+ HDLCActiveTab "0"
+ }
+ PropName "Components"
+ }
+ Name "Configuration"
+ CurrentDlgPage "Solver"
+ ConfigPrmDlgPosition [ 243, 69, 1123, 699 ]
+ }
+ PropName "ConfigurationSets"
+ }
+ Simulink.ConfigSet {
+ $PropName "ActiveConfigurationSet"
+ $ObjectID 7
+ }
+ Object {
+ $PropName "DataTransfer"
+ $ObjectID 20
+ $ClassName "Simulink.GlobalDataTransfer"
+ DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)"
+ DefaultTransitionBetweenAsyncTasks "Ensure data integrity only"
+ DefaultTransitionBetweenContTasks "Ensure deterministic transfer (minimum delay)"
+ DefaultExtrapolationMethodBetweenContTasks "None"
+ AutoInsertRateTranBlk [0]
+ }
+ ExplicitPartitioning off
+ BlockDefaults {
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ NamePlacement "normal"
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ ShowName on
+ BlockRotation 0
+ BlockMirror off
+ }
+ AnnotationDefaults {
+ HorizontalAlignment "center"
+ VerticalAlignment "middle"
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ UseDisplayTextAsClickCallback off
+ }
+ LineDefaults {
+ FontName "Helvetica"
+ FontSize 9
+ FontWeight "normal"
+ FontAngle "normal"
+ }
+ MaskDefaults {
+ SelfModifiable "off"
+ IconFrame "on"
+ IconOpaque "on"
+ RunInitForIconRedraw "off"
+ IconRotate "none"
+ PortRotate "default"
+ IconUnits "autoscale"
+ }
+ MaskParameterDefaults {
+ Evaluate "on"
+ Tunable "on"
+ NeverSave "off"
+ Internal "off"
+ ReadOnly "off"
+ Enabled "on"
+ Visible "on"
+ ToolTip "on"
+ }
+ BlockParameterDefaults {
+ Block {
+ BlockType Demux
+ Outputs "4"
+ DisplayOption "none"
+ BusSelectionMode off
+ }
+ Block {
+ BlockType Derivative
+ CoefficientInTFapproximation "inf"
+ }
+ Block {
+ BlockType Fcn
+ Expr "sin(u[1])"
+ SampleTime "-1"
+ }
+ Block {
+ BlockType Inport
+ Port "1"
+ OutputFunctionCall off
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ LatchByDelayingOutsideSignal off
+ LatchInputForFeedbackSignals off
+ Interpolate on
+ }
+ Block {
+ BlockType Outport
+ Port "1"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ SourceOfInitialOutputValue "Dialog"
+ OutputWhenDisabled "held"
+ InitialOutput "[]"
+ }
+ Block {
+ BlockType S-Function
+ FunctionName "system"
+ SFunctionModules "''"
+ PortCounts "[]"
+ }
+ Block {
+ BlockType SubSystem
+ ShowPortLabels "FromPortIcon"
+ Permissions "ReadWrite"
+ PermitHierarchicalResolution "All"
+ TreatAsAtomicUnit off
+ MinAlgLoopOccurrences off
+ PropExecContextOutsideSubsystem off
+ CheckFcnCallInpInsideContextMsg off
+ SystemSampleTime "-1"
+ RTWSystemCode "Auto"
+ RTWFcnNameOpts "Auto"
+ RTWFileNameOpts "Auto"
+ FunctionInterfaceSpec "void_void"
+ FunctionWithSeparateData off
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ SimViewingDevice off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ Opaque off
+ MaskHideContents off
+ SFBlockType "NONE"
+ GeneratePreprocessorConditionals off
+ ContentPreviewEnabled off
+ IsWebBlock off
+ }
+ Block {
+ BlockType Terminator
+ }
+ }
+ System {
+ Name "Cessna_6DOF_Wind_trim"
+ Location [-8, 27, 1374, 781]
+ Open on
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "80"
+ ReportName "simulink-default.rpt"
+ SIDHighWatermark "33"
+ Block {
+ BlockType Inport
+ Name "In1"
+ SID "18"
+ Position [910, 483, 940, 497]
+ ZOrder -1
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In2"
+ SID "19"
+ Position [910, 518, 940, 532]
+ ZOrder -2
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In3"
+ SID "20"
+ Position [910, 553, 940, 567]
+ ZOrder -3
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In4"
+ SID "21"
+ Position [910, 583, 940, 597]
+ ZOrder -4
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Reference
+ Name "6DoF Wind (Wind Angles)"
+ SID "1"
+ Ports [2, 10]
+ Position [335, 223, 535, 427]
+ ZOrder -5
+ LibraryVersion "1.46"
+ SourceBlock "aerolibobsolete/6DoF Wind (Wind Angles)"
+ SourceType "6DoF EoM (Wind Axis)"
+ ContentPreviewEnabled off
+ units "Metric (MKS)"
+ mtype "Fixed"
+ rep "Wind Angles"
+ xme_0 "[x y z]"
+ Vm_0 "[V alpha beta]"
+ wind_0 "[0 0 0]"
+ pm_0 "[p q r]"
+ mass_0 "m"
+ mass_e "0.5"
+ mass_f "2.0"
+ inertia "diag([I_xx I_yy I_zz])"
+ inertia_e "eye(3)"
+ inertia_f "2*eye(3)"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux"
+ SID "2"
+ Ports [1, 3]
+ Position [620, 236, 625, 274]
+ ZOrder -6
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux1"
+ SID "3"
+ Ports [1, 3]
+ Position [665, 256, 670, 294]
+ ZOrder -7
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux2"
+ SID "4"
+ Ports [1, 3]
+ Position [920, 356, 925, 394]
+ ZOrder -8
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux3"
+ SID "5"
+ Ports [1, 2]
+ Position [620, 336, 625, 374]
+ ZOrder -9
+ ShowName off
+ Outputs "2"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Derivative
+ Name "Derivative"
+ SID "6"
+ Position [905, 410, 935, 440]
+ ZOrder -10
+ }
+ Block {
+ BlockType Fcn
+ Name "Fcn"
+ SID "7"
+ Position [675, 310, 735, 340]
+ ZOrder -11
+ Expr "sin(u(1)*exp(2.3*(-u(2))))"
+ }
+ Block {
+ BlockType SubSystem
+ Name "MATLAB Function"
+ SID "8"
+ Ports [13, 2]
+ Position [1010, 228, 1165, 442]
+ ZOrder -12
+ LibraryVersion "1.32"
+ ErrorFcn "Stateflow.Translate.translate"
+ PermitHierarchicalResolution "ExplicitOnly"
+ TreatAsAtomicUnit on
+ RequestExecContextInheritance off
+ SFBlockType "MATLAB Function"
+ Variant off
+ System {
+ Name "MATLAB Function"
+ Location [227, 345, 838, 789]
+ Open off
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ SIDHighWatermark "36"
+ Block {
+ BlockType Inport
+ Name "alpha"
+ SID "8::1"
+ Position [20, 101, 40, 119]
+ ZOrder -1
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "beta"
+ SID "8::18"
+ Position [20, 136, 40, 154]
+ ZOrder -2
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "gamma"
+ SID "8::19"
+ Position [20, 171, 40, 189]
+ ZOrder -3
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "mu"
+ SID "8::20"
+ Position [20, 206, 40, 224]
+ ZOrder -4
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "p"
+ SID "8::21"
+ Position [20, 246, 40, 264]
+ ZOrder -5
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "q"
+ SID "8::22"
+ Position [20, 281, 40, 299]
+ ZOrder -6
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "r"
+ SID "8::23"
+ Position [20, 316, 40, 334]
+ ZOrder -7
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "V"
+ SID "8::24"
+ Position [20, 351, 40, 369]
+ ZOrder -8
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha_dot"
+ SID "8::25"
+ Position [20, 386, 40, 404]
+ ZOrder -9
+ Port "9"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_e"
+ SID "8::27"
+ Position [20, 426, 40, 444]
+ ZOrder -10
+ Port "10"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_a"
+ SID "8::28"
+ Position [20, 461, 40, 479]
+ ZOrder -11
+ Port "11"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_r"
+ SID "8::29"
+ Position [20, 496, 40, 514]
+ ZOrder -12
+ Port "12"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "thrust"
+ SID "8::30"
+ Position [20, 531, 40, 549]
+ ZOrder -13
+ Port "13"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Demux
+ Name " Demux "
+ SID "8::35"
+ Ports [1, 1]
+ Position [270, 230, 320, 270]
+ ZOrder 5
+ Outputs "1"
+ }
+ Block {
+ BlockType S-Function
+ Name " SFunction "
+ SID "8::34"
+ Tag "Stateflow S-Function Cessna_6DOF_Wind_trim 2"
+ Ports [13, 3]
+ Position [180, 90, 230, 370]
+ ZOrder 4
+ FunctionName "sf_sfun"
+ PortCounts "[13 3]"
+ SFunctionDeploymentMode off
+ EnableBusSupport off
+ Port {
+ PortNumber 2
+ Name "F"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ Port {
+ PortNumber 3
+ Name "M"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name " Terminator "
+ SID "8::36"
+ Position [460, 241, 480, 259]
+ ZOrder 6
+ }
+ Block {
+ BlockType Outport
+ Name "F"
+ SID "8::5"
+ Position [460, 101, 480, 119]
+ ZOrder -17
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "M"
+ SID "8::26"
+ Position [460, 136, 480, 154]
+ ZOrder -18
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Line {
+ ZOrder 35
+ SrcBlock "alpha"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 1
+ }
+ Line {
+ ZOrder 36
+ SrcBlock "beta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 2
+ }
+ Line {
+ ZOrder 37
+ SrcBlock "gamma"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 3
+ }
+ Line {
+ ZOrder 38
+ SrcBlock "mu"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 4
+ }
+ Line {
+ ZOrder 39
+ SrcBlock "p"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 5
+ }
+ Line {
+ ZOrder 40
+ SrcBlock "q"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 6
+ }
+ Line {
+ ZOrder 41
+ SrcBlock "r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 7
+ }
+ Line {
+ ZOrder 42
+ SrcBlock "V"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 8
+ }
+ Line {
+ ZOrder 43
+ SrcBlock "alpha_dot"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 9
+ }
+ Line {
+ ZOrder 44
+ SrcBlock "delta_e"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 10
+ }
+ Line {
+ ZOrder 45
+ SrcBlock "delta_a"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 11
+ }
+ Line {
+ ZOrder 46
+ SrcBlock "delta_r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 12
+ }
+ Line {
+ ZOrder 47
+ SrcBlock "thrust"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 13
+ }
+ Line {
+ Name "F"
+ ZOrder 48
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 2
+ DstBlock "F"
+ DstPort 1
+ }
+ Line {
+ Name "M"
+ ZOrder 49
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 3
+ DstBlock "M"
+ DstPort 1
+ }
+ Line {
+ ZOrder 50
+ SrcBlock " Demux "
+ SrcPort 1
+ DstBlock " Terminator "
+ DstPort 1
+ }
+ Line {
+ ZOrder 51
+ SrcBlock " SFunction "
+ SrcPort 1
+ DstBlock " Demux "
+ DstPort 1
+ }
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator"
+ SID "13"
+ Position [565, 225, 585, 245]
+ ZOrder -13
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator1"
+ SID "14"
+ Position [565, 285, 585, 305]
+ ZOrder -14
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator2"
+ SID "15"
+ Position [565, 405, 585, 425]
+ ZOrder -15
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator3"
+ SID "16"
+ Position [610, 385, 630, 405]
+ ZOrder -16
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator4"
+ SID "17"
+ Position [565, 345, 585, 365]
+ ZOrder -17
+ }
+ Block {
+ BlockType Outport
+ Name "Out1"
+ SID "22"
+ Position [910, 113, 940, 127]
+ ZOrder -18
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out2"
+ SID "23"
+ Position [910, 143, 940, 157]
+ ZOrder -19
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out3"
+ SID "24"
+ Position [910, 173, 940, 187]
+ ZOrder -20
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out4"
+ SID "25"
+ Position [655, 113, 685, 127]
+ ZOrder -21
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out5"
+ SID "26"
+ Position [655, 143, 685, 157]
+ ZOrder -22
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out6"
+ SID "27"
+ Position [655, 173, 685, 187]
+ ZOrder -23
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out7"
+ SID "28"
+ Position [705, 113, 735, 127]
+ ZOrder -24
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out8"
+ SID "29"
+ Position [720, 143, 750, 157]
+ ZOrder -25
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out9"
+ SID "30"
+ Position [720, 173, 750, 187]
+ ZOrder -26
+ Port "9"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out10"
+ SID "31"
+ Position [775, 483, 805, 497]
+ ZOrder -27
+ Port "10"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out11"
+ SID "32"
+ Position [810, 518, 840, 532]
+ ZOrder -28
+ Port "11"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out12"
+ SID "33"
+ Position [775, 543, 805, 557]
+ ZOrder -29
+ Port "12"
+ IconDisplay "Port number"
+ }
+ Line {
+ ZOrder 1
+ SrcBlock "MATLAB Function"
+ SrcPort 1
+ Points [9, 0; 0, -70; -859, 0]
+ DstBlock "6DoF Wind (Wind Angles)"
+ DstPort 1
+ }
+ Line {
+ ZOrder 2
+ SrcBlock "MATLAB Function"
+ SrcPort 2
+ Points [9, 0; 0, 60; -859, 0]
+ DstBlock "6DoF Wind (Wind Angles)"
+ DstPort 2
+ }
+ Line {
+ ZOrder 3
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 2
+ DstBlock "Demux"
+ DstPort 1
+ }
+ Line {
+ ZOrder 4
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 1
+ DstBlock "Terminator"
+ DstPort 1
+ }
+ Line {
+ ZOrder 5
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 3
+ DstBlock "Demux1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 6
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 4
+ DstBlock "Terminator1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 7
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 10
+ DstBlock "Terminator2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 8
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 9
+ DstBlock "Terminator3"
+ DstPort 1
+ }
+ Line {
+ ZOrder 9
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 8
+ DstBlock "Demux2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 10
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 7
+ DstBlock "Terminator4"
+ DstPort 1
+ }
+ Line {
+ ZOrder 11
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 6
+ Points [65, 0]
+ DstBlock "Demux3"
+ DstPort 1
+ }
+ Line {
+ ZOrder 12
+ SrcBlock "Demux3"
+ SrcPort 1
+ Points [165, 0]
+ Branch {
+ ZOrder 13
+ Points [0, 80]
+ DstBlock "Derivative"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 14
+ Points [0, -120]
+ Branch {
+ ZOrder 15
+ Points [86, 0; 0, 20]
+ DstBlock "MATLAB Function"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 16
+ Points [0, -75]
+ DstBlock "Out2"
+ DstPort 1
+ }
+ }
+ }
+ Line {
+ ZOrder 17
+ SrcBlock "Demux2"
+ SrcPort 1
+ Points [15, 0; 0, -60]
+ Branch {
+ ZOrder 52
+ Points [0, -5; -185, 0]
+ DstBlock "Out10"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 18
+ DstBlock "MATLAB Function"
+ DstPort 5
+ }
+ }
+ Line {
+ ZOrder 20
+ SrcBlock "Demux2"
+ SrcPort 2
+ Points [25, 0; 0, -55]
+ Branch {
+ ZOrder 51
+ Points [0, -5; -190, 0; 0, 210]
+ DstBlock "Out11"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 21
+ DstBlock "MATLAB Function"
+ DstPort 6
+ }
+ }
+ Line {
+ ZOrder 23
+ SrcBlock "Demux2"
+ SrcPort 3
+ Points [30, 0; 0, -50]
+ Branch {
+ ZOrder 50
+ Points [0, -5; -200, 0]
+ DstBlock "Out12"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 24
+ DstBlock "MATLAB Function"
+ DstPort 7
+ }
+ }
+ Line {
+ ZOrder 26
+ SrcBlock "Demux3"
+ SrcPort 2
+ Points [285, 0; 0, -115; -20, 0]
+ Branch {
+ ZOrder 27
+ Points [-112, 0; 0, 10]
+ DstBlock "MATLAB Function"
+ DstPort 2
+ }
+ Branch {
+ ZOrder 28
+ DstBlock "Out3"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 29
+ SrcBlock "Demux1"
+ SrcPort 1
+ Points [15, 0]
+ Branch {
+ ZOrder 30
+ Points [273, 0; 0, 25]
+ DstBlock "MATLAB Function"
+ DstPort 4
+ }
+ Branch {
+ ZOrder 31
+ DstBlock "Out7"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 32
+ SrcBlock "Demux1"
+ SrcPort 2
+ DstBlock "MATLAB Function"
+ DstPort 3
+ }
+ Line {
+ ZOrder 33
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 5
+ Points [0, 10]
+ DstBlock "Fcn"
+ DstPort 1
+ }
+ Line {
+ ZOrder 34
+ SrcBlock "Fcn"
+ SrcPort 1
+ Points [30, 0]
+ Branch {
+ ZOrder 35
+ Points [115, 0; 0, 25]
+ DstBlock "MATLAB Function"
+ DstPort 8
+ }
+ Branch {
+ ZOrder 36
+ Points [0, -205]
+ DstBlock "Out1"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 37
+ SrcBlock "Derivative"
+ SrcPort 1
+ Points [45, 0; 0, -60]
+ DstBlock "MATLAB Function"
+ DstPort 9
+ }
+ Line {
+ ZOrder 38
+ SrcBlock "In1"
+ SrcPort 1
+ Points [28, 0; 0, -110]
+ DstBlock "MATLAB Function"
+ DstPort 10
+ }
+ Line {
+ ZOrder 39
+ SrcBlock "In2"
+ SrcPort 1
+ Points [34, 0; 0, -130]
+ DstBlock "MATLAB Function"
+ DstPort 11
+ }
+ Line {
+ ZOrder 40
+ SrcBlock "In3"
+ SrcPort 1
+ Points [14, 0; 0, -150]
+ DstBlock "MATLAB Function"
+ DstPort 12
+ }
+ Line {
+ ZOrder 41
+ SrcBlock "In4"
+ SrcPort 1
+ Points [50, 0]
+ DstBlock "MATLAB Function"
+ DstPort 13
+ }
+ Line {
+ ZOrder 42
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [10, 0]
+ DstBlock "Out4"
+ DstPort 1
+ }
+ Line {
+ ZOrder 43
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [10, 0]
+ DstBlock "Out5"
+ DstPort 1
+ }
+ Line {
+ ZOrder 44
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [10, 0]
+ DstBlock "Out6"
+ DstPort 1
+ }
+ Line {
+ ZOrder 45
+ SrcBlock "Demux1"
+ SrcPort 3
+ Points [30, 0; 0, -105]
+ Branch {
+ ZOrder 46
+ DstBlock "Out9"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 47
+ DstBlock "Out8"
+ DstPort 1
+ }
+ }
+ }
+}
+#Finite State Machines
+#
+# Stateflow 80000006
+#
+#
+Stateflow {
+ machine {
+ id 1
+ name "Cessna_6DOF_Wind_trim"
+ created "23-Dec-2014 15:02:14"
+ isLibrary 0
+ firstTarget 22
+ sfVersion 80000006
+ }
+ chart {
+ id 2
+ name "MATLAB Function"
+ windowPosition [421 52 213 385]
+ viewLimits [0 156.75 0 153.75]
+ screen [1 1 1366 768 1.333333333333333]
+ treeNode [0 3 0 0]
+ firstTransition 20
+ firstJunction 19
+ viewObj 2
+ machine 1
+ ssIdHighWaterMark 18
+ decomposition CLUSTER_CHART
+ type EML_CHART
+ firstData 4
+ chartFileNumber 2
+ disableImplicitCasting 1
+ eml {
+ name "Force_Cessna"
+ }
+ }
+ state {
+ id 3
+ labelString "eML_blk_kernel()"
+ position [18 64.5 118 66]
+ fontSize 12
+ chart 2
+ treeNode [2 0 0 0]
+ superState SUBCHART
+ subviewer 2
+ ssIdNumber 1
+ type FUNC_STATE
+ decomposition CLUSTER_STATE
+ eml {
+ isEML 1
+ script "function [F, M] = Force_Cessna(alpha, beta, gamma, mu, p, q, r, V, alpha_dot, delta_e, delta_a, d"
+ "elta_r, thrust)\n\ng = 9.8;\nrho = 1.225;\n\nm = 1043.26;\nC_bar = 1.493;\nb = 10.911;\nS_ref = 16.1651;\n\nC_L_"
+ "0 = 0.25;\nC_L_alpha = 4.47;\nC_L_q = 1.7;\nC_L_delta_e = 0.3476;\n\nC_D_0 = 0.036;\nC_D_alpha = 0.13;\nC_D_beta"
+ " = 0.17;\nC_D_delta_e = 0.06;\n\nC_Y_beta = -0.31;\nC_Y_p = -0.037;\nC_Y_r = 0.21;\nC_Y_delta_a = 0;\n\nC_l_beta"
+ " = -0.089;\nC_l_p = -0.47;\nC_l_r = 0.096;\nC_l_delta_a = -0.09;\nC_l_delta_r = 0.0147;\n\nC_M_0 = -0.02;\nC_M_a"
+ "lpha = -1.8;\nC_M_alpha_dot = -12.4;\nC_M_delta_e = -1.28;\n\nC_N_beta = 0.065;\nC_N_p = -0.03;\nC_N_r = -0.99;\n"
+ "C_N_delta_a = -0.0053;\nC_N_delta_r = -0.0657;\n\n% delta_e = -0.0304;\n% delta_a = 0;\n% delta_r = 0;\n% thrust"
+ " = 1397;\n\nC_L = C_L_0 + C_L_alpha*alpha + C_L_q*(q*C_bar/(2*V)) + C_L_delta_e*delta_e;\nC_D = C_D_0 + C_D_alph"
+ "a*abs(alpha) + C_D_beta*abs(beta) + C_D_delta_e*abs(delta_e);\nC_Y = C_Y_beta*beta + C_Y_p*(p*b/(2*V)) + C_Y_r*("
+ "r*b/(2*V)) + C_Y_delta_a*delta_a;\n\nC_l = C_l_beta*beta + C_l_p*(p*b/(2*V)) + C_l_r*(r*b/(2*V)) + C_l_delta_a*d"
+ "elta_a + C_l_delta_r*delta_r;\nC_M = C_M_0 + C_M_alpha*alpha + C_M_alpha_dot*(alpha_dot*C_bar/(2*V)) + C_M_delta"
+ "_e*delta_e;\nC_N = C_N_beta*beta + C_N_p*(p*b/(2*V)) + C_N_r*(r*b/(2*V)) + C_N_delta_a*delta_a + C_N_delta_r*del"
+ "ta_r;\n\nF = zeros(3,1);\nM = zeros(3,1);\n\nq_bar = 0.5*rho*V*V;\n\nF(1,1) = q_bar*S_ref*(-C_D*cos(beta) + C_Y*"
+ "sin(beta)) - m*g*sin(gamma) + thrust*cos(alpha)*cos(beta);\nF(2,1) = q_bar*S_ref*(C_D*sin(beta) + C_Y*sin(beta))"
+ " - m*g*cos(gamma)*sin(mu) - thrust*cos(alpha)*sin(beta);\nF(3,1) = q_bar*S_ref*(-C_L) + m*g*cos(gamma)*cos(mu) -"
+ " thrust*sin(alpha);\n\nM(1,1) = q_bar*S_ref*b*C_l;\nM(2,1) = q_bar*S_ref*C_bar*C_M;\nM(3,1) = q_bar*S_ref*b*C_N;"
+ editorLayout "100 M4x1[205 227 1382 754]"
+ }
+ }
+ data {
+ id 4
+ ssIdNumber 4
+ name "alpha"
+ linkNode [2 0 5]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 5
+ ssIdNumber 5
+ name "F"
+ linkNode [2 4 6]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 6
+ ssIdNumber 6
+ name "beta"
+ linkNode [2 5 7]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 7
+ ssIdNumber 7
+ name "gamma"
+ linkNode [2 6 8]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 8
+ ssIdNumber 8
+ name "mu"
+ linkNode [2 7 9]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 9
+ ssIdNumber 9
+ name "p"
+ linkNode [2 8 10]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 10
+ ssIdNumber 10
+ name "q"
+ linkNode [2 9 11]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 11
+ ssIdNumber 11
+ name "r"
+ linkNode [2 10 12]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 12
+ ssIdNumber 12
+ name "V"
+ linkNode [2 11 13]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 13
+ ssIdNumber 13
+ name "alpha_dot"
+ linkNode [2 12 14]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 14
+ ssIdNumber 14
+ name "M"
+ linkNode [2 13 15]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 15
+ ssIdNumber 15
+ name "delta_e"
+ linkNode [2 14 16]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 16
+ ssIdNumber 16
+ name "delta_a"
+ linkNode [2 15 17]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 17
+ ssIdNumber 17
+ name "delta_r"
+ linkNode [2 16 18]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 18
+ ssIdNumber 18
+ name "thrust"
+ linkNode [2 17 0]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ junction {
+ id 19
+ position [23.5747 49.5747 7]
+ chart 2
+ linkNode [2 0 0]
+ subviewer 2
+ ssIdNumber 3
+ type CONNECTIVE_JUNCTION
+ }
+ transition {
+ id 20
+ labelString "{eML_blk_kernel();}"
+ labelPosition [36.125 25.875 102.544 14.964]
+ fontSize 12
+ src {
+ intersection [0 0 1 0 23.5747 14.625 0 0]
+ }
+ dst {
+ id 19
+ intersection [1 0 -1 0 23.5747 42.5747 0 0]
+ }
+ midPoint [23.5747 24.9468]
+ chart 2
+ linkNode [2 0 0]
+ dataLimits [21.175 25.975 14.625 42.575]
+ subviewer 2
+ drawStyle SMART
+ slide {
+ sticky BOTH_STICK
+ }
+ executionOrder 1
+ ssIdNumber 2
+ }
+ instance {
+ id 21
+ name "MATLAB Function"
+ machine 1
+ chart 2
+ }
+ target {
+ id 22
+ name "sfun"
+ description "Default Simulink S-Function Target."
+ machine 1
+ linkNode [1 0 0]
+ }
+}
diff --git a/Prof_Arya/Cessna_6DOF_Wind_trim.mdl.r2014a b/Prof_Arya/Cessna_6DOF_Wind_trim.mdl.r2014a
new file mode 100644
index 0000000..22c1a49
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF_Wind_trim.mdl.r2014a
@@ -0,0 +1,2317 @@
+Model {
+ Name "Cessna_6DOF_Wind_trim"
+ Version 8.3
+ MdlSubVersion 0
+ SavedCharacterEncoding "windows-1252"
+ GraphicalInterface {
+ NumRootInports 4
+ Inport {
+ BusObject ""
+ Name "In1"
+ }
+ Inport {
+ BusObject ""
+ Name "In2"
+ }
+ Inport {
+ BusObject ""
+ Name "In3"
+ }
+ Inport {
+ BusObject ""
+ Name "In4"
+ }
+ NumRootOutports 12
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out1"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out2"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out3"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out4"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out5"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out6"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out7"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out8"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out9"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out10"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out11"
+ }
+ Outport {
+ BusObject ""
+ BusOutputAsStruct "off"
+ Name "Out12"
+ }
+ ParameterArgumentNames ""
+ ComputedModelVersion "1.5"
+ NumModelReferences 0
+ NumTestPointedSignals 0
+ }
+ SaveDefaultBlockParams on
+ ScopeRefreshTime 0.035000
+ OverrideScopeRefreshTime on
+ DisableAllScopes off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ MinMaxOverflowArchiveMode "Overwrite"
+ FPTRunName "Run 1"
+ MaxMDLFileLineLength 120
+ Object {
+ $PropName "BdWindowsInfo"
+ $ObjectID 1
+ $ClassName "Simulink.BDWindowsInfo"
+ Object {
+ $PropName "WindowsInfo"
+ $ObjectID 2
+ $ClassName "Simulink.WindowInfo"
+ IsActive [1]
+ Location [-8.0, -8.0, 1382.0, 754.0]
+ Object {
+ $PropName "ModelBrowserInfo"
+ $ObjectID 3
+ $ClassName "Simulink.ModelBrowserInfo"
+ Visible [0]
+ DockPosition "Left"
+ Width [50]
+ Height [50]
+ Filter [8]
+ }
+ Object {
+ $PropName "ExplorerBarInfo"
+ $ObjectID 4
+ $ClassName "Simulink.ExplorerBarInfo"
+ Visible [1]
+ }
+ Object {
+ $PropName "EditorsInfo"
+ $ObjectID 5
+ $ClassName "Simulink.EditorInfo"
+ IsActive [1]
+ ViewObjType "SimulinkSubsys"
+ LoadSaveID "1"
+ Extents [1332.0, 580.0]
+ ZoomFactor [1.0]
+ Offset [-0.25, 0.0]
+ }
+ }
+ }
+ Created "Tue Dec 23 15:02:08 2014"
+ Creator "Pranav"
+ UpdateHistory "UpdateHistoryNever"
+ ModifiedByFormat "%<Auto>"
+ LastModifiedBy "Pranav"
+ ModifiedDateFormat "%<Auto>"
+ LastModifiedDate "Wed Apr 13 15:49:51 2016"
+ RTWModifiedTimeStamp 382463365
+ ModelVersionFormat "1.%<AutoIncrement:5>"
+ ConfigurationManager "none"
+ SampleTimeColors off
+ SampleTimeAnnotations off
+ LibraryLinkDisplay "none"
+ WideLines off
+ ShowLineDimensions off
+ ShowPortDataTypes off
+ ShowDesignRanges off
+ ShowLoopsOnError on
+ IgnoreBidirectionalLines off
+ ShowStorageClass off
+ ShowTestPointIcons on
+ ShowSignalResolutionIcons on
+ ShowViewerIcons on
+ SortedOrder off
+ ExecutionContextIcon off
+ ShowLinearizationAnnotations on
+ BlockNameDataTip off
+ BlockParametersDataTip off
+ BlockDescriptionStringDataTip off
+ ToolBar on
+ StatusBar on
+ BrowserShowLibraryLinks off
+ BrowserLookUnderMasks off
+ SimulationMode "normal"
+ PauseTimes "5"
+ NumberOfSteps 1
+ SnapshotBufferSize 10
+ SnapshotInterval 10
+ NumberOfLastSnapshots 0
+ LinearizationMsg "none"
+ Profile off
+ ParamWorkspaceSource "MATLABWorkspace"
+ AccelSystemTargetFile "accel.tlc"
+ AccelTemplateMakefile "accel_default_tmf"
+ AccelMakeCommand "make_rtw"
+ TryForcingSFcnDF off
+ Object {
+ $PropName "DataLoggingOverride"
+ $ObjectID 6
+ $ClassName "Simulink.SimulationData.ModelLoggingInfo"
+ model_ "Cessna_6DOF_Wind_trim"
+ signals_ []
+ overrideMode_ [0.0]
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell "Cessna_6DOF_Wind_trim"
+ PropName "logAsSpecifiedByModels_"
+ }
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell []
+ PropName "logAsSpecifiedByModelsSSIDs_"
+ }
+ }
+ RecordCoverage off
+ CovPath "/"
+ CovSaveName "covdata"
+ CovMetricSettings "dw"
+ CovNameIncrementing off
+ CovHtmlReporting on
+ CovForceBlockReductionOff on
+ CovEnableCumulative on
+ covSaveCumulativeToWorkspaceVar on
+ CovSaveSingleToWorkspaceVar on
+ CovCumulativeVarName "covCumulativeData"
+ CovCumulativeReport off
+ CovReportOnPause on
+ CovModelRefEnable "Off"
+ CovExternalEMLEnable off
+ CovSFcnEnable off
+ CovBoundaryAbsTol 0.000010
+ CovBoundaryRelTol 0.010000
+ ExtModeBatchMode off
+ ExtModeEnableFloating on
+ ExtModeTrigType "manual"
+ ExtModeTrigMode "normal"
+ ExtModeTrigPort "1"
+ ExtModeTrigElement "any"
+ ExtModeTrigDuration 1000
+ ExtModeTrigDurationFloating "auto"
+ ExtModeTrigHoldOff 0
+ ExtModeTrigDelay 0
+ ExtModeTrigDirection "rising"
+ ExtModeTrigLevel 0
+ ExtModeArchiveMode "off"
+ ExtModeAutoIncOneShot off
+ ExtModeIncDirWhenArm off
+ ExtModeAddSuffixToVar off
+ ExtModeWriteAllDataToWs off
+ ExtModeArmWhenConnect on
+ ExtModeSkipDownloadWhenConnect off
+ ExtModeLogAll on
+ ExtModeAutoUpdateStatusClock on
+ BufferReuse on
+ ShowModelReferenceBlockVersion off
+ ShowModelReferenceBlockIO off
+ Array {
+ Type "Handle"
+ Dimension 1
+ Simulink.ConfigSet {
+ $ObjectID 7
+ Version "1.14.2"
+ Array {
+ Type "Handle"
+ Dimension 9
+ Simulink.SolverCC {
+ $ObjectID 8
+ Version "1.14.2"
+ StartTime "0.0"
+ StopTime "10.0"
+ AbsTol "auto"
+ FixedStep "auto"
+ InitialStep "auto"
+ MaxNumMinSteps "-1"
+ MaxOrder 5
+ ZcThreshold "auto"
+ ConsecutiveZCsStepRelTol "10*128*eps"
+ MaxConsecutiveZCs "1000"
+ ExtrapolationOrder 4
+ NumberNewtonIterations 1
+ MaxStep "auto"
+ MinStep "auto"
+ MaxConsecutiveMinStep "1"
+ RelTol "1e-3"
+ SolverMode "Auto"
+ EnableConcurrentExecution off
+ ConcurrentTasks off
+ Solver "ode45"
+ SolverName "ode45"
+ SolverJacobianMethodControl "auto"
+ ShapePreserveControl "DisableAll"
+ ZeroCrossControl "UseLocalSettings"
+ ZeroCrossAlgorithm "Nonadaptive"
+ AlgebraicLoopSolver "TrustRegion"
+ SolverResetMethod "Fast"
+ PositivePriorityOrder off
+ AutoInsertRateTranBlk off
+ SampleTimeConstraint "Unconstrained"
+ InsertRTBMode "Whenever possible"
+ }
+ Simulink.DataIOCC {
+ $ObjectID 9
+ Version "1.14.2"
+ Decimation "1"
+ ExternalInput "[t, u]"
+ FinalStateName "xFinal"
+ InitialState "xInitial"
+ LimitDataPoints on
+ MaxDataPoints "1000"
+ LoadExternalInput off
+ LoadInitialState off
+ SaveFinalState off
+ SaveCompleteFinalSimState off
+ SaveFormat "Array"
+ SignalLoggingSaveFormat "ModelDataLogs"
+ SaveOutput on
+ SaveState off
+ SignalLogging on
+ DSMLogging on
+ InspectSignalLogs off
+ VisualizeSimOutput on
+ SaveTime on
+ ReturnWorkspaceOutputs off
+ StateSaveName "xout"
+ TimeSaveName "tout"
+ OutputSaveName "yout"
+ SignalLoggingName "logsout"
+ DSMLoggingName "dsmout"
+ OutputOption "RefineOutputTimes"
+ OutputTimes "[]"
+ ReturnWorkspaceOutputsName "out"
+ Refine "1"
+ }
+ Simulink.OptimizationCC {
+ $ObjectID 10
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "BooleansAsBitfields"
+ Cell "PassReuseOutputArgsAs"
+ Cell "PassReuseOutputArgsThreshold"
+ Cell "ZeroExternalMemoryAtStartup"
+ Cell "ZeroInternalMemoryAtStartup"
+ Cell "OptimizeModelRefInitCode"
+ Cell "NoFixptDivByZeroProtection"
+ Cell "UseSpecifiedMinMax"
+ PropName "DisabledProps"
+ }
+ BlockReduction on
+ BooleanDataType on
+ ConditionallyExecuteInputs on
+ InlineParams off
+ UseIntDivNetSlope off
+ UseFloatMulNetSlope off
+ DefaultUnderspecifiedDataType "double"
+ UseSpecifiedMinMax off
+ InlineInvariantSignals off
+ OptimizeBlockIOStorage on
+ BufferReuse on
+ EnhancedBackFolding off
+ CachingGlobalReferences off
+ GlobalBufferReuse on
+ StrengthReduction off
+ ExpressionFolding on
+ BooleansAsBitfields off
+ BitfieldContainerType "uint_T"
+ EnableMemcpy on
+ MemcpyThreshold 64
+ PassReuseOutputArgsAs "Structure reference"
+ ExpressionDepthLimit 2147483647
+ FoldNonRolledExpr on
+ LocalBlockOutputs on
+ RollThreshold 5
+ SystemCodeInlineAuto off
+ StateBitsets off
+ DataBitsets off
+ ActiveStateOutputEnumStorageType "Native Integer"
+ UseTempVars off
+ ZeroExternalMemoryAtStartup on
+ ZeroInternalMemoryAtStartup on
+ InitFltsAndDblsToZero off
+ NoFixptDivByZeroProtection off
+ EfficientFloat2IntCast off
+ EfficientMapNaN2IntZero on
+ OptimizeModelRefInitCode off
+ LifeSpan "inf"
+ MaxStackSize "Inherit from target"
+ BufferReusableBoundary on
+ SimCompilerOptimization "Off"
+ AccelVerboseBuild off
+ ParallelExecutionInRapidAccelerator on
+ }
+ Simulink.DebuggingCC {
+ $ObjectID 11
+ Version "1.14.2"
+ RTPrefix "error"
+ ConsistencyChecking "none"
+ ArrayBoundsChecking "none"
+ SignalInfNanChecking "none"
+ SignalRangeChecking "none"
+ ReadBeforeWriteMsg "UseLocalSettings"
+ WriteAfterWriteMsg "UseLocalSettings"
+ WriteAfterReadMsg "UseLocalSettings"
+ AlgebraicLoopMsg "warning"
+ ArtificialAlgebraicLoopMsg "warning"
+ SaveWithDisabledLinksMsg "warning"
+ SaveWithParameterizedLinksMsg "warning"
+ CheckSSInitialOutputMsg on
+ UnderspecifiedInitializationDetection "Classic"
+ MergeDetectMultiDrivingBlocksExec "none"
+ CheckExecutionContextPreStartOutputMsg off
+ CheckExecutionContextRuntimeOutputMsg off
+ SignalResolutionControl "UseLocalSettings"
+ BlockPriorityViolationMsg "warning"
+ MinStepSizeMsg "warning"
+ TimeAdjustmentMsg "none"
+ MaxConsecutiveZCsMsg "error"
+ MaskedZcDiagnostic "warning"
+ IgnoredZcDiagnostic "warning"
+ SolverPrmCheckMsg "warning"
+ InheritedTsInSrcMsg "warning"
+ DiscreteInheritContinuousMsg "warning"
+ MultiTaskDSMMsg "error"
+ MultiTaskCondExecSysMsg "error"
+ MultiTaskRateTransMsg "error"
+ SingleTaskRateTransMsg "none"
+ TasksWithSamePriorityMsg "warning"
+ SigSpecEnsureSampleTimeMsg "warning"
+ CheckMatrixSingularityMsg "none"
+ IntegerOverflowMsg "warning"
+ Int32ToFloatConvMsg "warning"
+ ParameterDowncastMsg "error"
+ ParameterOverflowMsg "error"
+ ParameterUnderflowMsg "none"
+ ParameterPrecisionLossMsg "warning"
+ ParameterTunabilityLossMsg "warning"
+ FixptConstUnderflowMsg "none"
+ FixptConstOverflowMsg "none"
+ FixptConstPrecisionLossMsg "none"
+ UnderSpecifiedDataTypeMsg "none"
+ UnnecessaryDatatypeConvMsg "none"
+ VectorMatrixConversionMsg "none"
+ InvalidFcnCallConnMsg "error"
+ FcnCallInpInsideContextMsg "UseLocalSettings"
+ SignalLabelMismatchMsg "none"
+ UnconnectedInputMsg "warning"
+ UnconnectedOutputMsg "warning"
+ UnconnectedLineMsg "warning"
+ SFcnCompatibilityMsg "none"
+ FrameProcessingCompatibilityMsg "warning"
+ UniqueDataStoreMsg "none"
+ BusObjectLabelMismatch "warning"
+ RootOutportRequireBusObject "warning"
+ AssertControl "UseLocalSettings"
+ EnableOverflowDetection off
+ ModelReferenceIOMsg "none"
+ ModelReferenceMultiInstanceNormalModeStructChecksumCheck "error"
+ ModelReferenceVersionMismatchMessage "none"
+ ModelReferenceIOMismatchMessage "none"
+ ModelReferenceCSMismatchMessage "none"
+ UnknownTsInhSupMsg "warning"
+ ModelReferenceDataLoggingMessage "warning"
+ ModelReferenceSymbolNameMessage "warning"
+ ModelReferenceExtraNoncontSigs "error"
+ StateNameClashWarn "warning"
+ SimStateInterfaceChecksumMismatchMsg "warning"
+ SimStateOlderReleaseMsg "error"
+ InitInArrayFormatMsg "warning"
+ StrictBusMsg "ErrorLevel1"
+ BusNameAdapt "WarnAndRepair"
+ NonBusSignalsTreatedAsBus "none"
+ LoggingUnavailableSignals "error"
+ BlockIODiagnostic "none"
+ SFUnusedDataAndEventsDiag "warning"
+ SFUnexpectedBacktrackingDiag "warning"
+ SFInvalidInputDataAccessInChartInitDiag "warning"
+ SFNoUnconditionalDefaultTransitionDiag "warning"
+ SFTransitionOutsideNaturalParentDiag "warning"
+ SFUnconditionalTransitionShadowingDiag "warning"
+ SFUndirectedBroadcastEventsDiag "warning"
+ SFTransitionActionBeforeConditionDiag "warning"
+ }
+ Simulink.HardwareCC {
+ $ObjectID 12
+ Version "1.14.2"
+ ProdBitPerChar 8
+ ProdBitPerShort 16
+ ProdBitPerInt 32
+ ProdBitPerLong 32
+ ProdBitPerLongLong 64
+ ProdBitPerFloat 32
+ ProdBitPerDouble 64
+ ProdBitPerPointer 32
+ ProdLargestAtomicInteger "Char"
+ ProdLargestAtomicFloat "None"
+ ProdIntDivRoundTo "Undefined"
+ ProdEndianess "Unspecified"
+ ProdWordSize 32
+ ProdShiftRightIntArith on
+ ProdLongLongMode off
+ ProdHWDeviceType "32-bit Generic"
+ TargetBitPerChar 8
+ TargetBitPerShort 16
+ TargetBitPerInt 32
+ TargetBitPerLong 32
+ TargetBitPerLongLong 64
+ TargetBitPerFloat 32
+ TargetBitPerDouble 64
+ TargetBitPerPointer 32
+ TargetLargestAtomicInteger "Char"
+ TargetLargestAtomicFloat "None"
+ TargetShiftRightIntArith on
+ TargetLongLongMode off
+ TargetIntDivRoundTo "Undefined"
+ TargetEndianess "Unspecified"
+ TargetWordSize 32
+ TargetTypeEmulationWarnSuppressLevel 0
+ TargetPreprocMaxBitsSint 32
+ TargetPreprocMaxBitsUint 32
+ TargetHWDeviceType "Specified"
+ TargetUnknown off
+ ProdEqTarget on
+ }
+ Simulink.ModelReferenceCC {
+ $ObjectID 13
+ Version "1.14.2"
+ UpdateModelReferenceTargets "IfOutOfDateOrStructuralChange"
+ CheckModelReferenceTargetMessage "error"
+ EnableParallelModelReferenceBuilds off
+ ParallelModelReferenceErrorOnInvalidPool on
+ ParallelModelReferenceMATLABWorkerInit "None"
+ ModelReferenceNumInstancesAllowed "Multi"
+ PropagateVarSize "Infer from blocks in model"
+ ModelReferencePassRootInputsByReference on
+ ModelReferenceMinAlgLoopOccurrences off
+ PropagateSignalLabelsOutOfModel off
+ SupportModelReferenceSimTargetCustomCode off
+ }
+ Simulink.SFSimCC {
+ $ObjectID 14
+ Version "1.14.2"
+ SFSimEnableDebug on
+ SFSimOverflowDetection on
+ SFSimEcho on
+ SimBlas on
+ SimCtrlC on
+ SimExtrinsic on
+ SimIntegrity on
+ SimUseLocalCustomCode off
+ SimParseCustomCode on
+ SimBuildMode "sf_incremental_build"
+ SimGenImportedTypeDefs off
+ }
+ Simulink.RTWCC {
+ $BackupClass "Simulink.RTWCC"
+ $ObjectID 15
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 8
+ Cell "IncludeHyperlinkInReport"
+ Cell "GenerateTraceInfo"
+ Cell "GenerateTraceReport"
+ Cell "GenerateTraceReportSl"
+ Cell "GenerateTraceReportSf"
+ Cell "GenerateTraceReportEml"
+ Cell "GenerateSLWebview"
+ Cell "GenerateCodeMetricsReport"
+ PropName "DisabledProps"
+ }
+ SystemTargetFile "grt.tlc"
+ TLCOptions ""
+ GenCodeOnly off
+ MakeCommand "make_rtw"
+ GenerateMakefile on
+ PackageGeneratedCodeAndArtifacts off
+ PackageName ""
+ TemplateMakefile "grt_default_tmf"
+ PostCodeGenCommand ""
+ Description ""
+ GenerateReport off
+ SaveLog off
+ RTWVerbose on
+ RetainRTWFile off
+ ProfileTLC off
+ TLCDebug off
+ TLCCoverage off
+ TLCAssert off
+ ProcessScriptMode "Default"
+ ConfigurationMode "Optimized"
+ ProcessScript ""
+ ConfigurationScript ""
+ ConfigAtBuild off
+ RTWUseLocalCustomCode off
+ RTWUseSimCustomCode off
+ CustomSourceCode ""
+ CustomHeaderCode ""
+ CustomInclude ""
+ CustomSource ""
+ CustomLibrary ""
+ CustomInitializer ""
+ CustomTerminator ""
+ Toolchain "Automatically locate an installed toolchain"
+ BuildConfiguration "Faster Builds"
+ IncludeHyperlinkInReport off
+ LaunchReport off
+ PortableWordSizes off
+ CreateSILPILBlock "None"
+ CodeExecutionProfiling off
+ CodeExecutionProfileVariable "executionProfile"
+ CodeProfilingSaveOptions "SummaryOnly"
+ CodeProfilingInstrumentation off
+ SILDebugging off
+ TargetLang "C"
+ IncludeBusHierarchyInRTWFileBlockHierarchyMap off
+ IncludeERTFirstTime off
+ GenerateTraceInfo off
+ GenerateTraceReport off
+ GenerateTraceReportSl off
+ GenerateTraceReportSf off
+ GenerateTraceReportEml off
+ GenerateCodeInfo off
+ GenerateWebview off
+ GenerateCodeMetricsReport off
+ GenerateCodeReplacementReport off
+ RTWCompilerOptimization "Off"
+ RTWCustomCompilerOptimizations ""
+ CheckMdlBeforeBuild "Off"
+ CustomRebuildMode "OnUpdate"
+ DataInitializer ""
+ SharedConstantsCachingThreshold 1024
+ Array {
+ Type "Handle"
+ Dimension 2
+ Simulink.CodeAppCC {
+ $ObjectID 16
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 21
+ Cell "IgnoreCustomStorageClasses"
+ Cell "IgnoreTestpoints"
+ Cell "InsertBlockDesc"
+ Cell "InsertPolySpaceComments"
+ Cell "SFDataObjDesc"
+ Cell "MATLABFcnDesc"
+ Cell "SimulinkDataObjDesc"
+ Cell "DefineNamingRule"
+ Cell "SignalNamingRule"
+ Cell "ParamNamingRule"
+ Cell "InlinedPrmAccess"
+ Cell "CustomSymbolStr"
+ Cell "CustomSymbolStrGlobalVar"
+ Cell "CustomSymbolStrType"
+ Cell "CustomSymbolStrField"
+ Cell "CustomSymbolStrFcn"
+ Cell "CustomSymbolStrFcnArg"
+ Cell "CustomSymbolStrBlkIO"
+ Cell "CustomSymbolStrTmpVar"
+ Cell "CustomSymbolStrMacro"
+ Cell "ReqsInCode"
+ PropName "DisabledProps"
+ }
+ ForceParamTrailComments off
+ GenerateComments on
+ CommentStyle "Auto"
+ IgnoreCustomStorageClasses on
+ IgnoreTestpoints off
+ IncHierarchyInIds off
+ MaxIdLength 31
+ PreserveName off
+ PreserveNameWithParent off
+ ShowEliminatedStatement off
+ OperatorAnnotations off
+ IncAutoGenComments off
+ SimulinkDataObjDesc off
+ SFDataObjDesc off
+ MATLABFcnDesc off
+ IncDataTypeInIds off
+ MangleLength 1
+ CustomSymbolStrGlobalVar "$R$N$M"
+ CustomSymbolStrType "$N$R$M_T"
+ CustomSymbolStrField "$N$M"
+ CustomSymbolStrFcn "$R$N$M$F"
+ CustomSymbolStrFcnArg "rt$I$N$M"
+ CustomSymbolStrBlkIO "rtb_$N$M"
+ CustomSymbolStrTmpVar "$N$M"
+ CustomSymbolStrMacro "$R$N$M"
+ CustomSymbolStrUtil "$N$C"
+ DefineNamingRule "None"
+ ParamNamingRule "None"
+ SignalNamingRule "None"
+ InsertBlockDesc off
+ InsertPolySpaceComments off
+ SimulinkBlockComments on
+ MATLABSourceComments off
+ EnableCustomComments off
+ InternalIdentifier "Shortened"
+ InlinedPrmAccess "Literals"
+ ReqsInCode off
+ UseSimReservedNames off
+ }
+ Simulink.GRTTargetCC {
+ $BackupClass "Simulink.TargetCC"
+ $ObjectID 17
+ Version "1.14.2"
+ Array {
+ Type "Cell"
+ Dimension 16
+ Cell "GeneratePreprocessorConditionals"
+ Cell "IncludeMdlTerminateFcn"
+ Cell "CombineOutputUpdateFcns"
+ Cell "SuppressErrorStatus"
+ Cell "ERTCustomFileBanners"
+ Cell "GenerateSampleERTMain"
+ Cell "GenerateTestInterfaces"
+ Cell "ModelStepFunctionPrototypeControlCompliant"
+ Cell "CPPClassGenCompliant"
+ Cell "PortableWordSizes"
+ Cell "PurelyIntegerCode"
+ Cell "SupportComplex"
+ Cell "SupportAbsoluteTime"
+ Cell "SupportContinuousTime"
+ Cell "SupportNonInlinedSFcns"
+ Cell "GenerateAllocFcn"
+ PropName "DisabledProps"
+ }
+ TargetFcnLib "ansi_tfl_table_tmw.mat"
+ TargetLibSuffix ""
+ TargetPreCompLibLocation ""
+ GenFloatMathFcnCalls "NOT IN USE"
+ TargetLangStandard "C89/C90 (ANSI)"
+ CodeReplacementLibrary "None"
+ UtilityFuncGeneration "Auto"
+ ERTMultiwordTypeDef "System defined"
+ ERTMultiwordLength 256
+ MultiwordLength 2048
+ GenerateFullHeader on
+ GenerateSampleERTMain off
+ GenerateTestInterfaces off
+ ModelReferenceCompliant on
+ ParMdlRefBuildCompliant on
+ CompOptLevelCompliant on
+ ConcurrentExecutionCompliant on
+ IncludeMdlTerminateFcn on
+ GeneratePreprocessorConditionals "Disable all"
+ CombineOutputUpdateFcns off
+ CombineSignalStateStructs off
+ SuppressErrorStatus off
+ ERTFirstTimeCompliant off
+ IncludeFileDelimiter "Auto"
+ ERTCustomFileBanners off
+ SupportAbsoluteTime on
+ LogVarNameModifier "rt_"
+ MatFileLogging on
+ MultiInstanceERTCode off
+ CodeInterfacePackaging "Nonreusable function"
+ SupportNonFinite on
+ SupportComplex on
+ PurelyIntegerCode off
+ SupportContinuousTime on
+ SupportNonInlinedSFcns on
+ SupportVariableSizeSignals off
+ EnableShiftOperators on
+ ParenthesesLevel "Nominal"
+ MATLABClassNameForMDSCustomization "Simulink.SoftwareTarget.GRTCustomization"
+ ModelStepFunctionPrototypeControlCompliant off
+ CPPClassGenCompliant on
+ AutosarCompliant off
+ GRTInterface on
+ GenerateAllocFcn off
+ UseMalloc off
+ ExtMode off
+ ExtModeStaticAlloc off
+ ExtModeTesting off
+ ExtModeStaticAllocSize 1000000
+ ExtModeTransport 0
+ ExtModeMexFile "ext_comm"
+ ExtModeIntrfLevel "Level1"
+ RTWCAPISignals off
+ RTWCAPIParams off
+ RTWCAPIStates off
+ RTWCAPIRootIO off
+ GenerateASAP2 off
+ MultiInstanceErrorCode "Error"
+ }
+ PropName "Components"
+ }
+ }
+ hdlcoderui.hdlcc {
+ $ObjectID 18
+ Version "1.14.2"
+ Description "HDL Coder custom configuration component"
+ Name "HDL Coder"
+ Array {
+ Type "Cell"
+ Dimension 1
+ Cell ""
+ PropName "HDLConfigFile"
+ }
+ HDLCActiveTab "0"
+ }
+ PropName "Components"
+ }
+ Name "Configuration"
+ CurrentDlgPage "Solver"
+ ConfigPrmDlgPosition [ 243, 69, 1123, 699 ]
+ }
+ PropName "ConfigurationSets"
+ }
+ Simulink.ConfigSet {
+ $PropName "ActiveConfigurationSet"
+ $ObjectID 7
+ }
+ Object {
+ $PropName "DataTransfer"
+ $ObjectID 19
+ $ClassName "Simulink.GlobalDataTransfer"
+ DefaultTransitionBetweenSyncTasks "Ensure deterministic transfer (maximum delay)"
+ DefaultTransitionBetweenAsyncTasks "Ensure data integrity only"
+ DefaultTransitionBetweenContTasks "Ensure deterministic transfer (minimum delay)"
+ DefaultExtrapolationMethodBetweenContTasks "None"
+ AutoInsertRateTranBlk [0]
+ }
+ ExplicitPartitioning off
+ BlockDefaults {
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ NamePlacement "normal"
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ ShowName on
+ BlockRotation 0
+ BlockMirror off
+ }
+ AnnotationDefaults {
+ HorizontalAlignment "center"
+ VerticalAlignment "middle"
+ ForegroundColor "black"
+ BackgroundColor "white"
+ DropShadow off
+ FontName "Helvetica"
+ FontSize 10
+ FontWeight "normal"
+ FontAngle "normal"
+ UseDisplayTextAsClickCallback off
+ }
+ LineDefaults {
+ FontName "Helvetica"
+ FontSize 9
+ FontWeight "normal"
+ FontAngle "normal"
+ }
+ MaskDefaults {
+ SelfModifiable "off"
+ IconFrame "on"
+ IconOpaque "on"
+ RunInitForIconRedraw "off"
+ IconRotate "none"
+ PortRotate "default"
+ IconUnits "autoscale"
+ }
+ MaskParameterDefaults {
+ Evaluate "on"
+ Tunable "on"
+ NeverSave "off"
+ Internal "off"
+ ReadOnly "off"
+ Enabled "on"
+ Visible "on"
+ ToolTip "on"
+ }
+ BlockParameterDefaults {
+ Block {
+ BlockType Demux
+ Outputs "4"
+ DisplayOption "none"
+ BusSelectionMode off
+ }
+ Block {
+ BlockType Derivative
+ CoefficientInTFapproximation "inf"
+ }
+ Block {
+ BlockType Fcn
+ Expr "sin(u[1])"
+ SampleTime "-1"
+ }
+ Block {
+ BlockType Inport
+ Port "1"
+ OutputFunctionCall off
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ LatchByDelayingOutsideSignal off
+ LatchInputForFeedbackSignals off
+ Interpolate on
+ }
+ Block {
+ BlockType Outport
+ Port "1"
+ OutMin "[]"
+ OutMax "[]"
+ OutDataTypeStr "Inherit: auto"
+ LockScale off
+ BusOutputAsStruct off
+ PortDimensions "-1"
+ VarSizeSig "Inherit"
+ SampleTime "-1"
+ SignalType "auto"
+ SamplingMode "auto"
+ SourceOfInitialOutputValue "Dialog"
+ OutputWhenDisabled "held"
+ InitialOutput "[]"
+ }
+ Block {
+ BlockType S-Function
+ FunctionName "system"
+ SFunctionModules "''"
+ PortCounts "[]"
+ SFunctionDeploymentMode off
+ }
+ Block {
+ BlockType SubSystem
+ ShowPortLabels "FromPortIcon"
+ Permissions "ReadWrite"
+ PermitHierarchicalResolution "All"
+ TreatAsAtomicUnit off
+ MinAlgLoopOccurrences off
+ PropExecContextOutsideSubsystem off
+ CheckFcnCallInpInsideContextMsg off
+ SystemSampleTime "-1"
+ RTWSystemCode "Auto"
+ RTWFcnNameOpts "Auto"
+ RTWFileNameOpts "Auto"
+ FunctionInterfaceSpec "void_void"
+ FunctionWithSeparateData off
+ RTWMemSecFuncInitTerm "Inherit from model"
+ RTWMemSecFuncExecute "Inherit from model"
+ RTWMemSecDataConstants "Inherit from model"
+ RTWMemSecDataInternal "Inherit from model"
+ RTWMemSecDataParameters "Inherit from model"
+ SimViewingDevice off
+ DataTypeOverride "UseLocalSettings"
+ DataTypeOverrideAppliesTo "AllNumericTypes"
+ MinMaxOverflowLogging "UseLocalSettings"
+ Opaque off
+ MaskHideContents off
+ SFBlockType "NONE"
+ Variant off
+ GeneratePreprocessorConditionals off
+ ContentPreviewEnabled off
+ }
+ Block {
+ BlockType Terminator
+ }
+ }
+ System {
+ Name "Cessna_6DOF_Wind_trim"
+ Location [-8, -8, 1374, 746]
+ Open off
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ ReportName "simulink-default.rpt"
+ SIDHighWatermark "33"
+ Block {
+ BlockType Inport
+ Name "In1"
+ SID "18"
+ Position [910, 483, 940, 497]
+ ZOrder -1
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In2"
+ SID "19"
+ Position [910, 518, 940, 532]
+ ZOrder -2
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In3"
+ SID "20"
+ Position [910, 553, 940, 567]
+ ZOrder -3
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "In4"
+ SID "21"
+ Position [910, 583, 940, 597]
+ ZOrder -4
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Reference
+ Name "6DoF Wind (Wind Angles)"
+ SID "1"
+ Ports [2, 10]
+ Position [335, 223, 535, 427]
+ ZOrder -5
+ LibraryVersion "1.44"
+ SourceBlock "aerolibobsolete/6DoF Wind (Wind Angles)"
+ SourceType "6DoF EoM (Wind Axis)"
+ ContentPreviewEnabled off
+ units "Metric (MKS)"
+ mtype "Fixed"
+ rep "Wind Angles"
+ xme_0 "[x y z]"
+ Vm_0 "[V alpha beta]"
+ wind_0 "[0 0 0]"
+ pm_0 "[p q r]"
+ mass_0 "m"
+ mass_e "0.5"
+ mass_f "2.0"
+ inertia "diag([I_xx I_yy I_zz])"
+ inertia_e "eye(3)"
+ inertia_f "2*eye(3)"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux"
+ SID "2"
+ Ports [1, 3]
+ Position [620, 236, 625, 274]
+ ZOrder -6
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux1"
+ SID "3"
+ Ports [1, 3]
+ Position [665, 256, 670, 294]
+ ZOrder -7
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux2"
+ SID "4"
+ Ports [1, 3]
+ Position [920, 356, 925, 394]
+ ZOrder -8
+ ShowName off
+ Outputs "3"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Demux
+ Name "Demux3"
+ SID "5"
+ Ports [1, 2]
+ Position [620, 336, 625, 374]
+ ZOrder -9
+ ShowName off
+ Outputs "2"
+ DisplayOption "bar"
+ }
+ Block {
+ BlockType Derivative
+ Name "Derivative"
+ SID "6"
+ Position [905, 410, 935, 440]
+ ZOrder -10
+ }
+ Block {
+ BlockType Fcn
+ Name "Fcn"
+ SID "7"
+ Position [675, 310, 735, 340]
+ ZOrder -11
+ Expr "sin(u(1)*exp(2.3*(-u(2))))"
+ }
+ Block {
+ BlockType SubSystem
+ Name "MATLAB Function"
+ SID "8"
+ Ports [13, 2]
+ Position [975, 223, 1045, 437]
+ ZOrder -12
+ LibraryVersion "1.32"
+ ErrorFcn "Stateflow.Translate.translate"
+ PermitHierarchicalResolution "ExplicitOnly"
+ TreatAsAtomicUnit on
+ RequestExecContextInheritance off
+ SFBlockType "MATLAB Function"
+ System {
+ Name "MATLAB Function"
+ Location [227, 345, 838, 789]
+ Open off
+ ModelBrowserVisibility off
+ ModelBrowserWidth 200
+ ScreenColor "white"
+ PaperOrientation "landscape"
+ PaperPositionMode "auto"
+ PaperType "A4"
+ PaperUnits "centimeters"
+ TiledPaperMargins [1.270000, 1.270000, 1.270000, 1.270000]
+ TiledPageScale 1
+ ShowPageBoundaries off
+ ZoomFactor "100"
+ SIDHighWatermark "33"
+ Block {
+ BlockType Inport
+ Name "alpha"
+ SID "8::1"
+ Position [20, 101, 40, 119]
+ ZOrder -1
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "beta"
+ SID "8::18"
+ Position [20, 136, 40, 154]
+ ZOrder -2
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "gamma"
+ SID "8::19"
+ Position [20, 171, 40, 189]
+ ZOrder -3
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "mu"
+ SID "8::20"
+ Position [20, 206, 40, 224]
+ ZOrder -4
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "p"
+ SID "8::21"
+ Position [20, 246, 40, 264]
+ ZOrder -5
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "q"
+ SID "8::22"
+ Position [20, 281, 40, 299]
+ ZOrder -6
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "r"
+ SID "8::23"
+ Position [20, 316, 40, 334]
+ ZOrder -7
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "V"
+ SID "8::24"
+ Position [20, 351, 40, 369]
+ ZOrder -8
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "alpha_dot"
+ SID "8::25"
+ Position [20, 386, 40, 404]
+ ZOrder -9
+ Port "9"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_e"
+ SID "8::27"
+ Position [20, 426, 40, 444]
+ ZOrder -10
+ Port "10"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_a"
+ SID "8::28"
+ Position [20, 461, 40, 479]
+ ZOrder -11
+ Port "11"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "delta_r"
+ SID "8::29"
+ Position [20, 496, 40, 514]
+ ZOrder -12
+ Port "12"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Inport
+ Name "thrust"
+ SID "8::30"
+ Position [20, 531, 40, 549]
+ ZOrder -13
+ Port "13"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Demux
+ Name " Demux "
+ SID "8::32"
+ Ports [1, 1]
+ Position [270, 230, 320, 270]
+ ZOrder 2
+ Outputs "1"
+ }
+ Block {
+ BlockType S-Function
+ Name " SFunction "
+ SID "8::31"
+ Tag "Stateflow S-Function Cessna_6DOF_Wind_trim 2"
+ Ports [13, 3]
+ Position [180, 90, 230, 370]
+ ZOrder 1
+ FunctionName "sf_sfun"
+ PortCounts "[13 3]"
+ EnableBusSupport on
+ Port {
+ PortNumber 2
+ Name "F"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ Port {
+ PortNumber 3
+ Name "M"
+ RTWStorageClass "Auto"
+ DataLoggingNameMode "SignalName"
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name " Terminator "
+ SID "8::33"
+ Position [460, 241, 480, 259]
+ ZOrder 3
+ }
+ Block {
+ BlockType Outport
+ Name "F"
+ SID "8::5"
+ Position [460, 101, 480, 119]
+ ZOrder -17
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "M"
+ SID "8::26"
+ Position [460, 136, 480, 154]
+ ZOrder -18
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Line {
+ ZOrder 18
+ SrcBlock "alpha"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 1
+ }
+ Line {
+ ZOrder 19
+ SrcBlock "beta"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 2
+ }
+ Line {
+ ZOrder 20
+ SrcBlock "gamma"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 3
+ }
+ Line {
+ ZOrder 21
+ SrcBlock "mu"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 4
+ }
+ Line {
+ ZOrder 22
+ SrcBlock "p"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 5
+ }
+ Line {
+ ZOrder 23
+ SrcBlock "q"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 6
+ }
+ Line {
+ ZOrder 24
+ SrcBlock "r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 7
+ }
+ Line {
+ ZOrder 25
+ SrcBlock "V"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 8
+ }
+ Line {
+ ZOrder 26
+ SrcBlock "alpha_dot"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 9
+ }
+ Line {
+ ZOrder 27
+ SrcBlock "delta_e"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 10
+ }
+ Line {
+ ZOrder 28
+ SrcBlock "delta_a"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 11
+ }
+ Line {
+ ZOrder 29
+ SrcBlock "delta_r"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 12
+ }
+ Line {
+ ZOrder 30
+ SrcBlock "thrust"
+ SrcPort 1
+ DstBlock " SFunction "
+ DstPort 13
+ }
+ Line {
+ Name "F"
+ ZOrder 31
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 2
+ DstBlock "F"
+ DstPort 1
+ }
+ Line {
+ Name "M"
+ ZOrder 32
+ Labels [0, 0]
+ SrcBlock " SFunction "
+ SrcPort 3
+ DstBlock "M"
+ DstPort 1
+ }
+ Line {
+ ZOrder 33
+ SrcBlock " Demux "
+ SrcPort 1
+ DstBlock " Terminator "
+ DstPort 1
+ }
+ Line {
+ ZOrder 34
+ SrcBlock " SFunction "
+ SrcPort 1
+ DstBlock " Demux "
+ DstPort 1
+ }
+ }
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator"
+ SID "13"
+ Position [565, 225, 585, 245]
+ ZOrder -13
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator1"
+ SID "14"
+ Position [565, 285, 585, 305]
+ ZOrder -14
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator2"
+ SID "15"
+ Position [565, 405, 585, 425]
+ ZOrder -15
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator3"
+ SID "16"
+ Position [610, 385, 630, 405]
+ ZOrder -16
+ }
+ Block {
+ BlockType Terminator
+ Name "Terminator4"
+ SID "17"
+ Position [565, 345, 585, 365]
+ ZOrder -17
+ }
+ Block {
+ BlockType Outport
+ Name "Out1"
+ SID "22"
+ Position [910, 113, 940, 127]
+ ZOrder -18
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out2"
+ SID "23"
+ Position [910, 143, 940, 157]
+ ZOrder -19
+ Port "2"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out3"
+ SID "24"
+ Position [910, 173, 940, 187]
+ ZOrder -20
+ Port "3"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out4"
+ SID "25"
+ Position [655, 113, 685, 127]
+ ZOrder -21
+ Port "4"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out5"
+ SID "26"
+ Position [655, 143, 685, 157]
+ ZOrder -22
+ Port "5"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out6"
+ SID "27"
+ Position [655, 173, 685, 187]
+ ZOrder -23
+ Port "6"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out7"
+ SID "28"
+ Position [705, 113, 735, 127]
+ ZOrder -24
+ Port "7"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out8"
+ SID "29"
+ Position [705, 143, 735, 157]
+ ZOrder -25
+ Port "8"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out9"
+ SID "30"
+ Position [705, 173, 735, 187]
+ ZOrder -26
+ Port "9"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out10"
+ SID "31"
+ Position [775, 483, 805, 497]
+ ZOrder -27
+ Port "10"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out11"
+ SID "32"
+ Position [775, 513, 805, 527]
+ ZOrder -28
+ Port "11"
+ IconDisplay "Port number"
+ }
+ Block {
+ BlockType Outport
+ Name "Out12"
+ SID "33"
+ Position [775, 543, 805, 557]
+ ZOrder -29
+ Port "12"
+ IconDisplay "Port number"
+ }
+ Line {
+ ZOrder 1
+ SrcBlock "MATLAB Function"
+ SrcPort 1
+ Points [0, -65; -730, 0]
+ DstBlock "6DoF Wind (Wind Angles)"
+ DstPort 1
+ }
+ Line {
+ ZOrder 2
+ SrcBlock "MATLAB Function"
+ SrcPort 2
+ Points [0, 65; -730, 0]
+ DstBlock "6DoF Wind (Wind Angles)"
+ DstPort 2
+ }
+ Line {
+ ZOrder 3
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 2
+ DstBlock "Demux"
+ DstPort 1
+ }
+ Line {
+ ZOrder 4
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 1
+ DstBlock "Terminator"
+ DstPort 1
+ }
+ Line {
+ ZOrder 5
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 3
+ DstBlock "Demux1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 6
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 4
+ DstBlock "Terminator1"
+ DstPort 1
+ }
+ Line {
+ ZOrder 7
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 10
+ DstBlock "Terminator2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 8
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 9
+ DstBlock "Terminator3"
+ DstPort 1
+ }
+ Line {
+ ZOrder 9
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 8
+ DstBlock "Demux2"
+ DstPort 1
+ }
+ Line {
+ ZOrder 10
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 7
+ DstBlock "Terminator4"
+ DstPort 1
+ }
+ Line {
+ ZOrder 11
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 6
+ Points [65, 0]
+ DstBlock "Demux3"
+ DstPort 1
+ }
+ Line {
+ ZOrder 12
+ SrcBlock "Demux3"
+ SrcPort 1
+ Points [165, 0]
+ Branch {
+ ZOrder 13
+ Points [0, 80]
+ DstBlock "Derivative"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 14
+ Points [0, -120]
+ Branch {
+ ZOrder 15
+ Points [165, 0]
+ DstBlock "MATLAB Function"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 16
+ Points [0, -75]
+ DstBlock "Out2"
+ DstPort 1
+ }
+ }
+ }
+ Line {
+ ZOrder 17
+ SrcBlock "Demux2"
+ SrcPort 1
+ Points [15, 0; 0, -65]
+ Branch {
+ ZOrder 18
+ DstBlock "MATLAB Function"
+ DstPort 5
+ }
+ Branch {
+ ZOrder 19
+ Points [-185, 0]
+ DstBlock "Out10"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 20
+ SrcBlock "Demux2"
+ SrcPort 2
+ Points [25, 0; 0, -60]
+ Branch {
+ ZOrder 21
+ DstBlock "MATLAB Function"
+ DstPort 6
+ }
+ Branch {
+ ZOrder 22
+ Points [-195, 0]
+ DstBlock "Out11"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 23
+ SrcBlock "Demux2"
+ SrcPort 3
+ Points [30, 0; 0, -55]
+ Branch {
+ ZOrder 24
+ DstBlock "MATLAB Function"
+ DstPort 7
+ }
+ Branch {
+ ZOrder 25
+ Points [-200, 0]
+ DstBlock "Out12"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 26
+ SrcBlock "Demux3"
+ SrcPort 2
+ Points [285, 0; 0, -115]
+ Branch {
+ ZOrder 27
+ Points [45, 0]
+ DstBlock "MATLAB Function"
+ DstPort 2
+ }
+ Branch {
+ ZOrder 28
+ Points [-20, 0]
+ DstBlock "Out3"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 29
+ SrcBlock "Demux1"
+ SrcPort 1
+ Points [15, 0]
+ Branch {
+ ZOrder 30
+ Points [270, 0]
+ DstBlock "MATLAB Function"
+ DstPort 4
+ }
+ Branch {
+ ZOrder 31
+ DstBlock "Out7"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 32
+ SrcBlock "Demux1"
+ SrcPort 2
+ Points [285, 0]
+ DstBlock "MATLAB Function"
+ DstPort 3
+ }
+ Line {
+ ZOrder 33
+ SrcBlock "6DoF Wind (Wind Angles)"
+ SrcPort 5
+ Points [0, 10]
+ DstBlock "Fcn"
+ DstPort 1
+ }
+ Line {
+ ZOrder 34
+ SrcBlock "Fcn"
+ SrcPort 1
+ Points [30, 0]
+ Branch {
+ ZOrder 35
+ Points [115, 0; 0, 20]
+ DstBlock "MATLAB Function"
+ DstPort 8
+ }
+ Branch {
+ ZOrder 36
+ Points [0, -205]
+ DstBlock "Out1"
+ DstPort 1
+ }
+ }
+ Line {
+ ZOrder 37
+ SrcBlock "Derivative"
+ SrcPort 1
+ Points [20, 0]
+ DstBlock "MATLAB Function"
+ DstPort 9
+ }
+ Line {
+ ZOrder 38
+ SrcBlock "In1"
+ SrcPort 1
+ Points [15, 0]
+ DstBlock "MATLAB Function"
+ DstPort 10
+ }
+ Line {
+ ZOrder 39
+ SrcBlock "In2"
+ SrcPort 1
+ Points [15, 0]
+ DstBlock "MATLAB Function"
+ DstPort 11
+ }
+ Line {
+ ZOrder 40
+ SrcBlock "In3"
+ SrcPort 1
+ Points [15, 0]
+ DstBlock "MATLAB Function"
+ DstPort 12
+ }
+ Line {
+ ZOrder 41
+ SrcBlock "In4"
+ SrcPort 1
+ Points [15, 0]
+ DstBlock "MATLAB Function"
+ DstPort 13
+ }
+ Line {
+ ZOrder 42
+ SrcBlock "Demux"
+ SrcPort 1
+ Points [10, 0]
+ DstBlock "Out4"
+ DstPort 1
+ }
+ Line {
+ ZOrder 43
+ SrcBlock "Demux"
+ SrcPort 2
+ Points [10, 0]
+ DstBlock "Out5"
+ DstPort 1
+ }
+ Line {
+ ZOrder 44
+ SrcBlock "Demux"
+ SrcPort 3
+ Points [10, 0]
+ DstBlock "Out6"
+ DstPort 1
+ }
+ Line {
+ ZOrder 45
+ SrcBlock "Demux1"
+ SrcPort 3
+ Points [15, 0; 0, -105]
+ Branch {
+ ZOrder 46
+ DstBlock "Out9"
+ DstPort 1
+ }
+ Branch {
+ ZOrder 47
+ DstBlock "Out8"
+ DstPort 1
+ }
+ }
+ }
+}
+#Finite State Machines
+#
+# Stateflow Version 8.1 (R2014a) dated Feb 8 2014, 02:29:12
+#
+#
+Stateflow {
+ machine {
+ id 1
+ name "Cessna_6DOF_Wind_trim"
+ created "23-Dec-2014 15:02:14"
+ isLibrary 0
+ firstTarget 22
+ sfVersion 76014001.002
+ }
+ chart {
+ id 2
+ name "MATLAB Function"
+ windowPosition [421 52 213 385]
+ viewLimits [0 156.75 0 153.75]
+ screen [1 1 1366 768 1.333333333333333]
+ treeNode [0 3 0 0]
+ firstTransition 20
+ firstJunction 19
+ viewObj 2
+ visible 1
+ machine 1
+ subviewS {
+ }
+ ssIdHighWaterMark 18
+ decomposition CLUSTER_CHART
+ type EML_CHART
+ firstData 4
+ chartFileNumber 2
+ disableImplicitCasting 1
+ eml {
+ name "Force_Cessna"
+ }
+ }
+ state {
+ id 3
+ labelString "eML_blk_kernel()"
+ position [18 64.5 118 66]
+ fontSize 12
+ chart 2
+ treeNode [2 0 0 0]
+ superState SUBCHART
+ subviewer 2
+ ssIdNumber 1
+ type FUNC_STATE
+ decomposition CLUSTER_STATE
+ eml {
+ isEML 1
+ script "function [F, M] = Force_Cessna(alpha, beta, gamma, mu, p, q, r, V, alpha_dot, delta_e, delta_a, d"
+ "elta_r, thrust)\n\ng = 9.8;\nrho = 1.225;\n\nm = 1043.26;\nC_bar = 1.493;\nb = 10.911;\nS_ref = 16.1651;\n\nC_L_"
+ "0 = 0.25;\nC_L_alpha = 4.47;\nC_L_q = 1.7;\nC_L_delta_e = 0.3476;\n\nC_D_0 = 0.036;\nC_D_alpha = 0.13;\nC_D_beta"
+ " = 0.17;\nC_D_delta_e = 0.06;\n\nC_Y_beta = -0.31;\nC_Y_p = -0.037;\nC_Y_r = 0.21;\nC_Y_delta_a = 0;\n\nC_l_beta"
+ " = -0.089;\nC_l_p = -0.47;\nC_l_r = 0.096;\nC_l_delta_a = -0.09;\nC_l_delta_r = 0.0147;\n\nC_M_0 = -0.02;\nC_M_a"
+ "lpha = -1.8;\nC_M_alpha_dot = -12.4;\nC_M_delta_e = -1.28;\n\nC_N_beta = 0.065;\nC_N_p = -0.03;\nC_N_r = -0.99;\n"
+ "C_N_delta_a = -0.0053;\nC_N_delta_r = -0.0657;\n\n% delta_e = -0.0304;\n% delta_a = 0;\n% delta_r = 0;\n% thrust"
+ " = 1397;\n\nC_L = C_L_0 + C_L_alpha*alpha + C_L_q*(q*C_bar/(2*V)) + C_L_delta_e*delta_e;\nC_D = C_D_0 + C_D_alph"
+ "a*abs(alpha) + C_D_beta*abs(beta) + C_D_delta_e*abs(delta_e);\nC_Y = C_Y_beta*beta + C_Y_p*(p*b/(2*V)) + C_Y_r*("
+ "r*b/(2*V)) + C_Y_delta_a*delta_a;\n\nC_l = C_l_beta*beta + C_l_p*(p*b/(2*V)) + C_l_r*(r*b/(2*V)) + C_l_delta_a*d"
+ "elta_a + C_l_delta_r*delta_r;\nC_M = C_M_0 + C_M_alpha*alpha + C_M_alpha_dot*(alpha_dot*C_bar/(2*V)) + C_M_delta"
+ "_e*delta_e;\nC_N = C_N_beta*beta + C_N_p*(p*b/(2*V)) + C_N_r*(r*b/(2*V)) + C_N_delta_a*delta_a + C_N_delta_r*del"
+ "ta_r;\n\nF = zeros(3,1);\nM = zeros(3,1);\n\nq_bar = 0.5*rho*V*V;\n\nF(1,1) = q_bar*S_ref*(-C_D*cos(beta) + C_Y*"
+ "sin(beta)) - m*g*sin(gamma) + thrust*cos(alpha)*cos(beta);\nF(2,1) = q_bar*S_ref*(C_D*sin(beta) + C_Y*sin(beta))"
+ " - m*g*cos(gamma)*sin(mu) - thrust*cos(alpha)*sin(beta);\nF(3,1) = q_bar*S_ref*(-C_L) + m*g*cos(gamma)*cos(mu) -"
+ " thrust*sin(alpha);\n\nM(1,1) = q_bar*S_ref*b*C_l;\nM(2,1) = q_bar*S_ref*C_bar*C_M;\nM(3,1) = q_bar*S_ref*b*C_N;"
+ editorLayout "100 M4x1[205 227 1382 754]"
+ }
+ }
+ data {
+ id 4
+ ssIdNumber 4
+ name "alpha"
+ linkNode [2 0 5]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 5
+ ssIdNumber 5
+ name "F"
+ linkNode [2 4 6]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 6
+ ssIdNumber 6
+ name "beta"
+ linkNode [2 5 7]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 7
+ ssIdNumber 7
+ name "gamma"
+ linkNode [2 6 8]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 8
+ ssIdNumber 8
+ name "mu"
+ linkNode [2 7 9]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 9
+ ssIdNumber 9
+ name "p"
+ linkNode [2 8 10]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 10
+ ssIdNumber 10
+ name "q"
+ linkNode [2 9 11]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 11
+ ssIdNumber 11
+ name "r"
+ linkNode [2 10 12]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 12
+ ssIdNumber 12
+ name "V"
+ linkNode [2 11 13]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 13
+ ssIdNumber 13
+ name "alpha_dot"
+ linkNode [2 12 14]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 14
+ ssIdNumber 14
+ name "M"
+ linkNode [2 13 15]
+ scope OUTPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_NO
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 15
+ ssIdNumber 15
+ name "delta_e"
+ linkNode [2 14 16]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 16
+ ssIdNumber 16
+ name "delta_a"
+ linkNode [2 15 17]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 17
+ ssIdNumber 17
+ name "delta_r"
+ linkNode [2 16 18]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ data {
+ id 18
+ ssIdNumber 18
+ name "thrust"
+ linkNode [2 17 0]
+ scope INPUT_DATA
+ machine 1
+ props {
+ array {
+ size "-1"
+ }
+ type {
+ method SF_INHERITED_TYPE
+ primitive SF_DOUBLE_TYPE
+ isSigned 1
+ wordLength "16"
+ }
+ complexity SF_COMPLEX_INHERITED
+ frame SF_FRAME_INHERITED
+ }
+ dataType "Inherit: Same as Simulink"
+ }
+ junction {
+ id 19
+ position [23.5747 49.5747 7]
+ chart 2
+ linkNode [2 0 0]
+ subviewer 2
+ ssIdNumber 3
+ type CONNECTIVE_JUNCTION
+ }
+ transition {
+ id 20
+ labelString "{eML_blk_kernel();}"
+ labelPosition [36.125 25.875 102.544 14.964]
+ fontSize 12
+ src {
+ intersection [0 0 1 0 23.5747 14.625 0 0]
+ }
+ dst {
+ id 19
+ intersection [1 0 -1 0 23.5747 42.5747 0 0]
+ }
+ midPoint [23.5747 24.9468]
+ chart 2
+ linkNode [2 0 0]
+ dataLimits [21.175 25.975 14.625 42.575]
+ subviewer 2
+ drawStyle SMART
+ slide {
+ sticky BOTH_STICK
+ }
+ executionOrder 1
+ ssIdNumber 2
+ }
+ instance {
+ id 21
+ name "MATLAB Function"
+ machine 1
+ chart 2
+ }
+ target {
+ id 22
+ name "sfun"
+ description "Default Simulink S-Function Target."
+ machine 1
+ linkNode [1 0 0]
+ }
+}
diff --git a/Prof_Arya/Cessna_6DOF_sfun.mexw64 b/Prof_Arya/Cessna_6DOF_sfun.mexw64
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF_sfun.mexw64
diff --git a/Prof_Arya/Cessna_6DOF_trim_ha.slx b/Prof_Arya/Cessna_6DOF_trim_ha.slx
new file mode 100644
index 0000000..77111ea
--- /dev/null
+++ b/Prof_Arya/Cessna_6DOF_trim_ha.slx
Binary files differ
diff --git a/Prof_Arya/Comp_LinMod.m b/Prof_Arya/Comp_LinMod.m
new file mode 100644
index 0000000..861e759
--- /dev/null
+++ b/Prof_Arya/Comp_LinMod.m
@@ -0,0 +1,32 @@
+[A, B, C, D] = linmod('Cessna_6DOF_trim');
+
+A = [A(1,1) A(1,3) A(1,5) A(1,11);
+ A(3,1) A(3,3) A(3,5) A(3,11);
+ A(5,1) A(5,3) A(5,5) A(5,11);
+ A(11,1) A(11,3) A(11,5) A(11,11)];
+
+B = [B(1,1) B(1,4);
+ B(3,1) B(3,4);
+ B(5,1) B(5,4);
+ B(11,1) B(11,4)];
+
+X(1:4,1) = [u, w, theta, q];
+
+for kk = 1:10/0.001
+
+ X(:,kk+1) = X(:,kk) + (A*(X(:,kk) - X(:,1)) + B*[(U(kk,1) + 0.0303) 0]')*0.001;
+
+end
+
+plot(X(1,:))
+hold on
+plot(V_arr.*cos(alpha_arr),'--')
+legend('Linearized','Nonlinear')
+xlabel('u (m/s)')
+
+figure
+plot(X(2,:))
+hold on
+plot(alpha_arr*180/pi,'--')
+legend('Linearized','Nonlinear')
+xlabel('alpha (degree)') \ No newline at end of file
diff --git a/Prof_Arya/Initial_Cessna.m b/Prof_Arya/Initial_Cessna.m
new file mode 100644
index 0000000..3fd510d
--- /dev/null
+++ b/Prof_Arya/Initial_Cessna.m
@@ -0,0 +1,93 @@
+clear all
+close all
+clc
+
+global C_L_0 C_L_alpha C_L_q C_L_delta_e
+global C_D_0 C_D_alpha C_D_beta C_D_delta_e k
+global C_Y_beta C_Y_p C_Y_r C_Y_delta_a
+global C_l_beta C_l_p C_l_r C_l_delta_a C_l_delta_r
+global C_M_0 C_M_alpha C_M_alpha_dot C_M_delta_e
+global C_N_beta C_N_p C_N_r C_N_delta_a C_N_delta_r
+
+global m C_bar b S_ref
+global I_xx I_yy I_zz I_xy I_yz I_xz
+
+g = 9.8;
+rho = 1.225;
+
+m = 1043.26;
+C_bar = 1.493;
+b = 10.911;
+S_ref = 16.1651;
+
+I_xx = 1285.31;
+I_yy = 1824.93;
+I_zz = 2666.893;
+I_xz = 0;
+I_yz = 0;
+I_xy = 0;
+
+C_L_0 = 0.25;
+C_L_alpha = 4.47;
+C_L_q = 1.7;
+C_L_delta_e = 0.3476;
+
+C_D_0 = 0.036;
+k = 0.3;
+% C_D_alpha = 0.13;
+% C_D_beta = 0.17;
+% C_D_delta_e = 0.06;
+
+C_Y_beta = -0.31;
+C_Y_p = -0.037;
+C_Y_r = 0.21;
+C_Y_delta_a = 0;
+
+C_l_beta = -0.089;
+C_l_p = -0.47;
+C_l_r = 0.096;
+C_l_delta_a = -0.09;
+C_l_delta_r = 0.0147;
+
+C_M_0 = -0.02;
+C_M_alpha = -1.8;
+C_M_alpha_dot = -12.4;
+C_M_delta_e = -1.28;
+
+C_N_beta = 0.065;
+C_N_p = -0.03;
+C_N_r = -0.99;
+C_N_delta_a = -0.0053;
+C_N_delta_r = -0.0657;
+
+V_trim = 60;
+V = 60;
+
+alpha_delta_e_thrust = fsolve(@Trim_Cessna_Body, [0.035 -0.065 1500]);
+
+alpha = alpha_delta_e_thrust(1,1);
+delta_e = alpha_delta_e_thrust(1,2);
+thrust = alpha_delta_e_thrust(1,3);
+
+x = 0;
+y = 0;
+z = 0;
+
+delta_a = 0;
+delta_r = 0;
+beta = 0;
+
+u = V_trim*cos(alpha)*cos(beta);
+v = V_trim*sin(beta);
+w = V_trim*sin(alpha)*cos(beta);
+
+phi = 0;
+theta = alpha;
+psi = 0;
+
+p = 0;
+q = 0;
+r = 0;
+
+statenames = getstatenames('Cessna_6DOF_trim_ha');
+display(statenames) \ No newline at end of file
diff --git a/Prof_Arya/Linearisation_LinMod.m b/Prof_Arya/Linearisation_LinMod.m
new file mode 100644
index 0000000..05123d9
--- /dev/null
+++ b/Prof_Arya/Linearisation_LinMod.m
@@ -0,0 +1,16 @@
+[A, B, C, D] = linmod('Cessna_6DOF_Wind_trim'); % V gamma q alpha
+
+A_lon = [A(1,1) A(1,8) A(1,11) A(1,2);
+ A(8,1) A(8,8) A(8,11) A(8,2);
+ A(11,1) A(11,8) A(11,11) A(11,2);
+ A(2,1) A(2,8) A(2,11) A(2,2)];
+
+A_phug = [A(1,1) A(1,8);
+ A(8,1) A(8,8)];
+
+A_short = [A(11,11) A(11,2);
+ A(2,11) A(2,2)];
+
+%display(eig(A_lon))
+%display(eig(A_phug))
+%display(eig(A_short)) \ No newline at end of file
diff --git a/Prof_Arya/Trim_Cessna_Body.m b/Prof_Arya/Trim_Cessna_Body.m
new file mode 100644
index 0000000..79be1d0
--- /dev/null
+++ b/Prof_Arya/Trim_Cessna_Body.m
@@ -0,0 +1,28 @@
+function F = Trim_Cessna_Body(x)
+
+m = 1043.26;
+S_ref = 16.1651;
+d = 1.225;
+V = 60;
+g = 9.8;
+
+C_L_0 = 0.25;
+C_L_alpha = 4.47;
+C_L_delta_e = 0.3476;
+
+C_D_0 = 0.036;
+C_D_alpha = 0.13;
+C_D_delta_e = 0.06;
+
+C_M_0 = -0.02;
+C_M_alpha = -1.8;
+C_M_delta_e = -1.28;
+
+C_L = C_L_0 + C_L_alpha*x(1) + C_L_delta_e*x(2);
+% C_D = C_D_0 + C_D_alpha*abs(x(1)) + C_D_delta_e*abs(x(2));
+C_D = C_D_0 + 0.3*C_L^2;
+C_M = C_M_0 + C_M_alpha*x(1) + C_M_delta_e*x(2);
+
+F = [C_M;
+ 0.5*d*V*V*S_ref*(-C_D*cos(x(1)) + C_L*sin(x(1))) - m*g*sin(x(1)) + x(3);
+ 0.5*d*V*V*S_ref*(-C_D*sin(x(1)) - C_L*cos(x(1))) + m*g*cos(x(1))]; \ No newline at end of file
diff --git a/Prof_Arya/Trim_Function_Cessna.m b/Prof_Arya/Trim_Function_Cessna.m
new file mode 100644
index 0000000..dea77e3
--- /dev/null
+++ b/Prof_Arya/Trim_Function_Cessna.m
@@ -0,0 +1,26 @@
+ % u v w phi theta psi x y z p q r
+ % 1 2 3 4 5 6 7 8 9 10 11 12
+X_Guess = [60 0 0 0 0 0 0 0 0 0 0 0]';
+
+ % e a r thrust
+ % 1 2 3 4
+U_guess = [0 0 0 1000]';
+
+ % V alpha beta phi theta psi x y z p q r gamma
+ % 1 2 3 4 5 6 7 8 9 10 11 12 13
+Y_guess = [60 0 0 0 0 0 0 0 0 0 0 0 0]';
+
+Dx_guess = [0 0 0 0 0 0 0 0 0 0 0 0]';
+
+Ix = [2 4 6 10 11 12]';
+Iu = [2 3]';
+Iy = [1 3 4 6 10 11 12 13]';
+
+Idx = [1 2 3 4 5 6 8 9 10 11 12]';
+
+[x1,u1,y1,dx1] = trim('Cessna_6DOF_trim',X_Guess,U_guess,Y_guess,Ix,Iu,Iy,Dx_guess,Idx);
+
+display(x1)
+display(y1)
+display(u1)
+display(dx1) \ No newline at end of file
diff --git a/Prof_Arya/[Content_Types].xml b/Prof_Arya/[Content_Types].xml
new file mode 100644
index 0000000..91db7d6
--- /dev/null
+++ b/Prof_Arya/[Content_Types].xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default ContentType="image/png" Extension="png"/><Default ContentType="application/vnd.openxmlformats-package.relationships+xml" Extension="rels"/><Default ContentType="application/vnd.mathworks.simulink.mdl+xml" Extension="xml"/><Override ContentType="application/vnd.openxmlformats-package.core-properties+xml" PartName="/metadata/coreProperties.xml"/></Types> \ No newline at end of file
diff --git a/Prof_Arya/_rels/.rels b/Prof_Arya/_rels/.rels
new file mode 100644
index 0000000..2269369
--- /dev/null
+++ b/Prof_Arya/_rels/.rels
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="Thumbnail" Target="metadata/thumbnail.png" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail"/><Relationship Id="blockDiagram" Target="simulink/blockdiagram.xml" Type="http://schemas.mathworks.com/simulink/2010/relationships/blockDiagram"/><Relationship Id="coreprops" Target="metadata/coreProperties.xml" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties"/></Relationships> \ No newline at end of file
diff --git a/Prof_Arya/getstatenames.m b/Prof_Arya/getstatenames.m
new file mode 100644
index 0000000..a98493f
--- /dev/null
+++ b/Prof_Arya/getstatenames.m
@@ -0,0 +1,47 @@
+function [statenames, stateblocks] = getstatenames(mdl)
+%% GETSTATENAMES
+%
+% This function will identify the states of a given simulink model. A mapping
+% to blockname will be assumed for this example. It is up to the user to map
+% states as they would wish or simply to use Simulink's definition of full block
+% path if they would like.
+%
+% Simulink uses full block path as a manner to assure uniqueness, allow
+% for scalability, and always have clear meaning. It is realized that
+% long block paths can result from large, highly nested models,
+% yet if automated scripting is used for manipulation, then
+% this is seen as an effective, consistant, and error resistant approach.
+% Especially when combined with a user defined mapping to things that are
+% shorter and can comply with company model styleguides and conventions.
+%
+% This file will additionally remove any new line characters in the
+% statename and blockpath.
+
+% Copyright 2004 - 2010 The MathWorks, Inc.
+
+%% Extract State Information
+% extract the state information (see <http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/model_cmd.html MODEL command>
+% for more info)
+% This is one main command that can be leveraged by users in their own
+% scripts. If you walk away with anything remember this one, and bookmark
+% the above page in your help browsers.
+%
+% It is important to realize that Simulink uses complete block path
+% to identify unique states within a Simulink model. It is the stateblocks
+% variable that is returned by the following command the shows what
+% Simulink sees as the continuous and discrete states in a model.
+[sys,x0,stateblocks]=feval(mdl,[],[],[],0);
+
+%% Example of State Mapping to Block Name
+% Here is one example of user defined state mapping.
+% Let's extract the block name from the handle to the block
+% This assumes you name the block what you would name the state. Also note
+% that this may not be unique (ie blocks with state within libraries will all
+% return the same thing for each instance).
+statenames = get_param(stateblocks,'Name');
+
+%% Remove New Linesn within names
+% lets remove the newline characters for ease on the eyes
+statenames = regexprep(statenames,'\n',' ');
+stateblocks = regexprep(stateblocks,'\n',' ');
+
diff --git a/Prof_Arya/lineariz.zip b/Prof_Arya/lineariz.zip
new file mode 100644
index 0000000..8da4868
--- /dev/null
+++ b/Prof_Arya/lineariz.zip
Binary files differ
diff --git a/Prof_Arya/metadata/coreProperties.xml b/Prof_Arya/metadata/coreProperties.xml
new file mode 100644
index 0000000..3383789
--- /dev/null
+++ b/Prof_Arya/metadata/coreProperties.xml
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?><cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><cp:category>Model</cp:category><dcterms:created xsi:type="dcterms:W3CDTF">2014-12-18T10:03:47Z</dcterms:created><dc:creator>Pranav</dc:creator><dc:description></dc:description><cp:lastModifiedBy>Prof.H.Arya</cp:lastModifiedBy><dcterms:modified xsi:type="dcterms:W3CDTF">2016-04-20T12:05:18Z</dcterms:modified><cp:revision>1.107</cp:revision><cp:version>R2012b</cp:version></cp:coreProperties> \ No newline at end of file
diff --git a/Prof_Arya/metadata/thumbnail.png b/Prof_Arya/metadata/thumbnail.png
new file mode 100644
index 0000000..976194d
--- /dev/null
+++ b/Prof_Arya/metadata/thumbnail.png
Binary files differ
diff --git a/Prof_Arya/simulink/blockdiagram.xml b/Prof_Arya/simulink/blockdiagram.xml
new file mode 100644
index 0000000..500a237
--- /dev/null
+++ b/Prof_Arya/simulink/blockdiagram.xml
@@ -0,0 +1,1840 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ModelInformation Version="0.9">
+ <Model>
+ <GraphicalInterface>
+ <P Name="NumRootInports">4</P>
+ <Inport>
+ <P Name="BusObject"></P>
+ <P Name="Name">In1</P>
+ </Inport>
+ <Inport>
+ <P Name="BusObject"></P>
+ <P Name="Name">In2</P>
+ </Inport>
+ <Inport>
+ <P Name="BusObject"></P>
+ <P Name="Name">In3</P>
+ </Inport>
+ <Inport>
+ <P Name="BusObject"></P>
+ <P Name="Name">In4</P>
+ </Inport>
+ <P Name="NumRootOutports">13</P>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out1</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out2</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out3</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out4</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out5</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out6</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out7</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out8</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out9</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out10</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out11</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out12</P>
+ </Outport>
+ <Outport>
+ <P Name="BusObject"></P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="Name">Out13</P>
+ </Outport>
+ <P Name="ParameterArgumentNames"></P>
+ <P Name="ComputedModelVersion">1.107</P>
+ <P Name="NumModelReferences">0</P>
+ <P Name="NumTestPointedSignals">0</P>
+ </GraphicalInterface>
+ <P Name="SavedCharacterEncoding">windows-1252</P>
+ <Object PropName="HDLParams" ObjectID="1" ClassName="slprops.hdlmdlprops">
+ <Array PropName="mdlProps" Type="Cell" Dimension="1*2">
+ <Cell Class="char">HDLSubsystem</Cell>
+ <Cell Class="char">Cessna_6DOF_trim</Cell>
+ </Array>
+ </Object>
+ <P Name="SaveDefaultBlockParams">on</P>
+ <P Name="ScopeRefreshTime">0.035000</P>
+ <P Name="OverrideScopeRefreshTime">on</P>
+ <P Name="DisableAllScopes">off</P>
+ <P Name="DataTypeOverride">UseLocalSettings</P>
+ <P Name="DataTypeOverrideAppliesTo">AllNumericTypes</P>
+ <P Name="MinMaxOverflowLogging">UseLocalSettings</P>
+ <P Name="MinMaxOverflowArchiveMode">Overwrite</P>
+ <P Name="FPTRunName">Run 1</P>
+ <P Name="MaxMDLFileLineLength">120</P>
+ <Object PropName="BdWindowsInfo" ObjectID="2" ClassName="Simulink.BDWindowsInfo">
+ <Object PropName="WindowsInfo" ObjectID="3" ClassName="Simulink.WindowInfo">
+ <P Name="IsActive" Class="logical">1</P>
+ <P Name="Location" Class="double">[-8.0, -8.0, 1378.0, 754.0]</P>
+ <Object PropName="ModelBrowserInfo" ObjectID="4" ClassName="Simulink.ModelBrowserInfo">
+ <P Name="Visible" Class="logical">0</P>
+ <P Name="DockPosition" Class="char">Left</P>
+ <P Name="Width" Class="int32">50</P>
+ <P Name="Height" Class="int32">50</P>
+ <P Name="Filter" Class="int32">9</P>
+ </Object>
+ <Object PropName="ExplorerBarInfo" ObjectID="5" ClassName="Simulink.ExplorerBarInfo">
+ <P Name="Visible" Class="logical">1</P>
+ </Object>
+ <Object PropName="EditorsInfo" ObjectID="6" ClassName="Simulink.EditorInfo">
+ <P Name="IsActive" Class="logical">1</P>
+ <P Name="ViewObjType" Class="char">SimulinkTopLevel</P>
+ <P Name="LoadSaveID" Class="char">0</P>
+ <P Name="Extents" Class="double">[1326.0, 578.0]</P>
+ <P Name="ZoomFactor" Class="double">1.0</P>
+ <P Name="Offset" Class="double">[0.0, 0.0]</P>
+ </Object>
+ </Object>
+ </Object>
+ <ConfigManagerSettings>
+ <P Name="UpdateHistory">UpdateHistoryNever</P>
+ <P Name="ModifiedByFormat">%&lt;Auto&gt;</P>
+ <P Name="ModifiedDateFormat">%&lt;Auto&gt;</P>
+ <P Name="RTWModifiedTimeStamp">383054472</P>
+ <P Name="ModelVersionFormat">1.%&lt;AutoIncrement:107&gt;</P>
+ <P Name="ConfigurationManager">none</P>
+ </ConfigManagerSettings>
+ <EditorSettings>
+ <P Name="SampleTimeColors">off</P>
+ <P Name="SampleTimeAnnotations">off</P>
+ <P Name="LibraryLinkDisplay">none</P>
+ <P Name="WideLines">off</P>
+ <P Name="ShowLineDimensions">off</P>
+ <P Name="ShowPortDataTypes">off</P>
+ <P Name="ShowDesignRanges">off</P>
+ <P Name="ShowLoopsOnError">on</P>
+ <P Name="IgnoreBidirectionalLines">off</P>
+ <P Name="ShowStorageClass">off</P>
+ <P Name="ShowTestPointIcons">on</P>
+ <P Name="ShowSignalResolutionIcons">on</P>
+ <P Name="ShowViewerIcons">on</P>
+ <P Name="SortedOrder">off</P>
+ <P Name="ExecutionContextIcon">off</P>
+ <P Name="ShowLinearizationAnnotations">on</P>
+ <P Name="BlockNameDataTip">off</P>
+ <P Name="BlockParametersDataTip">off</P>
+ <P Name="BlockDescriptionStringDataTip">off</P>
+ <P Name="ToolBar">on</P>
+ <P Name="StatusBar">on</P>
+ <P Name="BrowserShowLibraryLinks">off</P>
+ <P Name="BrowserLookUnderMasks">off</P>
+ </EditorSettings>
+ <SimulationSettings>
+ <P Name="SimulationMode">normal</P>
+ <P Name="LinearizationMsg">none</P>
+ <P Name="Profile">off</P>
+ <P Name="ParamWorkspaceSource">MATLABWorkspace</P>
+ <P Name="AccelSystemTargetFile">accel.tlc</P>
+ <P Name="AccelTemplateMakefile">accel_default_tmf</P>
+ <P Name="AccelMakeCommand">make_rtw</P>
+ <P Name="TryForcingSFcnDF">off</P>
+ <Object PropName="DataLoggingOverride" ObjectID="7" ClassName="Simulink.SimulationData.ModelLoggingInfo">
+ <P Name="model_" Class="char">Cessna_6DOF_trim_ha</P>
+ <P Name="signals_" Class="double">[]</P>
+ <P Name="overrideMode_" Class="double">0.0</P>
+ <Array PropName="logAsSpecifiedByModels_" Type="Cell" Dimension="1*1">
+ <Cell Class="char">Cessna_6DOF_trim_ha</Cell>
+ </Array>
+ <Array PropName="logAsSpecifiedByModelsSSIDs_" Type="Cell" Dimension="1*1">
+ <Cell>[]</Cell>
+ </Array>
+ </Object>
+ </SimulationSettings>
+ <Verification>
+ <P Name="RecordCoverage">off</P>
+ <P Name="CovPath">/</P>
+ <P Name="CovSaveName">covdata</P>
+ <P Name="CovMetricSettings">dw</P>
+ <P Name="CovNameIncrementing">off</P>
+ <P Name="CovHtmlReporting">on</P>
+ <P Name="CovForceBlockReductionOff">on</P>
+ <P Name="covSaveCumulativeToWorkspaceVar">on</P>
+ <P Name="CovSaveSingleToWorkspaceVar">on</P>
+ <P Name="CovCumulativeVarName">covCumulativeData</P>
+ <P Name="CovCumulativeReport">off</P>
+ <P Name="CovReportOnPause">on</P>
+ <P Name="CovModelRefEnable">Off</P>
+ <P Name="CovExternalEMLEnable">off</P>
+ </Verification>
+ <ExternalMode>
+ <P Name="ExtModeBatchMode">off</P>
+ <P Name="ExtModeEnableFloating">on</P>
+ <P Name="ExtModeTrigType">manual</P>
+ <P Name="ExtModeTrigMode">normal</P>
+ <P Name="ExtModeTrigPort">1</P>
+ <P Name="ExtModeTrigElement">any</P>
+ <P Name="ExtModeTrigDuration">1000</P>
+ <P Name="ExtModeTrigDurationFloating">auto</P>
+ <P Name="ExtModeTrigHoldOff">0</P>
+ <P Name="ExtModeTrigDelay">0</P>
+ <P Name="ExtModeTrigDirection">rising</P>
+ <P Name="ExtModeTrigLevel">0</P>
+ <P Name="ExtModeArchiveMode">off</P>
+ <P Name="ExtModeAutoIncOneShot">off</P>
+ <P Name="ExtModeIncDirWhenArm">off</P>
+ <P Name="ExtModeAddSuffixToVar">off</P>
+ <P Name="ExtModeWriteAllDataToWs">off</P>
+ <P Name="ExtModeArmWhenConnect">on</P>
+ <P Name="ExtModeSkipDownloadWhenConnect">off</P>
+ <P Name="ExtModeLogAll">on</P>
+ <P Name="ExtModeAutoUpdateStatusClock">on</P>
+ </ExternalMode>
+ <EngineSettings>
+ <P Name="BufferReuse">on</P>
+ </EngineSettings>
+ <ModelReferenceSettings>
+ <P Name="ShowModelReferenceBlockVersion">off</P>
+ <P Name="ShowModelReferenceBlockIO">off</P>
+ </ModelReferenceSettings>
+ <ConfigurationSet>
+ <Array PropName="ConfigurationSets" Type="Handle" Dimension="1*1">
+ <Object ObjectID="8" Version="1.12.1" ClassName="Simulink.ConfigSet">
+ <Array PropName="Components" Type="Handle" Dimension="1*9">
+ <Object ObjectID="9" Version="1.12.1" ClassName="Simulink.SolverCC">
+ <P Name="StartTime">0.0</P>
+ <P Name="StopTime">1000</P>
+ <P Name="AbsTol">auto</P>
+ <P Name="FixedStep">auto</P>
+ <P Name="InitialStep">auto</P>
+ <P Name="MaxNumMinSteps">-1</P>
+ <P Name="MaxOrder">5</P>
+ <P Name="ZcThreshold">auto</P>
+ <P Name="ConsecutiveZCsStepRelTol">10*128*eps</P>
+ <P Name="MaxConsecutiveZCs">1000</P>
+ <P Name="ExtrapolationOrder">4</P>
+ <P Name="NumberNewtonIterations">1</P>
+ <P Name="MaxStep">auto</P>
+ <P Name="MinStep">auto</P>
+ <P Name="MaxConsecutiveMinStep">1</P>
+ <P Name="RelTol">1e-5</P>
+ <P Name="SolverMode">Auto</P>
+ <P Name="EnableConcurrentExecution">off</P>
+ <P Name="ConcurrentTasks">off</P>
+ <P Name="Solver">ode45</P>
+ <P Name="SolverName">ode45</P>
+ <P Name="SolverJacobianMethodControl">auto</P>
+ <P Name="ShapePreserveControl">DisableAll</P>
+ <P Name="ZeroCrossControl">UseLocalSettings</P>
+ <P Name="ZeroCrossAlgorithm">Nonadaptive</P>
+ <P Name="AlgebraicLoopSolver">TrustRegion</P>
+ <P Name="SolverResetMethod">Fast</P>
+ <P Name="PositivePriorityOrder">off</P>
+ <P Name="AutoInsertRateTranBlk">off</P>
+ <P Name="SampleTimeConstraint">Unconstrained</P>
+ <P Name="InsertRTBMode">Whenever possible</P>
+ </Object>
+ <Object ObjectID="10" Version="1.12.1" ClassName="Simulink.DataIOCC">
+ <P Name="Decimation">1</P>
+ <P Name="ExternalInput">[t, u]</P>
+ <P Name="FinalStateName">xFinal</P>
+ <P Name="InitialState">xInitial</P>
+ <P Name="LimitDataPoints">on</P>
+ <P Name="MaxDataPoints">1000</P>
+ <P Name="LoadExternalInput">off</P>
+ <P Name="LoadInitialState">off</P>
+ <P Name="SaveFinalState">off</P>
+ <P Name="SaveCompleteFinalSimState">off</P>
+ <P Name="SaveFormat">Array</P>
+ <P Name="SignalLoggingSaveFormat">ModelDataLogs</P>
+ <P Name="SaveOutput">on</P>
+ <P Name="SaveState">off</P>
+ <P Name="SignalLogging">on</P>
+ <P Name="DSMLogging">on</P>
+ <P Name="InspectSignalLogs">off</P>
+ <P Name="SaveTime">on</P>
+ <P Name="ReturnWorkspaceOutputs">off</P>
+ <P Name="StateSaveName">xout</P>
+ <P Name="TimeSaveName">tout</P>
+ <P Name="OutputSaveName">yout</P>
+ <P Name="SignalLoggingName">logsout</P>
+ <P Name="DSMLoggingName">dsmout</P>
+ <P Name="OutputOption">RefineOutputTimes</P>
+ <P Name="OutputTimes">[]</P>
+ <P Name="ReturnWorkspaceOutputsName">out</P>
+ <P Name="Refine">1</P>
+ </Object>
+ <Object ObjectID="11" Version="1.12.1" ClassName="Simulink.OptimizationCC">
+ <Array PropName="DisabledProps" Type="Cell" Dimension="1*8">
+ <Cell Class="char">BooleansAsBitfields</Cell>
+ <Cell Class="char">PassReuseOutputArgsAs</Cell>
+ <Cell Class="char">PassReuseOutputArgsThreshold</Cell>
+ <Cell Class="char">ZeroExternalMemoryAtStartup</Cell>
+ <Cell Class="char">ZeroInternalMemoryAtStartup</Cell>
+ <Cell Class="char">OptimizeModelRefInitCode</Cell>
+ <Cell Class="char">NoFixptDivByZeroProtection</Cell>
+ <Cell Class="char">UseSpecifiedMinMax</Cell>
+ </Array>
+ <P Name="BlockReduction">on</P>
+ <P Name="BooleanDataType">on</P>
+ <P Name="ConditionallyExecuteInputs">on</P>
+ <P Name="InlineParams">off</P>
+ <P Name="UseIntDivNetSlope">off</P>
+ <P Name="UseFloatMulNetSlope">off</P>
+ <P Name="UseSpecifiedMinMax">off</P>
+ <P Name="InlineInvariantSignals">off</P>
+ <P Name="OptimizeBlockIOStorage">on</P>
+ <P Name="BufferReuse">on</P>
+ <P Name="EnhancedBackFolding">off</P>
+ <P Name="StrengthReduction">off</P>
+ <P Name="ExpressionFolding">on</P>
+ <P Name="BooleansAsBitfields">off</P>
+ <P Name="BitfieldContainerType">uint_T</P>
+ <P Name="EnableMemcpy">on</P>
+ <P Name="MemcpyThreshold">64</P>
+ <P Name="PassReuseOutputArgsAs">Structure reference</P>
+ <P Name="ExpressionDepthLimit">2147483647</P>
+ <P Name="FoldNonRolledExpr">on</P>
+ <P Name="LocalBlockOutputs">on</P>
+ <P Name="RollThreshold">5</P>
+ <P Name="SystemCodeInlineAuto">off</P>
+ <P Name="StateBitsets">off</P>
+ <P Name="DataBitsets">off</P>
+ <P Name="UseTempVars">off</P>
+ <P Name="ZeroExternalMemoryAtStartup">on</P>
+ <P Name="ZeroInternalMemoryAtStartup">on</P>
+ <P Name="InitFltsAndDblsToZero">off</P>
+ <P Name="NoFixptDivByZeroProtection">off</P>
+ <P Name="EfficientFloat2IntCast">off</P>
+ <P Name="EfficientMapNaN2IntZero">on</P>
+ <P Name="OptimizeModelRefInitCode">off</P>
+ <P Name="LifeSpan">inf</P>
+ <P Name="MaxStackSize">Inherit from target</P>
+ <P Name="BufferReusableBoundary">on</P>
+ <P Name="SimCompilerOptimization">Off</P>
+ <P Name="AccelVerboseBuild">off</P>
+ <P Name="ParallelExecutionInRapidAccelerator">on</P>
+ </Object>
+ <Object ObjectID="12" Version="1.12.1" ClassName="Simulink.DebuggingCC">
+ <P Name="RTPrefix">error</P>
+ <P Name="ConsistencyChecking">none</P>
+ <P Name="ArrayBoundsChecking">none</P>
+ <P Name="SignalInfNanChecking">none</P>
+ <P Name="SignalRangeChecking">none</P>
+ <P Name="ReadBeforeWriteMsg">UseLocalSettings</P>
+ <P Name="WriteAfterWriteMsg">UseLocalSettings</P>
+ <P Name="WriteAfterReadMsg">UseLocalSettings</P>
+ <P Name="AlgebraicLoopMsg">warning</P>
+ <P Name="ArtificialAlgebraicLoopMsg">warning</P>
+ <P Name="SaveWithDisabledLinksMsg">warning</P>
+ <P Name="SaveWithParameterizedLinksMsg">warning</P>
+ <P Name="CheckSSInitialOutputMsg">on</P>
+ <P Name="UnderspecifiedInitializationDetection">Classic</P>
+ <P Name="MergeDetectMultiDrivingBlocksExec">none</P>
+ <P Name="CheckExecutionContextPreStartOutputMsg">off</P>
+ <P Name="CheckExecutionContextRuntimeOutputMsg">off</P>
+ <P Name="SignalResolutionControl">UseLocalSettings</P>
+ <P Name="BlockPriorityViolationMsg">warning</P>
+ <P Name="MinStepSizeMsg">warning</P>
+ <P Name="TimeAdjustmentMsg">none</P>
+ <P Name="MaxConsecutiveZCsMsg">error</P>
+ <P Name="MaskedZcDiagnostic">warning</P>
+ <P Name="IgnoredZcDiagnostic">warning</P>
+ <P Name="SolverPrmCheckMsg">warning</P>
+ <P Name="InheritedTsInSrcMsg">warning</P>
+ <P Name="DiscreteInheritContinuousMsg">warning</P>
+ <P Name="MultiTaskDSMMsg">error</P>
+ <P Name="MultiTaskCondExecSysMsg">error</P>
+ <P Name="MultiTaskRateTransMsg">error</P>
+ <P Name="SingleTaskRateTransMsg">none</P>
+ <P Name="TasksWithSamePriorityMsg">warning</P>
+ <P Name="SigSpecEnsureSampleTimeMsg">warning</P>
+ <P Name="CheckMatrixSingularityMsg">none</P>
+ <P Name="IntegerOverflowMsg">warning</P>
+ <P Name="Int32ToFloatConvMsg">warning</P>
+ <P Name="ParameterDowncastMsg">error</P>
+ <P Name="ParameterOverflowMsg">error</P>
+ <P Name="ParameterUnderflowMsg">none</P>
+ <P Name="ParameterPrecisionLossMsg">warning</P>
+ <P Name="ParameterTunabilityLossMsg">warning</P>
+ <P Name="FixptConstUnderflowMsg">none</P>
+ <P Name="FixptConstOverflowMsg">none</P>
+ <P Name="FixptConstPrecisionLossMsg">none</P>
+ <P Name="UnderSpecifiedDataTypeMsg">none</P>
+ <P Name="UnnecessaryDatatypeConvMsg">none</P>
+ <P Name="VectorMatrixConversionMsg">none</P>
+ <P Name="InvalidFcnCallConnMsg">error</P>
+ <P Name="FcnCallInpInsideContextMsg">UseLocalSettings</P>
+ <P Name="SignalLabelMismatchMsg">none</P>
+ <P Name="UnconnectedInputMsg">warning</P>
+ <P Name="UnconnectedOutputMsg">warning</P>
+ <P Name="UnconnectedLineMsg">warning</P>
+ <P Name="SFcnCompatibilityMsg">none</P>
+ <P Name="FrameProcessingCompatibilityMsg">warning</P>
+ <P Name="UniqueDataStoreMsg">none</P>
+ <P Name="BusObjectLabelMismatch">warning</P>
+ <P Name="RootOutportRequireBusObject">warning</P>
+ <P Name="AssertControl">UseLocalSettings</P>
+ <P Name="EnableOverflowDetection">off</P>
+ <P Name="ModelReferenceIOMsg">none</P>
+ <P Name="ModelReferenceMultiInstanceNormalModeStructChecksumCheck">error</P>
+ <P Name="ModelReferenceVersionMismatchMessage">none</P>
+ <P Name="ModelReferenceIOMismatchMessage">none</P>
+ <P Name="ModelReferenceCSMismatchMessage">none</P>
+ <P Name="UnknownTsInhSupMsg">warning</P>
+ <P Name="ModelReferenceDataLoggingMessage">warning</P>
+ <P Name="ModelReferenceSymbolNameMessage">warning</P>
+ <P Name="ModelReferenceExtraNoncontSigs">error</P>
+ <P Name="StateNameClashWarn">warning</P>
+ <P Name="SimStateInterfaceChecksumMismatchMsg">warning</P>
+ <P Name="SimStateOlderReleaseMsg">error</P>
+ <P Name="InitInArrayFormatMsg">warning</P>
+ <P Name="StrictBusMsg">ErrorLevel1</P>
+ <P Name="BusNameAdapt">WarnAndRepair</P>
+ <P Name="NonBusSignalsTreatedAsBus">none</P>
+ <P Name="LoggingUnavailableSignals">error</P>
+ <P Name="BlockIODiagnostic">none</P>
+ <P Name="SFUnusedDataAndEventsDiag">warning</P>
+ <P Name="SFUnexpectedBacktrackingDiag">warning</P>
+ <P Name="SFInvalidInputDataAccessInChartInitDiag">warning</P>
+ <P Name="SFNoUnconditionalDefaultTransitionDiag">warning</P>
+ <P Name="SFTransitionOutsideNaturalParentDiag">warning</P>
+ <P Name="SFUnconditionalTransitionShadowingDiag">warning</P>
+ <P Name="SFUndirectedBroadcastEventsDiag">warning</P>
+ <P Name="SFTransitionActionBeforeConditionDiag">warning</P>
+ </Object>
+ <Object ObjectID="13" Version="1.12.1" ClassName="Simulink.HardwareCC">
+ <P Name="ProdBitPerChar">8</P>
+ <P Name="ProdBitPerShort">16</P>
+ <P Name="ProdBitPerInt">32</P>
+ <P Name="ProdBitPerLong">32</P>
+ <P Name="ProdBitPerFloat">32</P>
+ <P Name="ProdBitPerDouble">64</P>
+ <P Name="ProdBitPerPointer">32</P>
+ <P Name="ProdLargestAtomicInteger">Char</P>
+ <P Name="ProdLargestAtomicFloat">None</P>
+ <P Name="ProdIntDivRoundTo">Undefined</P>
+ <P Name="ProdEndianess">Unspecified</P>
+ <P Name="ProdWordSize">32</P>
+ <P Name="ProdShiftRightIntArith">on</P>
+ <P Name="ProdHWDeviceType">32-bit Generic</P>
+ <P Name="TargetBitPerChar">8</P>
+ <P Name="TargetBitPerShort">16</P>
+ <P Name="TargetBitPerInt">32</P>
+ <P Name="TargetBitPerLong">32</P>
+ <P Name="TargetBitPerFloat">32</P>
+ <P Name="TargetBitPerDouble">64</P>
+ <P Name="TargetBitPerPointer">32</P>
+ <P Name="TargetLargestAtomicInteger">Char</P>
+ <P Name="TargetLargestAtomicFloat">None</P>
+ <P Name="TargetShiftRightIntArith">on</P>
+ <P Name="TargetIntDivRoundTo">Undefined</P>
+ <P Name="TargetEndianess">Unspecified</P>
+ <P Name="TargetWordSize">32</P>
+ <P Name="TargetTypeEmulationWarnSuppressLevel">0</P>
+ <P Name="TargetPreprocMaxBitsSint">32</P>
+ <P Name="TargetPreprocMaxBitsUint">32</P>
+ <P Name="TargetHWDeviceType">Specified</P>
+ <P Name="TargetUnknown">off</P>
+ <P Name="ProdEqTarget">on</P>
+ </Object>
+ <Object ObjectID="14" Version="1.12.1" ClassName="Simulink.ModelReferenceCC">
+ <P Name="UpdateModelReferenceTargets">IfOutOfDateOrStructuralChange</P>
+ <P Name="CheckModelReferenceTargetMessage">error</P>
+ <P Name="EnableParallelModelReferenceBuilds">off</P>
+ <P Name="ParallelModelReferenceErrorOnInvalidPool">on</P>
+ <P Name="ParallelModelReferenceMATLABWorkerInit">None</P>
+ <P Name="ModelReferenceNumInstancesAllowed">Multi</P>
+ <P Name="PropagateVarSize">Infer from blocks in model</P>
+ <P Name="ModelReferencePassRootInputsByReference">on</P>
+ <P Name="ModelReferenceMinAlgLoopOccurrences">off</P>
+ <P Name="PropagateSignalLabelsOutOfModel">off</P>
+ <P Name="SupportModelReferenceSimTargetCustomCode">off</P>
+ </Object>
+ <Object ObjectID="15" Version="1.12.1" ClassName="Simulink.SFSimCC">
+ <P Name="SFSimEnableDebug">on</P>
+ <P Name="SFSimOverflowDetection">on</P>
+ <P Name="SFSimEcho">on</P>
+ <P Name="SimBlas">on</P>
+ <P Name="SimCtrlC">on</P>
+ <P Name="SimExtrinsic">on</P>
+ <P Name="SimIntegrity">on</P>
+ <P Name="SimUseLocalCustomCode">off</P>
+ <P Name="SimParseCustomCode">on</P>
+ <P Name="SimBuildMode">sf_incremental_build</P>
+ </Object>
+ <Object BackupClass="Simulink.RTWCC" ObjectID="16" Version="1.12.1" ClassName="Simulink.RTWCC">
+ <Array PropName="DisabledProps" Type="Cell" Dimension="1*8">
+ <Cell Class="char">IncludeHyperlinkInReport</Cell>
+ <Cell Class="char">GenerateTraceInfo</Cell>
+ <Cell Class="char">GenerateTraceReport</Cell>
+ <Cell Class="char">GenerateTraceReportSl</Cell>
+ <Cell Class="char">GenerateTraceReportSf</Cell>
+ <Cell Class="char">GenerateTraceReportEml</Cell>
+ <Cell Class="char">GenerateSLWebview</Cell>
+ <Cell Class="char">GenerateCodeMetricsReport</Cell>
+ </Array>
+ <P Name="SystemTargetFile">grt.tlc</P>
+ <P Name="GenCodeOnly">off</P>
+ <P Name="MakeCommand">make_rtw</P>
+ <P Name="GenerateMakefile">on</P>
+ <P Name="PackageGeneratedCodeAndArtifacts">off</P>
+ <P Name="TemplateMakefile">grt_default_tmf</P>
+ <P Name="GenerateReport">off</P>
+ <P Name="SaveLog">off</P>
+ <P Name="RTWVerbose">on</P>
+ <P Name="RetainRTWFile">off</P>
+ <P Name="ProfileTLC">off</P>
+ <P Name="TLCDebug">off</P>
+ <P Name="TLCCoverage">off</P>
+ <P Name="TLCAssert">off</P>
+ <P Name="ProcessScriptMode">Default</P>
+ <P Name="ConfigurationMode">Optimized</P>
+ <P Name="ConfigAtBuild">off</P>
+ <P Name="RTWUseLocalCustomCode">off</P>
+ <P Name="RTWUseSimCustomCode">off</P>
+ <P Name="IncludeHyperlinkInReport">off</P>
+ <P Name="LaunchReport">off</P>
+ <P Name="PortableWordSizes">off</P>
+ <P Name="GenerateErtSFunction">off</P>
+ <P Name="CreateSILPILBlock">None</P>
+ <P Name="CodeExecutionProfiling">off</P>
+ <P Name="CodeExecutionProfileVariable">executionProfile</P>
+ <P Name="CodeProfilingSaveOptions">SummaryOnly</P>
+ <P Name="CodeProfilingInstrumentation">off</P>
+ <P Name="TargetLang">C</P>
+ <P Name="IncludeBusHierarchyInRTWFileBlockHierarchyMap">off</P>
+ <P Name="IncludeERTFirstTime">off</P>
+ <P Name="GenerateTraceInfo">off</P>
+ <P Name="GenerateTraceReport">off</P>
+ <P Name="GenerateTraceReportSl">off</P>
+ <P Name="GenerateTraceReportSf">off</P>
+ <P Name="GenerateTraceReportEml">off</P>
+ <P Name="GenerateCodeInfo">off</P>
+ <P Name="GenerateWebview">off</P>
+ <P Name="GenerateCodeMetricsReport">off</P>
+ <P Name="GenerateCodeReplacementReport">off</P>
+ <P Name="RTWCompilerOptimization">Off</P>
+ <P Name="CheckMdlBeforeBuild">Off</P>
+ <P Name="CustomRebuildMode">OnUpdate</P>
+ <Array PropName="Components" Type="Handle" Dimension="1*2">
+ <Object ObjectID="17" Version="1.12.1" ClassName="Simulink.CodeAppCC">
+ <Array PropName="DisabledProps" Type="Cell" Dimension="1*21">
+ <Cell Class="char">IgnoreCustomStorageClasses</Cell>
+ <Cell Class="char">IgnoreTestpoints</Cell>
+ <Cell Class="char">InsertBlockDesc</Cell>
+ <Cell Class="char">InsertPolySpaceComments</Cell>
+ <Cell Class="char">SFDataObjDesc</Cell>
+ <Cell Class="char">MATLABFcnDesc</Cell>
+ <Cell Class="char">SimulinkDataObjDesc</Cell>
+ <Cell Class="char">DefineNamingRule</Cell>
+ <Cell Class="char">SignalNamingRule</Cell>
+ <Cell Class="char">ParamNamingRule</Cell>
+ <Cell Class="char">InlinedPrmAccess</Cell>
+ <Cell Class="char">CustomSymbolStr</Cell>
+ <Cell Class="char">CustomSymbolStrGlobalVar</Cell>
+ <Cell Class="char">CustomSymbolStrType</Cell>
+ <Cell Class="char">CustomSymbolStrField</Cell>
+ <Cell Class="char">CustomSymbolStrFcn</Cell>
+ <Cell Class="char">CustomSymbolStrFcnArg</Cell>
+ <Cell Class="char">CustomSymbolStrBlkIO</Cell>
+ <Cell Class="char">CustomSymbolStrTmpVar</Cell>
+ <Cell Class="char">CustomSymbolStrMacro</Cell>
+ <Cell Class="char">ReqsInCode</Cell>
+ </Array>
+ <P Name="ForceParamTrailComments">off</P>
+ <P Name="GenerateComments">on</P>
+ <P Name="IgnoreCustomStorageClasses">on</P>
+ <P Name="IgnoreTestpoints">off</P>
+ <P Name="IncHierarchyInIds">off</P>
+ <P Name="MaxIdLength">31</P>
+ <P Name="PreserveName">off</P>
+ <P Name="PreserveNameWithParent">off</P>
+ <P Name="ShowEliminatedStatement">off</P>
+ <P Name="OperatorAnnotations">off</P>
+ <P Name="IncAutoGenComments">off</P>
+ <P Name="SimulinkDataObjDesc">off</P>
+ <P Name="SFDataObjDesc">off</P>
+ <P Name="MATLABFcnDesc">off</P>
+ <P Name="IncDataTypeInIds">off</P>
+ <P Name="MangleLength">1</P>
+ <P Name="CustomSymbolStrGlobalVar">$R$N$M</P>
+ <P Name="CustomSymbolStrType">$N$R$M_T</P>
+ <P Name="CustomSymbolStrField">$N$M</P>
+ <P Name="CustomSymbolStrFcn">$R$N$M$F</P>
+ <P Name="CustomSymbolStrFcnArg">rt$I$N$M</P>
+ <P Name="CustomSymbolStrBlkIO">rtb_$N$M</P>
+ <P Name="CustomSymbolStrTmpVar">$N$M</P>
+ <P Name="CustomSymbolStrMacro">$R$N$M</P>
+ <P Name="DefineNamingRule">None</P>
+ <P Name="ParamNamingRule">None</P>
+ <P Name="SignalNamingRule">None</P>
+ <P Name="InsertBlockDesc">off</P>
+ <P Name="InsertPolySpaceComments">off</P>
+ <P Name="SimulinkBlockComments">on</P>
+ <P Name="MATLABSourceComments">off</P>
+ <P Name="EnableCustomComments">off</P>
+ <P Name="InternalIdentifier">Shortened</P>
+ <P Name="InlinedPrmAccess">Literals</P>
+ <P Name="ReqsInCode">off</P>
+ <P Name="UseSimReservedNames">off</P>
+ </Object>
+ <Object BackupClass="Simulink.TargetCC" ObjectID="18" Version="1.12.1" ClassName="Simulink.GRTTargetCC">
+ <Array PropName="DisabledProps" Type="Cell" Dimension="1*16">
+ <Cell Class="char">GeneratePreprocessorConditionals</Cell>
+ <Cell Class="char">IncludeMdlTerminateFcn</Cell>
+ <Cell Class="char">CombineOutputUpdateFcns</Cell>
+ <Cell Class="char">SuppressErrorStatus</Cell>
+ <Cell Class="char">ERTCustomFileBanners</Cell>
+ <Cell Class="char">GenerateSampleERTMain</Cell>
+ <Cell Class="char">GenerateTestInterfaces</Cell>
+ <Cell Class="char">ModelStepFunctionPrototypeControlCompliant</Cell>
+ <Cell Class="char">CPPClassGenCompliant</Cell>
+ <Cell Class="char">PortableWordSizes</Cell>
+ <Cell Class="char">PurelyIntegerCode</Cell>
+ <Cell Class="char">SupportComplex</Cell>
+ <Cell Class="char">SupportAbsoluteTime</Cell>
+ <Cell Class="char">SupportContinuousTime</Cell>
+ <Cell Class="char">SupportNonInlinedSFcns</Cell>
+ <Cell Class="char">GenerateAllocFcn</Cell>
+ </Array>
+ <P Name="TargetFcnLib">ansi_tfl_table_tmw.mat</P>
+ <P Name="TargetLibSuffix"></P>
+ <P Name="TargetPreCompLibLocation"></P>
+ <P Name="CodeReplacementLibrary">None</P>
+ <P Name="UtilityFuncGeneration">Auto</P>
+ <P Name="ERTMultiwordTypeDef">System defined</P>
+ <P Name="ERTMultiwordLength">256</P>
+ <P Name="MultiwordLength">2048</P>
+ <P Name="GenerateFullHeader">on</P>
+ <P Name="GenerateSampleERTMain">off</P>
+ <P Name="GenerateTestInterfaces">off</P>
+ <P Name="IsPILTarget">off</P>
+ <P Name="ModelReferenceCompliant">on</P>
+ <P Name="ParMdlRefBuildCompliant">on</P>
+ <P Name="CompOptLevelCompliant">on</P>
+ <P Name="ConcurrentExecutionCompliant">on</P>
+ <P Name="IncludeMdlTerminateFcn">on</P>
+ <P Name="GeneratePreprocessorConditionals">Disable all</P>
+ <P Name="CombineOutputUpdateFcns">off</P>
+ <P Name="CombineSignalStateStructs">off</P>
+ <P Name="SuppressErrorStatus">off</P>
+ <P Name="ERTFirstTimeCompliant">off</P>
+ <P Name="IncludeFileDelimiter">Auto</P>
+ <P Name="ERTCustomFileBanners">off</P>
+ <P Name="SupportAbsoluteTime">on</P>
+ <P Name="LogVarNameModifier">rt_</P>
+ <P Name="MatFileLogging">on</P>
+ <P Name="MultiInstanceERTCode">off</P>
+ <P Name="SupportNonFinite">on</P>
+ <P Name="SupportComplex">on</P>
+ <P Name="PurelyIntegerCode">off</P>
+ <P Name="SupportContinuousTime">on</P>
+ <P Name="SupportNonInlinedSFcns">on</P>
+ <P Name="SupportVariableSizeSignals">off</P>
+ <P Name="EnableShiftOperators">on</P>
+ <P Name="ParenthesesLevel">Nominal</P>
+ <P Name="ModelStepFunctionPrototypeControlCompliant">off</P>
+ <P Name="CPPClassGenCompliant">on</P>
+ <P Name="AutosarCompliant">off</P>
+ <P Name="GRTInterface">on</P>
+ <P Name="UseMalloc">off</P>
+ <P Name="ExtMode">off</P>
+ <P Name="ExtModeStaticAlloc">off</P>
+ <P Name="ExtModeTesting">off</P>
+ <P Name="ExtModeStaticAllocSize">1000000</P>
+ <P Name="ExtModeTransport">0</P>
+ <P Name="ExtModeMexFile">ext_comm</P>
+ <P Name="ExtModeIntrfLevel">Level1</P>
+ <P Name="RTWCAPISignals">off</P>
+ <P Name="RTWCAPIParams">off</P>
+ <P Name="RTWCAPIStates">off</P>
+ <P Name="RTWCAPIRootIO">off</P>
+ <P Name="GenerateASAP2">off</P>
+ </Object>
+ </Array>
+ </Object>
+ <Object ObjectID="19" Version="1.12.1" ClassName="hdlcoderui.hdlcc">
+ <P Name="Description">HDL Coder custom configuration component</P>
+ <P Name="Name">HDL Coder</P>
+ <Array PropName="HDLConfigFile" Type="Cell" Dimension="1*1">
+ <Cell Class="char"></Cell>
+ </Array>
+ <P Name="HDLCActiveTab">0</P>
+ </Object>
+ </Array>
+ <P Name="Name">Configuration</P>
+ <P Name="CurrentDlgPage">Solver</P>
+ <P Name="ConfigPrmDlgPosition"> [ 243, 69, 1123, 699 ] </P>
+ </Object>
+ </Array>
+ <Object Reference="true" PropName="ActiveConfigurationSet" ObjectID="8" ClassName="Simulink.ConfigSet">
+ </Object>
+ </ConfigurationSet>
+ <ConcurrentExecutionSettings>
+ <Object PropName="DataTransfer" ObjectID="20" ClassName="Simulink.GlobalDataTransfer">
+ <P Name="DefaultTransitionBetweenSyncTasks" Class="char">Ensure deterministic transfer (maximum delay)</P>
+ <P Name="DefaultTransitionBetweenAsyncTasks" Class="char">Ensure data integrity only</P>
+ <P Name="DefaultTransitionBetweenContTasks" Class="char">Ensure deterministic transfer (minimum delay)</P>
+ <P Name="DefaultExtrapolationMethodBetweenContTasks" Class="char">None</P>
+ <P Name="AutoInsertRateTranBlk" Class="logical">0</P>
+ </Object>
+ <P Name="ExplicitPartitioning">off</P>
+ </ConcurrentExecutionSettings>
+ <SystemDefaults>
+ <P Name="PaperOrientation">landscape</P>
+ <P Name="PaperPositionMode">auto</P>
+ <P Name="PaperType">A4</P>
+ <P Name="PaperUnits">centimeters</P>
+ <P Name="TiledPaperMargins">[1.270000, 1.270000, 1.270000, 1.270000]</P>
+ <P Name="TiledPageScale">1</P>
+ <P Name="ShowPageBoundaries">off</P>
+ <P Name="ModelBrowserVisibility">off</P>
+ <P Name="ModelBrowserWidth">200</P>
+ <P Name="ScreenColor">white</P>
+ </SystemDefaults>
+ <BlockDefaults>
+ <P Name="ForegroundColor">black</P>
+ <P Name="BackgroundColor">white</P>
+ <P Name="DropShadow">off</P>
+ <P Name="NamePlacement">normal</P>
+ <P Name="FontName">Helvetica</P>
+ <P Name="FontSize">10</P>
+ <P Name="FontWeight">normal</P>
+ <P Name="FontAngle">normal</P>
+ <P Name="ShowName">on</P>
+ <P Name="BlockRotation">0</P>
+ <P Name="BlockMirror">off</P>
+ </BlockDefaults>
+ <AnnotationDefaults>
+ <P Name="HorizontalAlignment">center</P>
+ <P Name="VerticalAlignment">middle</P>
+ <P Name="ForegroundColor">black</P>
+ <P Name="BackgroundColor">white</P>
+ <P Name="DropShadow">off</P>
+ <P Name="FontName">Helvetica</P>
+ <P Name="FontSize">10</P>
+ <P Name="FontWeight">normal</P>
+ <P Name="FontAngle">normal</P>
+ <P Name="UseDisplayTextAsClickCallback">off</P>
+ </AnnotationDefaults>
+ <LineDefaults>
+ <P Name="FontName">Helvetica</P>
+ <P Name="FontSize">9</P>
+ <P Name="FontWeight">normal</P>
+ <P Name="FontAngle">normal</P>
+ </LineDefaults>
+ <MaskDefaults>
+ <P Name="SelfModifiable">off</P>
+ <P Name="IconFrame">on</P>
+ <P Name="IconOpaque">on</P>
+ <P Name="RunInitForIconRedraw">off</P>
+ <P Name="IconRotate">none</P>
+ <P Name="PortRotate">default</P>
+ <P Name="IconUnits">autoscale</P>
+ </MaskDefaults>
+ <MaskParameterDefaults>
+ <P Name="Evaluate">on</P>
+ <P Name="Tunable">on</P>
+ <P Name="NeverSave">off</P>
+ <P Name="Internal">off</P>
+ <P Name="ReadOnly">off</P>
+ <P Name="Enabled">on</P>
+ <P Name="Visible">on</P>
+ <P Name="ToolTip">on</P>
+ </MaskParameterDefaults>
+ <BlockParameterDefaults>
+ <Block BlockType="Demux">
+ <P Name="Outputs">4</P>
+ <P Name="DisplayOption">none</P>
+ <P Name="BusSelectionMode">off</P>
+ </Block>
+ <Block BlockType="Derivative">
+ <P Name="CoefficientInTFapproximation">inf</P>
+ </Block>
+ <Block BlockType="Inport">
+ <P Name="Port">1</P>
+ <P Name="OutputFunctionCall">off</P>
+ <P Name="OutMin">[]</P>
+ <P Name="OutMax">[]</P>
+ <P Name="OutDataTypeStr">Inherit: auto</P>
+ <P Name="LockScale">off</P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="PortDimensions">-1</P>
+ <P Name="VarSizeSig">Inherit</P>
+ <P Name="SampleTime">-1</P>
+ <P Name="SignalType">auto</P>
+ <P Name="SamplingMode">auto</P>
+ <P Name="LatchByDelayingOutsideSignal">off</P>
+ <P Name="LatchInputForFeedbackSignals">off</P>
+ <P Name="Interpolate">on</P>
+ </Block>
+ <Block BlockType="Outport">
+ <P Name="Port">1</P>
+ <P Name="OutMin">[]</P>
+ <P Name="OutMax">[]</P>
+ <P Name="OutDataTypeStr">Inherit: auto</P>
+ <P Name="LockScale">off</P>
+ <P Name="BusOutputAsStruct">off</P>
+ <P Name="PortDimensions">-1</P>
+ <P Name="VarSizeSig">Inherit</P>
+ <P Name="SampleTime">-1</P>
+ <P Name="SignalType">auto</P>
+ <P Name="SamplingMode">auto</P>
+ <P Name="SourceOfInitialOutputValue">Dialog</P>
+ <P Name="OutputWhenDisabled">held</P>
+ <P Name="InitialOutput">[]</P>
+ </Block>
+ <Block BlockType="S-Function">
+ <P Name="FunctionName">system</P>
+ <P Name="SFunctionModules">&apos;&apos;</P>
+ <P Name="PortCounts">[]</P>
+ <P Name="SFunctionDeploymentMode">off</P>
+ </Block>
+ <Block BlockType="SubSystem">
+ <P Name="ShowPortLabels">FromPortIcon</P>
+ <P Name="Permissions">ReadWrite</P>
+ <P Name="PermitHierarchicalResolution">All</P>
+ <P Name="TreatAsAtomicUnit">off</P>
+ <P Name="CheckFcnCallInpInsideContextMsg">off</P>
+ <P Name="SystemSampleTime">-1</P>
+ <P Name="RTWFcnNameOpts">Auto</P>
+ <P Name="RTWFileNameOpts">Auto</P>
+ <P Name="RTWMemSecFuncInitTerm">Inherit from model</P>
+ <P Name="RTWMemSecFuncExecute">Inherit from model</P>
+ <P Name="RTWMemSecDataConstants">Inherit from model</P>
+ <P Name="RTWMemSecDataInternal">Inherit from model</P>
+ <P Name="RTWMemSecDataParameters">Inherit from model</P>
+ <P Name="SimViewingDevice">off</P>
+ <P Name="DataTypeOverride">UseLocalSettings</P>
+ <P Name="DataTypeOverrideAppliesTo">AllNumericTypes</P>
+ <P Name="MinMaxOverflowLogging">UseLocalSettings</P>
+ <P Name="SFBlockType">NONE</P>
+ <P Name="Variant">off</P>
+ <P Name="GeneratePreprocessorConditionals">off</P>
+ </Block>
+ <Block BlockType="Sum">
+ <P Name="IconShape">rectangular</P>
+ <P Name="Inputs">++</P>
+ <P Name="CollapseMode">All dimensions</P>
+ <P Name="CollapseDim">1</P>
+ <P Name="InputSameDT">on</P>
+ <P Name="AccumDataTypeStr">Inherit: Inherit via internal rule</P>
+ <P Name="OutMin">[]</P>
+ <P Name="OutMax">[]</P>
+ <P Name="OutDataTypeStr">Inherit: Same as first input</P>
+ <P Name="LockScale">off</P>
+ <P Name="RndMeth">Floor</P>
+ <P Name="SaturateOnIntegerOverflow">on</P>
+ <P Name="SampleTime">-1</P>
+ </Block>
+ <Block BlockType="Terminator">
+ </Block>
+ </BlockParameterDefaults>
+ <System>
+ <P Name="Location">[-8, -8, 1370, 746]</P>
+ <P Name="Open">on</P>
+ <P Name="ZoomFactor">100</P>
+ <P Name="ReportName">simulink-default.rpt</P>
+ <P Name="SIDHighWatermark">148</P>
+ <Block BlockType="Inport" Name="In1" SID="131">
+ <P Name="Position">[115, 283, 145, 297]</P>
+ <P Name="ZOrder">-1</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="In2" SID="132">
+ <P Name="Position">[145, 298, 175, 312]</P>
+ <P Name="ZOrder">-2</P>
+ <P Name="Port">2</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="In3" SID="133">
+ <P Name="Position">[115, 313, 145, 327]</P>
+ <P Name="ZOrder">-3</P>
+ <P Name="Port">3</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="In4" SID="134">
+ <P Name="Position">[145, 328, 175, 342]</P>
+ <P Name="ZOrder">-4</P>
+ <P Name="Port">4</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Reference" Name="6DoF (Euler Angles)" SID="148">
+ <P Name="Ports">[2, 8]</P>
+ <P Name="Position">[480, 132, 680, 333]</P>
+ <P Name="ZOrder">1</P>
+ <P Name="LibraryVersion">1.251</P>
+ <P Name="SourceBlock">aerolib6dof2/6DoF (Euler Angles)</P>
+ <P Name="SourceType">6DoF EoM (Body Axis)</P>
+ <P Name="units">Metric (MKS)</P>
+ <P Name="mtype">Fixed</P>
+ <P Name="rep">Euler Angles</P>
+ <P Name="xme_0">[0 0 0]</P>
+ <P Name="Vm_0">[u v w]</P>
+ <P Name="eul_0">[0 0 0]</P>
+ <P Name="pm_0">[0 0 0]</P>
+ <P Name="mass_0">m</P>
+ <P Name="mass_e">0.5</P>
+ <P Name="mass_f">2.0</P>
+ <P Name="inertia">diag([I_xx I_yy I_zz])</P>
+ <P Name="inertia_e">eye(3)</P>
+ <P Name="inertia_f">2*eye(3)</P>
+ <P Name="k_quat">1.0</P>
+ </Block>
+ <Block BlockType="Demux" Name="Demux" SID="12">
+ <P Name="Ports">[1, 3]</P>
+ <P Name="Position">[730, 301, 735, 339]</P>
+ <P Name="ZOrder">-6</P>
+ <P Name="ShowName">off</P>
+ <P Name="Outputs">3</P>
+ <P Name="DisplayOption">bar</P>
+ </Block>
+ <Block BlockType="Demux" Name="Demux1" SID="49">
+ <P Name="Ports">[1, 3]</P>
+ <P Name="Position">[975, 96, 980, 134]</P>
+ <P Name="ZOrder">-7</P>
+ <P Name="ShowName">off</P>
+ <P Name="Outputs">3</P>
+ <P Name="DisplayOption">bar</P>
+ </Block>
+ <Block BlockType="Demux" Name="Demux3" SID="63">
+ <P Name="Ports">[1, 3]</P>
+ <P Name="Position">[1015, 151, 1020, 189]</P>
+ <P Name="ZOrder">-8</P>
+ <P Name="ShowName">off</P>
+ <P Name="Outputs">3</P>
+ <P Name="DisplayOption">bar</P>
+ </Block>
+ <Block BlockType="Derivative" Name="Derivative" SID="25">
+ <P Name="Position">[885, 215, 915, 245]</P>
+ <P Name="ZOrder">-9</P>
+ </Block>
+ <Block BlockType="Reference" Name="Incidence, Sideslip,&#xA;&amp; Airspeed" SID="2">
+ <P Name="Ports">[1, 3]</P>
+ <P Name="Position">[765, 220, 825, 270]</P>
+ <P Name="ZOrder">-10</P>
+ <P Name="LibraryVersion">1.127</P>
+ <P Name="SourceBlock">aerolibasang/Incidence, Sideslip,
+&amp; Airspeed</P>
+ <P Name="SourceType">Incidence,Sideslip,&amp;Airspeed</P>
+ </Block>
+ <Block BlockType="SubSystem" Name="MATLAB Function" SID="20">
+ <P Name="Ports">[12, 2]</P>
+ <P Name="Position">[310, 145, 420, 360]</P>
+ <P Name="ZOrder">-11</P>
+ <P Name="LibraryVersion">1.32</P>
+ <P Name="ErrorFcn">Stateflow.Translate.translate</P>
+ <P Name="PermitHierarchicalResolution">ExplicitOnly</P>
+ <P Name="TreatAsAtomicUnit">on</P>
+ <P Name="MinAlgLoopOccurrences">off</P>
+ <P Name="PropExecContextOutsideSubsystem">off</P>
+ <P Name="RTWSystemCode">Auto</P>
+ <P Name="FunctionWithSeparateData">off</P>
+ <P Name="Opaque">off</P>
+ <P Name="RequestExecContextInheritance">off</P>
+ <P Name="MaskHideContents">off</P>
+ <P Name="SFBlockType">MATLAB Function</P>
+ <Object PropName="MaskObject" ObjectID="21" ClassName="Simulink.Mask">
+ <P Name="SelfModifiable" Class="char">on</P>
+ <P Name="Display" Class="char">bgColor = Simulink.Root.ColorString2Rgb(get_param(gcbh, &apos;BackgroundColor&apos;)); image(imread(&apos;private/eml_membrane_16.png&apos;,&apos;png&apos;,&apos;BackgroundColor&apos;,bgColor(1:3)),&apos;center&apos;); disp([10 10 &apos;Force_Cessna&apos;]);</P>
+ <P Name="IconUnits" Class="char">normalized</P>
+ </Object>
+ <System>
+ <P Name="Location">[227, 345, 838, 789]</P>
+ <P Name="Open">off</P>
+ <P Name="ZoomFactor">100</P>
+ <P Name="SIDHighWatermark">147</P>
+ <Block BlockType="Inport" Name="alpha" SID="20::1">
+ <P Name="Position">[20, 101, 40, 119]</P>
+ <P Name="ZOrder">-1</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="beta" SID="20::18">
+ <P Name="Position">[20, 136, 40, 154]</P>
+ <P Name="ZOrder">-2</P>
+ <P Name="Port">2</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="p" SID="20::19">
+ <P Name="Position">[20, 171, 40, 189]</P>
+ <P Name="ZOrder">-3</P>
+ <P Name="Port">3</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="q" SID="20::20">
+ <P Name="Position">[20, 206, 40, 224]</P>
+ <P Name="ZOrder">-4</P>
+ <P Name="Port">4</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="r" SID="20::21">
+ <P Name="Position">[20, 246, 40, 264]</P>
+ <P Name="ZOrder">-5</P>
+ <P Name="Port">5</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="theta" SID="20::24">
+ <P Name="Position">[20, 281, 40, 299]</P>
+ <P Name="ZOrder">-6</P>
+ <P Name="Port">6</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="V" SID="20::22">
+ <P Name="Position">[20, 316, 40, 334]</P>
+ <P Name="ZOrder">-7</P>
+ <P Name="Port">7</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="alpha_dot" SID="20::27">
+ <P Name="Position">[20, 351, 40, 369]</P>
+ <P Name="ZOrder">-8</P>
+ <P Name="Port">8</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="delta_e" SID="20::36">
+ <P Name="Position">[20, 386, 40, 404]</P>
+ <P Name="ZOrder">-9</P>
+ <P Name="Port">9</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="delta_a" SID="20::37">
+ <P Name="Position">[20, 426, 40, 444]</P>
+ <P Name="ZOrder">-10</P>
+ <P Name="Port">10</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="delta_r" SID="20::38">
+ <P Name="Position">[20, 461, 40, 479]</P>
+ <P Name="ZOrder">-11</P>
+ <P Name="Port">11</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Inport" Name="thrust" SID="20::39">
+ <P Name="Position">[20, 496, 40, 514]</P>
+ <P Name="ZOrder">-12</P>
+ <P Name="Port">12</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Demux" Name=" Demux " SID="20::41">
+ <P Name="Ports">[1, 1]</P>
+ <P Name="Position">[270, 230, 320, 270]</P>
+ <P Name="ZOrder">2</P>
+ <P Name="Outputs">1</P>
+ </Block>
+ <Block BlockType="S-Function" Name=" SFunction " SID="20::40">
+ <P Name="Tag">Stateflow S-Function Cessna_6DOF_trim_ha 2</P>
+ <P Name="Ports">[12, 3]</P>
+ <P Name="Position">[180, 95, 230, 355]</P>
+ <P Name="ZOrder">1</P>
+ <P Name="FunctionName">sf_sfun</P>
+ <P Name="PortCounts">[12 3]</P>
+ <P Name="EnableBusSupport">on</P>
+ <Port>
+ <P Name="PortNumber">2</P>
+ <P Name="Name">F</P>
+ <P Name="RTWStorageClass">Auto</P>
+ <P Name="DataLoggingNameMode">SignalName</P>
+ </Port>
+ <Port>
+ <P Name="PortNumber">3</P>
+ <P Name="Name">M</P>
+ <P Name="RTWStorageClass">Auto</P>
+ <P Name="DataLoggingNameMode">SignalName</P>
+ </Port>
+ </Block>
+ <Block BlockType="Terminator" Name=" Terminator " SID="20::42">
+ <P Name="Position">[460, 241, 480, 259]</P>
+ <P Name="ZOrder">3</P>
+ </Block>
+ <Block BlockType="Outport" Name="F" SID="20::5">
+ <P Name="Position">[460, 101, 480, 119]</P>
+ <P Name="ZOrder">-16</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="M" SID="20::26">
+ <P Name="Position">[460, 136, 480, 154]</P>
+ <P Name="ZOrder">-17</P>
+ <P Name="Port">2</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Line>
+ <P Name="Src">20::1#out:1</P>
+ <P Name="Dst">20::40#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::18#out:1</P>
+ <P Name="Dst">20::40#in:2</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::19#out:1</P>
+ <P Name="Dst">20::40#in:3</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::20#out:1</P>
+ <P Name="Dst">20::40#in:4</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::21#out:1</P>
+ <P Name="Dst">20::40#in:5</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::24#out:1</P>
+ <P Name="Dst">20::40#in:6</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::22#out:1</P>
+ <P Name="Dst">20::40#in:7</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::27#out:1</P>
+ <P Name="Dst">20::40#in:8</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::36#out:1</P>
+ <P Name="Dst">20::40#in:9</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::37#out:1</P>
+ <P Name="Dst">20::40#in:10</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::38#out:1</P>
+ <P Name="Dst">20::40#in:11</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::39#out:1</P>
+ <P Name="Dst">20::40#in:12</P>
+ </Line>
+ <Line>
+ <P Name="Name">F</P>
+ <P Name="Labels">[0, 0]</P>
+ <P Name="Src">20::40#out:2</P>
+ <P Name="Dst">20::5#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Name">M</P>
+ <P Name="Labels">[0, 0]</P>
+ <P Name="Src">20::40#out:3</P>
+ <P Name="Points">[0, -165]</P>
+ <P Name="Dst">20::26#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::41#out:1</P>
+ <P Name="Dst">20::42#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">20::40#out:1</P>
+ <P Name="Dst">20::41#in:1</P>
+ </Line>
+ </System>
+ </Block>
+ <Block BlockType="Sum" Name="Sum" SID="116">
+ <P Name="Ports">[2, 1]</P>
+ <P Name="Position">[975, 300, 995, 320]</P>
+ <P Name="ZOrder">-12</P>
+ <P Name="ShowName">off</P>
+ <P Name="IconShape">round</P>
+ <P Name="Inputs">|+-</P>
+ <P Name="InputSameDT">off</P>
+ <P Name="OutDataTypeStr">Inherit: Inherit via internal rule</P>
+ <P Name="SaturateOnIntegerOverflow">off</P>
+ </Block>
+ <Block BlockType="Terminator" Name="Terminator" SID="43">
+ <P Name="Position">[715, 135, 735, 155]</P>
+ <P Name="ZOrder">-13</P>
+ </Block>
+ <Block BlockType="Terminator" Name="Terminator2" SID="45">
+ <P Name="Position">[715, 210, 735, 230]</P>
+ <P Name="ZOrder">-14</P>
+ </Block>
+ <Block BlockType="Terminator" Name="Terminator3" SID="46">
+ <P Name="Position">[785, 300, 805, 320]</P>
+ <P Name="ZOrder">-15</P>
+ </Block>
+ <Block BlockType="Terminator" Name="Terminator4" SID="47">
+ <P Name="Position">[830, 360, 850, 380]</P>
+ <P Name="ZOrder">-16</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out1" SID="135">
+ <P Name="Position">[1000, 198, 1030, 212]</P>
+ <P Name="ZOrder">-17</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out2" SID="136">
+ <P Name="Position">[1000, 258, 1030, 272]</P>
+ <P Name="ZOrder">-18</P>
+ <P Name="Port">2</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out3" SID="137">
+ <P Name="Position">[1000, 243, 1030, 257]</P>
+ <P Name="ZOrder">-19</P>
+ <P Name="Port">3</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out4" SID="138">
+ <P Name="Position">[1040, 98, 1070, 112]</P>
+ <P Name="ZOrder">-20</P>
+ <P Name="Port">4</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out5" SID="139">
+ <P Name="Position">[1245, 108, 1275, 122]</P>
+ <P Name="ZOrder">-21</P>
+ <P Name="Port">5</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out6" SID="140">
+ <P Name="Position">[1115, 118, 1145, 132]</P>
+ <P Name="ZOrder">-22</P>
+ <P Name="Port">6</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out7" SID="141">
+ <P Name="Position">[1080, 153, 1110, 167]</P>
+ <P Name="ZOrder">-23</P>
+ <P Name="Port">7</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out8" SID="142">
+ <P Name="Position">[1040, 163, 1070, 177]</P>
+ <P Name="ZOrder">-24</P>
+ <P Name="Port">8</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out9" SID="143">
+ <P Name="Position">[1115, 173, 1145, 187]</P>
+ <P Name="ZOrder">-25</P>
+ <P Name="Port">9</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out10" SID="144">
+ <P Name="Position">[885, 398, 915, 412]</P>
+ <P Name="ZOrder">-26</P>
+ <P Name="Port">10</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out11" SID="145">
+ <P Name="Position">[825, 418, 855, 432]</P>
+ <P Name="ZOrder">-27</P>
+ <P Name="Port">11</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out12" SID="146">
+ <P Name="Position">[780, 433, 810, 447]</P>
+ <P Name="ZOrder">-28</P>
+ <P Name="Port">12</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Block BlockType="Outport" Name="Out13" SID="147">
+ <P Name="Position">[1025, 303, 1055, 317]</P>
+ <P Name="ZOrder">-29</P>
+ <P Name="Port">13</P>
+ <P Name="IconDisplay">Port number</P>
+ </Block>
+ <Line>
+ <P Name="Src">148#out:5</P>
+ <P Name="Dst">2#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:6</P>
+ <P Name="Points">[20, 0; 0, 50]</P>
+ <P Name="Dst">12#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">20#out:1</P>
+ <P Name="Points">[25, 0; 0, -15]</P>
+ <P Name="Dst">148#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">2#out:1</P>
+ <P Name="Points">[0, 0]</P>
+ <Branch>
+ <P Name="Points">[0, -115; -495, 0; 0, 12; -166, 0; 0, 43]</P>
+ <P Name="Dst">20#in:1</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[30, 0]</P>
+ <Branch>
+ <P Name="Dst">25#in:1</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 35]</P>
+ <Branch>
+ <P Name="Dst">136#in:1</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 70]</P>
+ <P Name="Dst">116#in:2</P>
+ </Branch>
+ </Branch>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">2#out:2</P>
+ <P Name="Points">[5, 0]</P>
+ <Branch>
+ <P Name="Points">[0, -135; -680, 0; 0, 75]</P>
+ <P Name="Dst">20#in:2</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 5]</P>
+ <P Name="Dst">137#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">12#out:1</P>
+ <P Name="Points">[5, 0; 0, 35; -30, 0; 0, 57]</P>
+ <Branch>
+ <P Name="Points">[-614, 0; 0, -202]</P>
+ <P Name="Dst">20#in:3</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 3]</P>
+ <P Name="Dst">144#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">12#out:2</P>
+ <P Name="Points">[10, 0; 0, 105]</P>
+ <Branch>
+ <P Name="Points">[0, 27; -663, 0; 0, -237]</P>
+ <P Name="Dst">20#in:4</P>
+ </Branch>
+ <Branch>
+ <P Name="Dst">145#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">12#out:3</P>
+ <P Name="Points">[0, 87]</P>
+ <Branch>
+ <P Name="Points">[-632, 0; 0, -187]</P>
+ <P Name="Dst">20#in:5</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 23]</P>
+ <P Name="Dst">146#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">2#out:3</P>
+ <P Name="Points">[15, 0; 0, -50]</P>
+ <Branch>
+ <P Name="Points">[0, -115; -683, 0; 0, 165]</P>
+ <P Name="Dst">20#in:7</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[135, 0; 0, -5]</P>
+ <P Name="Dst">135#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:1</P>
+ <P Name="Dst">43#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:2</P>
+ <P Name="Points">[7, 0; 0, 12; 293, 0; 0, -12]</P>
+ <P Name="Dst">63#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:4</P>
+ <P Name="Dst">45#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:7</P>
+ <P Name="Points">[65, 0; 0, 15]</P>
+ <P Name="Dst">46#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:8</P>
+ <P Name="Points">[13, 0; 0, 50]</P>
+ <P Name="Dst">47#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">148#out:3</P>
+ <P Name="Points">[270, 0; 0, -80]</P>
+ <P Name="Dst">49#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">49#out:2</P>
+ <P Name="Points">[5, 0]</P>
+ <Branch>
+ <P Name="Points">[0, -25; -55, 0]</P>
+ <Branch>
+ <P Name="Points">[-585, 0; 0, 376; -277, 0; 0, -221]</P>
+ <P Name="Dst">20#in:6</P>
+ </Branch>
+ <Branch>
+ <P Name="Points">[0, 220]</P>
+ <P Name="Dst">116#in:1</P>
+ </Branch>
+ </Branch>
+ <Branch>
+ <P Name="Dst">139#in:1</P>
+ </Branch>
+ </Line>
+ <Line>
+ <P Name="Src">49#out:1</P>
+ <P Name="Dst">138#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">49#out:3</P>
+ <P Name="Dst">140#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">63#out:1</P>
+ <P Name="Dst">141#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">63#out:2</P>
+ <P Name="Dst">142#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">63#out:3</P>
+ <P Name="Dst">143#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">20#out:2</P>
+ <P Name="Points">[25, 0; 0, -20]</P>
+ <P Name="Dst">148#in:2</P>
+ </Line>
+ <Line>
+ <P Name="Src">25#out:1</P>
+ <P Name="Points">[10, 0; 0, 160; -836, 0; 0, -115]</P>
+ <P Name="Dst">20#in:8</P>
+ </Line>
+ <Line>
+ <P Name="Src">116#out:1</P>
+ <P Name="Dst">147#in:1</P>
+ </Line>
+ <Line>
+ <P Name="Src">131#out:1</P>
+ <P Name="Dst">20#in:9</P>
+ </Line>
+ <Line>
+ <P Name="Src">132#out:1</P>
+ <P Name="Dst">20#in:10</P>
+ </Line>
+ <Line>
+ <P Name="Src">133#out:1</P>
+ <P Name="Dst">20#in:11</P>
+ </Line>
+ <Line>
+ <P Name="Src">134#out:1</P>
+ <P Name="Dst">20#in:12</P>
+ </Line>
+ </System>
+ </Model>
+ <Stateflow>
+ <machine id="28">
+ <P Name="created">18-Dec-2014 10:58:31</P>
+ <P Name="isLibrary">0</P>
+ <P Name="sfVersion">76014001.001</P>
+ <Children>
+ <target id="48" name="sfun">
+ <P Name="description">Default Simulink S-Function Target.</P>
+ </target>
+ <chart id="29">
+ <P Name="name">MATLAB Function</P>
+ <P Name="windowPosition">[401 52 213 385]</P>
+ <P Name="viewLimits">[0 156.75 0 153.75]</P>
+ <P Name="screen">[1 1 1366 768 1.333333333333333]</P>
+ <P Name="viewObj">29</P>
+ <P Name="visible">1</P>
+ <subviewS>
+ </subviewS>
+ <P Name="ssIdHighWaterMark">27</P>
+ <P Name="decomposition">CLUSTER_CHART</P>
+ <P Name="type">EML_CHART</P>
+ <P Name="chartFileNumber">2</P>
+ <P Name="disableImplicitCasting">1</P>
+ <eml>
+ <P Name="name">Force_Cessna</P>
+ </eml>
+ <Children>
+ <state SSID="1">
+ <P Name="labelString">eML_blk_kernel()</P>
+ <P Name="position">[18 64.5 118 66]</P>
+ <P Name="fontSize">12</P>
+ <P Name="superState">SUBCHART</P>
+ <P Name="subviewer">29</P>
+ <P Name="type">FUNC_STATE</P>
+ <P Name="decomposition">CLUSTER_STATE</P>
+ <eml>
+ <P Name="isEML">1</P>
+ <P Name="script">function [F, M] = Force_Cessna(alpha, beta, p, q, r, theta, V, alpha_dot, delta_e, delta_a, delta_r, thrust)
+
+g = 9.8;
+rho = 1.225;
+
+m = 1043.26;
+C_bar = 1.493;
+b = 10.911;
+S_ref = 16.1651;
+
+C_L_0 = 0.25;
+C_L_alpha = 4.47;
+C_L_q = 1.7;
+C_L_delta_e = 0.3476;
+
+% Ignore all other C_D derivatives excluding C_D_0
+% Use C_D = C_D_0 + k*C_L^2
+
+C_D_0 = 0.036;
+k = 0.3;
+
+C_Y_beta = -0.31;
+C_Y_p = -0.037;
+C_Y_r = 0.21;
+C_Y_delta_a = 0;
+
+C_l_beta = -0.089;
+C_l_p = -0.47;
+C_l_r = 0.096;
+C_l_delta_a = -0.09;
+C_l_delta_r = 0.0147;
+
+C_M_0 = -0.02;
+C_M_alpha = -1.8;
+C_M_alpha_dot = -12.4;
+C_M_delta_e = -1.28;
+
+C_N_beta = 0.065;
+C_N_p = -0.03;
+C_N_r = -0.99;
+C_N_delta_a = -0.0053;
+C_N_delta_r = -0.0657;
+
+C_L = C_L_0 + C_L_alpha*alpha + C_L_q*(q*C_bar/(2*V)) + C_L_delta_e*delta_e;
+C_D = C_D_0 + k*C_L^2;
+C_Y = C_Y_beta*beta + C_Y_p*(p*b/(2*V)) + C_Y_r*(r*b/(2*V)) + C_Y_delta_a*delta_a;
+
+C_l = C_l_beta*beta + C_l_p*(p*b/(2*V)) + C_l_r*(r*b/(2*V)) + C_l_delta_a*delta_a + C_l_delta_r*delta_r;
+C_M = C_M_0 + C_M_alpha*alpha + C_M_alpha_dot*(alpha_dot*C_bar/(2*V)) + C_M_delta_e*delta_e;
+C_N = C_N_beta*beta + C_N_p*(p*b/(2*V)) + C_N_r*(r*b/(2*V)) + C_N_delta_a*delta_a + C_N_delta_r*delta_r;
+
+C_X = -C_D*cos(alpha) + C_L*sin(alpha);
+C_Z = -C_D*sin(alpha) - C_L*cos(alpha);
+
+F = zeros(3,1);
+M = zeros(3,1);
+
+q_bar = 0.5*rho*V*V;
+
+F(1,1) = q_bar*S_ref*C_X - m*g*sin(theta) + thrust;
+F(2,1) = q_bar*S_ref*C_Y;
+F(3,1) = q_bar*S_ref*C_Z + m*g*cos(theta);
+
+M(1,1) = q_bar*b*S_ref*C_l;
+M(2,1) = q_bar*C_bar*S_ref*C_M;
+M(3,1) = q_bar*b*S_ref*C_N;</P>
+ <P Name="editorLayout" Class="double">Matrix(4,1)
+[[10.0]; [5.0]; [700.0]; [500.0]]</P>
+ </eml>
+ </state>
+ <data SSID="4" name="alpha">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="5" name="F">
+ <P Name="scope">OUTPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_NO</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="6" name="beta">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="7" name="p">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="8" name="q">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="9" name="r">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="12" name="theta">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="10" name="V">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="14" name="M">
+ <P Name="scope">OUTPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_NO</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="15" name="alpha_dot">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="24" name="delta_e">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="25" name="delta_a">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="26" name="delta_r">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <data SSID="27" name="thrust">
+ <P Name="scope">INPUT_DATA</P>
+ <props>
+ <array>
+ <P Name="size">-1</P>
+ </array>
+ <type>
+ <P Name="method">SF_INHERITED_TYPE</P>
+ <P Name="primitive">SF_DOUBLE_TYPE</P>
+ <P Name="isSigned">1</P>
+ <P Name="wordLength">16</P>
+ </type>
+ <P Name="complexity">SF_COMPLEX_INHERITED</P>
+ <P Name="frame">SF_FRAME_INHERITED</P>
+ </props>
+ <P Name="dataType">Inherit: Same as Simulink</P>
+ </data>
+ <transition SSID="2">
+ <P Name="labelString">{eML_blk_kernel();}</P>
+ <P Name="labelPosition">[36.125 25.875 102.544 14.964]</P>
+ <P Name="fontSize">12</P>
+ <src>
+ <P Name="intersection">[0 0 1 0 23.5747 14.625 0 0]</P>
+ </src>
+ <dst>
+ <P Name="SSID">3</P>
+ <P Name="intersection">[1 0 -1 0 23.5747 42.5747 0 0]</P>
+ </dst>
+ <P Name="midPoint">[23.5747 24.9468]</P>
+ <P Name="dataLimits">[21.175 25.975 14.625 42.575]</P>
+ <P Name="subviewer">29</P>
+ <P Name="drawStyle">SMART</P>
+ <slide>
+ <P Name="sticky">BOTH_STICK</P>
+ </slide>
+ <P Name="executionOrder">1</P>
+ </transition>
+ <junction SSID="3">
+ <P Name="position">[23.5747 49.5747 7]</P>
+ <P Name="subviewer">29</P>
+ <P Name="type">CONNECTIVE_JUNCTION</P>
+ </junction>
+ </Children>
+ </chart>
+ </Children>
+ </machine>
+ <instance id="47">
+ <P Name="name">MATLAB Function</P>
+ <P Name="machine">28</P>
+ <P Name="chart">29</P>
+ </instance>
+ </Stateflow>
+</ModelInformation>
diff --git a/Prof_Arya/slprj/_jitprj/jitEngineAccessInfo.mat b/Prof_Arya/slprj/_jitprj/jitEngineAccessInfo.mat
new file mode 100644
index 0000000..2e6b0d8
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/jitEngineAccessInfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.l b/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.l
new file mode 100644
index 0000000..a912364
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.l
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.mat b/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.mat
new file mode 100644
index 0000000..72066f3
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sEI9p49izcHUxn63CWpG2IC.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.l b/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.l
new file mode 100644
index 0000000..27def57
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.l
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.mat b/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.mat
new file mode 100644
index 0000000..a01f6bf
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sjLZixcOZskMJeeDfIb93hH.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.l b/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.l
new file mode 100644
index 0000000..27def57
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.l
Binary files differ
diff --git a/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.mat b/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.mat
new file mode 100644
index 0000000..14499df
--- /dev/null
+++ b/Prof_Arya/slprj/_jitprj/sywZUtpLbJvZ7sNRSY4m9bG.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/binfo.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/binfo.mat
new file mode 100644
index 0000000..8c3d4c4
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/binfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_61lDY9MbzCSyk6tMTxmxsG.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_61lDY9MbzCSyk6tMTxmxsG.mat
new file mode 100644
index 0000000..96112df
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_61lDY9MbzCSyk6tMTxmxsG.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_jFM61yZv4AZtAtyV4ewisH.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_jFM61yZv4AZtAtyV4ewisH.mat
new file mode 100644
index 0000000..3e61301
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_jFM61yZv4AZtAtyV4ewisH.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_v045JFXizl4FQXSha8a34C.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_v045JFXizl4FQXSha8a34C.mat
new file mode 100644
index 0000000..cd926a4
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/info/chart1_v045JFXizl4FQXSha8a34C.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.c b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.c
new file mode 100644
index 0000000..cbd0534
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.c
@@ -0,0 +1,2330 @@
+/* Include files */
+
+#include <stddef.h>
+#include "blas.h"
+#include "Cessna_6DOF_sfun.h"
+#include "c1_Cessna_6DOF.h"
+#include "mwmathutil.h"
+#define CHARTINSTANCE_CHARTNUMBER (chartInstance->chartNumber)
+#define CHARTINSTANCE_INSTANCENUMBER (chartInstance->instanceNumber)
+#include "Cessna_6DOF_sfun_debug_macros.h"
+#define _SF_MEX_LISTEN_FOR_CTRL_C(S) sf_mex_listen_for_ctrl_c(sfGlobalDebugInstanceStruct,S);
+
+/* Type Definitions */
+
+/* Named Constants */
+#define CALL_EVENT (-1)
+
+/* Variable Declarations */
+
+/* Variable Definitions */
+static real_T _sfTime_;
+static const char * c1_debug_family_names[55] = { "g", "rho", "m", "C_bar", "b",
+ "S_ref", "C_L_0", "C_L_alpha", "C_L_q", "C_L_delta_e", "C_D_0", "k",
+ "C_Y_beta", "C_Y_p", "C_Y_r", "C_Y_delta_a", "C_l_beta", "C_l_p", "C_l_r",
+ "C_l_delta_a", "C_l_delta_r", "C_M_0", "C_M_alpha", "C_M_alpha_dot",
+ "C_M_delta_e", "C_N_beta", "C_N_p", "C_N_r", "C_N_delta_a", "C_N_delta_r",
+ "delta_e", "delta_a", "delta_r", "thrust", "C_L", "C_D", "C_Y", "C_l", "C_M",
+ "C_N", "C_X", "C_Z", "q_bar", "nargin", "nargout", "V", "alpha", "alpha_dot",
+ "beta", "p", "q", "r", "theta", "F", "M" };
+
+/* Function Declarations */
+static void initialize_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void initialize_params_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void enable_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+static void disable_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+static void c1_update_debugger_state_c1_Cessna_6DOF
+ (SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+static const mxArray *get_sim_state_c1_Cessna_6DOF
+ (SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+static void set_sim_state_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_st);
+static void finalize_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void sf_gateway_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void c1_chartstep_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void initSimStructsc1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance);
+static void init_script_number_translation(uint32_T c1_machineNumber, uint32_T
+ c1_chartNumber, uint32_T c1_instanceNumber);
+static const mxArray *c1_sf_marshallOut(void *chartInstanceVoid, void *c1_inData);
+static void c1_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct *chartInstance,
+ const mxArray *c1_M, const char_T *c1_identifier, real_T c1_y[3]);
+static void c1_b_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct *chartInstance,
+ const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId, real_T c1_y[3]);
+static void c1_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData);
+static const mxArray *c1_b_sf_marshallOut(void *chartInstanceVoid, void
+ *c1_inData);
+static real_T c1_c_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId);
+static void c1_b_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData);
+static void c1_info_helper(const mxArray **c1_info);
+static const mxArray *c1_emlrt_marshallOut(const char * c1_u);
+static const mxArray *c1_b_emlrt_marshallOut(const uint32_T c1_u);
+static real_T c1_mpower(SFc1_Cessna_6DOFInstanceStruct *chartInstance, real_T
+ c1_a);
+static void c1_eml_scalar_eg(SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+static const mxArray *c1_c_sf_marshallOut(void *chartInstanceVoid, void
+ *c1_inData);
+static int32_T c1_d_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId);
+static void c1_c_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData);
+static uint8_T c1_e_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_b_is_active_c1_Cessna_6DOF, const char_T
+ *c1_identifier);
+static uint8_T c1_f_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId);
+static void init_dsm_address_info(SFc1_Cessna_6DOFInstanceStruct *chartInstance);
+
+/* Function Definitions */
+static void initialize_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ chartInstance->c1_sfEvent = CALL_EVENT;
+ _sfTime_ = sf_get_time(chartInstance->S);
+ chartInstance->c1_is_active_c1_Cessna_6DOF = 0U;
+}
+
+static void initialize_params_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ (void)chartInstance;
+}
+
+static void enable_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ _sfTime_ = sf_get_time(chartInstance->S);
+}
+
+static void disable_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ _sfTime_ = sf_get_time(chartInstance->S);
+}
+
+static void c1_update_debugger_state_c1_Cessna_6DOF
+ (SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ (void)chartInstance;
+}
+
+static const mxArray *get_sim_state_c1_Cessna_6DOF
+ (SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ const mxArray *c1_st;
+ const mxArray *c1_y = NULL;
+ int32_T c1_i0;
+ real_T c1_u[3];
+ const mxArray *c1_b_y = NULL;
+ int32_T c1_i1;
+ real_T c1_b_u[3];
+ const mxArray *c1_c_y = NULL;
+ uint8_T c1_hoistedGlobal;
+ uint8_T c1_c_u;
+ const mxArray *c1_d_y = NULL;
+ real_T (*c1_M)[3];
+ real_T (*c1_F)[3];
+ c1_M = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
+ c1_F = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
+ c1_st = NULL;
+ c1_st = NULL;
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_createcellmatrix(3, 1), false);
+ for (c1_i0 = 0; c1_i0 < 3; c1_i0++) {
+ c1_u[c1_i0] = (*c1_F)[c1_i0];
+ }
+
+ c1_b_y = NULL;
+ sf_mex_assign(&c1_b_y, sf_mex_create("y", c1_u, 0, 0U, 1U, 0U, 1, 3), false);
+ sf_mex_setcell(c1_y, 0, c1_b_y);
+ for (c1_i1 = 0; c1_i1 < 3; c1_i1++) {
+ c1_b_u[c1_i1] = (*c1_M)[c1_i1];
+ }
+
+ c1_c_y = NULL;
+ sf_mex_assign(&c1_c_y, sf_mex_create("y", c1_b_u, 0, 0U, 1U, 0U, 1, 3), false);
+ sf_mex_setcell(c1_y, 1, c1_c_y);
+ c1_hoistedGlobal = chartInstance->c1_is_active_c1_Cessna_6DOF;
+ c1_c_u = c1_hoistedGlobal;
+ c1_d_y = NULL;
+ sf_mex_assign(&c1_d_y, sf_mex_create("y", &c1_c_u, 3, 0U, 0U, 0U, 0), false);
+ sf_mex_setcell(c1_y, 2, c1_d_y);
+ sf_mex_assign(&c1_st, c1_y, false);
+ return c1_st;
+}
+
+static void set_sim_state_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_st)
+{
+ const mxArray *c1_u;
+ real_T c1_dv0[3];
+ int32_T c1_i2;
+ real_T c1_dv1[3];
+ int32_T c1_i3;
+ real_T (*c1_F)[3];
+ real_T (*c1_M)[3];
+ c1_M = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
+ c1_F = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
+ chartInstance->c1_doneDoubleBufferReInit = true;
+ c1_u = sf_mex_dup(c1_st);
+ c1_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c1_u, 0)), "F",
+ c1_dv0);
+ for (c1_i2 = 0; c1_i2 < 3; c1_i2++) {
+ (*c1_F)[c1_i2] = c1_dv0[c1_i2];
+ }
+
+ c1_emlrt_marshallIn(chartInstance, sf_mex_dup(sf_mex_getcell(c1_u, 1)), "M",
+ c1_dv1);
+ for (c1_i3 = 0; c1_i3 < 3; c1_i3++) {
+ (*c1_M)[c1_i3] = c1_dv1[c1_i3];
+ }
+
+ chartInstance->c1_is_active_c1_Cessna_6DOF = c1_e_emlrt_marshallIn
+ (chartInstance, sf_mex_dup(sf_mex_getcell(c1_u, 2)),
+ "is_active_c1_Cessna_6DOF");
+ sf_mex_destroy(&c1_u);
+ c1_update_debugger_state_c1_Cessna_6DOF(chartInstance);
+ sf_mex_destroy(&c1_st);
+}
+
+static void finalize_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ (void)chartInstance;
+}
+
+static void sf_gateway_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ int32_T c1_i4;
+ int32_T c1_i5;
+ real_T *c1_V;
+ real_T *c1_alpha;
+ real_T *c1_alpha_dot;
+ real_T *c1_beta;
+ real_T *c1_p;
+ real_T *c1_q;
+ real_T *c1_r;
+ real_T *c1_theta;
+ real_T (*c1_M)[3];
+ real_T (*c1_F)[3];
+ c1_M = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
+ c1_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
+ c1_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 6);
+ c1_q = (real_T *)ssGetInputPortSignal(chartInstance->S, 5);
+ c1_p = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
+ c1_beta = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
+ c1_alpha_dot = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
+ c1_alpha = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
+ c1_F = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
+ c1_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
+ _SFD_SYMBOL_SCOPE_PUSH(0U, 0U);
+ _sfTime_ = sf_get_time(chartInstance->S);
+ _SFD_CC_CALL(CHART_ENTER_SFUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
+ _SFD_DATA_RANGE_CHECK(*c1_V, 0U);
+ chartInstance->c1_sfEvent = CALL_EVENT;
+ c1_chartstep_c1_Cessna_6DOF(chartInstance);
+ _SFD_SYMBOL_SCOPE_POP();
+ _SFD_CHECK_FOR_STATE_INCONSISTENCY(_Cessna_6DOFMachineNumber_,
+ chartInstance->chartNumber, chartInstance->instanceNumber);
+ for (c1_i4 = 0; c1_i4 < 3; c1_i4++) {
+ _SFD_DATA_RANGE_CHECK((*c1_F)[c1_i4], 1U);
+ }
+
+ _SFD_DATA_RANGE_CHECK(*c1_alpha, 2U);
+ _SFD_DATA_RANGE_CHECK(*c1_alpha_dot, 3U);
+ _SFD_DATA_RANGE_CHECK(*c1_beta, 4U);
+ _SFD_DATA_RANGE_CHECK(*c1_p, 5U);
+ _SFD_DATA_RANGE_CHECK(*c1_q, 6U);
+ _SFD_DATA_RANGE_CHECK(*c1_r, 7U);
+ _SFD_DATA_RANGE_CHECK(*c1_theta, 8U);
+ for (c1_i5 = 0; c1_i5 < 3; c1_i5++) {
+ _SFD_DATA_RANGE_CHECK((*c1_M)[c1_i5], 9U);
+ }
+}
+
+static void c1_chartstep_c1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ real_T c1_hoistedGlobal;
+ real_T c1_b_hoistedGlobal;
+ real_T c1_c_hoistedGlobal;
+ real_T c1_d_hoistedGlobal;
+ real_T c1_e_hoistedGlobal;
+ real_T c1_f_hoistedGlobal;
+ real_T c1_g_hoistedGlobal;
+ real_T c1_h_hoistedGlobal;
+ real_T c1_V;
+ real_T c1_alpha;
+ real_T c1_alpha_dot;
+ real_T c1_beta;
+ real_T c1_p;
+ real_T c1_q;
+ real_T c1_r;
+ real_T c1_theta;
+ uint32_T c1_debug_family_var_map[55];
+ real_T c1_g;
+ real_T c1_rho;
+ real_T c1_m;
+ real_T c1_C_bar;
+ real_T c1_b;
+ real_T c1_S_ref;
+ real_T c1_C_L_0;
+ real_T c1_C_L_alpha;
+ real_T c1_C_L_q;
+ real_T c1_C_L_delta_e;
+ real_T c1_C_D_0;
+ real_T c1_k;
+ real_T c1_C_Y_beta;
+ real_T c1_C_Y_p;
+ real_T c1_C_Y_r;
+ real_T c1_C_Y_delta_a;
+ real_T c1_C_l_beta;
+ real_T c1_C_l_p;
+ real_T c1_C_l_r;
+ real_T c1_C_l_delta_a;
+ real_T c1_C_l_delta_r;
+ real_T c1_C_M_0;
+ real_T c1_C_M_alpha;
+ real_T c1_C_M_alpha_dot;
+ real_T c1_C_M_delta_e;
+ real_T c1_C_N_beta;
+ real_T c1_C_N_p;
+ real_T c1_C_N_r;
+ real_T c1_C_N_delta_a;
+ real_T c1_C_N_delta_r;
+ real_T c1_delta_e;
+ real_T c1_delta_a;
+ real_T c1_delta_r;
+ real_T c1_thrust;
+ real_T c1_C_L;
+ real_T c1_C_D;
+ real_T c1_C_Y;
+ real_T c1_C_l;
+ real_T c1_C_M;
+ real_T c1_C_N;
+ real_T c1_C_X;
+ real_T c1_C_Z;
+ real_T c1_q_bar;
+ real_T c1_nargin = 8.0;
+ real_T c1_nargout = 2.0;
+ real_T c1_F[3];
+ real_T c1_M[3];
+ real_T c1_A;
+ real_T c1_B;
+ real_T c1_x;
+ real_T c1_y;
+ real_T c1_b_x;
+ real_T c1_b_y;
+ real_T c1_c_x;
+ real_T c1_c_y;
+ real_T c1_d_y;
+ real_T c1_b_A;
+ real_T c1_b_B;
+ real_T c1_d_x;
+ real_T c1_e_y;
+ real_T c1_e_x;
+ real_T c1_f_y;
+ real_T c1_f_x;
+ real_T c1_g_y;
+ real_T c1_h_y;
+ real_T c1_c_A;
+ real_T c1_c_B;
+ real_T c1_g_x;
+ real_T c1_i_y;
+ real_T c1_h_x;
+ real_T c1_j_y;
+ real_T c1_i_x;
+ real_T c1_k_y;
+ real_T c1_l_y;
+ real_T c1_d_A;
+ real_T c1_d_B;
+ real_T c1_j_x;
+ real_T c1_m_y;
+ real_T c1_k_x;
+ real_T c1_n_y;
+ real_T c1_l_x;
+ real_T c1_o_y;
+ real_T c1_p_y;
+ real_T c1_e_A;
+ real_T c1_e_B;
+ real_T c1_m_x;
+ real_T c1_q_y;
+ real_T c1_n_x;
+ real_T c1_r_y;
+ real_T c1_o_x;
+ real_T c1_s_y;
+ real_T c1_t_y;
+ real_T c1_f_A;
+ real_T c1_f_B;
+ real_T c1_p_x;
+ real_T c1_u_y;
+ real_T c1_q_x;
+ real_T c1_v_y;
+ real_T c1_r_x;
+ real_T c1_w_y;
+ real_T c1_x_y;
+ real_T c1_g_A;
+ real_T c1_g_B;
+ real_T c1_s_x;
+ real_T c1_y_y;
+ real_T c1_t_x;
+ real_T c1_ab_y;
+ real_T c1_u_x;
+ real_T c1_bb_y;
+ real_T c1_cb_y;
+ real_T c1_h_A;
+ real_T c1_h_B;
+ real_T c1_v_x;
+ real_T c1_db_y;
+ real_T c1_w_x;
+ real_T c1_eb_y;
+ real_T c1_x_x;
+ real_T c1_fb_y;
+ real_T c1_gb_y;
+ real_T c1_y_x;
+ real_T c1_ab_x;
+ real_T c1_bb_x;
+ real_T c1_cb_x;
+ real_T c1_db_x;
+ real_T c1_eb_x;
+ real_T c1_fb_x;
+ real_T c1_gb_x;
+ int32_T c1_i6;
+ int32_T c1_i7;
+ real_T c1_hb_x;
+ real_T c1_ib_x;
+ real_T c1_jb_x;
+ real_T c1_kb_x;
+ int32_T c1_i8;
+ int32_T c1_i9;
+ real_T *c1_b_theta;
+ real_T *c1_b_r;
+ real_T *c1_b_q;
+ real_T *c1_b_p;
+ real_T *c1_b_beta;
+ real_T *c1_b_alpha_dot;
+ real_T *c1_b_alpha;
+ real_T *c1_b_V;
+ real_T (*c1_b_F)[3];
+ real_T (*c1_b_M)[3];
+ c1_b_M = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
+ c1_b_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
+ c1_b_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 6);
+ c1_b_q = (real_T *)ssGetInputPortSignal(chartInstance->S, 5);
+ c1_b_p = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
+ c1_b_beta = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
+ c1_b_alpha_dot = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
+ c1_b_alpha = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
+ c1_b_F = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
+ c1_b_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
+ _SFD_CC_CALL(CHART_ENTER_DURING_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
+ c1_hoistedGlobal = *c1_b_V;
+ c1_b_hoistedGlobal = *c1_b_alpha;
+ c1_c_hoistedGlobal = *c1_b_alpha_dot;
+ c1_d_hoistedGlobal = *c1_b_beta;
+ c1_e_hoistedGlobal = *c1_b_p;
+ c1_f_hoistedGlobal = *c1_b_q;
+ c1_g_hoistedGlobal = *c1_b_r;
+ c1_h_hoistedGlobal = *c1_b_theta;
+ c1_V = c1_hoistedGlobal;
+ c1_alpha = c1_b_hoistedGlobal;
+ c1_alpha_dot = c1_c_hoistedGlobal;
+ c1_beta = c1_d_hoistedGlobal;
+ c1_p = c1_e_hoistedGlobal;
+ c1_q = c1_f_hoistedGlobal;
+ c1_r = c1_g_hoistedGlobal;
+ c1_theta = c1_h_hoistedGlobal;
+ _SFD_SYMBOL_SCOPE_PUSH_EML(0U, 55U, 55U, c1_debug_family_names,
+ c1_debug_family_var_map);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_g, 0U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_rho, 1U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_m, 2U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_bar, 3U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_b, 4U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_S_ref, 5U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_L_0, 6U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_L_alpha, 7U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_L_q, 8U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_L_delta_e, 9U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_D_0, 10U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_k, 11U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_Y_beta, 12U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_Y_p, 13U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_Y_r, 14U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_Y_delta_a, 15U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_l_beta, 16U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_l_p, 17U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_l_r, 18U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_l_delta_a, 19U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_l_delta_r, 20U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_M_0, 21U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_M_alpha, 22U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_M_alpha_dot, 23U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_M_delta_e, 24U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_N_beta, 25U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_N_p, 26U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_N_r, 27U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_N_delta_a, 28U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_C_N_delta_r, 29U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_delta_e, 30U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_delta_a, 31U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_delta_r, 32U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_thrust, 33U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_L, 34U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_D, 35U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_Y, 36U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_l, 37U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_M, 38U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_N, 39U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_X, 40U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_C_Z, 41U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_q_bar, 42U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargin, 43U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(&c1_nargout, 44U, c1_b_sf_marshallOut,
+ c1_b_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_V, 45U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_alpha, 46U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_alpha_dot, 47U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_beta, 48U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_p, 49U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_q, 50U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_r, 51U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML(&c1_theta, 52U, c1_b_sf_marshallOut);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c1_F, 53U, c1_sf_marshallOut,
+ c1_sf_marshallIn);
+ _SFD_SYMBOL_SCOPE_ADD_EML_IMPORTABLE(c1_M, 54U, c1_sf_marshallOut,
+ c1_sf_marshallIn);
+ CV_EML_FCN(0, 0);
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 3);
+ c1_g = 9.8;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 4);
+ c1_rho = 1.225;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 6);
+ c1_m = 1043.26;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 7);
+ c1_C_bar = 1.493;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 8);
+ c1_b = 10.911;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 9);
+ c1_S_ref = 16.1651;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 11);
+ c1_C_L_0 = 0.25;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 12);
+ c1_C_L_alpha = 4.47;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 13);
+ c1_C_L_q = 1.7;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 14);
+ c1_C_L_delta_e = 0.3476;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 19);
+ c1_C_D_0 = 0.036;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 20);
+ c1_k = 0.3;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 22);
+ c1_C_Y_beta = -0.31;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 23);
+ c1_C_Y_p = -0.037;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 24);
+ c1_C_Y_r = 0.21;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 25);
+ c1_C_Y_delta_a = 0.0;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 27);
+ c1_C_l_beta = -0.089;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 28);
+ c1_C_l_p = -0.47;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 29);
+ c1_C_l_r = 0.096;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 30);
+ c1_C_l_delta_a = -0.09;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 31);
+ c1_C_l_delta_r = 0.0147;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 33);
+ c1_C_M_0 = -0.02;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 34);
+ c1_C_M_alpha = -1.8;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 35);
+ c1_C_M_alpha_dot = -12.4;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 36);
+ c1_C_M_delta_e = -1.28;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 38);
+ c1_C_N_beta = 0.065;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 39);
+ c1_C_N_p = -0.03;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 40);
+ c1_C_N_r = -0.99;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 41);
+ c1_C_N_delta_a = -0.0053;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 42);
+ c1_C_N_delta_r = -0.0657;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 46);
+ c1_delta_e = 0.0338;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 47);
+ c1_delta_a = 0.0;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 48);
+ c1_delta_r = 0.0;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 49);
+ c1_thrust = 4219.6;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 51);
+ c1_A = c1_q * 1.493;
+ c1_B = 2.0 * c1_V;
+ c1_x = c1_A;
+ c1_y = c1_B;
+ c1_b_x = c1_x;
+ c1_b_y = c1_y;
+ c1_c_x = c1_b_x;
+ c1_c_y = c1_b_y;
+ c1_d_y = c1_c_x / c1_c_y;
+ c1_C_L = ((c1_C_L_0 + 4.47 * c1_alpha) + 1.7 * c1_d_y) + 0.01174888;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 52);
+ c1_C_D = c1_C_D_0 + 0.3 * c1_mpower(chartInstance, c1_C_L);
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 53);
+ c1_b_A = c1_p * 10.911;
+ c1_b_B = 2.0 * c1_V;
+ c1_d_x = c1_b_A;
+ c1_e_y = c1_b_B;
+ c1_e_x = c1_d_x;
+ c1_f_y = c1_e_y;
+ c1_f_x = c1_e_x;
+ c1_g_y = c1_f_y;
+ c1_h_y = c1_f_x / c1_g_y;
+ c1_c_A = c1_r * 10.911;
+ c1_c_B = 2.0 * c1_V;
+ c1_g_x = c1_c_A;
+ c1_i_y = c1_c_B;
+ c1_h_x = c1_g_x;
+ c1_j_y = c1_i_y;
+ c1_i_x = c1_h_x;
+ c1_k_y = c1_j_y;
+ c1_l_y = c1_i_x / c1_k_y;
+ c1_C_Y = (-0.31 * c1_beta + -0.037 * c1_h_y) + 0.21 * c1_l_y;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 55);
+ c1_d_A = c1_p * 10.911;
+ c1_d_B = 2.0 * c1_V;
+ c1_j_x = c1_d_A;
+ c1_m_y = c1_d_B;
+ c1_k_x = c1_j_x;
+ c1_n_y = c1_m_y;
+ c1_l_x = c1_k_x;
+ c1_o_y = c1_n_y;
+ c1_p_y = c1_l_x / c1_o_y;
+ c1_e_A = c1_r * 10.911;
+ c1_e_B = 2.0 * c1_V;
+ c1_m_x = c1_e_A;
+ c1_q_y = c1_e_B;
+ c1_n_x = c1_m_x;
+ c1_r_y = c1_q_y;
+ c1_o_x = c1_n_x;
+ c1_s_y = c1_r_y;
+ c1_t_y = c1_o_x / c1_s_y;
+ c1_C_l = (-0.089 * c1_beta + -0.47 * c1_p_y) + 0.096 * c1_t_y;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 56);
+ c1_f_A = c1_alpha_dot * 1.493;
+ c1_f_B = 2.0 * c1_V;
+ c1_p_x = c1_f_A;
+ c1_u_y = c1_f_B;
+ c1_q_x = c1_p_x;
+ c1_v_y = c1_u_y;
+ c1_r_x = c1_q_x;
+ c1_w_y = c1_v_y;
+ c1_x_y = c1_r_x / c1_w_y;
+ c1_C_M = ((c1_C_M_0 + -1.8 * c1_alpha) + -12.4 * c1_x_y) + -0.043264;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 57);
+ c1_g_A = c1_p * 10.911;
+ c1_g_B = 2.0 * c1_V;
+ c1_s_x = c1_g_A;
+ c1_y_y = c1_g_B;
+ c1_t_x = c1_s_x;
+ c1_ab_y = c1_y_y;
+ c1_u_x = c1_t_x;
+ c1_bb_y = c1_ab_y;
+ c1_cb_y = c1_u_x / c1_bb_y;
+ c1_h_A = c1_r * 10.911;
+ c1_h_B = 2.0 * c1_V;
+ c1_v_x = c1_h_A;
+ c1_db_y = c1_h_B;
+ c1_w_x = c1_v_x;
+ c1_eb_y = c1_db_y;
+ c1_x_x = c1_w_x;
+ c1_fb_y = c1_eb_y;
+ c1_gb_y = c1_x_x / c1_fb_y;
+ c1_C_N = (0.065 * c1_beta + -0.03 * c1_cb_y) + -0.99 * c1_gb_y;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 59);
+ c1_y_x = c1_alpha;
+ c1_ab_x = c1_y_x;
+ c1_ab_x = muDoubleScalarCos(c1_ab_x);
+ c1_bb_x = c1_alpha;
+ c1_cb_x = c1_bb_x;
+ c1_cb_x = muDoubleScalarSin(c1_cb_x);
+ c1_C_X = -c1_C_D * c1_ab_x + c1_C_L * c1_cb_x;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 60);
+ c1_db_x = c1_alpha;
+ c1_eb_x = c1_db_x;
+ c1_eb_x = muDoubleScalarSin(c1_eb_x);
+ c1_fb_x = c1_alpha;
+ c1_gb_x = c1_fb_x;
+ c1_gb_x = muDoubleScalarCos(c1_gb_x);
+ c1_C_Z = -c1_C_D * c1_eb_x - c1_C_L * c1_gb_x;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 62);
+ for (c1_i6 = 0; c1_i6 < 3; c1_i6++) {
+ c1_F[c1_i6] = 0.0;
+ }
+
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 63);
+ for (c1_i7 = 0; c1_i7 < 3; c1_i7++) {
+ c1_M[c1_i7] = 0.0;
+ }
+
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 65);
+ c1_q_bar = 0.6125 * c1_V * c1_V;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 67);
+ c1_hb_x = c1_theta;
+ c1_ib_x = c1_hb_x;
+ c1_ib_x = muDoubleScalarSin(c1_ib_x);
+ c1_F[0] = (c1_q_bar * 16.1651 * c1_C_X - 10223.948 * c1_ib_x) + c1_thrust;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 68);
+ c1_F[1] = c1_q_bar * 16.1651 * c1_C_Y;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 69);
+ c1_jb_x = c1_theta;
+ c1_kb_x = c1_jb_x;
+ c1_kb_x = muDoubleScalarCos(c1_kb_x);
+ c1_F[2] = c1_q_bar * 16.1651 * c1_C_Z + 10223.948 * c1_kb_x;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 71);
+ c1_M[0] = c1_q_bar * 10.911 * 16.1651 * c1_C_l;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 72);
+ c1_M[1] = c1_q_bar * 1.493 * 16.1651 * c1_C_M;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, 73);
+ c1_M[2] = c1_q_bar * 10.911 * 16.1651 * c1_C_N;
+ _SFD_EML_CALL(0U, chartInstance->c1_sfEvent, -73);
+ _SFD_SYMBOL_SCOPE_POP();
+ for (c1_i8 = 0; c1_i8 < 3; c1_i8++) {
+ (*c1_b_F)[c1_i8] = c1_F[c1_i8];
+ }
+
+ for (c1_i9 = 0; c1_i9 < 3; c1_i9++) {
+ (*c1_b_M)[c1_i9] = c1_M[c1_i9];
+ }
+
+ _SFD_CC_CALL(EXIT_OUT_OF_FUNCTION_TAG, 0U, chartInstance->c1_sfEvent);
+}
+
+static void initSimStructsc1_Cessna_6DOF(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance)
+{
+ (void)chartInstance;
+}
+
+static void init_script_number_translation(uint32_T c1_machineNumber, uint32_T
+ c1_chartNumber, uint32_T c1_instanceNumber)
+{
+ (void)c1_machineNumber;
+ (void)c1_chartNumber;
+ (void)c1_instanceNumber;
+}
+
+static const mxArray *c1_sf_marshallOut(void *chartInstanceVoid, void *c1_inData)
+{
+ const mxArray *c1_mxArrayOutData = NULL;
+ int32_T c1_i10;
+ real_T c1_b_inData[3];
+ int32_T c1_i11;
+ real_T c1_u[3];
+ const mxArray *c1_y = NULL;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_mxArrayOutData = NULL;
+ for (c1_i10 = 0; c1_i10 < 3; c1_i10++) {
+ c1_b_inData[c1_i10] = (*(real_T (*)[3])c1_inData)[c1_i10];
+ }
+
+ for (c1_i11 = 0; c1_i11 < 3; c1_i11++) {
+ c1_u[c1_i11] = c1_b_inData[c1_i11];
+ }
+
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_create("y", c1_u, 0, 0U, 1U, 0U, 1, 3), false);
+ sf_mex_assign(&c1_mxArrayOutData, c1_y, false);
+ return c1_mxArrayOutData;
+}
+
+static void c1_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct *chartInstance,
+ const mxArray *c1_M, const char_T *c1_identifier, real_T c1_y[3])
+{
+ emlrtMsgIdentifier c1_thisId;
+ c1_thisId.fIdentifier = c1_identifier;
+ c1_thisId.fParent = NULL;
+ c1_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c1_M), &c1_thisId, c1_y);
+ sf_mex_destroy(&c1_M);
+}
+
+static void c1_b_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct *chartInstance,
+ const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId, real_T c1_y[3])
+{
+ real_T c1_dv2[3];
+ int32_T c1_i12;
+ (void)chartInstance;
+ sf_mex_import(c1_parentId, sf_mex_dup(c1_u), c1_dv2, 1, 0, 0U, 1, 0U, 1, 3);
+ for (c1_i12 = 0; c1_i12 < 3; c1_i12++) {
+ c1_y[c1_i12] = c1_dv2[c1_i12];
+ }
+
+ sf_mex_destroy(&c1_u);
+}
+
+static void c1_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData)
+{
+ const mxArray *c1_M;
+ const char_T *c1_identifier;
+ emlrtMsgIdentifier c1_thisId;
+ real_T c1_y[3];
+ int32_T c1_i13;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_M = sf_mex_dup(c1_mxArrayInData);
+ c1_identifier = c1_varName;
+ c1_thisId.fIdentifier = c1_identifier;
+ c1_thisId.fParent = NULL;
+ c1_b_emlrt_marshallIn(chartInstance, sf_mex_dup(c1_M), &c1_thisId, c1_y);
+ sf_mex_destroy(&c1_M);
+ for (c1_i13 = 0; c1_i13 < 3; c1_i13++) {
+ (*(real_T (*)[3])c1_outData)[c1_i13] = c1_y[c1_i13];
+ }
+
+ sf_mex_destroy(&c1_mxArrayInData);
+}
+
+static const mxArray *c1_b_sf_marshallOut(void *chartInstanceVoid, void
+ *c1_inData)
+{
+ const mxArray *c1_mxArrayOutData = NULL;
+ real_T c1_u;
+ const mxArray *c1_y = NULL;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_mxArrayOutData = NULL;
+ c1_u = *(real_T *)c1_inData;
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_create("y", &c1_u, 0, 0U, 0U, 0U, 0), false);
+ sf_mex_assign(&c1_mxArrayOutData, c1_y, false);
+ return c1_mxArrayOutData;
+}
+
+static real_T c1_c_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId)
+{
+ real_T c1_y;
+ real_T c1_d0;
+ (void)chartInstance;
+ sf_mex_import(c1_parentId, sf_mex_dup(c1_u), &c1_d0, 1, 0, 0U, 0, 0U, 0);
+ c1_y = c1_d0;
+ sf_mex_destroy(&c1_u);
+ return c1_y;
+}
+
+static void c1_b_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData)
+{
+ const mxArray *c1_nargout;
+ const char_T *c1_identifier;
+ emlrtMsgIdentifier c1_thisId;
+ real_T c1_y;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_nargout = sf_mex_dup(c1_mxArrayInData);
+ c1_identifier = c1_varName;
+ c1_thisId.fIdentifier = c1_identifier;
+ c1_thisId.fParent = NULL;
+ c1_y = c1_c_emlrt_marshallIn(chartInstance, sf_mex_dup(c1_nargout), &c1_thisId);
+ sf_mex_destroy(&c1_nargout);
+ *(real_T *)c1_outData = c1_y;
+ sf_mex_destroy(&c1_mxArrayInData);
+}
+
+const mxArray *sf_c1_Cessna_6DOF_get_eml_resolved_functions_info(void)
+{
+ const mxArray *c1_nameCaptureInfo = NULL;
+ c1_nameCaptureInfo = NULL;
+ sf_mex_assign(&c1_nameCaptureInfo, sf_mex_createstruct("structure", 2, 24, 1),
+ false);
+ c1_info_helper(&c1_nameCaptureInfo);
+ sf_mex_emlrtNameCapturePostProcessR2012a(&c1_nameCaptureInfo);
+ return c1_nameCaptureInfo;
+}
+
+static void c1_info_helper(const mxArray **c1_info)
+{
+ const mxArray *c1_rhs0 = NULL;
+ const mxArray *c1_lhs0 = NULL;
+ const mxArray *c1_rhs1 = NULL;
+ const mxArray *c1_lhs1 = NULL;
+ const mxArray *c1_rhs2 = NULL;
+ const mxArray *c1_lhs2 = NULL;
+ const mxArray *c1_rhs3 = NULL;
+ const mxArray *c1_lhs3 = NULL;
+ const mxArray *c1_rhs4 = NULL;
+ const mxArray *c1_lhs4 = NULL;
+ const mxArray *c1_rhs5 = NULL;
+ const mxArray *c1_lhs5 = NULL;
+ const mxArray *c1_rhs6 = NULL;
+ const mxArray *c1_lhs6 = NULL;
+ const mxArray *c1_rhs7 = NULL;
+ const mxArray *c1_lhs7 = NULL;
+ const mxArray *c1_rhs8 = NULL;
+ const mxArray *c1_lhs8 = NULL;
+ const mxArray *c1_rhs9 = NULL;
+ const mxArray *c1_lhs9 = NULL;
+ const mxArray *c1_rhs10 = NULL;
+ const mxArray *c1_lhs10 = NULL;
+ const mxArray *c1_rhs11 = NULL;
+ const mxArray *c1_lhs11 = NULL;
+ const mxArray *c1_rhs12 = NULL;
+ const mxArray *c1_lhs12 = NULL;
+ const mxArray *c1_rhs13 = NULL;
+ const mxArray *c1_lhs13 = NULL;
+ const mxArray *c1_rhs14 = NULL;
+ const mxArray *c1_lhs14 = NULL;
+ const mxArray *c1_rhs15 = NULL;
+ const mxArray *c1_lhs15 = NULL;
+ const mxArray *c1_rhs16 = NULL;
+ const mxArray *c1_lhs16 = NULL;
+ const mxArray *c1_rhs17 = NULL;
+ const mxArray *c1_lhs17 = NULL;
+ const mxArray *c1_rhs18 = NULL;
+ const mxArray *c1_lhs18 = NULL;
+ const mxArray *c1_rhs19 = NULL;
+ const mxArray *c1_lhs19 = NULL;
+ const mxArray *c1_rhs20 = NULL;
+ const mxArray *c1_lhs20 = NULL;
+ const mxArray *c1_rhs21 = NULL;
+ const mxArray *c1_lhs21 = NULL;
+ const mxArray *c1_rhs22 = NULL;
+ const mxArray *c1_lhs22 = NULL;
+ const mxArray *c1_rhs23 = NULL;
+ const mxArray *c1_lhs23 = NULL;
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(""), "context", "context", 0);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("mrdivide"), "name", "name", 0);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 0);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"), "resolved",
+ "resolved", 0);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1388463696U), "fileTimeLo",
+ "fileTimeLo", 0);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 0);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1370017086U), "mFileTimeLo",
+ "mFileTimeLo", 0);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 0);
+ sf_mex_assign(&c1_rhs0, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs0, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs0), "rhs", "rhs", 0);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs0), "lhs", "lhs", 0);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"), "context",
+ "context", 1);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("coder.internal.assert"),
+ "name", "name", 1);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("char"), "dominantType",
+ "dominantType", 1);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/shared/coder/coder/+coder/+internal/assert.m"),
+ "resolved", "resolved", 1);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363718156U), "fileTimeLo",
+ "fileTimeLo", 1);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 1);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 1);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 1);
+ sf_mex_assign(&c1_rhs1, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs1, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs1), "rhs", "rhs", 1);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs1), "lhs", "lhs", 1);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mrdivide.p"), "context",
+ "context", 2);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("rdivide"), "name", "name", 2);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 2);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"), "resolved",
+ "resolved", 2);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363717480U), "fileTimeLo",
+ "fileTimeLo", 2);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 2);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 2);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 2);
+ sf_mex_assign(&c1_rhs2, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs2, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs2), "rhs", "rhs", 2);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs2), "lhs", "lhs", 2);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"), "context",
+ "context", 3);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "coder.internal.isBuiltInNumeric"), "name", "name", 3);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 3);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/shared/coder/coder/+coder/+internal/isBuiltInNumeric.m"),
+ "resolved", "resolved", 3);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363718156U), "fileTimeLo",
+ "fileTimeLo", 3);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 3);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 3);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 3);
+ sf_mex_assign(&c1_rhs3, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs3, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs3), "rhs", "rhs", 3);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs3), "lhs", "lhs", 3);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"), "context",
+ "context", 4);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalexp_compatible"),
+ "name", "name", 4);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 4);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_compatible.m"),
+ "resolved", "resolved", 4);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1286825996U), "fileTimeLo",
+ "fileTimeLo", 4);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 4);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 4);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 4);
+ sf_mex_assign(&c1_rhs4, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs4, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs4), "rhs", "rhs", 4);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs4), "lhs", "lhs", 4);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/rdivide.m"), "context",
+ "context", 5);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_div"), "name", "name", 5);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 5);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"), "resolved",
+ "resolved", 5);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1375987888U), "fileTimeLo",
+ "fileTimeLo", 5);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 5);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 5);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 5);
+ sf_mex_assign(&c1_rhs5, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs5, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs5), "rhs", "rhs", 5);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs5), "lhs", "lhs", 5);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_div.m"), "context",
+ "context", 6);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("coder.internal.div"), "name",
+ "name", 6);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 6);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/coder/coder/+coder/+internal/div.p"), "resolved",
+ "resolved", 6);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1389311520U), "fileTimeLo",
+ "fileTimeLo", 6);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 6);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 6);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 6);
+ sf_mex_assign(&c1_rhs6, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs6, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs6), "rhs", "rhs", 6);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs6), "lhs", "lhs", 6);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(""), "context", "context", 7);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("mpower"), "name", "name", 7);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 7);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"), "resolved",
+ "resolved", 7);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363717478U), "fileTimeLo",
+ "fileTimeLo", 7);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 7);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 7);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 7);
+ sf_mex_assign(&c1_rhs7, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs7, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs7), "rhs", "rhs", 7);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs7), "lhs", "lhs", 7);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"), "context",
+ "context", 8);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "coder.internal.isBuiltInNumeric"), "name", "name", 8);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 8);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/shared/coder/coder/+coder/+internal/isBuiltInNumeric.m"),
+ "resolved", "resolved", 8);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363718156U), "fileTimeLo",
+ "fileTimeLo", 8);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 8);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 8);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 8);
+ sf_mex_assign(&c1_rhs8, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs8, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs8), "rhs", "rhs", 8);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs8), "lhs", "lhs", 8);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"), "context",
+ "context", 9);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("ismatrix"), "name", "name", 9);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 9);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elmat/ismatrix.m"), "resolved",
+ "resolved", 9);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1331308458U), "fileTimeLo",
+ "fileTimeLo", 9);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 9);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 9);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 9);
+ sf_mex_assign(&c1_rhs9, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs9, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs9), "rhs", "rhs", 9);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs9), "lhs", "lhs", 9);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/mpower.m"), "context",
+ "context", 10);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("power"), "name", "name", 10);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 10);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"), "resolved",
+ "resolved", 10);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363717480U), "fileTimeLo",
+ "fileTimeLo", 10);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 10);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 10);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 10);
+ sf_mex_assign(&c1_rhs10, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs10, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs10), "rhs", "rhs",
+ 10);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs10), "lhs", "lhs",
+ 10);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m"), "context",
+ "context", 11);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "coder.internal.isBuiltInNumeric"), "name", "name", 11);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 11);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/shared/coder/coder/+coder/+internal/isBuiltInNumeric.m"),
+ "resolved", "resolved", 11);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363718156U), "fileTimeLo",
+ "fileTimeLo", 11);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 11);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 11);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 11);
+ sf_mex_assign(&c1_rhs11, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs11, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs11), "rhs", "rhs",
+ 11);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs11), "lhs", "lhs",
+ 11);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"), "context",
+ "context", 12);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalar_eg"), "name",
+ "name", 12);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 12);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"), "resolved",
+ "resolved", 12);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1375987888U), "fileTimeLo",
+ "fileTimeLo", 12);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 12);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 12);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 12);
+ sf_mex_assign(&c1_rhs12, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs12, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs12), "rhs", "rhs",
+ 12);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs12), "lhs", "lhs",
+ 12);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"), "context",
+ "context", 13);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("coder.internal.scalarEg"),
+ "name", "name", 13);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 13);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/coder/coder/+coder/+internal/scalarEg.p"),
+ "resolved", "resolved", 13);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1389311520U), "fileTimeLo",
+ "fileTimeLo", 13);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 13);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 13);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 13);
+ sf_mex_assign(&c1_rhs13, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs13, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs13), "rhs", "rhs",
+ 13);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs13), "lhs", "lhs",
+ 13);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"), "context",
+ "context", 14);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalexp_alloc"), "name",
+ "name", 14);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 14);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"),
+ "resolved", "resolved", 14);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1375987888U), "fileTimeLo",
+ "fileTimeLo", 14);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 14);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 14);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 14);
+ sf_mex_assign(&c1_rhs14, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs14, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs14), "rhs", "rhs",
+ 14);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs14), "lhs", "lhs",
+ 14);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalexp_alloc.m"),
+ "context", "context", 15);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("coder.internal.scalexpAlloc"),
+ "name", "name", 15);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 15);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/coder/coder/+coder/+internal/scalexpAlloc.p"),
+ "resolved", "resolved", 15);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1389311520U), "fileTimeLo",
+ "fileTimeLo", 15);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 15);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 15);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 15);
+ sf_mex_assign(&c1_rhs15, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs15, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs15), "rhs", "rhs",
+ 15);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs15), "lhs", "lhs",
+ 15);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!fltpower"), "context",
+ "context", 16);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("floor"), "name", "name", 16);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 16);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"), "resolved",
+ "resolved", 16);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363717454U), "fileTimeLo",
+ "fileTimeLo", 16);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 16);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 16);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 16);
+ sf_mex_assign(&c1_rhs16, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs16, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs16), "rhs", "rhs",
+ 16);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs16), "lhs", "lhs",
+ 16);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"), "context",
+ "context", 17);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "coder.internal.isBuiltInNumeric"), "name", "name", 17);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 17);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[IXE]$matlabroot$/toolbox/shared/coder/coder/+coder/+internal/isBuiltInNumeric.m"),
+ "resolved", "resolved", 17);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1363718156U), "fileTimeLo",
+ "fileTimeLo", 17);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 17);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 17);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 17);
+ sf_mex_assign(&c1_rhs17, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs17, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs17), "rhs", "rhs",
+ 17);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs17), "lhs", "lhs",
+ 17);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/floor.m"), "context",
+ "context", 18);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalar_floor"), "name",
+ "name", 18);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 18);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_floor.m"),
+ "resolved", "resolved", 18);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1286825926U), "fileTimeLo",
+ "fileTimeLo", 18);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 18);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 18);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 18);
+ sf_mex_assign(&c1_rhs18, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs18, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs18), "rhs", "rhs",
+ 18);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs18), "lhs", "lhs",
+ 18);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/ops/power.m!scalar_float_power"),
+ "context", "context", 19);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalar_eg"), "name",
+ "name", 19);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 19);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/eml/eml_scalar_eg.m"), "resolved",
+ "resolved", 19);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1375987888U), "fileTimeLo",
+ "fileTimeLo", 19);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 19);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 19);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 19);
+ sf_mex_assign(&c1_rhs19, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs19, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs19), "rhs", "rhs",
+ 19);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs19), "lhs", "lhs",
+ 19);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(""), "context", "context", 20);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("cos"), "name", "name", 20);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 20);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"), "resolved",
+ "resolved", 20);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1343837572U), "fileTimeLo",
+ "fileTimeLo", 20);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 20);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 20);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 20);
+ sf_mex_assign(&c1_rhs20, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs20, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs20), "rhs", "rhs",
+ 20);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs20), "lhs", "lhs",
+ 20);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/cos.m"), "context",
+ "context", 21);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalar_cos"), "name",
+ "name", 21);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 21);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_cos.m"),
+ "resolved", "resolved", 21);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1286825922U), "fileTimeLo",
+ "fileTimeLo", 21);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 21);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 21);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 21);
+ sf_mex_assign(&c1_rhs21, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs21, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs21), "rhs", "rhs",
+ 21);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs21), "lhs", "lhs",
+ 21);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(""), "context", "context", 22);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("sin"), "name", "name", 22);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 22);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sin.m"), "resolved",
+ "resolved", 22);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1343837586U), "fileTimeLo",
+ "fileTimeLo", 22);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 22);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 22);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 22);
+ sf_mex_assign(&c1_rhs22, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs22, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs22), "rhs", "rhs",
+ 22);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs22), "lhs", "lhs",
+ 22);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/sin.m"), "context",
+ "context", 23);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("eml_scalar_sin"), "name",
+ "name", 23);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut("double"), "dominantType",
+ "dominantType", 23);
+ sf_mex_addfield(*c1_info, c1_emlrt_marshallOut(
+ "[ILXE]$matlabroot$/toolbox/eml/lib/matlab/elfun/eml_scalar_sin.m"),
+ "resolved", "resolved", 23);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(1286825936U), "fileTimeLo",
+ "fileTimeLo", 23);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "fileTimeHi",
+ "fileTimeHi", 23);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeLo",
+ "mFileTimeLo", 23);
+ sf_mex_addfield(*c1_info, c1_b_emlrt_marshallOut(0U), "mFileTimeHi",
+ "mFileTimeHi", 23);
+ sf_mex_assign(&c1_rhs23, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_assign(&c1_lhs23, sf_mex_createcellmatrix(0, 1), false);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_rhs23), "rhs", "rhs",
+ 23);
+ sf_mex_addfield(*c1_info, sf_mex_duplicatearraysafe(&c1_lhs23), "lhs", "lhs",
+ 23);
+ sf_mex_destroy(&c1_rhs0);
+ sf_mex_destroy(&c1_lhs0);
+ sf_mex_destroy(&c1_rhs1);
+ sf_mex_destroy(&c1_lhs1);
+ sf_mex_destroy(&c1_rhs2);
+ sf_mex_destroy(&c1_lhs2);
+ sf_mex_destroy(&c1_rhs3);
+ sf_mex_destroy(&c1_lhs3);
+ sf_mex_destroy(&c1_rhs4);
+ sf_mex_destroy(&c1_lhs4);
+ sf_mex_destroy(&c1_rhs5);
+ sf_mex_destroy(&c1_lhs5);
+ sf_mex_destroy(&c1_rhs6);
+ sf_mex_destroy(&c1_lhs6);
+ sf_mex_destroy(&c1_rhs7);
+ sf_mex_destroy(&c1_lhs7);
+ sf_mex_destroy(&c1_rhs8);
+ sf_mex_destroy(&c1_lhs8);
+ sf_mex_destroy(&c1_rhs9);
+ sf_mex_destroy(&c1_lhs9);
+ sf_mex_destroy(&c1_rhs10);
+ sf_mex_destroy(&c1_lhs10);
+ sf_mex_destroy(&c1_rhs11);
+ sf_mex_destroy(&c1_lhs11);
+ sf_mex_destroy(&c1_rhs12);
+ sf_mex_destroy(&c1_lhs12);
+ sf_mex_destroy(&c1_rhs13);
+ sf_mex_destroy(&c1_lhs13);
+ sf_mex_destroy(&c1_rhs14);
+ sf_mex_destroy(&c1_lhs14);
+ sf_mex_destroy(&c1_rhs15);
+ sf_mex_destroy(&c1_lhs15);
+ sf_mex_destroy(&c1_rhs16);
+ sf_mex_destroy(&c1_lhs16);
+ sf_mex_destroy(&c1_rhs17);
+ sf_mex_destroy(&c1_lhs17);
+ sf_mex_destroy(&c1_rhs18);
+ sf_mex_destroy(&c1_lhs18);
+ sf_mex_destroy(&c1_rhs19);
+ sf_mex_destroy(&c1_lhs19);
+ sf_mex_destroy(&c1_rhs20);
+ sf_mex_destroy(&c1_lhs20);
+ sf_mex_destroy(&c1_rhs21);
+ sf_mex_destroy(&c1_lhs21);
+ sf_mex_destroy(&c1_rhs22);
+ sf_mex_destroy(&c1_lhs22);
+ sf_mex_destroy(&c1_rhs23);
+ sf_mex_destroy(&c1_lhs23);
+}
+
+static const mxArray *c1_emlrt_marshallOut(const char * c1_u)
+{
+ const mxArray *c1_y = NULL;
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_create("y", c1_u, 15, 0U, 0U, 0U, 2, 1, strlen
+ (c1_u)), false);
+ return c1_y;
+}
+
+static const mxArray *c1_b_emlrt_marshallOut(const uint32_T c1_u)
+{
+ const mxArray *c1_y = NULL;
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_create("y", &c1_u, 7, 0U, 0U, 0U, 0), false);
+ return c1_y;
+}
+
+static real_T c1_mpower(SFc1_Cessna_6DOFInstanceStruct *chartInstance, real_T
+ c1_a)
+{
+ real_T c1_b_a;
+ real_T c1_c_a;
+ real_T c1_ak;
+ real_T c1_d_a;
+ c1_b_a = c1_a;
+ c1_c_a = c1_b_a;
+ c1_eml_scalar_eg(chartInstance);
+ c1_ak = c1_c_a;
+ c1_d_a = c1_ak;
+ c1_eml_scalar_eg(chartInstance);
+ return c1_d_a * c1_d_a;
+}
+
+static void c1_eml_scalar_eg(SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ (void)chartInstance;
+}
+
+static const mxArray *c1_c_sf_marshallOut(void *chartInstanceVoid, void
+ *c1_inData)
+{
+ const mxArray *c1_mxArrayOutData = NULL;
+ int32_T c1_u;
+ const mxArray *c1_y = NULL;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_mxArrayOutData = NULL;
+ c1_u = *(int32_T *)c1_inData;
+ c1_y = NULL;
+ sf_mex_assign(&c1_y, sf_mex_create("y", &c1_u, 6, 0U, 0U, 0U, 0), false);
+ sf_mex_assign(&c1_mxArrayOutData, c1_y, false);
+ return c1_mxArrayOutData;
+}
+
+static int32_T c1_d_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId)
+{
+ int32_T c1_y;
+ int32_T c1_i14;
+ (void)chartInstance;
+ sf_mex_import(c1_parentId, sf_mex_dup(c1_u), &c1_i14, 1, 6, 0U, 0, 0U, 0);
+ c1_y = c1_i14;
+ sf_mex_destroy(&c1_u);
+ return c1_y;
+}
+
+static void c1_c_sf_marshallIn(void *chartInstanceVoid, const mxArray
+ *c1_mxArrayInData, const char_T *c1_varName, void *c1_outData)
+{
+ const mxArray *c1_b_sfEvent;
+ const char_T *c1_identifier;
+ emlrtMsgIdentifier c1_thisId;
+ int32_T c1_y;
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)chartInstanceVoid;
+ c1_b_sfEvent = sf_mex_dup(c1_mxArrayInData);
+ c1_identifier = c1_varName;
+ c1_thisId.fIdentifier = c1_identifier;
+ c1_thisId.fParent = NULL;
+ c1_y = c1_d_emlrt_marshallIn(chartInstance, sf_mex_dup(c1_b_sfEvent),
+ &c1_thisId);
+ sf_mex_destroy(&c1_b_sfEvent);
+ *(int32_T *)c1_outData = c1_y;
+ sf_mex_destroy(&c1_mxArrayInData);
+}
+
+static uint8_T c1_e_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_b_is_active_c1_Cessna_6DOF, const char_T
+ *c1_identifier)
+{
+ uint8_T c1_y;
+ emlrtMsgIdentifier c1_thisId;
+ c1_thisId.fIdentifier = c1_identifier;
+ c1_thisId.fParent = NULL;
+ c1_y = c1_f_emlrt_marshallIn(chartInstance, sf_mex_dup
+ (c1_b_is_active_c1_Cessna_6DOF), &c1_thisId);
+ sf_mex_destroy(&c1_b_is_active_c1_Cessna_6DOF);
+ return c1_y;
+}
+
+static uint8_T c1_f_emlrt_marshallIn(SFc1_Cessna_6DOFInstanceStruct
+ *chartInstance, const mxArray *c1_u, const emlrtMsgIdentifier *c1_parentId)
+{
+ uint8_T c1_y;
+ uint8_T c1_u0;
+ (void)chartInstance;
+ sf_mex_import(c1_parentId, sf_mex_dup(c1_u), &c1_u0, 1, 3, 0U, 0, 0U, 0);
+ c1_y = c1_u0;
+ sf_mex_destroy(&c1_u);
+ return c1_y;
+}
+
+static void init_dsm_address_info(SFc1_Cessna_6DOFInstanceStruct *chartInstance)
+{
+ (void)chartInstance;
+}
+
+/* SFunction Glue Code */
+#ifdef utFree
+#undef utFree
+#endif
+
+#ifdef utMalloc
+#undef utMalloc
+#endif
+
+#ifdef __cplusplus
+
+extern "C" void *utMalloc(size_t size);
+extern "C" void utFree(void*);
+
+#else
+
+extern void *utMalloc(size_t size);
+extern void utFree(void*);
+
+#endif
+
+void sf_c1_Cessna_6DOF_get_check_sum(mxArray *plhs[])
+{
+ ((real_T *)mxGetPr((plhs[0])))[0] = (real_T)(2441411494U);
+ ((real_T *)mxGetPr((plhs[0])))[1] = (real_T)(3799077463U);
+ ((real_T *)mxGetPr((plhs[0])))[2] = (real_T)(3332296302U);
+ ((real_T *)mxGetPr((plhs[0])))[3] = (real_T)(1856172960U);
+}
+
+mxArray *sf_c1_Cessna_6DOF_get_autoinheritance_info(void)
+{
+ const char *autoinheritanceFields[] = { "checksum", "inputs", "parameters",
+ "outputs", "locals" };
+
+ mxArray *mxAutoinheritanceInfo = mxCreateStructMatrix(1,1,5,
+ autoinheritanceFields);
+
+ {
+ mxArray *mxChecksum = mxCreateString("B6ShapczQeOvAhTG9KtlQC");
+ mxSetField(mxAutoinheritanceInfo,0,"checksum",mxChecksum);
+ }
+
+ {
+ const char *dataFields[] = { "size", "type", "complexity" };
+
+ mxArray *mxData = mxCreateStructMatrix(1,8,3,dataFields);
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,0,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,0,"type",mxType);
+ }
+
+ mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,1,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,1,"type",mxType);
+ }
+
+ mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,2,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,2,"type",mxType);
+ }
+
+ mxSetField(mxData,2,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,3,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,3,"type",mxType);
+ }
+
+ mxSetField(mxData,3,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,4,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,4,"type",mxType);
+ }
+
+ mxSetField(mxData,4,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,5,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,5,"type",mxType);
+ }
+
+ mxSetField(mxData,5,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,6,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,6,"type",mxType);
+ }
+
+ mxSetField(mxData,6,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(1);
+ pr[1] = (double)(1);
+ mxSetField(mxData,7,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,7,"type",mxType);
+ }
+
+ mxSetField(mxData,7,"complexity",mxCreateDoubleScalar(0));
+ mxSetField(mxAutoinheritanceInfo,0,"inputs",mxData);
+ }
+
+ {
+ mxSetField(mxAutoinheritanceInfo,0,"parameters",mxCreateDoubleMatrix(0,0,
+ mxREAL));
+ }
+
+ {
+ const char *dataFields[] = { "size", "type", "complexity" };
+
+ mxArray *mxData = mxCreateStructMatrix(1,2,3,dataFields);
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(3);
+ pr[1] = (double)(1);
+ mxSetField(mxData,0,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,0,"type",mxType);
+ }
+
+ mxSetField(mxData,0,"complexity",mxCreateDoubleScalar(0));
+
+ {
+ mxArray *mxSize = mxCreateDoubleMatrix(1,2,mxREAL);
+ double *pr = mxGetPr(mxSize);
+ pr[0] = (double)(3);
+ pr[1] = (double)(1);
+ mxSetField(mxData,1,"size",mxSize);
+ }
+
+ {
+ const char *typeFields[] = { "base", "fixpt" };
+
+ mxArray *mxType = mxCreateStructMatrix(1,1,2,typeFields);
+ mxSetField(mxType,0,"base",mxCreateDoubleScalar(10));
+ mxSetField(mxType,0,"fixpt",mxCreateDoubleMatrix(0,0,mxREAL));
+ mxSetField(mxData,1,"type",mxType);
+ }
+
+ mxSetField(mxData,1,"complexity",mxCreateDoubleScalar(0));
+ mxSetField(mxAutoinheritanceInfo,0,"outputs",mxData);
+ }
+
+ {
+ mxSetField(mxAutoinheritanceInfo,0,"locals",mxCreateDoubleMatrix(0,0,mxREAL));
+ }
+
+ return(mxAutoinheritanceInfo);
+}
+
+mxArray *sf_c1_Cessna_6DOF_third_party_uses_info(void)
+{
+ mxArray * mxcell3p = mxCreateCellMatrix(1,0);
+ return(mxcell3p);
+}
+
+mxArray *sf_c1_Cessna_6DOF_updateBuildInfo_args_info(void)
+{
+ mxArray *mxBIArgs = mxCreateCellMatrix(1,0);
+ return mxBIArgs;
+}
+
+static const mxArray *sf_get_sim_state_info_c1_Cessna_6DOF(void)
+{
+ const char *infoFields[] = { "chartChecksum", "varInfo" };
+
+ mxArray *mxInfo = mxCreateStructMatrix(1, 1, 2, infoFields);
+ const char *infoEncStr[] = {
+ "100 S1x3'type','srcId','name','auxInfo'{{M[1],M[5],T\"F\",},{M[1],M[12],T\"M\",},{M[8],M[0],T\"is_active_c1_Cessna_6DOF\",}}"
+ };
+
+ mxArray *mxVarInfo = sf_mex_decode_encoded_mx_struct_array(infoEncStr, 3, 10);
+ mxArray *mxChecksum = mxCreateDoubleMatrix(1, 4, mxREAL);
+ sf_c1_Cessna_6DOF_get_check_sum(&mxChecksum);
+ mxSetField(mxInfo, 0, infoFields[0], mxChecksum);
+ mxSetField(mxInfo, 0, infoFields[1], mxVarInfo);
+ return mxInfo;
+}
+
+static void chart_debug_initialization(SimStruct *S, unsigned int
+ fullDebuggerInitialization)
+{
+ if (!sim_mode_is_rtw_gen(S)) {
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
+ ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *) chartInfo->chartInstance;
+ if (ssIsFirstInitCond(S) && fullDebuggerInitialization==1) {
+ /* do this only if simulation is starting */
+ {
+ unsigned int chartAlreadyPresent;
+ chartAlreadyPresent = sf_debug_initialize_chart
+ (sfGlobalDebugInstanceStruct,
+ _Cessna_6DOFMachineNumber_,
+ 1,
+ 1,
+ 1,
+ 0,
+ 10,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ &(chartInstance->chartNumber),
+ &(chartInstance->instanceNumber),
+ (void *)S);
+
+ /* Each instance must initialize ist own list of scripts */
+ init_script_number_translation(_Cessna_6DOFMachineNumber_,
+ chartInstance->chartNumber,chartInstance->instanceNumber);
+ if (chartAlreadyPresent==0) {
+ /* this is the first instance */
+ sf_debug_set_chart_disable_implicit_casting
+ (sfGlobalDebugInstanceStruct,_Cessna_6DOFMachineNumber_,
+ chartInstance->chartNumber,1);
+ sf_debug_set_chart_event_thresholds(sfGlobalDebugInstanceStruct,
+ _Cessna_6DOFMachineNumber_,
+ chartInstance->chartNumber,
+ 0,
+ 0,
+ 0);
+ _SFD_SET_DATA_PROPS(0,1,1,0,"V");
+ _SFD_SET_DATA_PROPS(1,2,0,1,"F");
+ _SFD_SET_DATA_PROPS(2,1,1,0,"alpha");
+ _SFD_SET_DATA_PROPS(3,1,1,0,"alpha_dot");
+ _SFD_SET_DATA_PROPS(4,1,1,0,"beta");
+ _SFD_SET_DATA_PROPS(5,1,1,0,"p");
+ _SFD_SET_DATA_PROPS(6,1,1,0,"q");
+ _SFD_SET_DATA_PROPS(7,1,1,0,"r");
+ _SFD_SET_DATA_PROPS(8,1,1,0,"theta");
+ _SFD_SET_DATA_PROPS(9,2,0,1,"M");
+ _SFD_STATE_INFO(0,0,2);
+ _SFD_CH_SUBSTATE_COUNT(0);
+ _SFD_CH_SUBSTATE_DECOMP(0);
+ }
+
+ _SFD_CV_INIT_CHART(0,0,0,0);
+
+ {
+ _SFD_CV_INIT_STATE(0,0,0,0,0,0,NULL,NULL);
+ }
+
+ _SFD_CV_INIT_TRANS(0,0,NULL,NULL,0,NULL);
+
+ /* Initialization of MATLAB Function Model Coverage */
+ _SFD_CV_INIT_EML(0,1,1,0,0,0,0,0,0,0,0);
+ _SFD_CV_INIT_EML_FCN(0,0,"eML_blk_kernel",0,-1,1623);
+ _SFD_SET_DATA_COMPILED_PROPS(0,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+
+ {
+ unsigned int dimVector[1];
+ dimVector[0]= 3;
+ _SFD_SET_DATA_COMPILED_PROPS(1,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
+ 1.0,0,0,(MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)
+ c1_sf_marshallIn);
+ }
+
+ _SFD_SET_DATA_COMPILED_PROPS(2,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(3,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(4,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(5,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(6,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(7,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+ _SFD_SET_DATA_COMPILED_PROPS(8,SF_DOUBLE,0,NULL,0,0,0,0.0,1.0,0,0,
+ (MexFcnForType)c1_b_sf_marshallOut,(MexInFcnForType)NULL);
+
+ {
+ unsigned int dimVector[1];
+ dimVector[0]= 3;
+ _SFD_SET_DATA_COMPILED_PROPS(9,SF_DOUBLE,1,&(dimVector[0]),0,0,0,0.0,
+ 1.0,0,0,(MexFcnForType)c1_sf_marshallOut,(MexInFcnForType)
+ c1_sf_marshallIn);
+ }
+
+ {
+ real_T *c1_V;
+ real_T *c1_alpha;
+ real_T *c1_alpha_dot;
+ real_T *c1_beta;
+ real_T *c1_p;
+ real_T *c1_q;
+ real_T *c1_r;
+ real_T *c1_theta;
+ real_T (*c1_F)[3];
+ real_T (*c1_M)[3];
+ c1_M = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 2);
+ c1_theta = (real_T *)ssGetInputPortSignal(chartInstance->S, 7);
+ c1_r = (real_T *)ssGetInputPortSignal(chartInstance->S, 6);
+ c1_q = (real_T *)ssGetInputPortSignal(chartInstance->S, 5);
+ c1_p = (real_T *)ssGetInputPortSignal(chartInstance->S, 4);
+ c1_beta = (real_T *)ssGetInputPortSignal(chartInstance->S, 3);
+ c1_alpha_dot = (real_T *)ssGetInputPortSignal(chartInstance->S, 2);
+ c1_alpha = (real_T *)ssGetInputPortSignal(chartInstance->S, 1);
+ c1_F = (real_T (*)[3])ssGetOutputPortSignal(chartInstance->S, 1);
+ c1_V = (real_T *)ssGetInputPortSignal(chartInstance->S, 0);
+ _SFD_SET_DATA_VALUE_PTR(0U, c1_V);
+ _SFD_SET_DATA_VALUE_PTR(1U, *c1_F);
+ _SFD_SET_DATA_VALUE_PTR(2U, c1_alpha);
+ _SFD_SET_DATA_VALUE_PTR(3U, c1_alpha_dot);
+ _SFD_SET_DATA_VALUE_PTR(4U, c1_beta);
+ _SFD_SET_DATA_VALUE_PTR(5U, c1_p);
+ _SFD_SET_DATA_VALUE_PTR(6U, c1_q);
+ _SFD_SET_DATA_VALUE_PTR(7U, c1_r);
+ _SFD_SET_DATA_VALUE_PTR(8U, c1_theta);
+ _SFD_SET_DATA_VALUE_PTR(9U, *c1_M);
+ }
+ }
+ } else {
+ sf_debug_reset_current_state_configuration(sfGlobalDebugInstanceStruct,
+ _Cessna_6DOFMachineNumber_,chartInstance->chartNumber,
+ chartInstance->instanceNumber);
+ }
+ }
+}
+
+static const char* sf_get_instance_specialization(void)
+{
+ return "v045JFXizl4FQXSha8a34C";
+}
+
+static void sf_opaque_initialize_c1_Cessna_6DOF(void *chartInstanceVar)
+{
+ chart_debug_initialization(((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar)
+ ->S,0);
+ initialize_params_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*)
+ chartInstanceVar);
+ initialize_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar);
+}
+
+static void sf_opaque_enable_c1_Cessna_6DOF(void *chartInstanceVar)
+{
+ enable_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar);
+}
+
+static void sf_opaque_disable_c1_Cessna_6DOF(void *chartInstanceVar)
+{
+ disable_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar);
+}
+
+static void sf_opaque_gateway_c1_Cessna_6DOF(void *chartInstanceVar)
+{
+ sf_gateway_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar);
+}
+
+extern const mxArray* sf_internal_get_sim_state_c1_Cessna_6DOF(SimStruct* S)
+{
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
+ ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
+ mxArray *plhs[1] = { NULL };
+
+ mxArray *prhs[4];
+ int mxError = 0;
+ prhs[0] = mxCreateString("chart_simctx_raw2high");
+ prhs[1] = mxCreateDoubleScalar(ssGetSFuncBlockHandle(S));
+ prhs[2] = (mxArray*) get_sim_state_c1_Cessna_6DOF
+ ((SFc1_Cessna_6DOFInstanceStruct*)chartInfo->chartInstance);/* raw sim ctx */
+ prhs[3] = (mxArray*) sf_get_sim_state_info_c1_Cessna_6DOF();/* state var info */
+ mxError = sf_mex_call_matlab(1, plhs, 4, prhs, "sfprivate");
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+ mxDestroyArray(prhs[3]);
+ if (mxError || plhs[0] == NULL) {
+ sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_raw2high'.\n");
+ }
+
+ return plhs[0];
+}
+
+extern void sf_internal_set_sim_state_c1_Cessna_6DOF(SimStruct* S, const mxArray
+ *st)
+{
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
+ ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
+ mxArray *plhs[1] = { NULL };
+
+ mxArray *prhs[3];
+ int mxError = 0;
+ prhs[0] = mxCreateString("chart_simctx_high2raw");
+ prhs[1] = mxDuplicateArray(st); /* high level simctx */
+ prhs[2] = (mxArray*) sf_get_sim_state_info_c1_Cessna_6DOF();/* state var info */
+ mxError = sf_mex_call_matlab(1, plhs, 3, prhs, "sfprivate");
+ mxDestroyArray(prhs[0]);
+ mxDestroyArray(prhs[1]);
+ mxDestroyArray(prhs[2]);
+ if (mxError || plhs[0] == NULL) {
+ sf_mex_error_message("Stateflow Internal Error: \nError calling 'chart_simctx_high2raw'.\n");
+ }
+
+ set_sim_state_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*)
+ chartInfo->chartInstance, mxDuplicateArray(plhs[0]));
+ mxDestroyArray(plhs[0]);
+}
+
+static const mxArray* sf_opaque_get_sim_state_c1_Cessna_6DOF(SimStruct* S)
+{
+ return sf_internal_get_sim_state_c1_Cessna_6DOF(S);
+}
+
+static void sf_opaque_set_sim_state_c1_Cessna_6DOF(SimStruct* S, const mxArray
+ *st)
+{
+ sf_internal_set_sim_state_c1_Cessna_6DOF(S, st);
+}
+
+static void sf_opaque_terminate_c1_Cessna_6DOF(void *chartInstanceVar)
+{
+ if (chartInstanceVar!=NULL) {
+ SimStruct *S = ((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar)->S;
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
+ if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
+ sf_clear_rtw_identifier(S);
+ unload_Cessna_6DOF_optimization_info();
+ }
+
+ finalize_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*) chartInstanceVar);
+ utFree((void *)chartInstanceVar);
+ if (crtInfo != NULL) {
+ utFree((void *)crtInfo);
+ }
+
+ ssSetUserData(S,NULL);
+ }
+}
+
+static void sf_opaque_init_subchart_simstructs(void *chartInstanceVar)
+{
+ initSimStructsc1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*)
+ chartInstanceVar);
+}
+
+extern unsigned int sf_machine_global_initializer_called(void);
+static void mdlProcessParameters_c1_Cessna_6DOF(SimStruct *S)
+{
+ int i;
+ for (i=0;i<ssGetNumRunTimeParams(S);i++) {
+ if (ssGetSFcnParamTunable(S,i)) {
+ ssUpdateDlgParamAsRunTimeParam(S,i);
+ }
+ }
+
+ if (sf_machine_global_initializer_called()) {
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)(ssGetUserData(S));
+ ChartInfoStruct * chartInfo = (ChartInfoStruct *)(crtInfo->instanceInfo);
+ initialize_params_c1_Cessna_6DOF((SFc1_Cessna_6DOFInstanceStruct*)
+ (chartInfo->chartInstance));
+ }
+}
+
+static void mdlSetWorkWidths_c1_Cessna_6DOF(SimStruct *S)
+{
+ if (sim_mode_is_rtw_gen(S) || sim_mode_is_external(S)) {
+ mxArray *infoStruct = load_Cessna_6DOF_optimization_info();
+ int_T chartIsInlinable =
+ (int_T)sf_is_chart_inlinable(sf_get_instance_specialization(),infoStruct,1);
+ ssSetStateflowIsInlinable(S,chartIsInlinable);
+ ssSetRTWCG(S,sf_rtw_info_uint_prop(sf_get_instance_specialization(),
+ infoStruct,1,"RTWCG"));
+ ssSetEnableFcnIsTrivial(S,1);
+ ssSetDisableFcnIsTrivial(S,1);
+ ssSetNotMultipleInlinable(S,sf_rtw_info_uint_prop
+ (sf_get_instance_specialization(),infoStruct,1,
+ "gatewayCannotBeInlinedMultipleTimes"));
+ sf_update_buildInfo(sf_get_instance_specialization(),infoStruct,1);
+ if (chartIsInlinable) {
+ ssSetInputPortOptimOpts(S, 0, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 1, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 2, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 3, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 4, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 5, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 6, SS_REUSABLE_AND_LOCAL);
+ ssSetInputPortOptimOpts(S, 7, SS_REUSABLE_AND_LOCAL);
+ sf_mark_chart_expressionable_inputs(S,sf_get_instance_specialization(),
+ infoStruct,1,8);
+ sf_mark_chart_reusable_outputs(S,sf_get_instance_specialization(),
+ infoStruct,1,2);
+ }
+
+ {
+ unsigned int outPortIdx;
+ for (outPortIdx=1; outPortIdx<=2; ++outPortIdx) {
+ ssSetOutputPortOptimizeInIR(S, outPortIdx, 1U);
+ }
+ }
+
+ {
+ unsigned int inPortIdx;
+ for (inPortIdx=0; inPortIdx < 8; ++inPortIdx) {
+ ssSetInputPortOptimizeInIR(S, inPortIdx, 1U);
+ }
+ }
+
+ sf_set_rtw_dwork_info(S,sf_get_instance_specialization(),infoStruct,1);
+ ssSetHasSubFunctions(S,!(chartIsInlinable));
+ } else {
+ }
+
+ ssSetOptions(S,ssGetOptions(S)|SS_OPTION_WORKS_WITH_CODE_REUSE);
+ ssSetChecksum0(S,(1256833735U));
+ ssSetChecksum1(S,(1696076141U));
+ ssSetChecksum2(S,(3784906244U));
+ ssSetChecksum3(S,(1371581968U));
+ ssSetmdlDerivatives(S, NULL);
+ ssSetExplicitFCSSCtrl(S,1);
+ ssSupportsMultipleExecInstances(S,1);
+}
+
+static void mdlRTW_c1_Cessna_6DOF(SimStruct *S)
+{
+ if (sim_mode_is_rtw_gen(S)) {
+ ssWriteRTWStrParam(S, "StateflowChartType", "Embedded MATLAB");
+ }
+}
+
+static void mdlStart_c1_Cessna_6DOF(SimStruct *S)
+{
+ SFc1_Cessna_6DOFInstanceStruct *chartInstance;
+ ChartRunTimeInfo * crtInfo = (ChartRunTimeInfo *)utMalloc(sizeof
+ (ChartRunTimeInfo));
+ chartInstance = (SFc1_Cessna_6DOFInstanceStruct *)utMalloc(sizeof
+ (SFc1_Cessna_6DOFInstanceStruct));
+ memset(chartInstance, 0, sizeof(SFc1_Cessna_6DOFInstanceStruct));
+ if (chartInstance==NULL) {
+ sf_mex_error_message("Could not allocate memory for chart instance.");
+ }
+
+ chartInstance->chartInfo.chartInstance = chartInstance;
+ chartInstance->chartInfo.isEMLChart = 1;
+ chartInstance->chartInfo.chartInitialized = 0;
+ chartInstance->chartInfo.sFunctionGateway = sf_opaque_gateway_c1_Cessna_6DOF;
+ chartInstance->chartInfo.initializeChart = sf_opaque_initialize_c1_Cessna_6DOF;
+ chartInstance->chartInfo.terminateChart = sf_opaque_terminate_c1_Cessna_6DOF;
+ chartInstance->chartInfo.enableChart = sf_opaque_enable_c1_Cessna_6DOF;
+ chartInstance->chartInfo.disableChart = sf_opaque_disable_c1_Cessna_6DOF;
+ chartInstance->chartInfo.getSimState = sf_opaque_get_sim_state_c1_Cessna_6DOF;
+ chartInstance->chartInfo.setSimState = sf_opaque_set_sim_state_c1_Cessna_6DOF;
+ chartInstance->chartInfo.getSimStateInfo =
+ sf_get_sim_state_info_c1_Cessna_6DOF;
+ chartInstance->chartInfo.zeroCrossings = NULL;
+ chartInstance->chartInfo.outputs = NULL;
+ chartInstance->chartInfo.derivatives = NULL;
+ chartInstance->chartInfo.mdlRTW = mdlRTW_c1_Cessna_6DOF;
+ chartInstance->chartInfo.mdlStart = mdlStart_c1_Cessna_6DOF;
+ chartInstance->chartInfo.mdlSetWorkWidths = mdlSetWorkWidths_c1_Cessna_6DOF;
+ chartInstance->chartInfo.extModeExec = NULL;
+ chartInstance->chartInfo.restoreLastMajorStepConfiguration = NULL;
+ chartInstance->chartInfo.restoreBeforeLastMajorStepConfiguration = NULL;
+ chartInstance->chartInfo.storeCurrentConfiguration = NULL;
+ chartInstance->chartInfo.debugInstance = sfGlobalDebugInstanceStruct;
+ chartInstance->S = S;
+ crtInfo->instanceInfo = (&(chartInstance->chartInfo));
+ crtInfo->isJITEnabled = false;
+ ssSetUserData(S,(void *)(crtInfo)); /* register the chart instance with simstruct */
+ init_dsm_address_info(chartInstance);
+ if (!sim_mode_is_rtw_gen(S)) {
+ }
+
+ sf_opaque_init_subchart_simstructs(chartInstance->chartInfo.chartInstance);
+ chart_debug_initialization(S,1);
+}
+
+void c1_Cessna_6DOF_method_dispatcher(SimStruct *S, int_T method, void *data)
+{
+ switch (method) {
+ case SS_CALL_MDL_START:
+ mdlStart_c1_Cessna_6DOF(S);
+ break;
+
+ case SS_CALL_MDL_SET_WORK_WIDTHS:
+ mdlSetWorkWidths_c1_Cessna_6DOF(S);
+ break;
+
+ case SS_CALL_MDL_PROCESS_PARAMETERS:
+ mdlProcessParameters_c1_Cessna_6DOF(S);
+ break;
+
+ default:
+ /* Unhandled method */
+ sf_mex_error_message("Stateflow Internal Error:\n"
+ "Error calling c1_Cessna_6DOF_method_dispatcher.\n"
+ "Can't handle method %d.\n", method);
+ break;
+ }
+}
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.h b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.h
new file mode 100644
index 0000000..99a7210
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_Cessna_6DOF.h
@@ -0,0 +1,41 @@
+#ifndef __c1_Cessna_6DOF_h__
+#define __c1_Cessna_6DOF_h__
+
+/* Include files */
+#include "sf_runtime/sfc_sf.h"
+#include "sf_runtime/sfc_mex.h"
+#include "rtwtypes.h"
+#include "multiword_types.h"
+
+/* Type Definitions */
+#ifndef typedef_SFc1_Cessna_6DOFInstanceStruct
+#define typedef_SFc1_Cessna_6DOFInstanceStruct
+
+typedef struct {
+ SimStruct *S;
+ ChartInfoStruct chartInfo;
+ uint32_T chartNumber;
+ uint32_T instanceNumber;
+ int32_T c1_sfEvent;
+ boolean_T c1_isStable;
+ boolean_T c1_doneDoubleBufferReInit;
+ uint8_T c1_is_active_c1_Cessna_6DOF;
+} SFc1_Cessna_6DOFInstanceStruct;
+
+#endif /*typedef_SFc1_Cessna_6DOFInstanceStruct*/
+
+/* Named Constants */
+
+/* Variable Declarations */
+
+/* Variable Definitions */
+
+/* Function Declarations */
+extern const mxArray *sf_c1_Cessna_6DOF_get_eml_resolved_functions_info(void);
+
+/* Function Definitions */
+extern void sf_c1_Cessna_6DOF_get_check_sum(mxArray *plhs[]);
+extern void c1_Cessna_6DOF_method_dispatcher(SimStruct *S, int_T method, void
+ *data);
+
+#endif
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_cessna_6dof.obj b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_cessna_6dof.obj
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF/_self/sfun/src/c1_cessna_6dof.obj
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF_Wind_trim/_self/sfun/info/binfo.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF_Wind_trim/_self/sfun/info/binfo.mat
new file mode 100644
index 0000000..02848c4
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF_Wind_trim/_self/sfun/info/binfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/Cessna_6DOF_trim_ha/_self/sfun/info/binfo.mat b/Prof_Arya/slprj/_sfprj/Cessna_6DOF_trim_ha/_self/sfun/info/binfo.mat
new file mode 100644
index 0000000..2ca213f
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/Cessna_6DOF_trim_ha/_self/sfun/info/binfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/EMLReport/emlReportAccessInfo.mat b/Prof_Arya/slprj/_sfprj/EMLReport/emlReportAccessInfo.mat
new file mode 100644
index 0000000..c5a1037
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/EMLReport/emlReportAccessInfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/EMLReport/sEI9p49izcHUxn63CWpG2IC.mat b/Prof_Arya/slprj/_sfprj/EMLReport/sEI9p49izcHUxn63CWpG2IC.mat
new file mode 100644
index 0000000..9d4d18d
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/EMLReport/sEI9p49izcHUxn63CWpG2IC.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/EMLReport/sjLZixcOZskMJeeDfIb93hH.mat b/Prof_Arya/slprj/_sfprj/EMLReport/sjLZixcOZskMJeeDfIb93hH.mat
new file mode 100644
index 0000000..6d7d58c
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/EMLReport/sjLZixcOZskMJeeDfIb93hH.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/precompile/9awVvODnlASRfvLpAy51pB.mat b/Prof_Arya/slprj/_sfprj/precompile/9awVvODnlASRfvLpAy51pB.mat
new file mode 100644
index 0000000..d67a604
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/precompile/9awVvODnlASRfvLpAy51pB.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/precompile/CHfRUMKLp7zBZlxChVZlPD.mat b/Prof_Arya/slprj/_sfprj/precompile/CHfRUMKLp7zBZlxChVZlPD.mat
new file mode 100644
index 0000000..364d8a5
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/precompile/CHfRUMKLp7zBZlxChVZlPD.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/precompile/VPBs6CX5Fj2d3KwfGqQPeF.mat b/Prof_Arya/slprj/_sfprj/precompile/VPBs6CX5Fj2d3KwfGqQPeF.mat
new file mode 100644
index 0000000..a413dc1
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/precompile/VPBs6CX5Fj2d3KwfGqQPeF.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/precompile/autoInferAccessInfo.mat b/Prof_Arya/slprj/_sfprj/precompile/autoInferAccessInfo.mat
new file mode 100644
index 0000000..bcafa3e
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/precompile/autoInferAccessInfo.mat
Binary files differ
diff --git a/Prof_Arya/slprj/_sfprj/precompile/pFxf9FCl6UH0ED177v1E9B.mat b/Prof_Arya/slprj/_sfprj/precompile/pFxf9FCl6UH0ED177v1E9B.mat
new file mode 100644
index 0000000..5fd3c97
--- /dev/null
+++ b/Prof_Arya/slprj/_sfprj/precompile/pFxf9FCl6UH0ED177v1E9B.mat
Binary files differ
diff --git a/RotationalSMD_Concat.mo b/RotationalSMD_Concat.mo
new file mode 100644
index 0000000..89419bb
--- /dev/null
+++ b/RotationalSMD_Concat.mo
@@ -0,0 +1,17 @@
+model RotationalSMD_Concat
+ "State space version of a rotationals spring-mass-damper system using concatenation"
+ parameter Real J1=0.4;
+ parameter Real J2=1.0;
+ parameter Real c1=11;
+ parameter Real c2=5;
+ parameter Real d1=0.2;
+ parameter Real d2=1.0;
+ parameter Real S[2,2] = [-1/J1, 1/J1; 1/J2, -1/J2];
+ extends LTI(nx=4, nu=0, ny=0, x0={0, 1, 0, 0},
+ A=[zeros(2, 2), identity(2);
+ c1*S+[0,0;0,-c2/J2], d1*S+[0,0;0,-d2/J2]],
+ B=fill(0, 4, 0), C=fill(0, 0, 4),
+ D=fill(0, 0, 0));
+equation
+ u = fill(0, 0);
+end RotationalSMD_Concat;
diff --git a/SpringMassTest.mo b/SpringMassTest.mo
new file mode 100644
index 0000000..1efa1c9
--- /dev/null
+++ b/SpringMassTest.mo
@@ -0,0 +1,17 @@
+model SpringMassTest
+
+parameter Real M = 1;
+parameter Real k = 1; //Spring Constant
+parameter Real b = 10;//Damping Coeff
+
+Real vel;
+Real dist;
+Real Force = if time > 10 and time < 11 then 105 else 100;
+equation
+Force = M * der(vel) + k*dist + b*vel;
+vel = der(dist);
+
+
+
+
+end SpringMassTest; \ No newline at end of file
diff --git a/Test6DOF.mo b/Test6DOF.mo
new file mode 100755
index 0000000..7ca9524
--- /dev/null
+++ b/Test6DOF.mo
@@ -0,0 +1,9 @@
+model Test6DOF
+ Real F[3] = {0, -1,9.8};
+ Real M[3] = {0 , 0, 0};
+ Flight6DOF flight6DOF1(angles(start = {0, 0, 0}),omega(start = {0, 0, 1}), pos(start = {0, -1, 0}), v(start = {1, 0, 0})) annotation(
+ Placement(visible = true, transformation(origin = {6, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ equation
+ flight6DOF1.Force = F;
+ flight6DOF1.Moment = M;
+end Test6DOF; \ No newline at end of file
diff --git a/TestFmZagi.mo b/TestFmZagi.mo
new file mode 100644
index 0000000..87916ab
--- /dev/null
+++ b/TestFmZagi.mo
@@ -0,0 +1,86 @@
+model TestFmZagi
+
+
+
+parameter Real m = 1.56;
+parameter Real W[3] = m*{0,0, 9.81};//gravitational force
+parameter Real b= 1.4224, cbar = 0.3302,s = 0.2589;
+
+
+
+parameter Real CD0 = 0.01631;// = 0.036;//for cessna
+parameter Real K_drag ;// = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.07359 ;// = -0.31;//for cessna
+parameter Real Cy_p = 0 ;// = -0.037;//for cessna
+parameter Real Cy_r = 0 ;// = 0.21;//for cessna
+parameter Real Cy_delta_r= 0;// = 0.187; //for cessna
+parameter Real Cy_delta_a = 0;//= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.09167 ;// = 0.25; //for cessna
+parameter Real CL_alpha= 3.5016 ;// = 4.47;//for cessna
+parameter Real CL_q = 2.8932 ;// = 3.9;//for cessna
+parameter Real CL_delta_e= 0.2724;// = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.02854 ;//= -0.089;//for cessna
+parameter Real Cl_p = -0.3209 ;//= -0.47;//for cessna
+parameter Real Cl_r = 0.03066 ;//= 0.096;//for cessna
+parameter Real Cl_delta_a= 0.1682 ;//= -0.09;//for cessna
+parameter Real Cl_delta_r= 0;// = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02338;// = -0.02;//for cessna
+parameter Real Cm_alpha = -0.5675 ;// = -1.8;//for cessna
+parameter Real Cm_q = -1.3990 ;//= -12.4;//for cessna
+parameter Real Cm_delta_e= -0.3254;// = -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = -0.00040 ;//= 0.065;//for cessna
+parameter Real Cn_p = -0.01297 ;// = -0.03;//for cessna
+parameter Real Cn_r = -0.00434 ;// = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.00328 ;//= -0.0053;//for cessna
+parameter Real Cn_delta_r = 0;//= -0.0657;//for cessna
+
+parameter Real del[3] = {0,-0.246251,0};
+parameter Real thrust[3] = {4.47729 , 0, 0};
+parameter Real alphazero = 0.1;
+
+ ForceMoment_Gen forceMoment_Gen1( CD0 = CD0, CD_alpha = CD_alpha, CD_beta = CD_beta, CD_delta_e = CD_delta_e, CD_q = CD_q, CL0 = CL0, CL_alpha = CL_alpha, CL_delta_e = CL_delta_e, CL_q = CL_q, Cl_beta = Cl_beta, Cl_delta_a = Cl_delta_a, Cl_delta_r =Cl_delta_r, Cl_p = Cl_p, Cl_r = Cl_r, Cm0 = Cm0, Cm_alpha = Cm_alpha, Cm_delta_e = Cm_delta_e, Cm_q = Cm_q, Cn_beta = Cn_beta, Cn_delta_a = Cn_delta_a, Cn_delta_r = Cn_delta_r, Cn_p = Cn_p, Cn_r = Cn_r, Cy_beta = Cy_beta, Cy_delta_a = Cy_delta_a, Cy_delta_r = Cy_delta_r, Cy_p = Cy_p, Cy_r = Cy_r,W =m * {0, 0, 9.81}, b= b, cbar =cbar, g = 9.81, m = 1.56, rho = 1.225, s = 0.2589) annotation(
+ Placement(visible = true, transformation(origin = {-9, 1}, extent = {{-17, -17}, {17, 17}}, rotation = 0)));
+ Flight6DOF flight6DOF1(J = {{0.1147, 0, -0.0015}, {0, 0.0576, 0}, {-0.0015, 0, 0.1712}}, g = {0,0, 9.81},mass = m, omega( fixed = true,start = {0, 0, 0}), pos(start = {0, 0, -1000}), v(start = {15.8114*cos(alphazero), 0, 15.8114*sin(alphazero)})) annotation(
+ Placement(visible = true, transformation(origin = {47, -1}, extent = {{-13, -13}, {13, 13}}, rotation = 0)));
+
+Modelica.Blocks.Sources.RealExpression[3] realExpression1(y = if time > 10 and time < 20 then {0, -0.01304370748, 0} else del) annotation( Placement(visible = true, transformation(origin = {-93, -3}, extent = {{-15, -9}, {15, 9}}, rotation = 0)));
+
+initial equation
+forceMoment_Gen1.alpha = alphazero;
+forceMoment_Gen1.angles[2] = alphazero;
+
+
+equation
+ //forceMoment_Gen1.delta = del;
+ connect(forceMoment_Gen1.delta, realExpression1.y) annotation( Line(points = {{-28, -4}, {-53.5, -4}, {-53.5, -3}, {-76.5, -3}}, color = {0, 0, 127}, thickness = 0.5));
+
+ connect(flight6DOF1.angles, forceMoment_Gen1.angles) annotation(
+ Line(points = {{61, -13}, {102, -13}, {102, 52}, {-18, 52}, {-18, 20}, {-17.5, 20}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(flight6DOF1.v, forceMoment_Gen1.vel) annotation(
+ Line(points = {{61, 11}, {90, 11}, {90, 42}, {-6, 42}, {-6, 20}, {-9, 20}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(forceMoment_Gen1.Force, flight6DOF1.Force) annotation(
+ Line(points = {{10, 6}, {33, 6}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(flight6DOF1.Moment, forceMoment_Gen1.Moment) annotation(
+ Line(points = {{33, -7}, {21.5, -7}, {21.5, -4}, {10, -4}}, color = {0, 0, 127}, thickness = 0.5));
+ connect(flight6DOF1.omega, forceMoment_Gen1.omega) annotation(
+ Line(points = {{61, -5}, {98, -5}, {98, 32}, {-0.5, 32}, {-0.5, 20}}, color = {0, 0, 127}, thickness = 0.5));
+ forceMoment_Gen1.thrust = thrust;
+
+
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+ end TestFmZagi; \ No newline at end of file
diff --git a/Trim_Cessna.mo b/Trim_Cessna.mo
new file mode 100644
index 0000000..d688d79
--- /dev/null
+++ b/Trim_Cessna.mo
@@ -0,0 +1,96 @@
+model Trim_Cessna
+
+
+import Modelica.SIunits.*;
+import Modelica.Math.Matrices.*;
+
+parameter Real m = 1043.26;//
+parameter Real s = 16.1651;//reference area
+parameter Real cbar = 1.493 ;//average chord
+parameter Real b = 10.911 ;//span
+parameter Real W[3] = m*{0,0, 9.81};//gravitational force
+
+
+
+parameter Real CD0 = 0.036;//
+parameter Real K_drag = 0.0830304;//for cessna
+parameter Real CD_beta = 0.17;//for cessna
+parameter Real CD_alpha= 0.2108;
+parameter Real CD_q = 0;
+parameter Real CD_delta_e= 0.3045;
+
+//side force
+parameter Real Cy_beta = -0.31;//for cessna
+parameter Real Cy_p = -0.037;//for cessna
+parameter Real Cy_r = 0.21;//for cessna
+parameter Real Cy_delta_r = 0.187; //for cessna
+parameter Real Cy_delta_a= 0; //for cessna
+
+// lift
+parameter Real CL0 = 0.25; //for cessna
+parameter Real CL_alpha = 4.47;//for cessna
+parameter Real CL_q = 3.9;//for cessna
+parameter Real CL_delta_e = 0.3476;//for cessna
+
+// rolling moment
+parameter Real Cl_beta = -0.089;//for cessna
+parameter Real Cl_p = -0.47;//for cessna
+parameter Real Cl_r = 0.096;//for cessna
+parameter Real Cl_delta_a= -0.09;//for cessna
+parameter Real Cl_delta_r = 0.0147;//for cessna
+
+// pitching moment
+parameter Real Cm0 = -0.02;//for cessna
+parameter Real Cm_alpha = -1.8;//for cessna
+parameter Real Cm_q = -12.4;//for cessna
+parameter Real Cm_delta_e= -1.28;//for cessna
+
+// yawing moment
+parameter Real Cn_beta = 0.065;//for cessna
+parameter Real Cn_p = -0.03;//for cessna
+parameter Real Cn_r = -0.99;//for cessna
+parameter Real Cn_delta_a = -0.0053;//for cessna
+parameter Real Cn_delta_r = -0.0657;//for cessna
+
+parameter Real rho = 1.225;
+parameter Real[3,3] J = {{1285.31, 0.0, 0.0}, {0.0, 1824.93, 0.0}, {0.0, 0.0, 2666.893}};
+Real L;
+Real D;
+
+Real Q;
+
+
+Real V;
+
+parameter Real[3] omega = {0,0.0,0};
+
+Real CL;
+Real CD;
+parameter Real alpha = 0.1;
+Real de;//To be pasted in delta[2] in the TestFm file
+Real thrust;//To be pasted in thrust[1] in the TestFm file
+Real theta = alpha;
+
+
+equation
+
+
+Q=0.5*rho*V^2;
+
+0 = Cm0+Cm_alpha*alpha+((Cm_q*omega[2]*cbar)/(2*V))+Cm_delta_e*de;
+CL = CL0+CL_alpha*alpha+((CL_q*omega[2]*cbar)/(2*V))+CL_delta_e*de;
+//CD = CD0+CD_alpha*alpha+((CD_q*omega[2]*cbar)/(2*V))+CD_delta_e*abs(de);// + CDbeta * beta + CDdeltae *
+CD = CD0 + K_drag*CL^2;
+
+//Elevator;
+// forces and moments
+
+L = CL*s*Q;
+D = CD*s*Q;
+
+
+
+0 = -D*cos(alpha)+L*sin(alpha)+thrust - m*9.81*sin(theta);
+0 = -D*sin(alpha)-L*cos(alpha)+m*9.81*cos(theta);
+
+end Trim_Cessna; \ No newline at end of file
diff --git a/avr_test.mo b/avr_test.mo
new file mode 100755
index 0000000..8f510fd
--- /dev/null
+++ b/avr_test.mo
@@ -0,0 +1,29 @@
+within MDD_Practice;
+model avr_test
+
+ Modelica.Blocks.Sources.Sine sine1(amplitude = 100, freqHz = 0.25, offset = 50) annotation(
+ Placement(visible = true, transformation(origin = {-72, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.Packager packager1(useBackwardPropagatedBufferSize = true, useBackwardSampleTimePropagation = true, userBufferSize = 16 * 64) annotation(
+ Placement(visible = true, transformation(origin = {-30, 76}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.AddReal addReal1(byteOrder = Modelica_DeviceDrivers.Utilities.Types.ByteOrder.LE, n = 1, nu = 1) annotation(
+ Placement(visible = true, transformation(origin = {-30, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortSend serialPortSend1(Serial_Port = "/dev/ttyACM1",autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B9600, enableExternalTrigger = false, sampleTime = 0.1) annotation(
+ Placement(visible = true, transformation(origin = {-30, 4}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.OperatingSystem.SynchronizeRealtime synchronizeRealtime1 annotation(
+ Placement(visible = true, transformation(origin = {68, 76}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ Modelica_DeviceDrivers.Blocks.Communication.SerialPortReceive serialPortReceive1(Serial_Port = "/dev/ttyACM1", autoBufferSize = true, baud = Modelica_DeviceDrivers.Utilities.Types.SerialBaudRate.B9600) annotation(
+ Placement(visible = true, transformation(origin = {32, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+ Modelica_DeviceDrivers.Blocks.Packaging.SerialPackager.GetReal getReal1 annotation(
+ Placement(visible = true, transformation(origin = {32,16}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+ connect(serialPortReceive1.pkgOut, getReal1.pkgIn) annotation(
+ Line(points = {{32, 45}, {32, 27}}));
+ connect(addReal1.pkgOut[1], serialPortSend1.pkgIn) annotation(
+ Line(points = {{-30, 29.2}, {-30, 29.2}, {-30, 13.2}, {-30, 13.2}}, thickness = 0.5));
+ connect(sine1.y, addReal1.u[1]) annotation(
+ Line(points = {{-61, 40}, {-43, 40}, {-43, 40}, {-43, 40}}, color = {0, 0, 127}));
+ connect(packager1.pkgOut, addReal1.pkgIn) annotation(
+ Line(points = {{-30, 65.2}, {-30, 65.2}, {-30, 49.2}, {-30, 49.2}}));
+ annotation(
+ uses(Modelica_DeviceDrivers(version = "1.5.0"), Modelica(version = "3.2.2")));
+end avr_test; \ No newline at end of file
diff --git a/basic_1st_order.mo b/basic_1st_order.mo
new file mode 100755
index 0000000..dba9353
--- /dev/null
+++ b/basic_1st_order.mo
@@ -0,0 +1,6 @@
+class basic_1st_order
+ Modelica.Blocks.Continuous.FirstOrder firstOrder1(T = 1, k = 1) annotation(
+ Placement(visible = true, transformation(origin = {-4, 4}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+ annotation(
+ uses(Modelica(version = "3.2.2")));
+end basic_1st_order; \ No newline at end of file
diff --git a/log.out b/log.out
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/log.out
diff --git a/runMDDManasTest b/runMDDManasTest
new file mode 100644
index 0000000..a8e7947
--- /dev/null
+++ b/runMDDManasTest
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/siddharth/Modelica_HIL_Tasks/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/siddharth/OpenModelica-Arduino/Arduino.mo");
+getErrorString();
+
+translateModel(Arduino.SerialCommunication.MDD_Examples.MDD_led.MDD_led_blue_red, fileNamePrefix="led_blue_red");
+getErrorString();
diff --git a/runMDDManasTest.mos b/runMDDManasTest.mos
new file mode 100644
index 0000000..9d424a6
--- /dev/null
+++ b/runMDDManasTest.mos
@@ -0,0 +1,11 @@
+loadModel(Modelica);
+getErrorString();
+
+loadFile("/home/siddharth/Downloads/Modelica_DeviceDrivers/Modelica_DeviceDrivers/package.mo");
+getErrorString();
+
+loadFile("/home/siddharth/Modelica-H-I-L-Tasks/ManasTestModel.mo");
+getErrorString();
+
+translateModel(ManasTestModel, fileNamePrefix="ManasTest");
+getErrorString();