// file euler3.hppprgm by jaime meza
// version 0.1
// parámetros m: masa del paracaidista,
// ta: tiempo de análisis, altura
// GLOBAL
export m, ta, paso, h;
//default values
// constantes g: aceleración,
local g, c;
// c: coeficiente de resistencia del aire
local t; // t: tiempo
// vi: velocidad inicial,
// tf: tiempo inicial
local vi;ti;vf;tf;iteration;
local v(t) // función: velocidad final
begin
return vi+(g-(c/m)*vi)*(t-ti);
end;
export euler3()
BEGIN
local offsetField0 := 0; //0%
local offsetField5 := 5; //10%
local offsetField10 := 10; //%
local offsetField15 := 15; //%
local offsetField20 := 20; //%
local offsetField25 := 25; //%
local offsetField30 := 30; //%
local offsetField40 := 40; //%
local offsetField45 := 45; //%
local offsetField50 := 50; //%
//...
local offsetField100 := 100; //100%
local widthField0 := 0; //0%
local widthField10 := 10; //%
local widthField15 := 15; //%
local widthField20 := 20; //%
local widthField25 := 25; //%
local widthField30 := 30; //%
local widthField40 := 40; //%
local widthField50 := 50; //%
// ...
// page 1
local lineField0 := 0;
local lineField1 := 1;
local lineField2 := 2;
local lineField3 := 3;
local lineField4 := 4;
local lineField5 := 5;
local lineField6 := 6;
// page 2
local lineField7 := 7;
local lineField8 := 8;
local lineField9 := 9;
local lineField10 := 10;
// ...
local ObjectType_Real := 0;
local empty:="";
m:=68.5;
h:=10000;
paso:=2;
ta:=10;
input(
{
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField0 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField1 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField2 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField3 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField4 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField5 } },
{ empty, [ ObjectType_Real ],
{ offsetField100, widthField0, lineField6 } },
{ m, [ ObjectType_Real ],
{ offsetField10, widthField20, lineField7 } },
{ h, [ ObjectType_Real ],
{ offsetField10, widthField20, lineField8 } },
{ paso, [ ObjectType_Real ],
{ offsetField10, widthField20, lineField9 } },
{ ta, [ ObjectType_Real ],
{ offsetField10, widthField20, lineField10 } }
},
{ "Método de Euler", "Input" },
{ "By ",
"Compsystems ",
"version 0.1 junio 2017 ",
"",
"",
"",
"Press [Page 1/#] to continue ",
"m:"
},
{ "", "", "", "", "", "", "",
"Entre la masa del paracaidista (kg)",
"Entre altura de caida (pies)",
"Entre paso (s)",
"Entre tiempo de analisis (s)"
}
);
g:=9.81; c:=12.5;
vi:=0;
ti:=0;
iteration:=1; ta:=10; paso:=2;
// clear terminal view (output)
print;
print("press [↓] for next iteration" );
print("euler2");
print("press [on] for exit" );
wait(1);
for tf from 0 to ta step paso do
print;
print("iteration = "+iteration);
vf:=v(tf);
print("vi = "+vi+" m/s");
print("ti = "+ti+" s");
print("tf = "+tf+" s");
print("vf("+tf+") = "+vf+" m/s");
print("");
vi:=vf;
ti:=tf;
iteration:=iteration+1;
wait();
end;
print("iterations finished" );
return("done");
return "Done";
END;