model/0000700010304500001470000000000011521770711012015 5ustar cspkajdcsothermodel/AssesmentMethod.txt0000600010304500001470000000002411521704300015646 0ustar cspkajdcsother30% paper 70% modelmodel/ReadMe.txt0000600010304500001470000000043711521704336013721 0ustar cspkajdcsother# # Author: Mohammed Alhourani # MSc Computer Science and applications # 1)open Cadence and exectue file "rocket_cadence.dasm" 2)Eden window will open Automatically 3)in Eden window Execute "rocket.s" this will show the UI, have fun assesment method 30% paper 70% modelmodel/rocket_cadence.dasm0000600010304500001470000001246011521703374015622 0ustar cspkajdcsother%include "eden/eden.dasm"; .eden edenParams = (new type = Handle ); .eden cadenceParams = (new type = Oracle y = 0 x = 0 reachedGround = 0 currentTime = 0 rocketWeight = 0 fuelMass = 0 velocity = 0 thrust = 0 drag = 0 weight = 0 rotationAngel = 0 rocketMass = 0 ); @eden = (.eden); @InitParameters = (new Pi is { 3.14159 } InitialHeight is {@eden edenParams initialHeight} InitialVelocity is {@eden edenParams initialVelocity} LaunchAngelDegrees is { @eden edenParams launchAngelDegrees } LaunchAngelRadians is { .LaunchAngelDegrees * (.Pi) / 180.0 } LaunchSin is { @root math sin (.LaunchAngelRadians) } LaunchCos is { @root math cos (.LaunchAngelRadians) } Environment =(new Cd is {@eden edenParams environment_Cd} g is {@eden edenParams environment_g} p is {@eden edenParams environment_p} ) ); @timer = (new Start is { if( 0< (@eden edenParams startSimulation)) { true } else { false } } SpeedRatio is {@eden edenParams timeSpeedRatio} DeltaTime is { if(.Start) { @root itime * (..SpeedRatio) }else { 0.0 } } TotalTime = 0.0 TotalTime := { if(.Start) { 0 + (..TotalTime) + (..DeltaTime) }else { 0.0 } } ); @Fuel = (new MassBurningRate is {@eden edenParams fuel_burningRate} ExhaustVelocity is {@eden edenParams fuel_exhaustVelocity} ); @Thrust = (new HaveFuel is { true } ThrustValue is { if(.HaveFuel) { @Fuel MassBurningRate * (@Fuel ExhaustVelocity) }else { 0.0 } } ); @Rocket = (new RocketMass is {@eden edenParams rocket_baseWeight} FuelMassInit is {@eden edenParams rocket_initFuelWeight} BodyBaseArea is {@eden edenParams rocket_bodyBaseArea} NozzleArea is {0.0005} ); @ODEs =(new RocketVelocity is {@InitParameters InitialVelocity} RocketVelocityY := { if(@timer Start) { 0+ (0 - (..WeightStep) - (..DragStepY) + (..ThrustYStep) ) / ( @Rocket TotalRocketMass ) * (@timer DeltaTime) + (..RocketVelocityY) }else{ 1.0 * (@InitParameters InitialVelocity) * (@InitParameters LaunchSin) } } RocketVelocityYAbs is { if(.RocketVelocityY < 0.0) { -1.0 * (..RocketVelocityY) }else{ 1.0 * (..RocketVelocityY) } } DragStepY is { 0.5 * (@InitParameters Environment p) * (.RocketVelocityY) * (.RocketVelocityYAbs) * (@InitParameters Environment Cd) * (@Rocket BodyBaseArea) * (@InitParameters LaunchSin) } RocketVelocityX := { if(@timer Start) { 0+ (0 - (..DragStepX) + (..ThrustXStep) ) / ( @Rocket TotalRocketMass ) * (@timer DeltaTime) + (..RocketVelocityX) }else{ 1.0 * (@InitParameters InitialVelocity) * (@InitParameters LaunchCos) } } RocketVelocityXAbs is { if(.RocketVelocityX < 0.0) { -1.0 * (..RocketVelocityX) }else{ 1.0 * (..RocketVelocityX) } } DragStepX is { 0.5 * (@InitParameters Environment p) * (.RocketVelocityX) * (.RocketVelocityXAbs) * (@InitParameters Environment Cd) * (@Rocket BodyBaseArea) * (@InitParameters LaunchCos) } WeightStep is { 1.0 * (@InitParameters Environment g) * (@Rocket TotalRocketMass) } ThrustYStep is { 1.0 * (@Thrust ThrustValue) * (@InitParameters LaunchSin) } ThrustXStep is { 1.0 * (@Thrust ThrustValue) * (@InitParameters LaunchCos) } RocketHeight = (@InitParameters InitialHeight) RocketHeight := { if(@timer Start) { 1 * (..RocketHeight) + (1 * (..RocketVelocityY) * (@timer DeltaTime)) }else{ 1.0 * (@InitParameters InitialHeight) } } RocketDistance = 0 RocketDistance := { if(@timer Start) { 1 * (..RocketDistance) + (1 * (..RocketVelocityX) * (@timer DeltaTime)) }else{ 0.0 } } GetVelocitySignY is { if(.RocketVelocityY < 0.0) { -1.0 }else{ 1.0 } } GetThrustSignX is { if( 0.0 > (@InitParameters LaunchCos)) { -1.0 }else{ 1.0 } } FuelMass = (@Rocket FuelMassInit) FuelMass := { if(@timer Start) { if( ..HaveFuel ){ 1 * (..FuelMass) - (@timer DeltaTime) }else{ 0.0 } }else{ @Rocket FuelMassInit } } HaveFuel is {0.0 < (.FuelMass)} HaveReachedGround is { 0.0 > (.RocketHeight)} TotalVelocity is { @root math sqrt( 1 * (.RocketVelocityX) * (.RocketVelocityX) + 1 * (.RocketVelocityY) * (.RocketVelocityY) )} TotalDrag is { @root math sqrt( 1 * (.DragStepX) * (.DragStepX) + 1 * (.DragStepY) * (.DragStepY) )} RotationAngelRad is { if(.RocketVelocityXAbs > 0.0) { 1 * (@root math atan( 1 * (..RocketVelocityY) / (..RocketVelocityX))) }else{ 1 * (@InitParameters Pi) / 2 } } RotationAngelDegrees is { 180 * (.RotationAngelRad) / (@InitParameters Pi)} ); @Rocket TotalRocketMass is {.RocketMass+(@ODEs FuelMass) }; @Thrust HaveFuel is {@ODEs HaveFuel}; @eden cadenceParams y is {@ODEs RocketHeight}; @eden cadenceParams x is {@ODEs RocketDistance}; @eden cadenceParams currentTime is {@timer TotalTime}; @eden cadenceParams rocketWeight is {@ODEs WeightStep}; @eden cadenceParams rocketMass is {@Rocket TotalRocketMass}; @eden cadenceParams fuelMass is {@ODEs FuelMass}; @eden cadenceParams velocity is {@ODEs TotalVelocity}; @eden cadenceParams thrust is {@Thrust ThrustValue}; @eden cadenceParams drag is {@ODEs TotalDrag}; @eden cadenceParams weight is {@ODEs WeightStep}; @eden cadenceParams rotationAngel is {@ODEs RotationAngelRad}; @eden cadenceParams reachedGround is { if(@ODEs HaveReachedGround) { 1 } else { 0 } }; model/rocket.s0000600010304500001470000005010511521771207013474 0ustar cspkajdcsother## Author: Mohammed Alhourani ## Rocket Model ## %eden /* this sections have parameters whcih are linked to the UI input elements */ pi is 3.14159265; rotationAngel is cadenceParams::rotationAngel - pi/2; launchAngelDegrees is 90; startSimulation is 0; rocketBaseWeight is 0.15; rocketInitFuelWeight is 0.05; rocketBodyBaseArea is 0.001; timeSpeedRatio is 0.01; initialHeight is 0; initialVelocity is 0; environment_Cd is 0.35; environment_g is 9.8; environment_p is 1.22; fuel_burningRate is 0.06; fuel_exhaustVelocity is 550; /* this sections creates the Handler parameters whcih will interact with Cadence Engine */ edenParams::launchAngelDegrees is launchAngelDegrees ; edenParams::startSimulation is startSimulation; edenParams::rocket_baseWeight is rocketBaseWeight; edenParams::rocket_initFuelWeight is rocketInitFuelWeight; edenParams::rocket_bodyBaseArea is rocketBodyBaseArea; edenParams::timeSpeedRatio is timeSpeedRatio; edenParams::initialHeight is initialHeight; edenParams::initialVelocity is initialVelocity; edenParams::environment_Cd is environment_Cd; edenParams::environment_g is environment_g; edenParams::environment_p is environment_p; edenParams::fuel_burningRate is fuel_burningRate; edenParams::fuel_exhaustVelocity is fuel_exhaustVelocity; %donald viewport view1 # The following definitions define a Rocket ... # ... and some objects inside the Rocket. # openshape rocket within rocket { int baseRadious, bodyHeight,totalRocketHeight point NW, NE, SW, SE # the 4 corners of rocket main body point SW_Init # used for calculating movement path point cg, cp circle centreOfGravity circle centerOfPressure int half # half of base, rocket total height half = baseRadious div 2 line N, S, E, W # the 4 sides of rocket N = [NW, NE] S = [SW, SE] W = [NW, SW] E = [NE, SE] SE = SW + {baseRadious, 0} # the other 3 corners are NE = SW + {baseRadious, bodyHeight} # relative to SW corner NW = SW + {0, bodyHeight} # centreOfGravity = circle(cg, 5) ? A_rocket_centreOfGravity = "fill=solid,outlinecolor=red,color=red"; centerOfPressure = circle(cp, 2) ? A_rocket_centerOfPressure = "fill=solid,outlinecolor=green,color=green"; cg = SW+{half,bodyHeight div 2} cp = cg + {0,-20} openshape nose within nose { int noseHeight line ns1,ns2,ns3 #nose sides ns1 = [~/NW, ~/NE] ns2 = [~/NE, ~/NE+{-~/half, noseHeight} ] ns3 = [~/NE+{-~/half, noseHeight}, ~/NW] } openshape nuzzle within nuzzle { int nuzzleHeight,nuzzleBase int halfNuzzleBase halfNuzzleBase = nuzzleBase div 2 line ns1,ns2,ns3 #nuzzle sides ns1 = [~/SE+{-~/half, 0}, ~/SE+{-~/half - halfNuzzleBase, -nuzzleHeight} ] ns2 = [ ~/SE+{-~/half - halfNuzzleBase, -nuzzleHeight} , ~/SE+{-~/half + halfNuzzleBase, -nuzzleHeight} ] ns3 = [ ~/SE+{-~/half + halfNuzzleBase, -nuzzleHeight} ,~/SE+{-~/half, 0}] } totalRocketHeight = bodyHeight + nuzzle/nuzzleHeight + nose/noseHeight } viewport view shape rotatedRocket # this is used to rotate the rocket when moving based on the Velocity rotation angel rotatedRocket = rot(rocket,rocket/cg,rotationAngel!) %scout display scr, basicScreen; window don1, don2; integer zoomSize,isHeightBiggerThanBase; point zoomPos; point rocketPosition; point p1, q1, p2, q2; p1 = {25, 20}; q1 = {225, 220}; #main window which shows rocket movement don1 = { box: [p1, q1], pict: "view", type: DONALD, xmin: 0, ymin: 0, xmax: 3000, ymax: 3000, border: 1 sensitive: ON }; rocketPosition = {500,500}; zoomPos = {0, 0}; zoomSize = 500; %eden isHeightBiggerThanBase is _rocket_totalRocketHeight - _rocket_baseRadious; /* this will be used to determine Zoom window size*/ proc update_zoomSIze:isHeightBiggerThanBase { if (isHeightBiggerThanBase >0) { zoomSize = _rocket_totalRocketHeight; } else{ zoomSize =_rocket_baseRadious; } } %scout p2 = {650, 20}; q2 = {950, 420}; #Zoom window which shows rocket rotation when moving don2 = { box: [p2, q2], pict: "view", type: DONALD, xmin: rocketPosition.1- zoomSize/2-10, ymin: rocketPosition.2 - zoomSize/2-40, xmax: rocketPosition.1+ zoomSize/2+20, ymax: rocketPosition.2 + zoomSize/2+10, border: 1 sensitive: ON }; %scout #in this section we define all elements related to input elements # integer windowHeight,windowWidth,offsetY,offsetX; windowHeight = 1; windowWidth = 5; offsetY = 50; offsetX = 210; window txtWeight,lblWeight; point posWeight; string strWeight; strWeight = "Rocket Body Weight kg"; posWeight = {10,250}; lblWeight = { frame: ([posWeight, 1, strlen(strWeight)]), string: strWeight, border: 1 sensitive: ON }; txtWeight = { type:TEXTBOX frame:([posWeight+{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtFuel,lblFuel; point posFuel; string strFuel; strFuel = "Fuel Weight kg"; posFuel = posWeight+{0,offsetY}; lblFuel = { frame: ([posFuel, 1, strlen(strFuel)]), string: strFuel, border: 1 sensitive: ON }; txtFuel = { type:TEXTBOX frame:([posFuel+{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtFuelBurningRate,lblFuelBurningRate; point posFuelBurningRate; string strFuelBurningRate; strFuelBurningRate = "Fuel Burning Rate kg/s"; posFuelBurningRate = posWeight+{0,offsetY*2}; lblFuelBurningRate = { frame: ([posFuelBurningRate, 1, strlen(strFuelBurningRate)]), string: strFuelBurningRate, border: 1 sensitive: ON }; txtFuelBurningRate = { type:TEXTBOX frame:([posFuelBurningRate+{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtFuelExhaustVelocity,lblFuelExhaustVelocity; point posFuelExhaustVelocity; string strFuelExhaustVelocity; strFuelExhaustVelocity = "Exhaust Velocity m/s"; posFuelExhaustVelocity = posWeight+{0,offsetY*3}; lblFuelExhaustVelocity = { frame: ([posFuelExhaustVelocity, 1, strlen(strFuelExhaustVelocity)]), string: strFuelExhaustVelocity, border: 1 sensitive: ON }; txtFuelExhaustVelocity = { type:TEXTBOX frame:([posFuelExhaustVelocity+{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtEnvironment_p,lblEnvironment_p,lblLaunchOnEarth,lblLaunchOnMars; point posEnvironment_p; string strEnvironment_p; strEnvironment_p = "Air density (p) kg/m3"; posEnvironment_p = posWeight+{offsetX,offsetY*1}; lblEnvironment_p = { frame: ([posEnvironment_p, 1, strlen(strEnvironment_p)]), string: strEnvironment_p, border: 1 sensitive: ON }; txtEnvironment_p = { type:TEXTBOX frame:([posEnvironment_p+{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; lblLaunchOnEarth = { frame: ([posWeight+{offsetX,offsetY*0}, 1, strlen("Launch on Earth")]), string: "Launch on Earth", bgcolour:"green" border: 1 sensitive: ON }; lblLaunchOnMars = { frame: ([posWeight+{offsetX,offsetY/2}, 1, strlen("Launch on Mars")]), string: "Launch on Mars", bgcolour:"lightblue" border: 1 sensitive: ON }; window txtEnvironment_Cd,lblEnvironment_Cd; point posEnvironment_Cd; string strEnvironment_Cd; strEnvironment_Cd = "Drag coefficient (Cd)"; posEnvironment_Cd = posWeight+{offsetX,offsetY*2}; lblEnvironment_Cd = { frame: ([posEnvironment_Cd , 1, strlen(strEnvironment_Cd )]), string: strEnvironment_Cd , border: 1 sensitive: ON }; txtEnvironment_Cd = { type:TEXTBOX frame:([posEnvironment_Cd +{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtEnvironment_g,lblEnvironment_g; point posEnvironment_g; string strEnvironment_g; strEnvironment_g = "Acceleration (g) m2/s"; posEnvironment_g = posWeight+{offsetX,offsetY*3}; lblEnvironment_g = { frame: ([posEnvironment_g , 1, strlen(strEnvironment_g )]), string: strEnvironment_g , border: 1 sensitive: ON }; txtEnvironment_g = { type:TEXTBOX frame:([posEnvironment_g +{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtLaunchAngel,lblLaunchAngel; point posLaunchAngel; string strLaunchAngel; strLaunchAngel = "Launch angel (Degrees)"; posLaunchAngel = posWeight+{offsetX*2,offsetY*0}; lblLaunchAngel = { frame: ([posLaunchAngel , 1, strlen(strLaunchAngel )]), string: strLaunchAngel , border: 1 sensitive: ON }; txtLaunchAngel = { type:TEXTBOX frame:([posLaunchAngel +{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; window txtRocketArea,lblRocketArea; point posRocketArea; string strRocketArea; strRocketArea = "Rocket Area m2"; posRocketArea = posWeight+{offsetX*2,offsetY*1}; lblRocketArea = { frame: ([posRocketArea , 1, strlen(strRocketArea )]), string: strRocketArea , border: 1 sensitive: ON }; txtRocketArea = { type:TEXTBOX frame:([posRocketArea +{0,20},{windowWidth,windowHeight}]) border:1 sensitive:ON }; #these are the main buttons to launch the rocket, stopping the rocket, and changing the speed of the simulation window lblFire,lblRestart,lblSpeedAnimation,lblSlowAnimation,lblSpeedRatio,lblSpeedRatioVal; point posFire; string strFire; strFire = "Fire Rocket"; posFire = posWeight+{offsetX*0,offsetY*4}; lblFire = { frame: ([posFire , 1, strlen(strFire )]), string: strFire , bgcolor:"red", border: 1 sensitive: ON }; lblRestart = { frame: ([posFire +{130,0} , 1, strlen("Restart Launch" )]), string: "Restart Launch" , bgcolor:"white", border: 1 sensitive: ON }; lblSpeedAnimation = { frame: ([posFire +{310,0} , 1, strlen("Speed Time" )]), string: "Speed Time" , bgcolor:"orange", border: 1 sensitive: ON }; lblSlowAnimation = { frame: ([posFire +{500,0} , 1, strlen("Slow Time" )]), string: "Slow Time" , bgcolor:"orange", border: 1 sensitive: ON }; lblSpeedRatio = { frame: ([posFire +{400,-20} , 1, strlen("Speed Ratio" )]), string: "Speed Ratio" , border: 1 sensitive: ON }; string strSpeedRatioVal; %eden strSpeedRatioVal is str(timeSpeedRatio); %scout lblSpeedRatioVal = { frame: ([posFire +{420,0} , 1, strlen(strSpeedRatioVal)]), string: strSpeedRatioVal , bgcolor:"white", border: 1 sensitive: ON }; integer offsetX2,offsetY2; point posWeight2; offsetX2 = 100; offsetY2 = 22; posWeight2 = {240,25}; window lblTime,lblTimeVal; point posTime; string strTime,strTimeVal; strTime = "Time (S)"; posTime = posWeight2+{offsetX2*0,offsetY2*0}; %eden strTimeVal is str(cadenceParams::currentTime); %scout lblTimeVal = { frame: ([posTime , 1, strlen(strTimeVal)]), string: strTimeVal , bgcolor:"white", border: 1 sensitive: ON }; lblTime = { frame: ([posTime +{100,0} , 1, strlen(strTime )]), string: strTime , bgcolor:"yellow", border: 1 sensitive: ON }; window lblHeight,lblHeightVal; point posHeight; string strHeight,strHeightVal; strHeight = "Height (m)"; posHeight = posWeight2+{offsetX2*0,offsetY2*1}; %eden strHeightVal is str(rocketY); %scout lblHeightVal = { frame: ([posHeight , 1, strlen(strHeightVal)]), string: strHeightVal , bgcolor:"white", border: 1 sensitive: ON }; lblHeight = { frame: ([posHeight +{100,0} , 1, strlen(strHeight )]), string: strHeight , bgcolor:"yellow", border: 1 sensitive: ON }; window lblDistance,lblDistanceVal; point posDistance; string strDistance,strDistanceVal; strDistance = "Distance (m)"; posDistance = posWeight2+{offsetX2*0,offsetY2*2}; %eden strDistanceVal is str(rocketX); %scout lblDistanceVal = { frame: ([posDistance , 1, strlen(strDistanceVal)]), string: strDistanceVal , bgcolor:"white", border: 1 sensitive: ON }; lblDistance = { frame: ([posDistance +{100,0} , 1, strlen(strDistance )]), string: strDistance , bgcolor:"yellow", border: 1 sensitive: ON }; window lblThrust,lblThrustVal; point posThrust; string strThrust,strThrustVal; strThrust = "Thrust (N)"; posThrust = posWeight2+{offsetX2*0,offsetY2*3}; %eden strThrustVal is str(cadenceParams::thrust); %scout lblThrustVal = { frame: ([posThrust , 1, strlen(strThrustVal)]), string: strThrustVal , bgcolor:"white", border: 1 sensitive: ON }; lblThrust = { frame: ([posThrust +{100,0} , 1, strlen(strThrust )]), string: strThrust , bgcolor:"yellow", border: 1 sensitive: ON }; window lblRocketMass,lblRocketMassVal; point posRocketMass; string strRocketMass,strRocketMassVal; strRocketMass = "Rocket Mass (kg)"; posRocketMass = posWeight2+{offsetX2*0,offsetY2*4}; %eden strRocketMassVal is str(cadenceParams::rocketMass); %scout lblRocketMassVal = { frame: ([posRocketMass , 1, strlen(strRocketMassVal)]), string: strRocketMassVal , bgcolor:"white", border: 1 sensitive: ON }; lblRocketMass = { frame: ([posRocketMass +{100,0} , 1, strlen(strRocketMass )]), string: strRocketMass , bgcolor:"yellow", border: 1 sensitive: ON }; window lblFuelMass,lblFuelMassVal; point posFuelMass; string strFuelMass,strFuelMassVal; strFuelMass = "Fuel Mass (kg)"; posFuelMass = posWeight2+{offsetX2*0,offsetY2*5}; %eden strFuelMassVal is str(cadenceParams::fuelMass); %scout lblFuelMassVal = { frame: ([posFuelMass , 1, strlen(strFuelMassVal)]), string: strFuelMassVal , bgcolor:"white", border: 1 sensitive: ON }; lblFuelMass = { frame: ([posFuelMass +{100,0} , 1, strlen(strFuelMass )]), string: strFuelMass , bgcolor:"yellow", border: 1 sensitive: ON }; window lblVelocity,lblVelocityVal; point posVelocity; string strVelocity,strVelocityVal; strVelocity = "Velocity (m/s)"; posVelocity = posWeight2+{offsetX2*0,offsetY2*6}; %eden strVelocityVal is str(cadenceParams::velocity); %scout lblVelocityVal = { frame: ([posVelocity , 1, strlen(strVelocityVal)]), string: strVelocityVal , bgcolor:"white", border: 1 sensitive: ON }; lblVelocity = { frame: ([posVelocity +{100,0} , 1, strlen(strVelocity )]), string: strVelocity , bgcolor:"yellow", border: 1 sensitive: ON }; window lblDrag,lblDragVal; point posDrag; string strDrag,strDragVal; strDrag = "Drag (N)"; posDrag = posWeight2+{offsetX2*0,offsetY2*7}; %eden strDragVal is str(cadenceParams::drag); %scout lblDragVal = { frame: ([posDrag , 1, strlen(strDragVal)]), string: strDragVal , bgcolor:"white", border: 1 sensitive: ON }; lblDrag = { frame: ([posDrag +{100,0} , 1, strlen(strDrag )]), string: strDrag , bgcolor:"yellow", border: 1 sensitive: ON }; window lblWeight2,lblWeightVal; point posWeightlbl; string strWeight2,strWeightVal; strWeight2 = "Weight (N)"; posWeightlbl = posWeight2+{offsetX2*0,offsetY2*8}; %eden strWeightVal is str(cadenceParams::weight); %scout lblWeightVal = { frame: ([posWeightlbl , 1, strlen(strWeightVal)]), string: strWeightVal , bgcolor:"white", border: 1 sensitive: ON }; lblWeight2 = { frame: ([posWeightlbl +{100,0} , 1, strlen(strWeight2 )]), string: strWeight2 , bgcolor:"yellow", border: 1 sensitive: ON }; window lblVelocityAngelDegrees,lblVelocityAngelDegreesVal; point posVelocityAngelDegrees; string strVelocityAngelDegrees,strVelocityAngelDegreesVal; strVelocityAngelDegrees = "Velocity Direction (Degrees)"; posVelocityAngelDegrees = {650,450}; %eden strVelocityAngelDegreesVal is str(cadenceParams::rotationAngel*180/pi); %scout lblVelocityAngelDegreesVal = { frame: ([posVelocityAngelDegrees , 1, strlen(strVelocityAngelDegreesVal)]), string: strVelocityAngelDegreesVal , bgcolor:"white", border: 1 sensitive: ON }; lblVelocityAngelDegrees = { frame: ([posVelocityAngelDegrees +{100,0} , 1, strlen(strVelocityAngelDegrees )]), string: strVelocityAngelDegrees , bgcolor:"yellow", border: 1 sensitive: ON }; window lblNotice; point posNotice; string strNotice; strNotice = "Please Maximise this Window to see all elements (For better Experience)"; posNotice = {10,470}; lblNotice = { frame: ([posNotice , 1, strlen(strNotice)]), string: strNotice , bgcolor:"gray", border: 1 sensitive: ON }; basicScreen = < don1/don2 /txtWeight/lblWeight/txtFuel/lblFuel/txtFuelBurningRate/lblFuelBurningRate /txtFuelExhaustVelocity/lblFuelExhaustVelocity/lblEnvironment_p/txtEnvironment_p /lblLaunchOnEarth/lblLaunchOnMars/lblEnvironment_Cd/txtEnvironment_Cd/lblEnvironment_g/txtEnvironment_g /lblLaunchAngel/txtLaunchAngel/lblRocketArea/txtRocketArea/lblFire/lblRestart/lblTime/lblTimeVal/lblHeightVal/lblHeight /lblDistanceVal/lblDistance/lblThrustVal/lblThrust/lblRocketMassVal/lblRocketMass/lblFuelMassVal/lblFuelMass /lblVelocityVal/lblVelocity/lblSpeedAnimation/lblSlowAnimation/lblVelocityAngelDegrees/lblVelocityAngelDegreesVal /lblNotice/lblSpeedRatio/lblSpeedRatioVal/lblDrag/lblDragVal/lblWeight2/lblWeightVal>; screen = basicScreen ; %eden /* events on labels */ proc lblLaunchOnEarth_click: lblLaunchOnEarth_mouse_1 { if (lblLaunchOnEarth_mouse_1[2] == 4) { txtEnvironment_Cd_setText( "0.7"); txtEnvironment_g_setText( "9.8"); txtEnvironment_p_setText( "1.22"); } } proc lblLaunchOnMars_click: lblLaunchOnMars_mouse_1 { if (lblLaunchOnMars_mouse_1[2] == 4) { txtEnvironment_Cd_setText( "0.35"); txtEnvironment_g_setText("3.7"); txtEnvironment_p_setText( "0.015"); } } proc lblFire_click: lblFire_mouse_1 { if (lblFire_mouse_1[2] == 4 && startSimulation <1 ) { fuel_exhaustVelocity=float(txtFuelExhaustVelocity_getText()); fuel_burningRate=float(txtFuelBurningRate_getText()); rocketInitFuelWeight=float(txtFuel_getText()); rocketBaseWeight=float(txtWeight_getText()); launchAngelDegrees = float(txtLaunchAngel_getText( )); rocketBodyBaseArea = float(txtRocketArea_getText()); environment_Cd=float(txtEnvironment_Cd_getText()); environment_g=float(txtEnvironment_g_getText( )); environment_p=float(txtEnvironment_p_getText()); startSimulation = 1; } } proc lblRestart_click: lblRestart_mouse_1 { if (lblRestart_mouse_1[2] == 4 && startSimulation > 0) { startSimulation = 0; } } proc lblSpeedAnimation_click: lblSpeedAnimation_mouse_1 { if (lblSpeedAnimation_mouse_1[2] == 4) { timeSpeedRatio = timeSpeedRatio + 0.02; } } proc lblSlowAnimation_click: lblSlowAnimation_mouse_1 { if (lblSlowAnimation_mouse_1[2] == 4 && timeSpeedRatio > 0.03) { timeSpeedRatio = timeSpeedRatio - 0.02; } } %donald within rocket { bodyHeight = 200 baseRadious = 80 SW = {1500, nuzzle/nuzzleHeight+1} SW_Init = {1500, nuzzle/nuzzleHeight+1} within nose { noseHeight = 40 } within nuzzle{ nuzzleHeight,nuzzleBase = 40,72 } } %eden rocketX is cadenceParams::x; /*linking cadene calculated positions with eden*/ rocketY is cadenceParams::y; rocketHitGround is cadenceParams::reachedGround; proc move_rocket_X : rocketX { _rocket_SW = [_rocket_SW[1],rocketX*100+1500,_rocket_SW[3]]; eager(); } proc move_rocket_Y : rocketY { _rocket_SW = [_rocket_SW[1],_rocket_SW[2],rocketY*100+_rocket_nuzzle_nuzzleHeight+1]; eager(); } proc rocket_hit_ground : rocketHitGround { if(rocketHitGround>0) { startSimulation = 0; } } proc zoom_positioning : _rocket_SW { rocketPosition = pt_add(zoomPos, [_rocket_SW[2]+_rocket_half, _rocket_SW[3]+_rocket_totalRocketHeight/2]); } txtFuelExhaustVelocity_setText( "550"); txtFuelBurningRate_setText( "0.06"); txtFuel_setText( "0.05"); txtWeight_setText( "0.15"); txtLaunchAngel_setText( "90"); txtRocketArea_setText( "0.001"); txtRocketArea_setText( "0.001"); txtEnvironment_Cd_setText( "0.7"); txtEnvironment_g_setText( "9.8"); txtEnvironment_p_setText( "1.22");