blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
214
content_id
stringlengths
40
40
detected_licenses
listlengths
0
50
license_type
stringclasses
2 values
repo_name
stringlengths
6
115
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
21 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
141k
586M
star_events_count
int64
0
30.4k
fork_events_count
int64
0
9.67k
gha_license_id
stringclasses
8 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
50 values
src_encoding
stringclasses
23 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
1 class
length_bytes
int64
5
10.4M
extension
stringclasses
29 values
filename
stringlengths
2
96
content
stringlengths
5
10.4M
eef3babc7adb1db65babd5af03b8c651f5c62ed4
449d555969bfd7befe906877abab098c6e63a0e8
/2159/CH7/EX7.3/73.sce
3b63052887c76aa566fd05ecff83fa42b2e48c1c
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
178
sce
73.sce
// problem 7.3 b=2.5 d=2.5 C=56 A=b*(7.5+d)*0.5 P=2.5+((b*b+d*d)^0.5)*2 m=A/P i=1/1200 Q=A*C*((m*i)^0.5) disp(Q*1000,"the diacharge through the channel in litres/sec")
164efb1eeb8100c3ce9e9305ee417dcd4fe5d1bb
7d8beb39000d2a95f50e45da16938847d4e74fed
/trajectory-20180709.sce
94f6d0909f95e65b45b7d215f642457ddfae45b7
[]
no_license
TheMagicNacho/artemis-trajectory
12ff3ea967ca0da8a1754ad4ff709b2433485fd8
f87e7de768ac6580232c9b04f0cf407abf31f457
refs/heads/master
2020-03-19T10:23:33.660658
2018-06-09T21:41:35
2018-06-09T21:41:35
136,366,001
0
0
null
null
null
null
UTF-8
Scilab
false
false
915
sce
trajectory-20180709.sce
// !!!!! VARIABLES !!!!!!!// tstep = 1; //sec - interval for graphing AA = 88; //degrees - Angle of Attack from horizon T = 1650245.73705; //N - Thrust // DOUBLE CHECK THE THRUST M0 = 200000; //g - initial mass of vehicle V = 11000; // m/s - velocity // !!!!!constants don't change !!!!!!// mdot = 592.64056;//mass flow is considered constant (kg/s) //DOUBLE CHECK THE MDOT Re = 6378135; //Radius of earth in meters Gr = 9.81; //gravity g; D = 0; // drag - left zero because there is no ATM X0 = 30000; //m - initial launch altitude Y0 = 0; //initial horizontal launch distance // !!!!!! CALCULATOR OUTPUTS !!!!!!! psi0 = 90 - AA; // angle from center line of rocket n = (T-D / M0 * Gr); //new constant z = tan(psi/2); // calculate change in altitude C = V / (z^(n-1) * (1+Z^2) ); v = C * z^(n-1) * (1+z^2); /// !!!!!!! PLOT GRAPH !!!!!!! plot ( altitude, distance);
05d1ddb1c6670314fd346855407b00d37b5f67de
449d555969bfd7befe906877abab098c6e63a0e8
/2825/CH6/EX6.4/Ex6_4.sce
8480fb10ad3e177fa51867304afb86e4f1c30d88
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
427
sce
Ex6_4.sce
//Ex6_4 Pg-335 clc Rb=330*10^(3) //base resistance in ohm Vcc=15 //supply voltage in V Vbe=0.7 //voltage drop in V Rl=3.3*10^(3) //load resistor in ohm Beta=60 //transistor gain Ib=(Vcc-Vbe)/Rb //base current in A Ic=Beta*Ib //collector current (value in textbook is wrong) Vce=Vcc-(Ic+Ib)*Rl printf("\n The collector emitter voltage = %.2f V\n ",Vce) //collector emitter voltage (value in textbook is wrong)
bd708087fc675ecc216463d32c704d02086ecdff
449d555969bfd7befe906877abab098c6e63a0e8
/3886/CH4/EX4.11/Ex4_11.sce
0f916a3802eae4dde207ae31c203c1c7699a8573
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
817
sce
Ex4_11.sce
//Analyse the truss by method of tension coefficient to determine the forces //Refer fig.4.19 //Consider entire structure //Taking moment about A YD=(40*2+50*6+30*4*sind(60)+60*4)/8 XA=-30 //kN YA=40+50+60-90.49 //kN //Take A as origin and determine co-ordinates of all other point //Consider equilibrium of individual joints //Joint A tAB=-(59.51/3.464) FAB=tAB*4 //kN tAE=64.36/4 FAE=tAE*4 //kN //Joint B tBE=-11.547+17.18 FBE=tBE*4 //kN tBC=0.5*(-17.18-5.637) FBC=tBC*4 //kN //Joint C tCD=-(14.434+37.818)/2 FCD=4*tCD //kN tCD=4 //kN tCE=-14.434-tCD FCE=11.692*4 //kN //Joint D tDE=-0.5*(-26.126) FDE=tDE*4 //kN printf("The forces in different members are:-\nAB=%.2d kN\nBC=%.2d kN\nCD=%.2d kN\nDE=%.2d kN\nEA=%.2d kN\nEB=%.2d kN\nEC=%.2d kN",FAB,FBC,FCD,FDE,FAE,FBE,FCE)
570a1b439a5f75e95d6a4f825d7ac42058105644
449d555969bfd7befe906877abab098c6e63a0e8
/1217/CH8/EX8.2/Exa8_2.sce
4391ec1cb4d0790324e497e8c8418b00eb6d78a1
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
521
sce
Exa8_2.sce
// Exa 8.2 clc; clear; close; // given data disp("We have : "); disp("Io1=gm1*(V1-Vo)"); disp("Io2=gm2*(V1-Vo)"); disp("But Vc=Io1/s*C1"); disp("So Io2=gm2(Io1/s*C1-Vo)") disp("We also have : Io2=(Vo-V1)*s*C2"); disp("Substituting for Io1 gives :"); disp("gm2*((gm1*(V1-Vo)-s*C1*Vo)/s*C1=(Vo-V1)/s*C2)"); disp("gm1*gm2*V1-gm1*gm2*Vo-gm2*s*C1*Vo=s^2*C1*C2*Vo-s^2*C1*C2*V1"); disp("Arranging terms to get Vo/V1 we have : "); disp("Transfer Function : V0/V1=(s^2*C1*C2+gm1*gm2)/(s^2*C1*C2+sgm1*C1+gm1*gm2)");
4d4a6e0eeb7aa9cb2a8394e025943fe180865f27
449d555969bfd7befe906877abab098c6e63a0e8
/2459/CH16/EX16.16/Ex16_16.sce
92b999d853fa2cab85269129f1cb3ba3ede078f4
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
399
sce
Ex16_16.sce
//chapter16 //example16.16 //page356 Vcc=18 // V R1=16 // kilo ohm R2=22 // kilo ohm Vbe=0.7 // V Re=910d-3 // kilo ohm V2=Vcc*R2/(R1+R2) Ve=V2-Vbe Ie=Ve/Re printf("voltage across Re = %.3f V \n",Ve) printf("emitter current = %.3f mA \n",Ie) clf() x=linspace(0,18,100) y=-(19.78/18)*x+19.78 xtitle("dc load line","Vce(volts)","Ic(mA)") plot2d(x,y,style=3,rect=[0,0,19,20])
0ea00181845b58c04f8502745887b6f992c004f4
449d555969bfd7befe906877abab098c6e63a0e8
/662/CH3/EX3.1/ex3_1.sce
6b1b5df94ea1479d73ea06dd5513a44833c598de
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
896
sce
ex3_1.sce
//Example 3.1 //unsigned integer operands a=10 b=3 printf("\n\na+b=%d", a+b); printf("\na-b= %d", a-b); printf("\na*b= %d", a*b); printf("\na/b= %d", a/b); ab = modulo(a,b); //in scilab modulo() function is used instead of % operator of c. printf("\n a\b= %d",ab); v1=12.5 v2=2.0 printf("\n\nv1+v2=%f", v1+v2); printf("\nv1-v2= %f",v1-v2); printf("\nv1*v2= %f", v1*v2); printf("\nv1/v2= %f", v1/v2); // in scilab variables are not stored as thier ASCII values as in case of c. //so for calculations including characters is done with the help of ascii(). c1='P' c2='T' printf("\n\nc1 = %d", ascii(c1)); c= ascii(c1)+ascii(c2); printf("\nc1 + c2 = %d",c); c=c+5; printf("\nc1 + c2 + 5 = %d", c); c=c+ascii('5'); printf("\n Here 5 is character, hence diff from statement above:"); printf("\nc1 + c2 + 5 = %d", c);
19fcf630b904cf8830592e51554c743154d9e47a
449d555969bfd7befe906877abab098c6e63a0e8
/2741/CH4/EX4.8/Chapter4_Example8.sce
0d5fe54c6dd03fc37d21f0e09806f5a3c23b0d6f
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
591
sce
Chapter4_Example8.sce
clc clear //Input data t=16.5;//The temperature of air in degree centigrade d=6.5;//The dew point in degree centigrade s1=7.05;//S.V.P at 6 degree centigrade in mm s2=7.51;//S.V.P at 7 degree centigrade in mm s3=13.62;//S.V.P at 16 degree centigrade in mm s4=14.42;//S.V.P at 17 degree centigrade in mm //Calculations s5=(s1+s2)/2;//S.V.P at 6.5 degree centigrade in mm s6=(s3+s4)/2;//S.V.P at 16.5 degree centigrade in mm R=(s5/s6)*100;//Relative humidity of air in percent //Output printf('The percentage relative humidity of air is R.H = %3.1f percent ',R)
1f0236e126440fb6937d6d3ab5cbba25d1a37771
1a7b63c9449ba39c7fa962de1460f524275ed219
/workshop04/Memoryx.tst
9ef4fb63381280eef2bb56cc025a460a25c28c3f
[ "MIT" ]
permissive
raymondsim/Computer-System
9325bb2375b3dcea7ad16398fb147d6504ea7202
0b4de4d55157d92e64cae4af048933e39cb09c1f
refs/heads/main
2023-08-24T23:45:42.889417
2021-10-10T11:51:21
2021-10-10T11:51:21
415,566,076
4
0
null
null
null
null
UTF-8
Scilab
false
false
3,596
tst
Memoryx.tst
// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/05/Memory.tst load Memory.hdl, output-file Memoryx.out, compare-to Memoryx.cmp, output-list in%D1.6.1 load%B2.1.2 address%B1.15.1 out%D1.6.1; echo "Before you run this script, select the 'Screen' option from the 'View' menu"; set in -1, // Set RAM[0] = -1 set load 1, set address 0, tick, output; tock, output; set in 9999, // RAM[0] holds value set load 0, tick, output; tock, output; set address %X2000, // Did not also write to upper RAM or Screen eval, output; set address %X4000, eval, output; set in 2222, // Set RAM[2000] = 2222 set load 1, set address %X2000, tick, output; tock, output; set in 9999, // RAM[2000] holds value set load 0, tick, output; tock, output; set address 0, // Did not also write to lower RAM or Screen eval, output; set address %X4000, eval, output; set load 0, // Low order address bits connected set address %X0001, eval, output; set address %X0002, eval, output; set address %X0004, eval, output; set address %X0008, eval, output; set address %X0010, eval, output; set address %X0020, eval, output; set address %X0040, eval, output; set address %X0080, eval, output; set address %X0100, eval, output; set address %X0200, eval, output; set address %X0400, eval, output; set address %X0800, eval, output; set address %X1000, eval, output; set address %X2000, eval, output; set address %X1234, // RAM[1234] = 1234 set in 1234, set load 1, tick, output; tock, output; set load 0, set address %X2234, // Did not also write to upper RAM or Screen eval, output; set address %X6234, eval, output; set address %X2345, // RAM[2345] = 2345 set in 2345, set load 1, tick, output; tock, output; set load 0, set address %X0345, // Did not also write to lower RAM or Screen eval, output; set address %X4345, eval, output; //// Keyboard test // //set address 24576, //echo "Click the Keyboard icon and hold down the 'K' key (uppercase) until you see the next message (it should appear shortly after that) ...", //// It's important to keep holding the key down since if the system is busy, //// the memory will zero itself before being outputted. // //while out <> 75 { // eval, //} // //clear-echo, //output; // Screen test set load 1, set in -1, set address %X4FCF, tick, tock, output, set address %X504F, tick, tock, output; set address %X0FCF, // Did not also write to lower or upper RAM eval, output; set address %X2FCF, eval, output; set load 0, // Low order address bits connected set address %X4FCE, eval, output; set address %X4FCD, eval, output; set address %X4FCB, eval, output; set address %X4FC7, eval, output; set address %X4FDF, eval, output; set address %X4FEF, eval, output; set address %X4F8F, eval, output; set address %X4F4F, eval, output; set address %X4ECF, eval, output; set address %X4DCF, eval, output; set address %X4BCF, eval, output; set address %X47CF, eval, output; set address %X5FCF, eval, output; //set load 0, //set address 24576, //echo "Make sure you see ONLY two horizontal lines in the middle of the screen. Hold down 'Y' (uppercase) until you see the next message ...", //// It's important to keep holding the key down since if the system is busy, //// the memory will zero itself before being outputted. // //while out <> 89 { // eval, //} // //clear-echo, //output;
da527704001afe46915bc1f901747458ef21533c
449d555969bfd7befe906877abab098c6e63a0e8
/2885/CH15/EX15.6/ex15_6.sce
9654d7a367a75b7ded726e73e54b0073c24ed122
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
253
sce
ex15_6.sce
//Determine rms value of the ac voltage clear; clc; //soltion //given l=8.3;//cm //length of the trace D=5;// V/cm //deflection sensitivity Vpp=l*D; Vrms=Vpp/(2*sqrt(2)); printf("The rms value of the ac voltage %.2f V",Vrms);
5f4a19f26c61e4242882979bb9e16a9011c2827d
449d555969bfd7befe906877abab098c6e63a0e8
/635/CH9/EX9.3/Ch09Ex3.sci
868c979b5b0dce5651fc8775994d5ee4aea55304
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
875
sci
Ch09Ex3.sci
// Scilab Code Ex9.3 Vibrational frequency and molar heat capacity of diamond: Page-312(2010) h = 6.626e-034; // Planck's constant, joule second k = 1.38e-023; // Boltzmann constant, joule/mol/kelvin T = 10; // Given temperature, kelvin N = 6.023e+023; // Avogadro's number R = N*k; // Universal gas constant, joule/kelvin theta_D = 2230; // Debye temperature for diamond, kelvin f_D = k*theta_D/h; // Debye frequency of diamond, hertz C_v = 12/5*%pi^4*R*1e+03*(T/theta_D)^3; // Specific heat of diamond, J/kmol/kelvin printf("\nThe highest possible vibrational frequency of diamond = %4.2e per second", f_D); printf("\nThe molar specific heat of diamond = %5.3f J/kmol/kelvin", C_v); // Result // The highest possible vibrational frequency of diamond = 4.64e+013 per second // The molar specific heat of diamond = 0.175 J/kmol/kelvin
fa71a57d7b8c7452c77ee59c6e2dae2d3ec717d6
449d555969bfd7befe906877abab098c6e63a0e8
/1862/CH17/EX17.3/C17P3.sce
dd5f1f6f312326730662914e4eab18a78547a7b5
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,585
sce
C17P3.sce
clear clc //to find equation for x(t) // GIVEN: //refer to problem 17-1 //mass of boby M = 1.65//in Kg //increase in length y = 7.33//in cm //mass of block m = 2.43//in Kg //distance by which spring is streched x_m = 11.6//in cm //displacement of block x = 0.0624//in meters //velocity of block vx = 0.847//in m/s //acceleration due to gravity g = 9.81//in m/s^2 // SOLUTION: //applying simple harmonic motion equation //equating forces in y direction //force constant k of spring k = (-M*g)/(-y*10^-2)//in N/m //taking y in meters //total energy of system E = ((1/2)*m*(vx^2))+((1/2)*k*(x^2))//in J //maximum amplitude of motion xm = sqrt((2*E)/k)//in meters //using cosin equation of x //value of cos(fi) cos_fi = x/xm //phase constant fi1 = acosd(cos_fi) fi2 = 360-(fi1) fi = fi2*(%pi/180)//in rad //period of oscillation T = (2*%pi*(sqrt(m/k)))*10^3//in miliseconds //angular frequency omega = (2*%pi)/(T*10^-3)//in rad/s //initial velocity v_x1 = -(omega*xm)*sind(fi1)//in m/s v_x2 = -(omega*xm)*sind(fi2)//in m/s xm = nearfloat("pred",0.1085) cos_fi = nearfloat("succ",0.5751) omega = nearfloat("succ",9.54) fi = nearfloat("succ",5.33) printf ("\n\n Total energy of system E = \n\n %.3f J",E) printf ("\n\n Maximum amplitude of motion xm = \n\n %.4f m",xm) printf ("\n\n Value of cos(fi) = \n\n %.4f",cos_fi) printf ("\n\n Initial velocity = \n\n %.3f for fi = %.1f degree \n 0r \n %.3f for fi = %.1f degree",v_x1,fi1,v_x2,fi2) printf ("\n\n Equation for x(t) = \n\n (%.3f m)*(cos(%.2f rad/s)t + %.2f rad)",xm,omega,fi)
aae777d589e671b3657e24bb1edae13d1452fb1c
449d555969bfd7befe906877abab098c6e63a0e8
/1658/CH34/EX34.17/Ex34_17.sce
05415a0b24745d2e6ed278d6bed6663b4aac3646
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
453
sce
Ex34_17.sce
clc; VL=12; IL=200*10**-3; Vs=30; Rs=10; B1=150; Ic1=10*10**-3; VBE1=0.7; B2=100; VBE2=0.7; Vz=6; Rz=10; Iz=20*10**-3; ID=10*10**-3; I1=10*10**-3; RD=(VL-Vz)/ID; disp('ohm',RD*1,"RD="); //a=R1/R2; a=(VL/(Vz+VBE2))-1; Ic2=Ic1; IB2=Ic2/B2; V2=Vz+VBE2; Vz=12; R1=(Vz-V2)/I1; disp('ohm',R1*1,"R1="); R2=R1/a; disp('ohm',R2*1,"R2="); hfe1=B1; IB1=(IL+I1+ID)/hfe1; I=IB1+Ic2; R3=(Vs-(VBE1+VL))/I; disp('Kohm',R3*10**-3,"R3=");
483df5c84beace572c2944be8cb1df1b22c20658
449d555969bfd7befe906877abab098c6e63a0e8
/1970/CH11/EX11.2/CH11Exa2.sce
11cf49f22bfc11dd76c3322e3df07a6365e1d18b
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
687
sce
CH11Exa2.sce
// Scilab code Exa11.2 : : Page-536 (2011) clc; clear; s = 15; // Speed, metre per sec w = 0.3; // Width of the electrode, metre E = 3e+06; // Breakdown strength, volts per metre eps = 8.85e-12; // Absolute permitivity of free space, farad per metre C = 111e-12; // Capacitance, farad i = round (2*eps*E*s*w*10^6); // Current, micro ampere V = i/C*10^-12; // Rate of rise of electrode potential, mega volts per sec printf("\nThe charging current = %d micro-ampere \nThe rate of rise of electrode potential = %4.2f MV/sec", i, V); // Result // The charging current = 239 micro-ampere // The rate of rise of electrode potential = 2.15 MV/sec
278e491ce323378dd89d89f38a8fb36b52101fab
5ed8234edfa9f877fe2bc6ed926e81ec4d99a182
/Module/Simulation/AOCS/XcosToVTSQuat.sci
6b7713262599c9cad84f0d7355859d4f63a3d5bd
[]
no_license
NCKU-AA-IISlab/DOCKing_System
23cb95adc773aeb2b7480f81817a6339bddec881
832d1ef0b1824e76010fe50cf253bcfa93f71c49
refs/heads/master
2021-05-29T19:17:27.929049
2015-09-30T11:57:31
2015-09-30T11:57:31
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
3,402
sci
XcosToVTSQuat.sci
// This function will write the attitude of the satellite from the simulation to a file in CIC fromat function [] = XcosToVTSQuat(Attitude_Data,SatDate, Attitude_Type, Sat_Name, Directory, file_name) clc; dims = 2; // for string array concatenation // Header definition Header.version = ['CIC_AEM_VERS = 1.0', 'CIC_OEM_VERS = 1.0']; Header.comment = ['COMMENT Generated by BIRDY AOCS TEAM']; Header.time = getdate(); Header.time1 = [Header.time(1),Header.time(2), Header.time(6),Header.time(7),Header.time(8),Header.time(9), Header.time(10)]; correction_month = ""; correction_day = ""; correction_hour = ""; correction_mn = ""; correction_sec = ""; if Header.time(6) <10 then correction_day = '0'; end if Header.time(2) <10 then correction_month = '0'; end if Header.time(7) < 10 then correction_hour = '0'; end if Header.time(8) <10 then correction_mn = '0'; end if Header.time(9) <10 then correction_sec = '0'; end Header.time2 = strcat(['CREATION_DATE = ', string(Header.time1(1)),"-",strcat([correction_month,string(Header.time1(2))]),"-",strcat([correction_day,string(Header.time1(3))]),"T",strcat([correction_hour,string(Header.time1(4))]),":",strcat([correction_mn,string(Header.time1(5))]),":",strcat([correction_sec,string(Header.time1(6))]),".",string(Header.time1(7)) ]); Header.originator = ['ORIGINATOR = BIRDY AOCS TEAM']; Header.meta_Start = ['META_START']; Header.sat_name = strcat(['OBJECT_NAME = ', Sat_Name]); Header.ID = strcat(['OBJECT_ID = ', Sat_Name]); Header.Ref_frame_A = ['REF_FRAME_A = EME2000']; Header.Ref_frame_B = ['REF_FRAME_B = SC_BODY_1']; Header.attitude_dir = ['ATTITUDE_DIR = A2B']; Header.time_system = ['TIME_SYSTEM = UTC']; Header.attitude_type = strcat(['ATTITUDE_TYPE = ', Attitude_Type]); Header.euler_sequence = ['EULER_ROT_SEQ = 313']; Header.meta_stop = ['META_STOP']; // Possible Attitude Types Attitude = ['QUATERNION', 'EULER ANGLE', 'POSITION']; // Check whcih attitude the user has input if Attitude_Type == Attitude(1) then Header.euler_sequence = ""; end if Attitude_Type == Attitude(3) then Header.version = Header.version(2); else Header.version = Header.version(1); end // Check if the directory provided is correct directory.check = isdir(Directory); if directory.check == 'F' then error("This Directory you provided does not exist or the Name is incorrect. Please provide a suitable directory"); else FileDirectory = strcat([Directory, file_name]) end // Prepare the header file HEADER = [Header.version; Header.comment;Header.time2; Header.originator;""; Header.meta_Start; ""; Header.sat_name; Header.ID; Header.Ref_frame_A; Header.Ref_frame_B; Header.attitude_dir; Header.time_system; Header.attitude_type; Header.euler_sequence; ""; Header.meta_stop; ""]; // For Date for count = 1:length(Attitude_Data(:,1)) Date(count,1) = SatDate; Date(count,2) = 30*count; end Formated_Attitude_Data = [Date, Attitude_Data]; // Writing to file fprintfMat(FileDirectory, Formated_Attitude_Data,"%15g",HEADER); endfunction
62b4ca23a855558dfe8f4ebf338c9c1fc8a5d497
449d555969bfd7befe906877abab098c6e63a0e8
/3673/CH1/EX1.a.14/Example_a_1_14.sce
08cb4011ad99f3285cbeaa028d845cb59e8c0d43
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
388
sce
Example_a_1_14.sce
//Example 1_14 page no:31 clc; I1=1; I2=5; Va=70; V=100; //calculating R1 and R2 V5=5*60; Va=100-30; R2=(70-30)/I2; R1=(70-50)/I1; disp(R1,"the resistance R1 is (in ohm)"); disp(R2,"the resistance R2 is (in ohm)"); //calculating R2 when current in R1 is zero Va=50; I2=(100-Va)/5; R2=20/I2; disp(R2,"the resistance R2 when current flowing through R1 is zero (in ohm)");
b4c8155681af2a5e9876447eddaee29a616fa47e
449d555969bfd7befe906877abab098c6e63a0e8
/830/CH8/EX8.2.5/FIR_Differentiator.sce
be8f92658f24ec46104dbd2d5396e42aac714891
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
522
sce
FIR_Differentiator.sce
//Graphical// //Example 8.2.5 //Linear Phase FIR Differentiator of length M = 60 //Pass Band Edge frequency fp = 0.1 clear; clc; close; M =60; tuo = (M/2)-1; Wc = 0.1; h = zeros(1,M); for n = 1:M if n ~= M/2 h(n) =cos((n-1-tuo)*Wc)/(n-1-tuo); end end [hm,fr]=frmag(h,1024); disp('The Filter Coefficients are:') h figure plot(fr,hm/max(hm)) a =gca(); xlabel('Normalized Digital Frequency fr'); ylabel('Magnitude'); title('Frequency Response of FIR Differentiator for M=60') xgrid(2)
1526317c5aa6a6f73763ca0a0968f192c8da2200
449d555969bfd7befe906877abab098c6e63a0e8
/3875/CH2/EX2.1/Ex2_1.sce
46a43a15e27fb6d37878b465745d671dfc7712b7
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
157
sce
Ex2_1.sce
clc; clear; V=7500 //volume in m^3 T=1.2 //time in seconds //calculations A=(0.162*V)/T mprintf("Total absorption in hall = %0.1f sq-m sabine",A)
4ba60dbfde742426d375431153464bf1322c9dbe
72974db10f5812e41d63d11a47d6f5cfc4e26f46
/src/pla_korrekt.tst
5671f1c9637fcbf39066811ef3ffe5e43b2f8c7e
[]
no_license
sleipold/plac
112f98a9bc38c8f03adcf217f58932a4ee6436a6
f25c5c0e1cec562ada6f08d5d3da87d2f076dd70
refs/heads/master
2021-04-15T18:28:42.166638
2018-05-30T12:34:23
2018-05-30T12:34:23
126,210,270
2
0
null
2018-04-04T11:48:56
2018-03-21T16:41:06
C++
UTF-8
Scilab
false
false
314
tst
pla_korrekt.tst
const c = 6; var n: int , f: real, e:real; procedure test; var i : int, k:real; begin f := k+f; i := 2; while i <=n do begin f := f + k * 1.0; f := 1.0; if i = 0 then i := 1; i := i+1 end end; begin n := c; call test end$
1aaf7f5ace7f05f614e79ecbfb4b7a0843ea6207
449d555969bfd7befe906877abab098c6e63a0e8
/494/CH8/EX8.14/8_14.sce
335e585d9fa3a2948404057bf5f90a6021fa5022
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
716
sce
8_14.sce
//All the quantities are expressedin SI units p1 = 2527.3; //ambient pressure at the altitude of 25 km T1 = 216.66; //ambient temperature at the altitude of 25 km p0_1 = 38800; //total pressure gam = 1.4; //ratio of specific heats R = 287; //universal gas constant pressure_ratio = p0_1/p1; //ratio of total to static pressure //for this value of pressure ratio, mach number is M1 = 3.4; //the speed of sound is given by a1 = sqrt(gam*R*T1) //thus the velocity can be calculated as V1 = M1*a1; printf("\nRESULTS\n---------\nThe Velocity of the airplane is:\n V1 = %4.0f m/s\n",V1)
cbd59dc6d0204442c94423e77d5861ca252fadcf
449d555969bfd7befe906877abab098c6e63a0e8
/3647/CH6/EX6.12/ex6_12.sce
e67dc7c1d50fd35fb664cb5abb5de75dfdf63b06
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
433
sce
ex6_12.sce
//Solutions to Problems In applied mechanics //A N Gobby clear all; clc //initialisation of variables a=1/16//ft/s h=100//lbf/in^2 w=10//lbf/in^2 q=2//in b=%pi/4*(3/16)^2//in^2 p=5//inch valu per 12.7 //CALCULATIONS H=(h*w)/(q*a)//lbf/in^2 F=H*1*a//lbf A=H/2//lbf/in^2 R=(b)/(F/A)*5.14*4//per inch F1=A*1*a//lbf m=(b)/(F1/A)*5.14//per inch //RESULTS printf('the force per inch of circumferential seam=% f per in',m)
2c3c9b686427e2fd137e98c5b1bf928036a44130
449d555969bfd7befe906877abab098c6e63a0e8
/3392/CH5/EX5.6/Ex5_6.sce
1b61ab36122fa3872e5f468da7bad9f73c2f9a10
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
273
sce
Ex5_6.sce
clc // initialization of variables clear // Material constants E=200 //GPa G=77.5 // GPa Lh=5 // Lh = L/h // part (b) rhs1=1.8*Lh*E/G rhs2=7*12*Lh^3/16 LHS=1.8*Lh*E/G+7*12*Lh^3/16 e=rhs1/LHS*100 printf('The error in neglecting small terms is %.2f per cent',e)
1455b6d403844af39749022eb1eadec2b87e533c
449d555969bfd7befe906877abab098c6e63a0e8
/812/CH9/EX9.07/9_07.sce
3f1d56c77a6b9842e09170d0c11c3aea6d5c9cad
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
323
sce
9_07.sce
//Time required// pathname=get_absolute_file_path('9.07.sce') filename=pathname+filesep()+'9.07-data.sci' exec(filename) //Time required to decelerate to 100 mph(in seconds): t=(s1-s2)*2*w/(s1*s2)/Cd/d/A/g*3600/5280 printf("\n\nRESULTS\n\n") printf("\n\nTime required to decelerate to 100 mph: %.3f seconds\n\n",t)
9f32046925610f9a18c40819c5db1597d2cc837a
449d555969bfd7befe906877abab098c6e63a0e8
/3828/CH12/EX12.6/Ex12_6.sce
efd2cdb1f0e6c009c83370a239841366bf190b36
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
302
sce
Ex12_6.sce
//Chapter 12 : Semiconductor Physics clear; //Variable declaration RH=3.66*10**-4 //Hall coefficient t=10**-3 //thickness I=1 //current B=0.5 //magnetic induction //Calculations VH=(RH*I*B)/t //Result mprintf("Hall voltage VH= %.3f V",VH)
3058ae12c8738c3632bf6d71c965aa112de932a2
449d555969bfd7befe906877abab098c6e63a0e8
/1892/CH1/EX1.68/Example1_68.sce
bf29e4680c97c09ce42b80d4ae87c6a92d378eec
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
507
sce
Example1_68.sce
// Example 1.68 clc;clear;close; // Given data format('v',7); Pis=60;//in KW phase=3;//no. of phase S=3;//in % StatorLaser=1;//in KW //calculations S=S/100;//slip StatorOutput=Pis-StatorLaser;//in KW RotorInput=StatorOutput;//in KW RotorCuLoss=S*RotorInput;//in KW RotorCuLoss_phase=S*RotorInput/phase;//in KW/phase disp(RotorCuLoss_phase,"Rotor Copper loss per phase in KW : "); MechPower=RotorInput-RotorCuLoss;//in KW disp(MechPower,"Total mechanical lpower devloped in KW : ");
a46519061c881b413021b80bff2c4e7c9bb91477
449d555969bfd7befe906877abab098c6e63a0e8
/3014/CH4/EX4.8/Ex4_8.sce
abae3cbe3fa34b470165cd08a20209a7da776ef1
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
308
sce
Ex4_8.sce
clc //Given that epsilon_0 = 8.854e-12 // Permittivity of free space E = 2000 // Electric field in V/m P = 6.4e-8 // Polarization in C/m^2 printf("Example 4.8") epsilon_r = 1+ P/(epsilon_0*E) // Calculation of relative permittivity printf("\n Relative permittivity is %f\n\n\n",epsilon_r)
c545c62a06c37469de581b4707a24f9928909390
449d555969bfd7befe906877abab098c6e63a0e8
/539/CH6/EX6.4.b/Example_6_4b.sce
af3869f2c6159a0851499e4bebe42164cac23df3
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
357
sce
Example_6_4b.sce
//True-Stress-At-Fracture Computations clear; clc; printf("\tExample 6.4\n"); di=12.8; //Initial dia in mm df=10.7; //Final dia in mm printf("\n\tPart B"); Ao=%pi*di^2*10^-6/4; sig=460*10^6; //Tensile strength F=sig*Ao; printf("\nF = %d N",F); Af=%pi*df^2/4; sig_t=F/Af; printf("\nTrue stress is %d MPa",sig_t); //End
db0a8a2538b7ed40087b1a004200a569022098aa
08bfc8a1f8e44adc624d1f1c6250a3d9635f99de
/SDKs/swig/Examples/test-suite/scilab/abstract_inherit_runme.sci
955455717fa09a02a27cb73986dda37eaae28922
[]
no_license
Personwithhat/CE_SDKs
cd998a2181fcbc9e3de8c58c7cc7b2156ca21d02
7afbd2f7767c9c5e95912a1af42b37c24d57f0d4
refs/heads/master
2020-04-09T22:14:56.917176
2019-07-04T00:19:11
2019-07-04T00:19:11
160,623,495
0
0
null
null
null
null
UTF-8
Scilab
false
false
128
sci
abstract_inherit_runme.sci
version https://git-lfs.github.com/spec/v1 oid sha256:cc2f33639faf7dd577c3e2713b2d830c20051dd3d4b6778d3ab49aea52f90376 size 180
6abb7ccd086d553a3edbdbe5141bac71e763ad9d
b4bbf9b2a475b5cf299b30bf5e0c621e32f6c832
/test/assign1/solve3.tst
d396f4d65dd60291fcc61d777accfbb88571bebc
[]
no_license
apetresc/castro
1ec1ac1307542487aa1be14c335170f7a1347bf2
843165af7c946188a2dd772384cd2d579723c99d
refs/heads/master
2022-02-20T14:28:41.962893
2019-10-07T08:41:59
2019-10-07T08:41:59
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
29
tst
solve3.tst
boardsize 3 havannah_solve 3
edcf5426a109b31168b02d67f33d30472caec71b
449d555969bfd7befe906877abab098c6e63a0e8
/3554/CH13/EX13.2/Ex13_2.sce
64174d9e46ba3fbe075b8486d03541cc3dfde6a3
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
526
sce
Ex13_2.sce
// Exa 13.2 clc; clear; // Given data Ra=5; // (R1+R2) in k Ohms Rb=5;// (R3+R4) in k Ohms Vt=5; // Applied voltage (V) Shaft=5; // Shaft distance in inches // Solution disp(" As given, wiper moves 0.5 inch towards A from the centre, it will have moved 3 inches from B"); Wiper=3; // Wiper movement from B in inches Wiper1=2.5;//Wiper movement from A in inches R2=Wiper/Shaft * R; // in k Ohms R4=Wiper1/Shaft * R; // in k Ohms //Ve=VR2-VR4 Vc=(R2/(Ra)) *Vt - (R4/(Rb)) * Vt; printf(' The new value of Vc= %.1f V \n',Vc);
4868e211adb3a9737ab464ed23bbcc5fa876729d
449d555969bfd7befe906877abab098c6e63a0e8
/287/CH18/EX18.1/Exa18_1.sci
4118e495f78a004733f29fc51c6aad1046433fbb
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
219
sci
Exa18_1.sci
//Determine the usage in seconds,CCS and Erlangs which has accumulated on the piece of the equipment U = (450-0)*(5/3600) disp(U, 'Usage in Erlangs') disp(U*36, 'Usage in CCS') disp(U*36*100, 'Usage in seconds')
edb0d10b28503233f8ad872c46fedc85e74f016c
449d555969bfd7befe906877abab098c6e63a0e8
/1913/CH1/EX1.4/ex4.sce
3e65e4a1f057bb439cfdd1324c8a94209e0092d8
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
369
sce
ex4.sce
clc clear //Input data v1=0.056;//Initial volume of gas in m^3 v2=0.007;//Final volume of gas in m^3 p1=100;//Initial perssure compressed Isothermally in kN/m^2 //Calculations p2=(p1*v1)/v2;//Final pressure in kN/m^2 W=p1*v1*(log(v2/v1));//Work done in kJ //Output printf('(a)Final pressure p2= %3.2f kN/m^2 \n (b)The work done on gas W= %3.2f kJ',p2,W)
286b8f8f0829bca74feaba2531ba502673a6534c
8217f7986187902617ad1bf89cb789618a90dd0a
/browsable_source/2.5/Unix-Windows/scilab-2.5/macros/m2sci/sci_type.sci
e2d2f11a903ce1bd526e06a2ee43e3e0f127d5a9
[ "LicenseRef-scancode-public-domain", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
clg55/Scilab-Workbench
4ebc01d2daea5026ad07fbfc53e16d4b29179502
9f8fd29c7f2a98100fa9aed8b58f6768d24a1875
refs/heads/master
2023-05-31T04:06:22.931111
2022-09-13T14:41:51
2022-09-13T14:41:51
258,270,193
0
1
null
null
null
null
UTF-8
Scilab
false
false
151
sci
sci_type.sci
function [stk,txt,top]=sci_type() // Copyright INRIA set_infos('type ignored',1) txt=[txt;'// type('+stk(top)(1)+')'] stk=list(' ','-2','0','0','1')
8b73ef612702c40148df7faee0d45495c26ed2a4
449d555969bfd7befe906877abab098c6e63a0e8
/1580/CH7/EX7.5/Ch07Ex5.sce
bfb50ca7499d445bbe1613ebef3b3215078b0ad7
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
450
sce
Ch07Ex5.sce
// Scilab Code Ex7.5: Page-7.26 (2004) clc;clear; N = 2.7e+25; // Number density, atoms per metrecube eo = 8.854e-12; //Permittivity of the free space, farad per metre er = 1.0000684; // Dielectric constant of the material alpha = eo*(er-1)/N; // Electrical polarization, farad metresquare printf("\nElectrical polarization = %3.3e farad metresquare", alpha); // Result // Electrical polarization = 2.243e-41 farad metresquare
4ce0294404699ea75fffab954ce3f6132b5464ac
bc1993259ec7381d99fca78fca2858eed02b6c0b
/07/overflowtest/StackTestOverflow.tst
f5d96b07173815ced52e3d6f6372d177d241787a
[]
no_license
DavidOriel/Nand-2-Tetris
e54c6c4fa49a1a9a85e0415fc89a7a093a3e7c08
89367ea17a9758b3ea58da56c294b06d6c084743
refs/heads/main
2022-12-29T20:08:49.105190
2020-10-17T11:00:36
2020-10-17T11:00:36
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
624
tst
StackTestOverflow.tst
// This file is part of www.nand2tetris.org // and the book "The Elements of Computing Systems" // by Nisan and Schocken, MIT Press. // File name: projects/07/StackArithmetic/StackTest/StackTest.tst load StackTestOverflow.asm, output-file StackTestOverflow.out, compare-to StackTestOverflow.cmp, output-list RAM[0]%D2.6.2 RAM[256]%D2.6.2 RAM[257]%D2.6.2 RAM[258]%D2.6.2 RAM[259]%D2.6.2; set RAM[0] 256, // initializes the stack pointer repeat 1000 { // enough cycles to complete the execution ticktock; } // outputs the stack pointer (RAM[0]) and // the stack contents: RAM[256]-RAM[265] output;
60a06e24cb07cd3f66936dd0bec2755df56756fb
449d555969bfd7befe906877abab098c6e63a0e8
/40/CH5/EX5.9a/Exa_5_9a.sce
46f3540d15ea9de03ecec7ef1c96ff737c56e3a5
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
408
sce
Exa_5_9a.sce
//DTFT and steady state response a=0.5,b=1;F=0.25; n=0:(5/1000):5; h=(a^n); x=10*cos(0.5*%pi*n'+%pi/3); H=h*exp(-%i*n'*F); Yss=H*x; [phase_Yss,m]=phasemag(Yss); Yss=real(Yss); subplot(2,1,1) plot2d(n,Yss); xlabel('Frequency in radians') ylabel('abs(Yss)') title('magnitude Response') subplot(2,1,2) plot2d(n,phase_Yss) xlabel('Frequency in Radians'); ylabel('<(y)') title('Phase Response')
05b602a4fdcdb74dcbc0ddbdfa7ae7d541e78f09
33d7960e39a3e71591538dccbe1dd4014c377e78
/Sample Solution/Exercise_16.sce
b489873fa8c61afdd26352a8d51811969f8ad240
[]
no_license
wiiwins/Compfin
529e2997994babb9e3795283ddbd8ec782131148
2629685421e970a369ec797b76dda3d2803bcbcf
refs/heads/master
2020-05-18T01:25:39.357847
2019-06-27T11:21:46
2019-06-27T11:21:46
184,090,400
0
0
null
null
null
null
UTF-8
Scilab
false
false
961
sce
Exercise_16.sce
//a) exec("./CompFin_2019_SS_BS_Price_Int.sce") function [Delta, vega, gamma] = BS_Greeks_num(r, sigma, S0, T, g, eps) //price function for initial parameters V0 = BS_Price_Int(r, sigma, S0, T, g); V_Delta = BS_Price_Int(r, sigma, (1+eps)*S0, T, g); V_vega = BS_Price_Int(r, (1+eps)*sigma, S0, T, g); V_gamma = BS_Price_Int(r, sigma, (1+eps)*S0, T, g); V_gamma2 = BS_Price_Int(r, sigma, (1-eps)*S0, T, g) //Compute greeks num Delta = (V_Delta-V0)/(eps*S0) vega = (V_vega-V0)/(eps*sigma) gamma = (V_gamma-2*V0+V_gamma2)/((eps*S0)^2) endfunction //b) r=0.03; sigma=0.2; T=1; S0=60:1:140; eps=0.001; function y = g(x) y = max(x-100, 0) endfunction Delta = ones(S0); vega = ones(S0); gamma = ones(S0); for i = 1:length(S0) [Delta(i), vega(i), gamma(i)] = BS_Greeks_num(r, sigma, S0(i), T, g, eps); end plot(S0, vega) xlabel("S0") ylabel("Delta")
1485f33f6205a87c8cd2f4a703b035bc5df7d05d
449d555969bfd7befe906877abab098c6e63a0e8
/1808/CH3/EX3.19/Chapter3_Exampl19.sce
ea0fdfa85eebf8d6b3cc952056a57454ee53f307
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,155
sce
Chapter3_Exampl19.sce
clc clear //INPUT DATA d=0.12;////bore of the engine in m l=0.13;//stroke of the engine in m p1=101.325;//pressure in atm t1=298;//temperature in K t3=1773;//temperature in K n=2000;//speed in rpm g=1.4;//constant cp=1.005;//specific pressure in kJ/kgK cv=0.718;//specific volume inkJ/kgK R=0.287;//gas constant inkJ/kgK //CALCULATIONS Rc=1.1/0.1;//compression ratio v1=R*t1/p1;//specific volume in m^3/kg v2=v1/Rc;//specific volume in m^3/kg t2=t1*((v1/v2)^(g-1));//temperature in K p2=p1*(v1/v2)^(g);//pressure in kN/m^2 v3=v2*(t3/t2);//specific volume in m^3/kg t4=t3*((v3/v1)^(g-1));//temperature in K p4=p2*(v3/v1)^g;//pressure in kN/m^2 Q3=cp*(t3-t2);//heat added in kJ/kg Qr=cv*(t4-t1);//heat rejected in kJ/kg nd=((Q3-Qr)/Q3)*100;//Thermal efficiency in percentage V1=1.1*(3.14*d^2*l)/4;//volume in m^3 m=4*(n/2)*(V1/(v1*240));//flow rate in kg/s P=(Q3-Qr)*m;//Power of the engine in kg/s //OUTPUT printf('(a)compression ratio is %3.i \n (b)pressure and temperature at the end of compression is %3.2f kN/m^2 \n (c)Thermal efficiency is %3.2f percentage \n (d)Power of the engine is %2.3f kg/s ',Rc,p2,nd,P)
d7d9ce39fc8f33babf6d5682031bae0e436eb3a1
1a00eb132340e145c8a7d8fd0ef79a02b24605a2
/macros/cmd_dcmotor_release.sci
b94beb30104287d4c5036bca696b522789b33c24
[]
no_license
manasdas17/Scilab-Arduino-Toolbox
e848d75dc810cb0700df34b1e5c606802631ada4
2a6c9d3f9f2e656e1f201cecccd4adfe737175e7
refs/heads/master
2018-12-28T15:51:35.378091
2015-08-06T07:22:15
2015-08-06T07:22:15
37,854,821
3
2
null
null
null
null
UTF-8
Scilab
false
false
1,504
sci
cmd_dcmotor_release.sci
function cmd_dcmotor_release(h,motor_no) // Command to release pins which have setup for DC motor // // Calling Sequence // cmd_dcmotor_release(h,motor_no) // // Parameters // h : Board number, reserved for future use. For this version, any number would do // motor_no : ID in which the motor has been connected // // Description // 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. // // Examples // ok = open_serial(1,9,115200) // cmd_dcmotor_setup(1,3,1,9,10) // Setup DC motor of type 3 (L293), motor 1, pin 9 and 10 // cmd_dcmotor_run(1,1,255) // sleep(1000) // cmd_dcmotor_run(1,1,-255) // sleep(1000) // cmd_dcmotor_release(1,1) // close_serial(1) // See also // cmd_dcmotor_setup // cmd_dcmotor_release // // Authors // Bruno JOFRET // code_sent="M"+ascii(48+motor_no)+"1"+ascii(0); write_serial(h,code_sent,4); code_sent="M"+ascii(48+motor_no)+"r"; write_serial(h,code_sent,3) endfunction
853a25a1178582241d02f21f78bac8db574016ad
1bb72df9a084fe4f8c0ec39f778282eb52750801
/test/BV26.prev.tst
a6328879ba8e47abde1531dd1b0039cb78ffab3c
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
gfis/ramath
498adfc7a6d353d4775b33020fdf992628e3fbff
b09b48639ddd4709ffb1c729e33f6a4b9ef676b5
refs/heads/master
2023-08-17T00:10:37.092379
2023-08-04T07:48:00
2023-08-04T07:48:00
30,116,803
2
0
null
null
null
null
UTF-8
Scilab
false
false
1,388
tst
BV26.prev.tst
[1,2,3,4,5] << 6 = shift by 6 icol=0 sum= 0 + this(0)=1 * dipows(0)=1 * binoms(0)=1 icol=1 sum= 1 + this(1)=2 * dipows(1)=6 * binoms(1)=1 icol=2 sum= 13 + this(2)=3 * dipows(2)=36 * binoms(2)=1 icol=3 sum= 121 + this(3)=4 * dipows(3)=216 * binoms(3)=1 icol=4 sum= 985 + this(4)=5 * dipows(4)=1296 * binoms(4)=1 row 0 dipows=[1,6,36,216,1296] binoms=[1,1,1,1,1] result=[7465,0,0,0,0] icol=1 sum= 0 + this(1)=2 * dipows(0)=1 * binoms(0)=1 icol=2 sum= 2 + this(2)=3 * dipows(1)=6 * binoms(1)=2 icol=3 sum= 38 + this(3)=4 * dipows(2)=36 * binoms(2)=3 icol=4 sum= 470 + this(4)=5 * dipows(3)=216 * binoms(3)=4 row 1 dipows=[1,6,36,216,1296] binoms=[1,2,3,4,5] result=[7465,4790,0,0,0] icol=2 sum= 0 + this(2)=3 * dipows(0)=1 * binoms(0)=1 icol=3 sum= 3 + this(3)=4 * dipows(1)=6 * binoms(1)=3 icol=4 sum= 75 + this(4)=5 * dipows(2)=36 * binoms(2)=6 row 2 dipows=[1,6,36,216,1296] binoms=[1,3,6,10,15] result=[7465,4790,1155,0,0] icol=3 sum= 0 + this(3)=4 * dipows(0)=1 * binoms(0)=1 icol=4 sum= 4 + this(4)=5 * dipows(1)=6 * binoms(1)=4 row 3 dipows=[1,6,36,216,1296] binoms=[1,4,10,20,35] result=[7465,4790,1155,124,0] icol=4 sum= 0 + this(4)=5 * dipows(0)=1 * binoms(0)=1 row 4 dipows=[1,6,36,216,1296] binoms=[1,5,15,35,70] result=[7465,4790,1155,124,5] [7465,4790,1155,124,5]
658bee3d925120ce17e966d84dafeac8930e6b04
b80969c9d72c732b0153d0de2b8fd28dc10d8a16
/Biologie/Site/sauvegarde/28.07.2016/www/Documents/simulation/initation_scilab/ex29.sci
dfff9c049e4179ba4f7adb88ffb2adc20dd45772
[]
no_license
adamdepossylux/stem_cells
6a2596a0734e3604b570cfdaa1e6cb798d13d7b7
e1ffdf24a223fea3a3606a0bd262067edc81f5b9
refs/heads/master
2020-04-01T17:26:21.772875
2017-05-10T15:15:09
2017-05-10T15:15:09
61,795,551
0
0
null
null
null
null
UTF-8
Scilab
false
false
192
sci
ex29.sci
function[x1,x2]=ex29(a,b,c) delta=b^2-4*a*c; if delta<0 then error('pas de solutions reélles') end x1=(-b+sqrt(delta))/(2*a) x2=(-b-sqrt(delta))/(2*a) endfunction
b8e50806fef3ca88fb64115e4cb12c467e041e54
8ff2fa0731006b571c8e5b5f4f9fa249b5de4825
/TestTrajectoire.sce
b82d43225037b55ebb851d6dfadba2540e2d8645
[]
no_license
rianaR/Tank
ef6467ca19fe8ac932798ecf3a0337afd04fa816
83e6bd5d905331468ecfe6fba037d9870633ebfc
refs/heads/master
2020-05-19T21:29:08.755417
2015-05-05T09:06:58
2015-05-05T09:06:58
31,966,295
0
0
null
null
null
null
UTF-8
Scilab
false
false
522
sce
TestTrajectoire.sce
m=5; g=9.81; Te=1/1000; v0=50; x0=0; y0=1; theta0=%pi/6; v0x=v0*cos(theta0); v0y=v0*sin(theta0); X0=[x0;y0;v0x;v0y;theta0]; X=[X0]; Xp=X0; Xs=Xp; K=0; i=1; while (Xs(2) > 0) if (Xp(5) < 0) then K=100; end Xs(1)=0.5*K*cos(Xp(5))*(2*i-1)*Te*Te+v0x*Te+Xp(1); Xs(2)=0.5*(-m*g+K*sin(Xp(5)))*(2*i-1)*Te*Te+v0y*Te+Xp(2); Xs(3)=K*cos(Xp(5))*Te+Xp(3); Xs(4)=(-m*g+K*sin(Xp(5)))*Te+Xp(4); Xs(5)=atan(Xs(4)/Xs(3)); X=[X,Xs]; Xp=Xs; i=i+1; end X x=X(1,:); y=X(2,:); plot2d(x,y)
7c3b8b6ee2be244c0cdfa4d04251b752275af473
449d555969bfd7befe906877abab098c6e63a0e8
/1574/CH8/EX8.4/TL_Ex_8_4.sce
c2c702932a9b92e47f8a8c9cddb43ba2d5386cdd
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
559
sce
TL_Ex_8_4.sce
clc //Chapter8 //Example8.4, page no 316 //Given d=0.7// distance between two insertions Ld_m= (80e-3)*(10/7)//Loading coil inductance //disp(Ld_m) Rd_m=100/7//Loading coil resistance //disp(Rd_m) R=20+Rd_m//Line resistance L=Ld_m// Line inductance C=0.05e-6// Line Capacitance alfa=0.5*R*sqrt(C/L)//Attenuation Constant // fc=(%pi*d*sqrt(L*C))^-1//cut off freq mprintf('The atenuation constant is %f nepers/mile\nThe Cut-off Freq is %d KHz',alfa,fc*1e-3) // Note : There are some calculation errors in the solution presented in the book
8bc852a6ef4a8f3750755e7955f399963425225d
449d555969bfd7befe906877abab098c6e63a0e8
/1862/CH9/EX9.7/C9P7.sce
d0179a9b43227bdfe698d3dfa11cc9402b01ccaf
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,158
sce
C9P7.sce
clear clc //to find forces exerted on the ladder by the ground and by the wall // GIVEN:: //refer to figure 9-23(a) from page no. 189 //length of ladder L = 12//in meters //mass of ladder m = 45//in kg //distance of upper end of ladder above the ground h = 9.3//in meters //mass of firefighter M = 72//in kg //acceleration due to gravity g = 9.8//in m/s^2 // SOLUTION: //refer to figure 9-23(b) from page no. 189 //distance from the wall to the foot of ladder a = sqrt(L^2 - h^2)//in meters //considering equillibrium conditions //finding normal reaction by ground N = (M+m)*g//in N //force exerted on ladder by the wall Fw = (g*a*(M/2 + m/3))/h//in N N = round(N) Fw = round(Fw) printf ("\n\n Distance from the wall to the foot of ladder a = \n\n %.1f m",a); //answer is slightly different than book.But answer of scilab program is same as that of calculator printf ("\n\n Forces exerted on the ladder by the ground N = \n\n %3i N",N); //answer is slightly different than book.But answer of scilab program is same as that of calculator printf ("\n\n Forces exerted on the ladder by the wall Fw = \n\n %3i N",Fw);
3e759ec876fa2644ad8d2a20082392b3479ce8f6
c6990d954ae9e819a5de22440cc4437019a7b550
/projects/01/Or4Way.tst
d08370a4749c7325299539992916e1c428093857
[]
no_license
moneytech/nand2tetris
28e8bacbd72065db73751d184489c1376fdafef7
d80ff97de782bee14ef2e2ea7fbe9e7859efea2d
refs/heads/master
2021-01-01T07:23:52.654424
2018-04-15T14:40:07
2018-04-15T14:40:07
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
488
tst
Or4Way.tst
load Or4Way.hdl, output-file Or4Way.out, compare-to Or4Way.cmp, output-list in%B2.4.2 out%B2.1.2; set in 0, eval, output; set in 1, eval, output; set in 2, eval, output; set in 3, eval, output; set in 4, eval, output; set in 5, eval, output; set in 6, eval, output; set in 7, eval, output; set in 8, eval, output; set in 9, eval, output; set in 10, eval, output; set in 11, eval, output; set in 12, eval, output; set in 13, eval, output; set in 14, eval, output; set in 15, eval, output;
ffa0a56ed99420c84c10e79cbcd7bb6fd1339e15
f5d97602ad111cf2fe570b890646522118e3f9f1
/ziegler-nichols-first-method.sce
66328e9e8ae11c8d44e1729db740865fa9ae9e40
[]
no_license
HugoJF/scilab-pid-controller
5d6d869d00e7bcc404ae358db92976863d2619cc
f4726b3f6a01cac1526632c31a6e2c840b6fb07c
refs/heads/master
2023-01-28T11:20:43.264090
2020-12-11T20:27:29
2020-12-11T20:27:29
320,695,475
0
0
null
null
null
null
UTF-8
Scilab
false
false
863
sce
ziegler-nichols-first-method.sce
exec('C:\Users\hugo_\Desktop\trabalho-controller\prep.sce', -1) exec('C:\Users\hugo_\Desktop\trabalho-controller\funcs.sce', -1) // Simulation parameters t = gettime(45, 100); ts = gettime(20, 100); // shorter // Method preparation ya = csim('step', ts, g); // Method parameters L = 2.7 T = 6.3 // Simulations y = csim('step', t, g/.(1)); yp = simu_zn1_p(t, T, L); ypi = simu_zn1_pi(t, T, L); ypid = simu_zn1_pid(t, T, L); // Plots subplot(311) plot(t, y, t, yp, t, ypi); title('Ziegler-Nichols first method for PID tuning (PID omitted)') legend(['G response', 'P response', 'PI response']); subplot(312) plot(t, ypid); title('Ziegler-Nichols first method for PID tuning (PID only)') legend(['PID response']); subplot(313) plot(ts, ya); title('Open loop system response for Ziegler-Nichols'' first method parameter estimation') legend(['Open loop response'])
99083c341e726671da4828401e4d22164a5b2337
449d555969bfd7befe906877abab098c6e63a0e8
/491/CH8/EX8.2/8_2.sce
0e988eb43b7be9694021806f8bd2d1adfdea7f29
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,180
sce
8_2.sce
a = 55 ; // Angle made by helix with longitudinal axis in degree r = 1.8 ; // Inner radius of vessel in m t = 0.02 ; // thickness of vessel in m E = 200e09 ; // Modulus of ealsticity of steel in Pa v = 0.3 ; // Poission's ratio of steel P = 800e03 ; // Pressure inside the tank in Pa // Part (a) s1 = (P*r)/t ; // Circumferential stress in Pa s2 = (P*r)/(2*t) ; // Longitudinal stress in Pa // Part (b) t_max_z = (s1-s2)/2 ; // Maximum inplane shear stress in Pa t_max = s1/2 ; // Maximum out of plane shear stress in Pa // Part (c) e1 = (s1/(2*E))*(2-v) ; // Strain in circumferential direction e2 = (s2/E)*(1-(2*v)); // Strain in longitudinal direction // Part (d) // x1 is the direction along the helix theta = 90 - a ; sx1 = ((P*r)/(4*t))*(3-cosd(2*theta)); // Stress along x1 direction tx1y1 = ((P*r)/(4*t))*(sind(2*theta)); // Shear stress in x1y1 plane sy1 = s1+s2-sx1 ; // Stress along y1 direction // Mohr Circle Method savg = (s1+s2)/2 ; // Average stress in Pa R = (s1 - s2 )/2 ; // Radius of Mohr's Circle in Pa sx1_ = savg - R*cosd(2*theta) ; // Stress along x1 direction tx1y1_ = R*sind(2*theta); // Shear stress in x1y1 plane
72093e7b996f7bc65e4b9412462c95a25c46d4c4
449d555969bfd7befe906877abab098c6e63a0e8
/964/CH21/EX21.3/21_3.sce
5cbca050b7eeedcb5443f09f3bae3e817cb6e160
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
3,146
sce
21_3.sce
clc; clear; g=9.8;//m/s^2; acceleration due to gravity m=68.1;//kg c=12.5;//kg/sec; drag coefficient function v=f(t) v=g*m*(1-exp(-c*t/m))/c endfunction tval=289.43515;//m a=0; b=10; fa=f(a); fb=f(b); for i=10:10:20 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=50:50:100 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=100:100:200 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=200:300:500 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=1000:1000:2000 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=2000:3000:5000 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end for i=5000:5000:10000 n=i; h=(b-a)/n; disp(i,"No. of segments=") disp(h,"Segment size=") j=a+h; s=0; while j<b s=s+f(j); j=j+h; end l=(b-a)*(fa+2*s+fb)/(2*n); Et=tval-l;//error et=Et*100/tval;//percent relative error disp("m",l,"Estimated d=") disp(et,"et(%)") disp("---------------------------------------------------------") end
a6eba2af8db95dad5fb30d34e023013a91329d95
449d555969bfd7befe906877abab098c6e63a0e8
/3651/CH8/EX8.8/8.sce
3586f07876801318309643365383d49adb6bec6b
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
168
sce
8.sce
//variable declaration V=2.405 lamda=1.3 N_a=0.05 //Calculations a_max=(V*lamda)/(2*%pi*N_a) //Result printf('Maximum core radius=%0.3f micro m\n',(a_max))
411c05d469a1846ad96814c5ea776b95f813eb87
449d555969bfd7befe906877abab098c6e63a0e8
/405/CH6/EX6.4/6_4.sce
b381b646b5e36f4ce1d9ffb846a3b597096c004b
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,243
sce
6_4.sce
clear; clc; printf("\t\t\tExample Number 6.4\n\n\n"); // heating of air with isothermal tube wall // illustration6.4 // solution p = 101325;// [Pa] pressure of air Ta = 27;// [degree celsius] temperature of air d = 0.005;// [m] diameter of tube R = 287;// [] gas constant u = 3;// [m/s] velocity of air L = 0.1;// [m] length of tube Tb = 77;// [degree celsius] exit bulk temperature // we first must evaluate the flow regime and do so by taking properties at the average bulk temperature Tb_bar = (Ta+Tb)/2;// [degree celsius] v = 18.22*10^(-6);// [square meter/s] kinematic viscosity k = 0.02814;// [W/m degree celsius] Cp = 1006;// [J/kg K] Pr = 0.703;// prandtl no. Re_d = u*d/v;// reynolds number disp(Re_d, "reynolds number is" ); disp("so that the flow is laminar"); // so that the flow is laminar // now we determine Nu_d_bar for Tw = constant. for Gz_inverse = 0.0346 we read Nu_d = 5.15; // we thus calculate the average heat transfer coefficient as h_bar = Nu_d*k/d;// [W/square meter degree celsius] // we base the heat transfer on a mean bulk temperature of Tb_bar, so that Tw = 3.49/(h_bar*%pi*d*L)+Tb_bar;// [degree celsius] printf("\n exit wall temperature is %f degree celsius",Tw);
68356003b3507a9afeb3184219973fd97227d208
61e39cdb9efce4bc7bc35be444b193c1066f1bf2
/secant.sce
f38206563ddefd38cb912aa112bed51e84edab75
[]
no_license
nancyanand2807/SCILAB-CODES
866c1c99754975f9f0deb271d3844c854db1645c
69bf72606e8cd62aae3d1302c734f425d381a121
refs/heads/master
2020-06-02T00:39:27.236873
2019-06-09T11:26:55
2019-06-09T11:26:55
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
1,561
sce
secant.sce
// ------------------------- // Nonlinear Equation Solver // Using the Secant Method // ------------------------- str=x_mdialog(['** Solve Nonlinear Equations Using Secant Method **'], .. ['Function y='; 'Initial Guess p(0)'; 'Initial Guess p(1)' ; 'Tolerance'], .. ['x**3-5*x+1'; '0'; '1'; '0.0001']); if (str == []) then return; end//stop if press cancel deff('y=f(x)','y='+str(1));//Function to study //Initial Guess p1=evstr(str(2));//Initial guess p(0) pn=evstr(str(3));//Initial guess p(1) tol=evstr(str(4));//Required accuracy (tolerance) //Print some information on screen printf('\n\n Look for a root of '+str(1)+'=0 starting with p0='+str(2)+' and p1='+str(3)+'\n') printf("\nNote: K=|p(n)-p(n-1)|/|p(n-1)-p(n-2)|^((1+sqrt(5)/2)\n") mprintf('\n%3s %14s %14s %14s\n','n','pn','|p(n)-p(n-1)|','K') mprintf('%3i %14.11f %14.11f %14.11f\n',fix(0),p1,0,0) mprintf('%3i %14.11f %14.11f %14.11f\n',fix(1),pn,0,0) //SECANT METHOD //------------- n=1;Diff=abs(pn-p1); while (Diff>=tol) //Stop when "error" smaller than tolerance p2=p1;p1=pn;//Save previous iterations Diff1=Diff; //Save previous difference |p(n)-p(n-1)| n=n+1;//New iteration pn = p1-f(p1)*(p2-p1)/(f(p2)-f(p1)); //Secant iteration Diff = abs(pn-p1);//Update difference |p(n)-p(n-1)| K=Diff/Diff1**((1+sqrt(5))/2); //Print results on screen mprintf('%3i %14.11f %14.11f %14.11f\n',fix(n),pn,Diff,K) end mprintf('\n%3i iterations required.to guarantee solution p=%10.7f accurate to within '+str(4)+'\n',n,pn)
ba48dcf0902cd4ae0fa5afd465be633b6e48c71d
67310b5d7500649b9d53cf62226ec2d23468413c
/tags/archive/TestCaseGenerator-Plugin-OpeningSequenceCoverage/trunk/tests/large-system-tests/inputs/jEdit/ground_truth/OpeningSequenceCoverage/length-1/max-150/t88.tst
9e00875a83af20c1b693583d2ca8c366109fdf4d
[]
no_license
csnowleopard/guitar
e09cb77b2fe8b7e38d471be99b79eb7a66a5eb02
1fa5243fcf4de80286d26057db142b5b2357f614
refs/heads/master
2021-01-19T07:53:57.863136
2013-06-06T15:26:25
2013-06-06T15:26:25
10,353,457
1
0
null
null
null
null
UTF-8
Scilab
false
false
660
tst
t88.tst
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <TestCase> <Step> <EventId>e6</EventId> <ReachingStep>false</ReachingStep> </Step> <Step> <EventId>e23</EventId> <ReachingStep>false</ReachingStep> </Step> <Step> <EventId>e17</EventId> <ReachingStep>false</ReachingStep> </Step> <Step> <EventId>e38</EventId> <ReachingStep>false</ReachingStep> </Step> <Step> <EventId>e78</EventId> <ReachingStep>false</ReachingStep> </Step> <Step> <EventId>e46</EventId> <ReachingStep>false</ReachingStep> </Step> </TestCase>
1fdf9fc847d99c5adfe999a34c123888ee1b63d1
449d555969bfd7befe906877abab098c6e63a0e8
/98/CH18/EX18.7/example18_7.sce
1d25f603808a77a53f08e427697466d11002745e
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
2,037
sce
example18_7.sce
//Chapter 18 //Example 18_7 //Page 432 clear;clc; i=90; disp("(i) BEFORE REMOVAL OF FUSES: "); a=1*(cosd(120)+%i*sind(120)); Ir=90*(cosd(0)+%i*sind(0)); Iy=90*(cosd(240)+%i*sind(240)); Ib=90*(cosd(120)+%i*sind(120)); Ir0=1/3*(Ir+Iy+Ib); Ir2=1/3*(Ir+a^2*Iy+a*Ib); Iy2=a*Ir2; Ib2=a^2*Ir2; Ir1=Ir; Iy1=Iy; Ib1=Ib; printf("Ir = %.2f /_%.2f A \n", abs(Ir), atand(imag(Ir)/real(Ir))); printf("Iy = %.2f /_%.2f A \n", abs(Iy), atand(imag(Iy)/real(Iy))+180); printf("Ib = %.2f /_%.2f A \n\n", abs(Ib), atand(imag(Ib)/real(Ib))+180); printf("Zero sequence components of three line currents are: \n"); printf("Ir0 = Iy0 = Ib0 = %d A \n\n", real(Ir0)); printf("Ir2 = %d A \n", abs(Ir2)); printf("Iy2 = %d A \n", abs(Iy2)); printf("Ib2 = %d A \n\n", abs(Ib2)); printf("Ir1 = %.2f /_%.2f A \n", abs(Ir), atand(imag(Ir)/real(Ir))); printf("Iy1 = %.2f /_%.2f A \n", abs(Iy), atand(imag(Iy)/real(Iy))+180); printf("Ib1 = %.2f /_%.2f A \n\n\n", abs(Ib), atand(imag(Ib)/real(Ib))+180); disp("AFTER REMOVAL OF FUSES: "); Ird=90*(cosd(0)+%i*sind(0)); Iyd=0; Ibd=0; printf("Ir = %.2f /_%.2f A \n", abs(Ird), atand(imag(Ird)/real(Ird))); printf("Iy = %d A \n", Iyd); printf("Ib = %d A \n\n", Ibd); Ir0d=1/3*(Ird+Iyd+Ibd); Ir1d=1/3*(Ird+a*Iyd+a^2*Ibd); Ir2d=1/3*(Ird+a^2*Iyd+a*Ibd); printf("Zero sequence components of three line currents are: \n"); printf("Ir0 = Iy0 = Ib0 = %d /_0 A \n\n", real(Ir0d)); Iy0d=Ir0d; Ib0d=Ir0d; Iy1d=a^2*Ir1d; Iy2d=a*Ir2d; Ib1d=a*Ir1d; Ib2d=a^2*Ir2d; printf("Ir1 = %.2f /_%.2f A \n", abs(Ir1d), atand(imag(Ir1d)/real(Ir1d))); printf("Ir2 = %.2f /_%.2f A \n\n", abs(Ir2d), atand(imag(Ir2d)/real(Ir2d))+180); printf("Iy1 = %.2f /_%.2f A \n", abs(Iy1d), atand(imag(Iy1d)/real(Iy1d))+180); printf("Iy2 = %.2f /_%.2f A \n\n", abs(Iy2d), atand(imag(Iy2d)/real(Iy2d))+180); printf("Ib1 = %.2f /_%.2f A \n", abs(Ib1d), atand(imag(Ib1d)/real(Ib1d))+180); printf("Ib2 = %.2f /_%.2f A \n\n", abs(Ib2d), atand(imag(Ib2d)/real(Ib2d))+180); Iyd=Iy0d+Iy1d+Iy2d; printf("Curretn in yellow line = %d A \n\n", real(Iyd));
ff3b15eb92da072686b820be7b7169e9da8232de
449d555969bfd7befe906877abab098c6e63a0e8
/1226/CH12/EX12.9/EX12_9.sce
4ad7e8f6ae69d6e9dc25c5d42a688d5018caee95
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
671
sce
EX12_9.sce
clc;funcprot(0);//EXAMPLE 12.9 // Initialisation of Variables p1=145;...........//injection pressure in bar p2=235;.........//Injection pressure in bar (2nd case) t1=16;.............//spray penetration time in milliseconds s1=22;................//spray penetration length in cm s2=22;.................//spray penetration length in cm (2nd case) pc=30;.................//combustion chamber pressure in bar //calculations delp1=p1-pc; delp2=p2-pc; t2=(s2/s1)*t1*sqrt(delp1/delp2);..........//Spray time in seconds for 2nd case //Given that s=t*sqrt(delp) disp(t2,"The time required for spray penetration at an injection pressure of 235 bar in milliseconds:")
860febe5e8e7783ae7bdeb9a22ad3b455d220ebc
449d555969bfd7befe906877abab098c6e63a0e8
/2990/CH5/EX5.10/Ex5_10.sce
7faa1524c9bd83660a0b7a1e9292ef12cc8f963b
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
955
sce
Ex5_10.sce
funcprot(0); // Initialization of Variable function[dms]=degtodms(deg) d = int(deg) md = abs(deg - d) * 60 m = int(md) sd = (md - m) * 60 sd=(round(sd*100)/100) dms=[d m sd] endfunction Long=75.0//longitude in degrees GST=11+40.0/60+32.4/3600;//GST in degrees RA=12+25.0/60+18.35/3600;//RA in degrees GMT=15+45.0/60+25.3/3600;//GMT in degrees delta=22+6.0/60+32.5/3600;//angle in degrees //calculation e1=Long/15*9.8565/3600; LSTofLMM=GST-e1; LMT=GMT+Long/15; SIT=LMT+LMT*9.8565/3600//sidereal time interval LHA=SIT+LSTofLMM; H=RA+24-LHA; H=H*15; B=atan(tan(delta*%pi/180)*tan(H*%pi/180)); B=B*180/%pi; A=atan(tan(H*%pi/180)*cos(B*%pi/180)/sin((B-32-15.0/60)*%pi/180)) A=A*180/%pi; TB=360+A-135-15.0/60-20.0/3600; TB=degtodms(TB); disp(TB,"true bearing TB in degree,minites,seconds respectively"); disp("there is slight difference in the answers due to rounding off error in the book"); clear()
2e1e795a1579030def165762ffa1857011eca964
2d52e11c7b61898224f065e3bbf4433c814c9fe1
/measurement/analyzed-codes/FNN_logistic.sci
4c131259c7c8c131c0256dba549e31784e856d7a
[ "MIT" ]
permissive
quepas/performance-estimation-array-operations
b6954d753c83d235f12c5d97fa82bcc38656cf5e
b209ba5efebf5dee60ec5fca0fa711ca2e766e17
refs/heads/master
2021-01-24T13:24:52.734940
2018-05-12T15:18:20
2018-05-12T15:18:20
123,173,497
0
0
null
null
null
null
UTF-8
Scilab
false
false
263
sci
FNN_logistic.sci
// FNN-logistic > Logistic function used // > as an activation function in neural networks // Array operations // * vneg (x1) // * vexp (x1) // * vadd2 (x1) // * vdiv2 (x1) //////// function FNN_logistic(A) R = 1 ./ (1 + exp(-A)); endfunction
031a730d0eca1f8db89a178f5f9f456f8fa7d711
449d555969bfd7befe906877abab098c6e63a0e8
/978/CH6/EX6.7/Example6_7.sce
58dc4f6498a9e5489e8a17987c257db646271d16
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
265
sce
Example6_7.sce
//chapter-6,Example6_7,pg 494 R=10*10^5//scope input impedance C1=0.31*62*10^-12//probe capacitance C2=22*10^-12//probe input impedance fcut=(1/(2*%pi*R*(C1+C2)))//cutoff frequency of filter printf("cutoff frequency\n") printf("fcut=%.2f Hz",fcut)
08c0f8dd272b61ca7d9cf6ecb51b9ec8d04ca5a8
449d555969bfd7befe906877abab098c6e63a0e8
/1019/CH2/EX2.7/Example_2_7.sce
bc8f98c60431168db2138266442169c1b3541dd0
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
468
sce
Example_2_7.sce
//Example 2.7 clear; clc; //Given n=2;//moles of ideal gas R=8.314;// gas constant in J K^-1 mol^-1 T=273;// temperature in K p1=10;// initial pressure in atm p2=0.4;// final pressure in atm // To determine q,w,delH and DelE w=(-1)*n*R*T*(1-(p2/p1));// w in joule q=(-1)*w; mprintf('q = %f J',q); mprintf('\n w = %f J',w); mprintf('\n delE = 0 J,since it is an isothermal process'); mprintf('\n delH = 0 J,since it is an isothermal process'); //end
88d5c202bd620742c8ce703977695d44a4e23ecf
e2ae697563b1b764d79ea1933b555ab0d5e3849c
/macros/addzero.sci
b26791e9d25c30ef0a0d9a5cd9680dec2b157279
[]
no_license
gq-liu/IPDesignLab
c49b760740f47ec636232a6947aecb3c0626518a
b2f9a9eecad6616c99a2ec20fcceb14fb3ed0c3f
refs/heads/master
2022-01-18T13:30:55.972779
2019-05-06T17:23:12
2019-05-06T17:23:12
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
1,580
sci
addzero.sci
function addzero() // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // Authors // Holger Nahrstaedt - 2010 // Ishan Pendharkar - 2001-2007 // //RLTOOL for scilab (c) Ishan Pendharkar. //function adds a zero to the existing plant. global g g_cont g_sensor g_plant marked_handle choice if choice<>1 then return;end; // you cannot add zero in frequency design mode //xset('window',0); scf(0) p=locate(1,1); // locate zero and clean it p=clean(p,Limits()); if clean(p(2),Limits())==0 then gtr_cont=g_cont*(%s-p(1)); // real zero is added else gtr_cont=g_cont*((%s-p(1))^2+p(2)^2); // complex zero and its conjugate is added end; gtr=gtr_cont*g_plant*g_sensor whichplot(gtr); // update rootlocus plot gtr=rl(gtr); // edit new plant if gtr<>[] then, g_cont=gtr_cont g=gtr; else whichplot(g); end; marked_handle=[] clear gtr gtr_cont; //return; endfunction
30c4167cf89ffd8508f6b216ea395fa7e67fdfa6
449d555969bfd7befe906877abab098c6e63a0e8
/476/CH8/EX8.19/Example_8_19.sce
a26234941f6785f64bfeac24563c89501464a220
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
2,208
sce
Example_8_19.sce
//A Textbook of Chemical Engineering Thermodynamics //Chapter 8 //Phase Equilibria //Example 19 clear; clc; //Given: //Wilson constants: a12 = 1225.31; //(J/mol) a21 = 6051.01; //(J/mol) V1 = 74.05*10^-6; //(m^3/mol) V2 = 18.07*10^-6; //(m^3/mol) R = 8.314; //ideal gas constant T = 349; //temperature in K //Antoine Equation: //Vapour pressure of 1st element function [y1] = P1(T) y1 = %e^(14.39155-(2795.817/(T-43.198))) endfunction //Vapour pressure of 2nd element function [y2] = P2(T) y2 = %e^(16.26205-(3799.887/(T-46.854))) endfunction //To calculate equilibrium pressure and composition //Using eq. 8.73 (Page no. 350) //Wilson Parameters: W12 = (V2/V1)*%e^(-a12/(R*T)); W21 = (V1/V2)*%e^(-a21/(R*T)); //Using Antoine equation P1_s = P1(T); P2_s = P2(T); //(a). Composition of vapour in equilibrium x1 = 0.43; x2 = 1-x1; //Using eq. 8.72 (Page no. 350) //Wilson equations: //Activity coeffecient of 1st component function [y3] = g_1(n1,n2) //n1 is mol fraction of 1 and n2 is for 2 y3 = %e^(-log(n1 + W12*n2) + n2*((W12/(n1+W12*n2))-(W21/(W21*n1+n2)))); endfunction //Activity coeffecint of 2nd component function [y4] = g_2(n1,n2) y4 = %e^(-log(n2 + W21*n1) - n1*((W12/(n1+W12*n2))-(W21/(W21*n1+n2)))); endfunction //Activity coeffecients: g1 = g_1(x1,x2); g2 = g_2(x1,x2); P = (g1*x1*P1_s) + (g2*x2*P2_s); y1 = (g1*x1*P1_s)/P; mprintf('(a).'); mprintf('\n Equilibrium pressure is %f kPa',P); mprintf('\n Composition of acetone vapour in equilibrium is %f',y1); //(b). Composition of liquid in equilibrium y1 = 0.8; y2 = 1-y1; g1 = 1; g2 = 1; //assumed activity coeffecients P_as = 1/((y1/(g1*P1_s)) + (y2/(g2*P2_s))); //Hit and trial method: flag = 1; while(flag==1) x1 = (y1*P_as)/(g1*P1_s); x2 = 1-x1; g1 = g_1(x1,x2); g2 = g_2(x1,x2); P_calc = 1/((y1/(g1*P1_s)) + (y2/(g2*P2_s))); if((P_calc-P_as)<=1) and ((P_calc-P_as)>=-1) flag = 0; else P_as = P_calc; end end mprintf('\n\n (b).'); mprintf('\n Equilibrium Pressure is %f kPa',P_calc); mprintf('\n Composition of acetone in liquid in equilibrium is %f',x1); //end
29e407a4fa01b07a7105041482c5d14ffcc9b141
a589f95d013369896bef66dc002835588232d49b
/coordV.sce
04c4f36deb192eb30e764e52bd28d22a8e179b49
[]
no_license
saifsmailbox98/scilab-linear-algebra
c26273bbeb8031874e7b13e90a0d191f7a331bd8
2249f2d46672c8acb35e25f719c64f1db6823326
refs/heads/master
2020-05-03T12:17:35.971027
2019-04-07T18:26:23
2019-04-07T18:26:23
178,621,819
0
0
null
null
null
null
UTF-8
Scilab
false
false
259
sce
coordV.sce
function [coordinates] = coordV(M, X) coordinates = (M'\X')'; endfunction A = [1 -2; 4 -7]; X = [5, 3]; c = coordV(A, X); disp(c); A = [1 2 0; 1 3 2; 0 1 3]; X = [2 7 -4]; c = coordV(A, X); disp(c); /* -47. 13. -11. 13. -10. */
c3f69599858b73329f65cd5dcbfc9c68d7449bd6
7b040f1a7bbc570e36aab9b2ccf77a9e59d3e5c2
/2-DOF_manual/2dof/init.sci
bb9fbd62b09222176f3ff6a9381efa4b0d5de2f6
[]
no_license
advait23/sbhs-manual
e2c380051117e3a36398bb5ad046781f7b379cb9
d65043acd98334c44a0f0dbf480473c4c4451834
refs/heads/master
2021-01-16T19:50:40.218314
2012-11-16T04:11:12
2012-11-16T04:11:12
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
69
sci
init.sci
u_old_old = 1; u_old = 1; r_old = 1; r_new = 1; y_old = 1; y_new = 1;
8732b7873fa3dfd5c6549342b99c9c0f61047488
449d555969bfd7befe906877abab098c6e63a0e8
/2159/CH2/EX2.7/27.sce
11111f46d2f0d9e5cfffe81ba5973264cff7a195
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
140
sce
27.sce
// problem 2.7 s1=19.3 s2=9 x=14/24 wg=x*10 wc=(1-x)*10 vg=wg/s1 vc=wc/s2 vt=vg+vc disp(vt,"volume of 10gm,14 carat gold in cm3")
fa1c5bb3a20e4e16de4b51f3acc8727449723992
449d555969bfd7befe906877abab098c6e63a0e8
/3838/CH3/EX3.1.E/EX3_1_e.sce
90d6010afa78086d08ccee454e24ddaeb45e94b4
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
79
sce
EX3_1_e.sce
//EXAMPLE 3.1.E clc; Syms s t e e=laplace(exp(-4*t),t,s)-laplace(exp(4*t),t,s)
829c17067784e689659f7c889ad59276ba8cb589
449d555969bfd7befe906877abab098c6e63a0e8
/167/CH9/EX9.8/ex8.sce
1c7bd0336b320c9e321fb999243d8a4a716d0e99
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
WINDOWS-1252
Scilab
false
false
1,827
sce
ex8.sce
//ques8 //A Gas Turbine with Reheating and Intercooling clear clc //For two-stage compression and expansion, the work input is minimized and the work output is maximized when both stages of the compressor and the turbine have the same pressure ratio //P2/P1=P4/P3=P6/P7=P8/P9=sqrt(8)=r //At inlets: T1=T3 h1=h3 T6=T8 h6=h8 //At outlet T2=T4 h2=h4 T7=T9 h7=h9 //In the absence of any regeneration, the back work ratio and the thermal efficiency are determined by using data from Table A–17 T1=300;//temperature at state 1 in K h1=300.19;//enthalpy at state 1 in kJ/kg T3=T1;//temperature at state 3 in K h3=h1;//enthalpy at state 3 Pr1=1.386;//reduced pressure at state 1 r=sqrt(8);//constant ratio Pr2=Pr1*r;//here r is for P2/P1 //from table T2=403.3;//temp at state 2 in K T4=T2;//temp at state 4 in K h2=404.31;//enthalpy at state 2 in kJ/kg h4=h2;//enthalpy at state 4 T6=1300;//temperature at state 6 in K T8=T6;//temp at state 8 h6=1395.97;//enthalpy at state 6 h8=h6;//enthalpy at state 8 Pr6=330.9;//reduced pressure at state 6 Pr7=1/r*Pr6;//reduced pressure at state 7 T7=1006.4;//temperature at state 7 in K T9=T7;//temperature at state 9 in K h7=1053.33;//enthalpy at state 7 in kJ/kg h5=h7;//enthalpy at state 5 h9=h7;//enthalpy at state 9 Wcompin=2*(h2-h1);//input work in compression in kJ/kg Wturbout=2*(h6-h7);//output turbine work in kJ/kg Wnet=Wturbout-Wcompin;//net work done in kJ/kg Qin=(h6-h4)+(h8-h7);//input heat in kJ/kg Rbw=Wcompin/Wturbout;//back work ratio printf('(a) Back work ratio = %.3f \n',Rbw); nth=Wnet/Qin;//thermal efficiency printf(' (b) Thermal Efficiency = %.3f \n',nth); //(b) qin=(h6-h5)+(h8-h7);//input specific heat in kJ/kg nth=Wnet/qin;//thermal efficiency printf(' (c) Thermal efficiency in this case = %.3f \n',nth);
656cafeb831bed329b757624478c417d07f1acec
449d555969bfd7befe906877abab098c6e63a0e8
/2471/CH8/EX8.2/Ex8_2.sce
41902bca39789085c704c274bf7bbb8a045ee060
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
693
sce
Ex8_2.sce
clear ; clc; // Example 8.2 printf('Example 8.2\n\n'); printf('Page No. 223\n\n'); // given V1 = 100;// In Volts V2 = 50;// In Volts R1 = 8;// Resistance in ohm R2 = 5;// Resistance in ohm R3 = 10;// Resistance in ohm R4 = 50;// Resistance in ohm //By refering figure 8.3, and applying kirchoff's current law and kirchoff's voltage law in the given circuit diagram, we get following equations: // I1 = I2 + I3 //V1 - R1*I1 - V2 - R3*I3 = 0 //V2 - R4*I3 + R3*I3 - R2*I2 = 0 A = [1 -1 -1;8 0 10;0 55 -10]; b = [0;50;50]; x = A\b printf('The currents in I1 is %.1f A \n',x(1)) printf('The currents in I2 is %.1f A \n',x(2)) printf('The currents in I3 is %.1f A \n ',x(3))
474b8818f51fe22e7ade5959f9a1a7afd99f3081
449d555969bfd7befe906877abab098c6e63a0e8
/2231/CH4/EX4.13/Ex_4_13.sce
860b55d3ae18d6708591c42aee0b13be6b06e037
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
202
sce
Ex_4_13.sce
//Example 4_13 clc; clear;close; //Given data: V=500;//V I=10;//A f=400;//Hz //Solution : alfa=0.5;//for maximum swing //I=V/(4*f*L);//A L=V/(4*f*I);//H disp(L,"Series inductance(H)");
cbcca7ef5a1f7cc5f8ee8bf5737456c52288db48
449d555969bfd7befe906877abab098c6e63a0e8
/635/CH6/EX6.4/Ch06Ex4.sci
859d94218dc5bf6a1d0d29d33e37ed4870a6f441
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
608
sci
Ch06Ex4.sci
// Scilab Code Ex6.4 Diffusion through a cylinder: Page-199 (2010) r = 12; // Radius of cylindrical crystal, mm A1 = %pi*r^2; // Cross-sectional area for diffusion through the cylinder, milli-metre square t = 4e-07; // Assume effective thickness of the surface to be 4 angstrom = two atomic diameters, mm A2 = 2*%pi*r*t; // Cross-sectional area for diffusion along the surface, milli-metre square ratio = A2/A1; // Ratio of two cross-sectional areas printf("\nThe ratio of two cross-sectional areas = %4.2e", ratio); // Result // The ratio of two cross-sectional areas = 6.67e-008
eeb6185235cbca363ef312fa83cfc9f2c9ba384b
449d555969bfd7befe906877abab098c6e63a0e8
/3542/CH7/EX7.4/Ex7_4.sce
68af60af15d3029a21f9007c11cf8ca9f702f9aa
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,395
sce
Ex7_4.sce
// Example no 7.4 // To determine probability that the SNR will drop below threshold SNR // Page no. 383 clc; clear all; // Given data M1=4; // Number of branch diversity M2=1; // Number of branch diversity gamm=10; // Specified SNR threshold in dB gamm=10^(gamm/10); // Specified SNR threshold Gamma=20; // Average SNR in dB Gamma=10^(Gamma/10); // Average SNR // Probability that the SNR will drop below 10dB when 4 branch diversity is used P4=(1-exp(-gamm/Gamma))^M1; // Probability that the SNR will drop below 10dB // Probability that the SNR will drop below 10dB when single branch diversity is used P1=(1-exp(-gamm/Gamma))^M2; // Probability that the SNR will drop below 10dB // Displaying the result in command window printf('\n Probability that the SNR will drop below 10dB when 4 branch diversity is used = %0.6f',P4); printf('\n Probability that the SNR will drop below 10dB when single branch diversity is used = %0.3f',P1); printf('\n \n From above results, it is observed that without diversity the SNR drops below the specified threshold with a probability that is three orders of magnitude greater \n than if four branch diversity is used.')
53a192fb3bf1950f75a73f65d8c64b8403456599
449d555969bfd7befe906877abab098c6e63a0e8
/3876/CH6/EX6.1/Ex6_1.sce
4d95d2f3336e421bc7d3c6f02bc6148214df8b41
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
255
sce
Ex6_1.sce
//Chapter 6 Solutions of Electrolytes clc; clear; //Initialisation of Variables T= 25 //C R= 0.0821 //li-atm per mole per degree M= 0.5 //m n= 2 m= 0.680 V= 1 //lit //CALCULATIONS P= R*(273+T)*M*n*m/V //RESULTS mprintf("Osmotic pressure= %.2f atm",P)
cd51f9f9e36d269054882d26762a2be772950a7b
449d555969bfd7befe906877abab098c6e63a0e8
/2969/CH2/EX2.2/Ex2_2.sce
a06563e31f3e5e8f7c49a56136fae9b2ce80596d
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,284
sce
Ex2_2.sce
clc clear //DATA GIVEN V1=0.08; //gas burnt in calorimeter in m^3 Pg=5.2; //pressure of gas supply in cm of water Pb=75.5; //barometer reading in cm of Hg Ww=28; //weight of water heated by gas in kg Tg=13; //temperature of gas in deg celsius Twi=10; //temperature of water at inlet in deg celsius Two=23.5; //temperature of water at outlet in deg celsius Ms=0.06; //steam condensed in kg //CALCULATIONS //by using general gas equation, reducing the volume to S.T.P. //p1*V1/T1=p2*V2/T2 p1=Pb+(Pg/13.6); //in cm of Hg T1=Tg+273; //in K p2=76; //in cm of Hg T2=15+273; //in K V2=p1*V1*T2/T1/p2; //in m^3 Hw=Ww*4.18*(Two-Twi); //heat recieved by water in kJ HCV=Hw/V1; //higher calorific value of fuel in kJ/m^3 LCV=HCV-2465*Ms/V1; //lower calorific value of fuel in kJ/m^3 printf(' The Calorific values of fuel per m^3 of gas at 15 deg celsius and 76 cm of Hg pressure are: \n'); printf(' The Higher calorific value of fuel, H.C.V. is: %5.1f kJ/m^3. \n',HCV); printf(' The Lower calorific value of fuel, L.C.V. is: %5.1f kJ/m^3. \n',LCV);
406c81c1ed7d19df95428715f4fd71a01c5f1d67
c2249f1089957357481c4bc88e17047fb96af0fd
/TestCases/projp3.tst
9623e9130de11dd06014147e94dd148ad35b3fdf
[]
no_license
FikriAnuar/LaTeXParser
9bf5d0f1ea85d26ae4cb4cb72ef0cd95a7e358d6
97a872d3903aafea98045050f1782b0ff7840ed7
refs/heads/master
2022-12-12T04:17:47.702201
2020-09-09T16:38:05
2020-09-09T16:38:05
294,170,332
0
0
null
null
null
null
UTF-8
Scilab
false
false
3,191
tst
projp3.tst
\begin{document} The third and final part of the semester project focuses on the actual generation of formatted output from Latex input. There are 5 tasks for this project, with the divisions given to differentiate between required work point totals and bonuses. Note that you {\it MUST} utilize the {\it union} command to redefine the parsing stack in yacc bison. This project is worth 100 points with up to 15 bonus points. The tasks for the project are: \begin{enumerate} \item Basic Text Processing Capabilities (35 points total), including: Section Subsection Table of Contents (5pts), Line Spacing Single-Double-Triple (5pts), Page Numbering Styles (2.5pts), Horizontal Vertical Spacing (2.5pts), Italics Roman Fonts (2.5pts), Paragraphs Noindent (2.5pts), Right Justification (10pts), and Begin End Single Blocks (5pts). \item Advanced Text Processing capabilities (55 points total), including: Itemize Blocks (5pts), Enumerate Blocks (5pts), Center Blocks (5pts), Verbatim Blocks (5pts), Tabular Blocks (10pts), Table Blocks with Refs Captions (5pts), and Relevant Combinations of Blocks (20pts). \item Documentation, Log, Testing (10 points total). \item Bonus A: Nested Blocks within Single Environment \item Bonus B: Full-Blown Verbatim: All possible Latex commands that are embedded in a verbatim block (e.g., backslash, blocks, etc.) are ignored. \end{enumerate} The directory {\it home ug1 demurjs CSE244.SP94 Part3} contains a number of important files, including: \begin{verbatim} latex.l : A common latex lex file. latexp3.y : A yacc specification where verbatim works. latexp3code.y : A yacc specification with sample code generation. util.c : A number of C utility routines. generate.c : A number of routines used to generate code. \end{verbatim} Portions of these and other files will be discussed in class. The third part of the project is due on Monday, May 2, 1994. Please hand in the following: \begin{enumerate} \item The yacc bison specification for tasks 1, 2, and 3. DO NOT HAND IN C files! Also include copies of any relevant C files. Make sure that these are well-commented, clear, and organized. \item Documentation of your solution that includes: (1) any assumptions that you make regarding the output format and style of your document (e.g., margins, page number locations, handling underlining, etc.); (2) a log file that keeps track of all of your major design steps, implementation strategies, problems encountered (with lex yacc) and their solutions, aspects of the project that were easy hard, changes that were made to the grammar, etc. The key word is MAJOR design steps. NOTE AGAIN THAT YOUR DOCUMENTATION MUST BE GENERATED USING YOUR LATEX COMPILER!!!! \item Test cases and test results for all tasks, clearly marked and organized. \item The directory location for your files and detailed compilation instructions. \end{enumerate} {\it IMPORTANT:} Do not open your directory for access by the world until 7:00 p.m. on May 2. \end{document}
7bc406ccea121dcca4d72ca217a6a7025755c5c9
6f42ce02216774066d077c6db628f9df34bc527f
/packages/test code/Stewardship gift log script.tst
1207b7c6e9f06c607142f1bd6f1d76a2caef483d
[]
no_license
phively/nu-plsql
2d0181fb9eea1e1118369e47bb4ac7ab3f7ec3d9
806afe34fe56dfc4fb1d7237a956df04c8e9ba82
refs/heads/master
2023-09-03T23:34:37.122157
2023-08-30T20:11:25
2023-08-30T20:11:25
78,759,887
10
3
null
2023-09-07T17:11:41
2017-01-12T15:37:39
PLSQL
UTF-8
Scilab
false
false
3,964
tst
Stewardship gift log script.tst
PL/SQL Developer Test script 3.0 122 -- Created on 6/13/2017 by PBH634 Declare -- Local variables here Type rc2 Is Ref Cursor; crs sys_refcursor; Type rec Is Record ( ID_NUMBER varchar2(10), PREF_MAIL_NAME varchar2(512), FACULTY_STAFF_IND varchar2(512), JOINT_IND varchar2(1), JOINT_NAME_1 varchar2(512), JOINT_NAME_2 varchar2(512), JNT_FORMAL_SALUTATION varchar2(512), PREF_NAME_SORT varchar2(512), RECORD_TYPE varchar2(512), RECORD_STATUS varchar2(512), PREF_CLASS_YEAR varchar2(512), PREF_SCHOOL varchar2(512), PREF_ADDRESS_LINE1 varchar2(512), PREF_ADDRESS_LINE2 varchar2(512), PREF_ADDRESS_LINE3 varchar2(512), PREF_ADDRESS_LINE4 varchar2(512), PREF_ADDRESS_LINE5 varchar2(512), PREF_ADDRESS_LINE6 varchar2(512), PREF_ADDRESS_LINE7 varchar2(512), PREF_ADDRESS_LINE8 varchar2(512), TX_GYPM_IND varchar2(1), TX_NUMBER varchar2(512), TX_SEQUENCE integer, PMT_ON_PLEDGE_NUMBER varchar2(10), ASSOCIATED_CODE varchar2(512), TRANSACTION_TYPE varchar2(512), PAYMENT_TYPE varchar2(512), DATE_OF_RECORD varchar2(10), PROCESSED_DATE varchar2(10), LEGAL_CREDIT float, SOFT_CREDIT float, TOTAL_TRANS_AMT float, PMT_ON_PLEDGE_DATE varchar2(10), PMT_ON_PLEDGE_AMOUNT float, PLEDGE_BALANCE float, PLEDGE_STATUS varchar2(512), PAY_FREQUENCY varchar2(512), PLEDGE_COMMENT varchar2(512), RECURRING_12MONTHS_AMOUNT float, ALLOCATION_CODE varchar2(512), ALLOC_SHORT_NAME varchar2(512), ALLOC_SCHOOL_GROUP varchar2(512), ALLOC_DEPARTMENT varchar2(512), APPEAL_CODE varchar2(512), APPEAL_DESC varchar2(512), TRANSACTION_CATEGORY varchar2(512), TRUSTEE_CREDIT_IND varchar2(1), BATCH_NUMBER varchar2(512), PRIM_PREMIUM_CNT float, PRIM_PREMIUM_AMT float, ADJUSTMENT_IND varchar2(512), REASON_CHANGED varchar2(512), REASON_CHANGED_DATE varchar2(10), CURRENT_FY varchar2(10), CURRENT_FY_GIFT_AMOUNT float, CURRENT_FY_GIFT_COUNT integer, PREVIOUS_FY varchar2(10), PREVIOUS_FY_GIFT_AMOUNT float, PREVIOUS_FY_GIFT_COUNT integer, SELECTED_SCHOOL_GROUP varchar2(512), PROCESSED_COMMENT varchar2(512), ANONYMOUS_IND varchar2(1), NOTATIONS varchar2(1000), REPORT_GROUPING varchar2(512), P_MIN_AMOUNT varchar2(512), P_MAX_AMOUNT varchar2(512), PROSPECT_MANAGER varchar2(512), ALLOC_LONG_NAME varchar2(512), SALUTATION_TYPE1 varchar2(512), STAFF_SALUTATION1 varchar2(512), SALUTATION_TYPE2 varchar2(512), STAFF_SALUTATION2 varchar2(512), SALUTATION_TYPE3 varchar2(512), STAFF_SALUTATION3 varchar2(512), V_USER_NAME varchar2(512) ); Type recs Is Table Of rec; res rec; results recs; Begin -- Test statements here /* ADVANCE_NU.NU_RPT_PKG_SCHOOL_TRANSACTION.NU_RPT_P_SCHOOL_TRANS_REPORT( p_start_date => '06/12/2017', p_end_date => '06/12/2017', p_fiscal_year => '2017', i_username => 'pbh634', O_RC => crs ); Fetch crs Bulk Collect Into results; Execute Immediate 'Truncate Table rpt_pbh634.t_giftlog'; Commit Work; Forall i in 1..(results.count) Insert Into rpt_pbh634.t_giftlog Values results(i); Commit Work; */ -- Delete table t_giftlog; /* Loop Fetch crs Into res; Exit When crs%notfound; dbms_output.put_line(res.TX_NUMBER); End Loop; */ ksm_gift_log.school_transaction_rpt; dbms_output.put_line(ksm_pkg.get_fiscal_year(dt => add_months(trunc(sysdate, 'Month'), -1))); dbms_output.put_line(to_char(add_months(trunc(sysdate, 'Month'), -1), 'mm/dd/yyyy')); dbms_output.put_line(to_char(trunc(sysdate) - 1, 'mm/dd/yyyy')); -- Scheduler test /* dbms_scheduler.create_job( job_name => 'rpt_pbh634.proc_ksm_gift_log', job_type => 'PLSQL_BLOCK', job_action => 'Begin ksm_gift_log.school_transaction_rpt; Commit; End;', start_date => sysdate + 1/24/60, -- 1 minute in the future enabled => True ); */ End; 0 0
a34c8e87cd8c9bb48c1d3d66baa042e44476e90a
449d555969bfd7befe906877abab098c6e63a0e8
/2175/CH7/EX7.1/7_1.sce
148c9ff70a54b5abc845cae8a816569fd01a298f
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,069
sce
7_1.sce
clc; m_C=12; m_O2=32; x_C=0.9; O_req_CO2=x_C*([m_O2*1]/[m_C*1]); CO2_prod=x_C*([m_C*1]+[m_O2*1])/[m_C*1]; //HYDROGEN m_H2=2; x_H=0.03; O_req_H2O=x_H*[m_O2/2/2]; steam_prod=x_H*{0.5*[(m_H2)+(m_O2)/2]}; //SULPHUR m_S=32; x_S=0.005; O_req_SO2=x_S*(m_O2/32); SO2_prod=2*x_S; O_req=O_req_CO2+O_req_H2O+O_req_SO2; %O=23.3; A=O_req*100/%O; disp("A/F ratio is:"); disp(A); //part (ii) actual_A=A*(1+0.2); %N=076.7; m_N2=28; N_supp=actual_A*%N/100; O_supp=actual_A*%O/100; x_N=0.01; N2=N_supp+x_N; O2=O_supp-O_req; disp("actual A/F ratio is"); disp(actual_A); m_CO2=m_C+m_O2; m_H2O=m_H2+0.5*m_O2; m_SO2=m_S+m_O2; ni_CO2=CO2_prod/m_CO2; ni_H2O=steam_prod/m_H2O; ni_SO2=SO2_prod/m_SO2; ni_O2=O2/m_O2; ni_N2=N2/m_N2; n_wet=ni_CO2+ni_H2O+ni_SO2+ni_O2+ni_N2; n_dry=ni_CO2+ni_SO2+ni_O2+ni_N2; disp(O_supp) CO2_wet=ni_CO2/n_wet; H2O_wet=ni_H2O/n_wet; SO2_wet=ni_SO2/n_wet; O2_wet=ni_O2/n_wet; N2_wet=ni_N2/n_wet; disp("wet analysis of CO2,H2O,SO2,O2,N2"); disp(N2_wet*100,O2_wet*100,SO2_wet*100,H2O_wet*100,CO2_wet*100);
dac4998f27d08ee84c7db256f7147cf15edb928c
c02a5183ecb8b32e87391dc92c7592fd218b55f0
/02/IsZero16.tst
0808c4340161b4899da72b5520f49eee9d396142
[]
no_license
feel-think/nand2tetris
386ad8065c401a5995dbf3a38025417d2ad8125b
819e4efa4aa523a7805c453ddab24c2c16924eee
refs/heads/master
2022-02-11T17:24:01.814746
2019-09-17T08:00:10
2019-09-17T08:00:10
198,190,700
0
0
null
null
null
null
UTF-8
Scilab
false
false
231
tst
IsZero16.tst
load IsZero16.hdl, output-file IsZero16.out, compare-to IsZero16.cmp, output-list in%B1.16.1 out%B2.1.2; set in %B0000000000000000, eval, output; set in %B0001000100010001, eval, output; set in %B0110011001100110, eval, output;
31105d19fd6199d874c21aa577c6e57dcbb0f2ec
449d555969bfd7befe906877abab098c6e63a0e8
/2735/CH12/EX12.8/Ex12_8.sce
84c738348ce2c40b8168e786d2afe093deedbe41
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
517
sce
Ex12_8.sce
clc clear //Initialization of variables p1=400 //psia t1=600 //F h1=1306.9 //Btu/lbm b1=480.9 //Btu/lbm p2=50 //psia h2=1122 //Btu/lbm h3=1169.5 //Btu/lbm b3=310.9 //Btu/lbm //calculations disp("All the values are obtained from Mollier chart,") dw13=h1-h3 dw12=h1-h2 dasf=b3-b1 etae=dw13/dw12 eta=abs(dw13/dasf) dq=dw13+dasf //results printf("Engine efficiency = %.1f percent",etae*100) printf("\n Effectiveness = %.1f percent",eta*100) printf("\n Loss of available energy = %.1f Btu/lbm",dq)
9a610c74a23f32ef8e36500ac9f0051228b88955
449d555969bfd7befe906877abab098c6e63a0e8
/1904/CH4/EX4.7/4_7.sce
c08f5222676f6744932d3815840c544632634b70
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,389
sce
4_7.sce
//To Find feeder properties of TL and VDL //Page 211 clc; clear; D=1000; //Load Density in kVA per sq miles Vll=4.16; //Line to Lien voltage in kV //From The Tables and Curves from the Theory K=0.007; //For TL TLImax=230; //Maximum Feeder Current TLSn=sqrt(3)*Vll*TLImax; //Maximum Load Per Feeder TLn=4; //No of Feeders TLTSn=TLn*TLSn; //Substation Load TLl4=sqrt(TLSn/D); //Feeder Length TLS=2*TLl4; //Total Spacing TLVDn=2*K*D*(TLl4^3)/3; //TotalVoltageDrop in the main //For VDL VDLVDn=3; //Percent Voltage Drop VDLl4=nthroot((3*VDLVDn/(2*K*D)),3); //Feeder Length VDLS=2*VDLl4; //Station size VDLSn=D*(VDLl4^2); //Maximum Load Per Feeder VDLn=TLn; //Number Of Feeders VDLTSn=VDLn*VDLSn; //Susbtation Load VDLImax=VDLSn/(sqrt(3)*Vll); //Ampere Rating of the Main R=VDLImax/TLImax; //Ampere Loading printf('\na) For Thermally Limited \n') printf('i) The Substation Size = %g kVA\n',TLTSn) printf('ii) Substation Spacing = %g miles\n',TLS) printf('iii) Maximum Load Per Feeder = %g kVA\n',TLSn) printf('iv) The Voltage Drop is %g percent\n',TLVDn) printf('\nb) For Voltage Drop Limited \n') printf('i) The Substation Size = %g kVA\n',VDLTSn) printf('ii) Substation Spacing = %g miles\n',VDLS) printf('iii) Maximum Load Per Feeder = %g kVA\n',VDLSn) printf('iv) Ampere Loading of the Main is %g pu\n',R) //Note The Approximation to 750 kVA
d62aa6b2e3fd6aae36500fd8524a7d0af8ffb7cc
449d555969bfd7befe906877abab098c6e63a0e8
/1301/CH15/EX15.8/ex15_8.sce
d68f9f3cd29359032a26e2d1ec6f3ad6bc5a9f63
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
343
sce
ex15_8.sce
clc; r=100; //resistance in ohm v1=120; //potential diff in Volt n2=50; //no. of turns n1=200; //no. of turns v2=(n2*v1)/n1; //potential diff in volt i2=v2/r; //calculating current i1=(n2/n1)*i2; //calculating current disp(i1,"Current in primary circuit in Ampere = "); //diplaying result
af18a3559ec5ac5f29be87e62b7322241ee345ac
449d555969bfd7befe906877abab098c6e63a0e8
/683/CH24/EX24.2/RD_2.sce
2186696e923a7983e36640ad1179df5b792ac126
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
506
sce
RD_2.sce
// sum 24-2 clc; clear; W=1000; m=0.498; BL=78; d=12; Am=0.39*d^2; dw=sqrt(Am*4/(6*19*%pi)); Ew=74.4*10^3; Ds=56*d; sigb=Ew*dw/Ds; Wb=sigb*%pi*(d^2)/4*10^-3; l=20; Ws=m*l; a=1.2; Wa=a*(W/2+Ws)*10^-3; //Let the static load be Ps Ps=(W/2+Ws)*9.81*10^-3; //let the effective load be Peff Peff=Ps+Wb+Wa; FOS1=BL/Peff; FOS2=BL/(5+0.612); // printing data in scilab o/p window printf("annual FOS is %0.2f ",FOS1); printf("\n FOS neglecting bending load is %0.1f ",FOS2);
60b0aa16011207f71a7cf0b7cf6816d629da3f92
06c050d87b5b6b7e42f2d24889ec60b0f5fdd998
/Ajustes de Curvas.sce
d1aabc39a61c2582321712476d899f4c7369b6ac
[]
no_license
jaimedantas/Numerical-Computation-Scilab
06958d436ee9724daa7c03f2ea14f195e5fbb596
66bf163bdbc0d9453cafff0369bbd5cd2fce78f3
refs/heads/master
2021-01-11T15:18:52.809391
2017-01-29T03:47:50
2017-01-29T03:47:50
80,327,110
0
0
null
null
null
null
UTF-8
Scilab
false
false
651
sce
Ajustes de Curvas.sce
clc //AJUSTES DE CURVAS //o problema eh resolver o sitema linear Xa = y //o produto escalar do erro com a funcao eh zero //logo fica xT*x = xT*y + xT*e onde xT*e eh zero //operacao eh a = (xT*x)^-1 * xT*y //por comparacao coma funcao f(t) = a1 + a2t com a funcao f() = a1g(t) + a2(g2(t) ..... //exemplo 1 //t = [0.5; 1; 3]; //y = [0.5; 2; 2.5]; //x = [1 0.5; 1 1; 1 3]; //a = (x' *x)^-1 * x'*y//ou utiliza inv(a) para inversa //exemplo 2 t = [0.5; 1.5; 2]; y = [0.5; 1.5; 2.8]; x = [1 0.5; 1 1.5; 1 2]; a = inv(x'*x)*x'*y; plot(t,y, 'o') tempo = 0:0.1:2.5; plot(t, y, 'o', tempo, a(1) + a(2)*tempo) //pode usar x = [t^0 t^1 t^2...]
1487b9238f3758b64d8d40e8f26543c7bc0314bb
584105ff5b87869494a42f632079668e4c3f82de
/TestCases/convolver/test12.sce
fcea5c553956905ad046ae671f76fcbe1a9c5e3b
[]
no_license
kevgeo/FOSSEE-Computer-Vision
0ceb1aafb800580498ea7d79982003714d88fb48
9ca5ceae56d11d81a178a9dafddc809238e412ba
refs/heads/master
2021-01-17T21:11:31.309967
2016-08-01T14:45:40
2016-08-01T14:45:40
63,127,286
6
0
null
null
null
null
UTF-8
Scilab
false
false
1,735
sce
test12.sce
//Reading grayscale image I1 = imread("box.png"); //Kernel or filter and convolution on image is done with this kernel //This kernel will give same image with no change a = [0 0 0; 0 1 0; 0 0 0]; //Checking if error message comes if we don't add "values" string in front of 'a' variable //Perforing convolution out1 = convolver(I1,"scalar",1,"size",3,a); //output->in getMatrixOfString: Invalid argument type, string matrix expected //Reading image I2 = imread("lena.jpeg"); //Kernel or filter and convolution on image is done with this kernel //This kernel will give same image with no change a = [0 0 0; 0 1 0; 0 0 0]; //Checking if error message comes if we don't add "values" string in front of 'a' variable //Perforing convolution out2 = convolver(I2,"scalar",1,"size",3,a); //output->in getMatrixOfString: Invalid argument type, string matrix expected //Reading image I3 = imread("clc1.jpg"); //Kernel or filter and convolution on image is done with this kernel //This kernel will give same image with no change a = [0 0 0; 0 1 0; 0 0 0]; //Checking if error message comes if we don't add "values" string in front of 'a' variable //Perforing convolution out3 = convolver(I3,"scalar",1,"size",3,a); //output->in getMatrixOfString: Invalid argument type, string matrix expected //Reading grayscale image I4 = imread("left01.jpg"); //Kernel or filter and convolution on image is done with this kernel //This kernel will give same image with no change a = [0 0 0; 0 1 0; 0 0 0]; //Checking if error message comes if we don't add "values" string in front of 'a' variable //Perforing convolution out4 = convolver(I4,"scalar",1,"size",3,a); //output->in getMatrixOfString: Invalid argument type, string matrix expected
64b22c210862e03b33e0c4916f77b6412b064b05
449d555969bfd7befe906877abab098c6e63a0e8
/1619/CH1/EX1.14.1/Example1_14_1.sce
2be1863a9975575a267e31d3a9fe69bcad36d59f
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
445
sce
Example1_14_1.sce
//Example 1.14.1 page 1.41 // To calculate the number of modes... clc; clear; d = 50*10^-6; // diameter of fibre... n1 = 1.48; //RI of core.. n2 = 1.46; //RI of cladding.. lamda = 0.82*10^-6; //wavelength of light.. NA = sqrt(n1^2-n2^2); // Numerical Aperture.. Vn= %pi*d*NA/lamda; //normalised frequency... M = Vn^2/2; // number of modes... printf(" The number of modes in the fibre are %d",M);
2c1f8d544b9f309d79ceb68f993a1b7e449045fe
449d555969bfd7befe906877abab098c6e63a0e8
/135/CH1/EX1.7/EX7.sce
784587c9083235f5272ad1e1e9c2a9b89f5d2362
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
857
sce
EX7.sce
// Example 1.7: Potential barrier clc, clear rho_p=0.05; // Resistivity of p side of step-graded junction in ohm metres rho_n=0.025; // Resistivity of n side of step-graded junction in ohm metres mu_p=475e-4; // Mobility of holes in metres square per volt second mu_n=1500e-4; // Mobility of holes in metres square per volt second ni=1.45e16; // Intrinsic carrier concentration in atoms per metres cube q=1.6e-19; // Charge on an electron in coulombs VT=25e-3; // Voltage equivalent to temperatue at room temperature in volts NA=1/(q*mu_p*rho_p); // Acceptor concentration in atoms per metres cube ND=1/(q*mu_n*rho_n); // Donor concentration in atoms per metres cube Vo=VT*log(NA*ND/ni^2); // Contact difference of potential in volts Vo=Vo*1e3; // Contact difference of potential in milivolts disp(Vo,"Contact difference of potential (mV) = ");
ca423a986b56a0ee891c2fbeaa739471a0e9152b
449d555969bfd7befe906877abab098c6e63a0e8
/226/CH14/EX14.12/example12_sce.sce
c9b3ebf4586f95ce5f4c4b04be0fd5e92b50aeb9
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
238
sce
example12_sce.sce
//chapter 14 //example 14.12 //page 623 printf("\n") printf("given") Vcc=15;Vee=-15;Av=200000;SR=.5/10^-6;Vo=14; V=(Vcc-1)-(Vee+1) Vi=Vo/Av disp("rise time of output is ") t=(V/SR)*10^6; printf("rise time of output is %dus\n",t)
99f3d29382ca9dc91204fc6872776f2707a26187
9835e6a99ef801fdd06a9193c1846cae987d740a
/MissionsU/MissionU-1.sce
4966a52fe007193ebcd0195e9a9acbc6bfe9368e
[]
no_license
Martinhubz/Exo-Life
c2356d064d2f4727b7a42b104aaca340c0e65a64
dcea54e689b2d7bb3b454648d7cb6fb5a57f115f
refs/heads/master
2021-04-30T08:52:50.851933
2018-02-13T16:19:34
2018-02-13T16:19:34
121,385,860
0
0
null
null
null
null
UTF-8
Scilab
false
false
473
sce
MissionU-1.sce
//---------Mission U-1----------- //------------------------------------- // Identifier les contours // pour déterminer la présence d'un éventuel réseau routier // funcprot(0) getd("../Fonctions") missPath="./" nomMission="MissionU-1" // PBM--->matrice img = readpbm(missPath+"U1_surface.pbm") //Traitement de l'image //rendu = medianFilter(img) rendu = gaussien(img); rendu = contours(rendu); //matrice--->PBM writepbm(rendu,"../Rendus/"+nomMission+"2.pbm");
cd59dffb0f667ca4abcf654be41d214da0b76032
449d555969bfd7befe906877abab098c6e63a0e8
/866/CH2/EX2.3/2_3.sce
0a151b6c435a7a94b69dcd8a828e8baa8f6ea5ff
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
428
sce
2_3.sce
clc //initialisation of variables F1= -2*cosd(45) //KN F2= -2*sind(45) //KN F3= -5 //KN x1= 0.4 //m x2= 1.0 //m Rc= 2.5 //m Rd= 3.7 //m //CALCULATIONS Rah= -F1 Rav= -F3-F2 Ma= -F3*x1-F2*x2 Ra= sqrt(Rc^2+Rd^2) theta= atan(Rc/Rd) *180/%pi //RESULTS printf ('Rah= %.1f kN',Rah) printf (' \n Rav=%.1f KN',Rav) printf (' \n Ma=%.1f KNm',Ma) printf (' \n Ra=%.1f KN',Ra) printf (' \n theta=%.1f degrees',theta)
ccd6b8878010defbccb1af38672bbc15bdc507b8
449d555969bfd7befe906877abab098c6e63a0e8
/3428/CH11/EX5.11.4/Ex5_11_4.sce
098271e0e8fd018889e451434e9c1448e2e9d0ab
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
421
sce
Ex5_11_4.sce
//Section-5,Example-4,Page no.-D.124 //To calculate the energy required for dissociation of 1 bond clc; B_E=95*10^3 //Bond energy h=6.626*10^-34 c=3*10^8 lm=2450*10^-10 E=(h*c)/lm E_1=E*(1/4.184) //Energy in Calories disp(E_1) N_A=6.023*10^23 Ebar=B_E/N_A disp(Ebar,'Energy required for the dissociation of one bond') //Since E_1>Ebar,therefore the bond will be dissociated
88ede218f4843446dea45f776a537f9e2046becf
a62e0da056102916ac0fe63d8475e3c4114f86b1
/set6/s_Electronic_Circuits_M._H._Tooley_995.zip/Electronic_Circuits_M._H._Tooley_995/CH4/EX4.3/Ex4_3.sce
542c3aa8e2bd808f00ad09810e077192c4710b09
[]
no_license
hohiroki/Scilab_TBC
cb11e171e47a6cf15dad6594726c14443b23d512
98e421ab71b2e8be0c70d67cca3ecb53eeef1df6
refs/heads/master
2021-01-18T02:07:29.200029
2016-04-29T07:01:39
2016-04-29T07:01:39
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
131
sce
Ex4_3.sce
errcatch(-1,"stop");mode(2);//Ex:4.3 ; ; T=40*10^-3;//in Hz f=1/T; printf("Frequency of 40 ms waveform = %f Hz",f); exit();
1011938875dd1eb5279243e5a112935e45fb7c94
717ddeb7e700373742c617a95e25a2376565112c
/2474/CH8/EX8.6/Ch08Ex06.sce
7b146cfee8cc395d63d3a366a73a2656a9a83b7a
[]
no_license
appucrossroads/Scilab-TBC-Uploads
b7ce9a8665d6253926fa8cc0989cda3c0db8e63d
1d1c6f68fe7afb15ea12fd38492ec171491f8ce7
refs/heads/master
2021-01-22T04:15:15.512674
2017-09-19T11:51:56
2017-09-19T11:51:56
92,444,732
0
0
null
2017-05-25T21:09:20
2017-05-25T21:09:19
null
UTF-8
Scilab
false
false
1,177
sce
Ch08Ex06.sce
// Scilab code Ex8.6: Pg.332-333 (2008) clc; clear; // Part (a) V = 2.24e-02; // Standard volume, m^3 N = 5.24e-06; // of He molecules in atmosphereNumber N_A = 6.02e+23; // Avagrados number h = 6.63e-34; // Plank's constant, J-s k = 1.38e-23; // Boltzmann constant, J/K T = 273; // Standard temperature, K m = 1.66e-27; // Mass of He gas, kg l = N_A*N/V*h^3/(3*m*k*T)^(3/2); if (l < 1) then printf("\nFor T = %d K, Boltzmann distribution describes He behaviour.", T) else printf("\nFor T = %d K, Boltzmann distribution does not describe He behaviour.", T); end; // Part (b) T = 4.2; // Temperature, K m_He = 4; // Atomic weight of He, g rho = 0.124e-06; // Density of liquid He, g/m^3 N_A_V = (N_A*rho*1e+06)/m_He; // Particle density, atoms/m^3 l = N_A*N/V*h^3/(3*m*k*T)^(3/2); if (l < 1) then printf("\nFor T = %d K, Boltzmann distribution describes He behaviour.", T) else printf("\nFor T = %d K, Boltzmann distribution does not describe He behaviour.", T); end; // Result // For T = 273 K, Boltzmann distribution describes He behaviour. // For T = 4 K, Boltzmann distribution describes He behaviour.
bec95c370b33cd3c2ea8f29d47ffabeb5600f2b7
99b4e2e61348ee847a78faf6eee6d345fde36028
/Toolbox Test/latc2tf/latc2tf11.sce
1595c447b417fedcbc936f05b621a5d1db96f1ee
[]
no_license
deecube/fosseetesting
ce66f691121021fa2f3474497397cded9d57658c
e353f1c03b0c0ef43abf44873e5e477b6adb6c7e
refs/heads/master
2021-01-20T11:34:43.535019
2016-09-27T05:12:48
2016-09-27T05:12:48
59,456,386
0
0
null
null
null
null
UTF-8
Scilab
false
false
209
sce
latc2tf11.sce
//i/p args contain negative values k=[0 0 0 0 0]; v=[0 0 0 0 0]; [num,den] = latc2tf(k,v); disp(num); disp(den); //output // 0. 0. 0. 0. 0. 0. // // 1. 0. 0. 0. 0. 0. //
efb2847f21fecad4087477005d5f22393a3b2271
449d555969bfd7befe906877abab098c6e63a0e8
/1484/CH4/EX4.20/4_20.sce
86dcb270e7c752f332f8c057031afbe89cb5a9a0
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
237
sce
4_20.sce
clc //initialisation of variables L= 3 //ft H1= 1.5 //ft H2= 0.75 //ft Cd= 0.62 g= 32.2 //ft/sec^2 //CALCULATIONS Q= 2*Cd*60*L*sqrt(2*g)*(H1^1.5-H2^1.5)/3 //RESULTS printf ('Discharge per minute= %.1f cubic ft per minute',Q)
aa5bdc4910ace3b02de27dab5aaa9b25838c59ec
9075eb7fae04907e48cd0a730255fdc9b69071f9
/sci/testsFFT.sci
f2e5e0fc8e7fbdeb06543ca87d705ed52d697326
[]
no_license
philippematthieu/GolfBall
2173288fd434cc2abf5ee277fa584757fc172ebf
fe75825b89187dc68e78fe8d60c1a9f5596db075
refs/heads/master
2021-07-25T22:54:22.866727
2020-12-16T10:06:40
2020-12-16T10:06:40
66,164,790
3
0
null
null
null
null
UTF-8
Scilab
false
false
81,358
sci
testsFFT.sci
function toto() x=[1;2,5; pause; abort; pause; pause; // Copyright (C) 2017 - Corporation - Author // // About your license if you have any // // Date of creation: 30 oct. 2017 // // Dimensions d, w, and h // The separation distance (d) between the antenna element and the back-reflection plane should be by // approximately λc ~= 19 mm = 0.7 in.) This will enhance frequencies close to 4 GHz. // The width (w) of the reflection plane should, in theory, be at least 15 cm (6 in.), providing // a full wavelength of surface area margin on each side of the antenna element in the azimuth (horizontal) // plane. Even wider back-reflectors will provide even better performance at wide angles, but in practice anything // wider than 20 cm (9 in.) produces rapidly diminishing returns. // The reflector height (h) isn’t as critical due to the dipole nature of the element. However, the reflector should have at // least ¼λc = 19 mm = 0.7 in. of top and bottom margin, especially if the reflected antenna can tilt forward/back or the // relative elevation angle of the other radio(s) can be large (more than +/-45 o.) In this case a wider top/bottom margin is recommended. Note: one can always // // ////fichier = '400_TrMin.wav'; //fichier = '1150_TrMin.wav'; //fichier = 'BalleRoule3_smooth.wav'; //fichier = 'BalleRoule4_smooth.wav'; //fichier = 'BalleRoule5_smooth.wav'; //fichier = 'BalleRoule2_dimpled.wav'; //fichier = 'BalleRoule5_smooth'; //fichier = 'Driver5.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(11300:14200);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'Driver4.wav'; //fichier = 'Driver3.wav';[z,Fs,bits]=wavread(fichier);s2 = z;s2test = s2(10000:14500);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'Driver2.wav'; //fichier = 'Driver1.wav'; fichier = 'Fer7_5.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(6500:11200);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'Fer7_4.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(16950:21000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'Fer7_3.wav'; //fichier = 'Fer7_2.wav'; //fichier = 'Fer7_1.wav'; //fichier = 'fer7Radar.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(1:4500);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = '1150_TrMin_Bruit.wav'; //fichier = '1150_TrMin.wav'; //fichier = 'BalleRoule1_dimpled.wav'; //fichier = '400_TrMinbruit.wav'; //fichier = 'roulage1.wav'; //fichier = 'BalleRoule3.wav'; //fichier = 'voiture1.wav'; //fichier = 'testRadar.wav';[z,Fs,bits]=wavread(fichier);s2 = z;s2test = s2(20000:60000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'testRadar2.wav';[z,Fs,bits]=wavread(fichier);s2 = z;s2test = s2(20000:70000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'testRadar3.wav';[z,Fs,bits]=wavread(fichier);s2 = z;s2test = s2(1:10000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'testRadar4.wav';[z,Fs,bits]=wavread(fichier);s2 = z;s2test = s2(1:10000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'roulage2.wav'; //fichier = 'lancer.wav'; //fichier = 'BalleFil.wav'; //fichier = 'BalleFil4Tourne.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(1:10000);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'BalleFil5Tombe.wav'; //fichier = 'Fer7_seul_1.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(58000:60600);[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'Fer7_seul_2.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(52000:55500); //fichier = 'Fer7_seul_3.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(52000:55500); //fichier = 'Fer7_seul_4.wav';[z,Fs,bits]=wavread(fichier);s2 = z(2,:);s2test = s2(52000:55500); //fichier = 'RecordAudio.wav';;[z,Fs,bits]=wavread(fichier);s2=z(2,14000:24000);s2test = s2;[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'test2_1_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2;[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'test2_2_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2;[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'test2_3_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2;[s2Centre, s2f] = plotFFT(s2test,Fs); //fichier = 'test2_4_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(1000:9000);[s2Centre, s2f] = plotFFT(s2test,Fs); [z,Fs,bits]=wavread(fichier); // lecture du fichier wav s2 = z(2,:);// prise en compte uniquement du canal 2, car le 1 n'est pas utilise dans mon appli [s2Centre, s2f] = plotFFT(s2test,Fs); // pour le fer7_5 s2test = s2( 6700:7600);// swing s2test = s2( 7600:8400);// swing s2test = s2( 8500:10000);// swing s2test = s2(10000:11000);// s2test = s2(11000:12000);// s2test = s2(6800:12500);// [s2Centre, s2f] = plotFFT(s2test,Fs); figure();plot(s2Centre); s2backswing = s2test(1:2100); s2swing = s2test(2100:4000); s2ball = s2test(4000:$); figure();plot(s2test); figure();plot(s2backswing); figure();plot(s2swing); figure();plot(s2ball); plotFFT(s2test,Fs); plotFFT(s2backswing,Fs); plotFFT(s2swing,Fs); plotFFT(s2ball,Fs); [T,X1,H1,k,M,tt, f_y]=splitSignal(s2Centre,Fs); figure();xset("colormap",hotcolormap(64));plot3d1(M(:,1:$/4)); [xx,yy,zz]=genfac3d(tt,f_y,M); figure();xset("colormap",hotcolormap(64));plot3d1(xx,yy,zz); /////////////////////////////////////////////////////////////////////////////////// [s2Centre, s2f] = plotFFT(s2test,Fs); s2f = filtrageVitesse(s2Centre); //s2f = filtrageVitesseSpin(s2Centre); //s2f = filtrage(s2Centre,1,3000); [tt5,f5,M5,M]=animFFT(s2f,44100,128,0); [i,j]=find(M5 == max(M5)); f5(j)/19.49 // vitesse max ///////////////////////////////////////////////////////////////////////// //////// Calcul de la vitesse de balle suite à la animFFT /////////////// ///////////////////////////////////////////////////////////////////////// fichier = 'test2_3_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(100:9000);s2f = filtrage(s2, 0, 28000); [tt5,f5,M5]=animFFT(s2f,44100, 512 ,50 , 1); fichier = 'test2_4_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(1:14000); [s2Centre, s2f, MaxFreq] = plotFFT(s2,Fs); s2f = filtrage(s2, MaxFreq-100, MaxFreq+1);// filtrage pour le spin [M5,tt5,f5]=animDensite(s2f,44100, 512 ,10 , 1, 0.0,1); [m,k]=max(M5,'c'); figure();plot(tt5,f5(k)/19.49);figure();plot(f5,sum(M5,'r')); fichier = 'test2_3_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(100:9000);s2f = filtrage(s2, 100, 2000); [tt5,f5,M5]=animFFT(s2f,44100, 512 ,50 , 1); fichier = 'test2_3_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(100:9000);s2f = filtrage(s2, 1000, 6000); [tt5,f5,M5]=animFFT(s2f,44100, 512 ,50 , 1); tic;[tt5,f5,M5]=animFFT(s2,44100, 512 ,50 , 1); [VClub, VBall] = Info(M5);toc // l'idee est de déterminer l'angle d'envole entre le SmashFactor donnee par le constructeur // et le smashfactor observe. Du coup on obtien le loft dynamic // en appairant la vitesse du club mesuré au radar et celui calculé par le modèle. // attention toute fois, il faut revoir la définition de la vitesse de club par le radar. // la vitesse max du club n'est pas la vitesse du club à l'impact.... // impact club = début du vol de balle (T(vitesse enregistrée max)) [V0Clubkmh,dynamicLoft_deg] = BallGolf(VBall, 30, 0,VBall / VClub,0.04545,0.2) [t,VOL,Res] = Golfball(18, VClub, '7', 0,0,dynamicLoft_deg-30 ,1); ///////////////////////////////////////////////////////////////////////////// f = figure();subplot(1,6,1);g=gca();g.axes_reverse=["on","off","off"];plot(sum(M5.^2,'r'),f5);subplot(1,2/3,1);f.color_map = jjetcolormap(64);Sgrayplot(tt5,f5,M5);title("Fenetre 3000 pts Hz non filtré");xlabel("s");ylabel("Hz"); f = figure();f.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M5);title("Fenetre 3000 pts Hz non filtré");xlabel("s");ylabel("Hz"); f = figure();f.color_map = matcolormap(64);Sgrayplot(tt5,f5,M5);title("Fenetre 3000 pts RPM non filtré");xlabel("s");ylabel("Hz"); f = figure();f.color_map = hotcolormap(64);Sgrayplot(tt5,f5,M5);title("Fenetre 3000 pts Hz non filtré");xlabel("s");ylabel("Hz"); f = figure();f.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M);title("Fenetre 3000 pts Hz non filtré");xlabel("s");ylabel("Hz"); ///////////////////////////////////////////////////////////////////////////////////// s2Centre2 = sin(Fvb*2*%pi*t+%pi/4); a=angle(fft(s2_filtreWavelet)); figure();subplot(2,1,1);plot(a) subplot(2,1,2);plot(abs(real(fft(s2Centre)))) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// fichier = 'fer7Radar.wav'; [z,Fs,bits]=wavread(fichier); // lecture du fichier wav s2 = z(2,:);// prise en compte uniquement du canal 2, car le 1 n'est pas utilise dans mon appli [s2Centre, s2f] = plotFFT(s2(1:10000),Fs); s2f = filtrageVitesse(s2Centre); [tt5,f5,M5,M]=animFFT(s2f,44100,300,0); s2f = filtrage(s2,14000,22000); [s2Centre, s2f] = plotFFT(s2f,Fs); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// fichier = 'Fer7_5.wav'; [z,Fs,bits]=wavread(fichier); // lecture du fichier wav s2 = z(2,:);// prise en compte uniquement du canal 2, car le 1 n'est pas utilise dans mon appli [s2Centre, s2f] = plotFFT(s2(6800:11300),Fs); s2f = filtrageVitesseSpin(s2Centre); [tt5,f5,M5,M]=animFFT(s2f,44100,600,0); //////////////////////////////////////////////////////////////////////////////////////////////////////////: //////////////////////////////////////////////////////////////////////////////////////////////////////////: figure();plot(1);ax = gca();ax.auto_clear = 'on'; Fs = 44100; N = 512;//Fs*0.01; f = Fs*(0:(N)-1)/N; [wft,wfm,fr] = wfir('bp',64,[1000/Fs 6000/Fs],'hm',[-1 -1]); // définition de la fenetre du filtre passa bande //[s2f zf] = filter(wft,1,s2); // filtrage du signal par le filtre passe bande while %T //y = pa_recordwav(N,Fs ,1); s2_fft = fft(filter(wft,1,pa_recordwav(N,Fs ,1)')); //s2_fft = abs(real(fft(filter(wft,1,pa_recordwav(N,Fs ,1)')))); //plot(f(2:$/2),s2_fft(2:$/2)); s2_densite_real = abs(real(s2_fft.*conj(s2_fft))); plot(f(2:$/16),s2_densite_real(2:$/16)); [m,k]=max(s2_densite_real); //m //f(k)/19.49 end /////////////////////////////////////////:: // affichage continue de la capture sonnore //figure();plot(1);ax = gca();ax.auto_clear = 'on'; Fs = 44100; N1 = 512;//Fs*0.1;// nb echantillon f1 = Fs*(0:(N1)-1)/N1; N2 = 512;//Fs*1.0;// nb echantillon N3 = N1 + N2;// nb echantillon f2 = Fs*(0:(N2)-1)/N2; f3 = Fs*(0:(N3)-1)/N3; [wft,wfm,fr] = wfir('bp',64,[1000/Fs 6000/Fs],'hm',[-1 -1]); // définition de la fenetre du filtre passa bande tic; while %T //tic(); s1 = pa_recordwav(N1,Fs ,1)';//toc();tic(); //s1_fft = abs(real(fft(filter(wft,1,pa_recordwav(N1,Fs ,1)')))); //plot(s1); if max(abs(s1))>0.3 then s2 = pa_recordwav(N2,Fs ,1)'; break; end;//toc(); end; s2 = [s1 s2]; plot(s1); figure();plot(s2); s2_fft = abs(real((fft(filter(wft,1, s2))))); figure();plot(f3(2:$/8),s2_fft(2:$/8)); conjuguee_s2 = conj(s2_fft); s2_densite = s2_fft.*conjuguee_s2; s2_densite_real = abs(real(s2_densite)); figure();plot(f3(2:$/8),s2_densite_real(2:$/8)); [m,k]=max(s2_densite_real); [M5,tt5,f5]=animDensite(s2,44100, 512 ,16 , 1, 0.0,1); ///////////////////////////////////////////////////////////////////// [i,j]=find(M5 == max(M5)); a=f5(j); b=a(1:$-1); c=a(2:$); plot(c-b); a=max(M5,'r');// amplitude en fonction de la fréq b=a(1:$-1); c=a(2:$); figure();plot(f5(1:$-1),c-b); figure();plot(f5,a); aa=max(M5,'c');// amplitude en fonction de la tu temps bb=aa(1:$-1); cc=aa(2:$); figure();plot(tt5(1:$-1),cc-bb); figure();plot(tt5,aa); ///////////////////////////////////////////////////////////////////// s2test=(s2Centre(2200:4800)); [s2Centre, s2f, MaxFreq] = plotFFT([s2test],Fs); s2f = filtrage(s2, MaxFreq-100, MaxFreq+1); [s2Centre, s2f, MaxFreq] = plotFFT([s2test, zeros(1,2000)],Fs); s2f = filtrage(s2, MaxFreq-100, MaxFreq+1); [M5,tt5,f5]=animDensite(s2f,44100, 512 ,10 , 1, 0.05,1); /////////////////////////////////////////////////////////////////////// fichier = 'test2_2_dehors_metal.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(4001:12192); //s2test = s2(6000:12192);figure();plot(s2test);// vecteur uniquement de la ball //[s2Centre, s2f, MaxFreq] = plotFFT(s2test,Fs); Fs = 44100; N=size(s2test,'c'); // definition du nombre d'échantillons fq=Fs*(0:(N)-1)/N; tau = 1 / Fs; // interval temporel de l'echantillonnage t = (0:N - 1) * tau; // construction du vecteur temps [wft,wfm,fr] = wfir('bp',64,[600/Fs 6000/Fs],'hm',[-1 -1]); s2Centre = s2test - mean(s2test); [s2f zf] = filter(wft,1,s2Centre); [M5,tt5,f5]=animDensite(s2f,44100, 512 ,16 , 1, 0.0,1); fig = figure();fig.color_map = jetcolormap(128);Sgrayplot(tt5,f5,M5);xlabel("s");ylabel("Hz"); fig = figure();fig.color_map = jetcolormap(2);Sgrayplot(1:size(T,1),1:size(T,2),T); s2f_fft = fft(s2f); s2f_fft_real = abs(real(s2f_fft)); [m,n] = max(s2f_fft_real(2:$/2)); a = fq(2:$/2); MaxFreq = a(n); s2f = filtrage(s2Centre, (MaxFreq-1), (MaxFreq+1));// filtrage pour centrer sur le spin [M5,tt5,f5]=animDensite(s2f,44100, 512 ,16 , 1, 0.0,1); [vClub, vBall, SmashFactor] = Info(M5,f5) // filtrage pour la tête de club ubiquement s2f = filtrage(s2Centre, (MaxFreq-1000)/SmashFactor, (MaxFreq-200)/SmashFactor);// filtrage pour la tête de club ubiquement [M5,tt5,f5]=animDensite(s2f,44100, 512 ,16 , 1, 0.0,1); [M5,tt5,f5]=animDensite(s2Centre,44100, 512 ,16 , 1, 0.0,1); [thetaLoft, ShafLeanImp, launchAngle, spin] = LaunchAngle(vBall, vClub, '7') [t,VOL,Res] = Golfball(18, vClub, '7', 0,0,ShafLeanImp ,1); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// s2test = s2(7000:10096);figure();plot(s2test);// vecteur uniquement de la ball Fs = 44100; N=size(s2test,'c'); // definition du nombre d'échantillons fq=Fs*(0:(N)-1)/N; Nf = 512; Nr = 16; s2Centre = s2test - mean(s2test); y = sgolayfilt(s2Centre,12,23); plot(s2Centre); plot(y,'r'); s2_fft = fft(s2Centre); s2_densite = abs(real(s2_fft.*conj(s2_fft))); // Visualisation de la vitesse de balle et spin // entre 2000tr/min et 10000 tr/min soit entre (freq_Ball - 24Hz) à (freq_Ball - 121Hz) figure();plot(fq(1:$/2),s2_densite(1:$/2)); plot(fq(1:$/2),dbv(s2_densite(1:$/2)),'r'); plot(fq(1:$/2),s2_densite(1:$/2).* dbv(s2_densite(1:$/2)),'y'); [M5,tt5,f5]=animDensite(s2Centre,44100, 512 ,16 , 1, 0.0,1); fig = figure();fig.color_map = jetcolormap(128);Sgrayplot(tt5,f5,M5);xlabel("s");ylabel("Hz"); // vitesse de la balle = Freq_Max [m,n] = max(s2_densite(1:$/2).* dbv(s2_densite(1:$/2))); a = fq(2:$/2); MaxFreq = a(n); // recherche du rpm du Spin MaxSpin = MaxFreq - 121; MinSpin = MaxFreq - 30; [iMin,jMin]=find(fq > MaxSpin); [iMax,jMax]=find(fq < MinSpin); fq_fen = fq(jMin(1):jMax($)); s2_densite_fen = s2_densite(jMin(1):jMax($)); figure();plot(fq(jMin(1):jMax($)),s2_densite(jMin(1):jMax($))) [val, pos] = max(s2_densite_fen); Spin = Freq2RpmSpin(MaxFreq - max(fq_fen(pos))); ///////// s2_fft = fft(y); s2_densite = abs(real(s2_fft.*conj(s2_fft))); plot(fq,s2_densite,'r'); plot(fq,abs(real(fft(s2Centre-y').*conj(fft(s2Centre-y'))))); plot(fq,abs(real(fft(s2Centre-s2f).*conj(fft(s2Centre-s2f))))); [T,X1] = splitSignal(s2Centre,Fs, Nf, Nr); plot(fq,signal/max(signal),'c'); plot(fq,(h1.*signal)/max((h1.*signal)),'r'); plot(fq,(h2.*signal)/max((h2.*signal)),'b'); plot(fq,(h3.*signal)/max((h3.*signal)),'b'); plot(T(516/2-1,1:$),'y'); plot(T(516/2,1:$),'b'); plot(T(516/2+1,1:$),'r'); TT = []; for ii = 1:size(M5,2) TT(ii,:) = splitSignal(M5(ii,:),Fs, Nf/2, Nr); end; plot(f5,M(1,1:$/2)) [m,k]=max(M5,'c'); figure();plot(tt5,f5(k)/19.49);figure();plot(f5,sum(M5,'r')); dT = tt5(2:$) - tt5(1:$-1); dT($+1) = dT($); figure();plot(tt5,f5(k)'.*dT/19.49) Distance = f5(k)'.*dT/19.49; SumD = 0; for ii=2:size(Distance,1) SumD(ii) = SumD(ii-1)+Distance(ii-1); end figure();plot(tt5,SumD) [m,k]=max(s2Centre); t(k) plot(tt5(2:$),SumD(2:$))./tt5(2:$)) plot3d1(tt5'*1e5,f5,M5*1e4) //////////////////////////////////////////////////////////////////////////////// fichier = 'Fer7_seul_4.wav';[z,Fs,bits]=wavread(fichier);s2=z(2,:);s2test = s2(4001:12192); //s2test = s2(6000:12192);figure();plot(s2test);// vecteur uniquement de la ball //[s2Centre, s2f, MaxFreq] = plotFFT(s2test,Fs); Fs = 44100; N=size(s2test,'c'); // definition du nombre d'échantillons fq=Fs*(0:(N)-1)/N; tau = 1 / Fs; // interval temporel de l'echantillonnage t = (0:N - 1) * tau; // construction du vecteur temps [wft,wfm,fr] = wfir('bp',64,[2000/Fs 2001/Fs],'hm',[-1 -1]); s2Centre = s2test - mean(s2test); [s2f zf] = filter(wft,1,s2Centre); [M5,tt5,f5]=animDensite(s2f,44100, 512 ,16 , 1, 0.0,1); fig = figure();fig.color_map = jetcolormap(128);Sgrayplot(tt5,f5,M5);xlabel("s");ylabel("Hz"); fig = figure();fig.color_map = jetcolormap(4);Sgrayplot(tt5,f5,M5);xlabel("s");ylabel("Hz"); /////////////////////////////////////////////////////////////////////////////////////////////// [wft,wfm,fr] = wfir('bp',64,[0.03 0.08],'hm',[-1 -1]); s2 = filter(wft,1, test1(Fs*5.8:Fs*6.1)); tic;[M5,tt5,f5]=animDensite(s2,44100, 512 ,16 , 1, 0.0,1);toc [m,k]=max(M5,'c');figure();plot(tt5,f5(k)/19.49); figure();plot(f5,sum(M5,'r'));[m,k]=max(sum(M5,'r')); f(k)/19.49 tic;[M5,tt5,f5]=animDensite(s2,44100, 512 ,16 , 1, 0.0,0);toc fig = figure();fig.color_map = jetcolormap(128); plot(1);ax = gca();ax.auto_clear = 'on'; for ii=1:size(tt5,1) //Sgrayplot(tt5,f5,M5);xlabel("s");ylabel("Hz"); plot(f5,M5(ii,:)); //sleep(50); end; ///////////////////////////////////////////////////////////////////////////////////////////////////// fichier = 'Serie22.wav';[s2,Fs,bits]=wavread(fichier); test = s2; Fs = 44100; nbEchantillon = 1024*1; f1 = Fs*(0:(nbEchantillon)-1)/nbEchantillon; //fig = figure();fig.color_map = hotcolormap(128);drawlater();plot(1);ax = gca();ax.auto_clear = 'on';tic; [wft,wfm,fr] = wfir('bp',64,[0.04 0.09],'hm',[-1 -1]); // boucle de détection de début de swing, ou le joueur bouge, pas la vitesse max for ii=2:size(test , 2)/nbEchantillon, //tic; //drawnow(); //drawlater(); //[M5,tt5,f5]=animDensite(test((ii)*nbEchantillon+1:nbEchantillon*ii),44100, nbEchantillon ,16 , 0, -100.0,1); //fig = figure();fig.color_map = jetcolormap(128);Sgrayplot(tt5,f5,M5); s2_fft = abs(real(fft(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+1)))))); if (max(s2_fft,'c') > 3) then, break; end; //toc //Sgrayplot(tt5,f5,M5); //plot(f(1:$/2), s2_fft(1:$/2)); end;//toc [m,k] = max(s2_fft,'c');//vitesse probable du club //drawnow(); ////////// Plot de la FFT Club puis Balle juste avec la FFT ////////////////////////////////// s2_fft = abs(real(fft(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+1)))))); f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); figure();plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2)),'r'); s2_fft = abs(real(fft(filter(wft,1, test((ii+2)*nbEchantillon+1:nbEchantillon*(ii+4)))))); f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); plot(f1(1:$/2)/19.49, s2_fft(1:$/2),'b');f1(k)/19.49 ///////////////////////////////////// SIMULATION ////////////////////////////////////////// /////// recherche de la fonction sinus appérée à la fréquence sin(wt) = sin(2*%pi*F*t)) // Form a signal containing a 50 Hz sinusoid of amplitude 0.7 and a 120 Hz sinusoid of amplitude 1. // S = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t); [wft,wfm,fr] = wfir('bp',64,[0.04 0.09],'hn',[-1 -1]); [wft,wfm,fr] = wfir('bp',64,[2000/Fs 2001/Fs],'hm',[-1 -1]); s2_fft = abs(real(fft(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+4)))))); [m,k] = max(s2_fft,'c'); f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); t = (0:size(f1,2)-1)/Fs; Ref = GenereSignalSimu(44100, 4096, 0.03, 120, 160, 5000,[1 1 1], 0); [wft,wfm,fr] = wfir('bp',64,[150*19.49/Fs 169*19.49/Fs],'hm',[-1 -1]); ff1 = Fs*(0:(size(Ref,2))-1)/size(Ref,2); Ref_fft = abs(real(fft(filter(wft,1, Ref)))); plot(ff1(1:$/2)/19.49, Ref_fft(1:$/2)/max(Ref_fft(1:$/2)),'c'); plot(f1(1:$/2), s2_fft(1:$/2)/max(s2_fft(1:$/2)),'b');f1(k)/19.49 plot(f1(1:$/2), s2_fft(1:$/2)/max(s2_fft(1:$/2))-Ref_fft(1:$/2)/max(Ref_fft(1:$/2)),'g');f1(k)/19.49 [M5,tt5,f5]=animDensite(filter(wft,1, Ref),44100, 512 ,16 , 0, -75,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); t = (0:size(test,2)-1)/Fs; test = test - Ref; //////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////// [m,k] = max(s2_fft,'c'); f1(k)/19.49 //[M5,tt5,f5]=animDensite(filter(wft,1, test),44100, 512 ,16 , 0, 0.0,1);tic [M5,tt5,f5]=animDensite(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+3))),44100, 512 ,16 , 0, -75,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); [vClub, vBall, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZ] = Info(M5,f5,'7') MM5 = (M5 ==1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,MM5/19.49); figure();plot(f5/19.49,sum(MM5,'r')); a = sum(MM5,'c'); a(find(a==0)) = %nan; s2_fft = abs(real(fft(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+3))))));f1 = Fs*(0:(4*nbEchantillon)-1)/(4*nbEchantillon);figure();plot(f1(1:$/2)/19.49, s2_fft(1:$/2)); s2_fft = abs(real(fft(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+3))))));f1 = Fs*(0:(3*nbEchantillon)-1)/(3*nbEchantillon);figure();plot(f1(1:$/2)/19.49, s2_fft(1:$/2)); [t,VOL,Res] = Golfball(18, vClub, '7', 0,-0,ShafLeanImp ,0); /////////////////////////////////////////////////////////////////////////////// /////////////// détection précise de la vitesse initiale de la balle [wft,wfm,fr] = wfir('bp',64,[0.04 0.09],'hm',[-1 -1]); [M5,tt5,f5]=animDensite(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+3))),44100, 512 ,16 , 0, -90,1); //fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); [vClub, vBall, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZ] = Info(M5,f5,'7') freqC = vBall*19.49/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.00001 ],'hm',[-1 -1]); [tt5,f5,MB5]=animDensite(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+10))),44100, 512 ,16 , 0, -90.0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,MB5/19.49); /////////// spin freqC = (vBall+5)*19.49/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC - 0.000001 freqC ],'hm',[-1 -1]); [tt5,f5,MS5]=animDensite(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+20))),44100, 4096 ,16 , 0, -900.0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,MS5/19.49); /////////////// puis détection précise de la vitesse initiale du club freqC = vClub*19.49/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.000001 ],'hm',[-1 -1]); [tt5,f5,MC5]=animDensite(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+2))),44100, 512 ,16 , 0, -90.0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,MC5/19.49); [vClub, vBall, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZ] = Info(M5,f5,'7') M55 = -M5(1:$-1,:)+M5(2:$,:); M55 = [0*(1:size(M55,'c'));M55]; fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,(M5+M5.*M55)/19.49); [m,k]=max(M5,'c'); figure();plot(tt5,f5(k)/19.49); figure();plot(f5/19.49,sum(M5,'r')); f_fft = abs(real(fft(f5(k)-mean(f5(k)))));; ffft = Fs*(0:(size(f_fft,2))-1)/size(f_fft,2); figure(); subplot(2,1,1);plot(ffft(1:$/2),f_fft(1:$/2)); a=angle(fft(f_fft(1:$/2))); subplot(2,1,2);plot(ffft(1:$/2),a); //////////////////////////////////////////////////////////////////////////////// // Etude de la variation de l'angle de l'objet eclaire en focntion de la vitesse doppler mesurée // // F = 2*V*(Ft/c)*Cos(theta) = 19.49*V*Cos(Theta) // dF = 19.49*V*sin(theta) Theta = [20*%pi/180; VOL(2:$,3)./VOL(2:$,1)]; plot(VOL(:,1),cos(atan(Theta))*160); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////// Algo de détection de vitesse club et balle ////////////// /////////////////////////// avec la fft capturée ////////////// // lecture du signal // lecture de largeur de spectre se fait à -20db // forder = 64; [wft,wfm,fr] = wfir('bp',forder,[0.044 0.09],'hm',[-1 -1]); //Calculate window coefficients //[win_l_,cwp_]=window(wtype,forder,ffpar); //wtype = 'hm'; //ffpar = [-1 -1]; forder = 64; fl = 0.044; // fcbasse = 2000/44100 fh = 0.09; // fchaute = 6000/44100 no2=(forder-1)/2; ino2 = int(no2); xt=(-no2:no2); un=ones(1,forder); // hamming win_l=.54*un+.46*cos(2*%pi*xt/(forder-1)); //hanning //win_l=.5*un+.5*cos(2*%pi*xt/(n-1)); //Get forder samples of the appropriate filter type //hfilt_=ffilt(ftype,forder,fl,fh); //Calculate n samples of the sinc function //Band pass filter wc=%pi*(fh+fl); fl=(fh-fl)/2; //x=filt_sinc(forder,fl); wl = fl*2*%pi; xn = sin(wl*(-no2:no2)); xd = %pi*(-no2:no2); if ino2==no2 then xn(no2+1) = 2*fl; xd(no2+1) = 1; end x=xn./xd; y=2*cos(wc*(-no2:no2)); hfilt=x.*y; //Multiply window with sinc function wft_=win_l.*hfilt; Fs = 44100; nbEchantillon = 256*1; fichier = 'serie211.wav'; [test,Fs,bits]=wavread(fichier); // serie211 : 122.68kmh et 154.23kmh tic; test = test - mean(test); // boucle de détection de début de swing, ou le joueur bouge // l'indice ii donne le début du signal for ii=2:size(test , 2)/nbEchantillon, s2_fft = abs(real(fftpadding(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+1)))))); if (max(s2_fft,'c') > 3) then, break; end; end;// // Identificatin de la vitesse de club s2_fft = abs(real(fftpadding(filter(wft,1, test((ii-1)*nbEchantillon+1:nbEchantillon*(ii+3))))));//1024 echantillon. //[s2_fft, f1] = FftFiltree(test((ii)*nbEchantillon+1:nbEchantillon*(ii+2)),Fs,1700,6000); //f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2);plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2)),'r'); //[M5,tt5,f5]=animDensite(filter(wft,1, (test((ii-5)*nbEchantillon+1:nbEchantillon*(ii+50)))),44100, 1024 ,16 , 1, -90,1); [m,k] = max(s2_fft,'c');VClub = Fs*((k)-1)/size(s2_fft,2)/19.49;//vitesse probable du club, qui est la première détection de vitesse seuille // Identification de la vitesse de balle probable s2_fft = abs(real(fft(filter(wft,1, test((ii+7)*nbEchantillon+1:nbEchantillon*(ii+20)))))); //f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2);plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2))); //[s2_fft, f1] = FftFiltree(test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+8)),Fs,1700,6000); //[M5,tt5,f5]=animDensite(filter(wft,1, (test((ii+3)*nbEchantillon+1:nbEchantillon*(ii+8)))),44100, 256 ,16 , 1, -90,1); //f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2);plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2)),'b'); [m,k] = max(s2_fft,'c');VBall = Fs*((k)-1)/size(s2_fft,2)/19.49;//vitesse probable de la balle, qui est la première détection de vitesse seuil f1 = Fs*((k)-1)/size(s2_fft,2) // identification précise de la vitesse de la balle avec un filtrage passe bande fin freqC = VBall*19.49/Fs ;[wft,wfm,fr] = wfir('bp',forder,[freqC-0.000001 freqC+0.000001 ],'hm',[-1 -1]); s2_fft = abs(real(fftpadding(filter(wft,1, test((ii+7)*nbEchantillon+1:nbEchantillon*(ii+20)))))); // //f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); //plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2)),'g'); [m,k] = max(s2_fft,'c');VBall = Fs*((k)-1)/size(s2_fft,2)/19.49;//vitesse probable de la balle, qui est la première détection de vitesse seuil toc ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////// // // Filtrage pour déterminer le spin balle // /////////////////////////////////////////// tic; [wft1,wfm1,fr1] = wfir('bp',forder,[(VBall*19.49-RpmSpin2Freq(7000))/Fs (VBall*19.49-RpmSpin2Freq(3000))/Fs],'hm',[-1 -1]); [wft2,wfm2,fr2] = wfir('sb',forder+1,[(VBall*19.49-100)/Fs (VBall*19.49+100)/Fs],'hm',[-1 -1]); [wft3,wfm3,fr3] = wfir('bp',forder,[(VBall*19.49+RpmSpin2Freq(3000))/Fs (VBall*19.49+RpmSpin2Freq(7000))/Fs],'hm',[-1 -1]); [wft4,wfm4,fr4] = wfir('bp',forder+1,[(VBall*19.49+RpmSpin2Freq(3000))/Fs (VBall*19.49+RpmSpin2Freq(15000))/Fs],'hm',[-1 -1]); //[wft,wfm,fr] = wfir('bp',forder+1,[(VBall-0.5)*19.49/Fs (VBall+0.5)*19.49/Fs],'hm',[-1 -1]); //s2_fft = abs(real(fftpadding(filter(wft,1, (x))))); //[s2_fft, f1] = FftFiltree(test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+8)),Fs,(VBall-0.5)*19.49 , (VBall+0.5)*19.49); //f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); //plot(f1(1:$/2), s2_fft(1:$/2)/max(s2_fft(1:$/2)),'g'); s2_fftb = abs(real(fft( filter(wft1,1, filter(wft2,1, x))))); //[s2_fftb, f1] = FftFiltree(test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+8)),Fs,(VBall*19.49-RpmSpin2Freq(10000)) , VBall*19.49-RpmSpin2Freq(3000)); //f1 = Fs*(0:(size(s2_fftb,2))-1)/size(s2_fftb,2); //plot(f1(1:$/2), s2_fftb(1:$/2)/max(s2_fftb(1:$/2)),'b') [m k]=max(s2_fftb); MIN = (f1(k)); s2_fftc = abs(real(fft( filter(wft4, 1,filter(wft2, 1,x))))); //[s2_fftc, f1] = FftFiltree(test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+8)),Fs,(VBall*19.49+RpmSpin2Freq(3000)) , (VBall*19.49+RpmSpin2Freq(10000))); //f1 = Fs*(0:(size(s2_fftc,2))-1)/size(s2_fftc,2); //plot(f1(1:$/2), s2_fftc(1:$/2)/max(s2_fftc(1:$/2)),'r') [m k]=max(s2_fftc); MAX = (f1(k)); toc [Freq2RpmSpin(VBall*19.49-MIN) Freq2RpmSpin(-VBall*19.49+MAX)] ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Ref_total = GenereSignalSimu(44100, 4096, 0.03, VClub, VBall, [Freq2RpmSpin(VBall*19.49-MIN) Freq2RpmSpin(-VBall*19.49+MAX)], [1, 1, 0], 0); ff1 = Fs*(0:(size(Ref_total,2))-1)/size(Ref_total,2); [wft,wfm,fr] = wfir('bp',forder,[(VBall-5)*19.49/Fs (VBall+5)*19.49/Fs],'hm',[-0 -0]); Ref_total_fft = abs(real(fftpadding(filter(wft,1,Ref_total)))); plot(ff1(1:$/2), Ref_total_fft(1:$/2)/max(Ref_total_fft(1:$/2)),'b-o'); [wft1,wfm1,fr1] = wfir('bp',forder,[(VBall*19.49-RpmSpin2Freq(9000))/Fs (VBall*19.49+RpmSpin2Freq(9000))/Fs],'hm',[-1 -1]); s2_fftb = abs(real(fftpadding( filter(wft1,1, x)))); f1 = Fs*(0:(size(s2_fftb,2))-1)/size(s2_fftb,2);plot(f1(1:$/2), s2_fftb(1:$/2)/max(s2_fftb(1:$/2)),'r'); [wft,wfm,fr1] = wfir('bp',forder,[(MIN)/Fs (MAX)/Fs],'hm',[-1 -1]); [M5, tt5, f5]= animDensite(filter(wft,1, Ref_total),44100, 4096 ,64 , 0, -0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5(:,1:$-1)/19.49); [M5, tt5, f5]= animDensite(filter(wft,1, x),44100, 4096 ,64 , 0, -0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5(:,1:$-1)/19.49); xd = wden(x,'heursure','s','one',1,'sym8');figure();plot(t,xd); s2_fft = abs(real(fftpadding( ( xd)))); f1 = Fs*(0:(size(xd,2))-1)/size(xd,2); figure();plot(f1(1:$/2), s2_fft(1:$/2)/max(s2_fft(1:$/2)),'b'); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // calcul du signal de référence simulé en fonction de la vitesse de balle pour identifier le spin t = (0:size(f1,2)-1)/Fs; spin = 7634;//a déterminer Ref_total = GenereSignalSimu(44100, 4096, 0.03, VClub, VBall, spin, [1, 1, 0], 0); ff1 = Fs*(0:(size(Ref_total,2))-1)/size(Ref_total,2); [wft,wfm,fr] = wfir('bp',forder,[(VBall-5)*19.49/Fs (VBall+5)*19.49/Fs],'hm',[-0 -0]); Ref_total_fft = abs(real(fftpadding(Ref_total)));// Ref_total_fft = abs(real(fftpadding(filter(wft,1,Ref_total)))); Ref_spin = GenereSignalSimu(44100, 4096, 0.03, VClub, VBall, spin, [0, 1, 0], 0); [wft,wfm,fr] = wfir('bp',forder,[(VBall*19.49+RpmSpin2Freq(3000)))/Fs (VBall*19.49+RpmSpin2Freq(3000)))/Fs],'hm',[-1 -1]); Ref_spin_fft = abs(real(fftpadding( Ref_spin)));// Ref_ball = GenereSignalSimu(44100, 4096, 0.03, VClub, VBall, spin, [1, 0, 0], 0); [wft,wfm,fr] = wfir('bp',forder,[(VBall-5)*19.49/Fs (VBall+5)*19.49/Fs],'hm',[-1 -1]); Ref_ball_fft = abs(real(fftpadding(Ref_ball))); // ////////////////////////////////////////// // // Affichage des courbes simulées et captées // ///////////// figure(); plot2d(ff1(1:$/2)/19.49, [Ref_total_fft(1:$/2)/max(Ref_total_fft(1:$/2)); Ref_ball_fft(1:$/2)/max(Ref_ball_fft(1:$/2)); Ref_spin_fft(1:$/2)/max(Ref_spin_fft(1:$/2))]'); f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); plot(f1(1:$/2)/19.49, s2_fft(1:$/2)/max(s2_fft(1:$/2)),'r'); legends(['Signal Total: VClub: ' + string(VClub)+' kmh';'Signal Ball: ' + string(VBall) + ' kmh';'Signal Spin: '+ string(spin)+'rpm';'Signal Capturé'],[1 2 3 5],opt=1); [M5,tt5,f5]=animDensite(filter(wft,1, test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+19))),44100, 1024 ,16 , 0, -90,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); [vClub, vBall, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZ] = Info(M5,f5,'7') /////////////////////////////////////////////////// // // Vue d'une coupe bande fin sur la vitesse // identification précise de la vitesse de la balle avec un filtrage passe bande fin // ////////////// forder = 64; x = test((ii+4)*nbEchantillon+1:nbEchantillon*(ii+8)); freqC = VBall*19.49/Fs ;[wft1,wfm1,fr1] = wfir('bp',forder,(VBall-5)*19.49/Fs (VBall +5)*19.49/Fs],'hm',[-1 -1]); //freqC = VBall*19.49/Fs ;[wft2,wfm2,fr2] = wfir('sb',forder+1,[(VBall-0.5)*19.49/Fs (VBall+0.5)*19.49/Fs],'hm',[-1 -1]); //s2_fft = abs(real(fftpadding(filter(wft2,1, filter(wft1,1, x))))); [m k]=max(s2_fft);MIN = (f1(k)-31); MAX = (f1(k)+31); ll = find(((f1) >= MIN) & ((f1) <= MAX)); s2_fftb = s2_fft; s2_fftb(ll) = 0; f1 = Fs*(0:(size(s2_fftb,2))-1)/size(s2_fftb,2);plot(f1(1:$/2)/19.49, s2_fftb(1:$/2)/max(s2_fftb(1:$/2)),'b'); [m k]=max(s2_fft(1:ll(1))); MIN = (f1(k)); [m k]=max(s2_fft(ll($):$/2));MAX = (f1(ll($)+k-1)); [wft1,wfm1,fr1] = wfir('bp',forder,[(VBall*19.49+RpmSpin2Freq(3000))/Fs (VBall*19.49+RpmSpin2Freq(9000))/Fs],'hm',[-1 -1]); s2_fftb = abs(real(fftpadding( filter(wft1,1, x)))); f1 = Fs*(0:(size(s2_fftb,2))-1)/size(s2_fftb,2);plot(f1(1:$/2), s2_fftb(1:$/2)/max(s2_fftb(1:$/2)),'r'); [wft1,wfm1,fr1] = wfir('bp',forder,[(VBall*19.49-RpmSpin2Freq(9000))/Fs (VBall*19.49-RpmSpin2Freq(3000))/Fs],'hm',[-1 -1]); s2_fftb = abs(real(fftpadding( filter(wft1,1, x)))); f1 = Fs*(0:(size(s2_fftb,2))-1)/size(s2_fftb,2);plot(f1(1:$/2), s2_fftb(1:$/2)/max(s2_fftb(1:$/2)),'b'); ///////////////////////////////////////////////////////////////////////////////////////////////// // essais sur plusieurs fréquences ou echantillonnages avec fenêtre glissante // i=1; freqC = (500*i)/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.000001 ],'hm',[-1 -1]); [M5, tt5, f5]= animDensite(filter(wft,1, test((ii-2)*nbEchantillon+1:nbEchantillon*(ii+19))),44100, 4096/(2^i) ,16 , 0, -550,1);; M5[]; for i=2:8; freqC = (3100)/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.000001 ],'hm',[-1 -1]); [M5, tt5, f5]=animDensite(filter(wft,1, test((ii-2)*nbEchantillon+1:nbEchantillon*(ii+19))),44100, 4096/(2^i) ,16 , 0, -190,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); end fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); ///////////////////////////////////////// // // Wavelet // recherche du temps de la vitesse max // /////////////////////////////////////// fichier = 'serie211.wav'; [test,Fs,bits]=wavread(fichier); // serie211 : 122.68kmh et 154.23kmh test = test - mean(test); [wft,wfm,fr] = wfir('bp',64,[0.044 0.09],'hm',[-1 -1]); Fs = 44100; nbEchantillon = 1024*1; // boucle de détection de début de swing, ou le joueur bouge // l'indice ii donne le début du signal for ii=2:size(test , 2)/nbEchantillon, s2_fft = abs(real(fft(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+1)))))); if (max(s2_fft,'c') > 3) then, break; end; end;// freqC = (VBall*19.49)/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.000001 ],'hm',[-1 -1]); x = test((ii-2)*nbEchantillon+1:nbEchantillon*(ii+15)); f1 = Fs*(0:(size(x,2))-1)/size(x,2); t = (0:size(x,2)-1)/Fs; level = 2; //[cA,cD] = dwt(filter(wft,level, x),'haar'); [C,L]=wavedec(filter(wft,1, x),level,'haar');wavedecplot(C,L); scf();clf(); subplot(511) plot(x,'r') subplot(512) plot(C(1:L(1))) subplot(513) s2_filtreWavelet = C(L(1):sum(L(1:2))); plot(s2_filtreWavelet,'g'); //f1 = Fs*(0:(size(s2_filtreWavelet,2))-1)/size(s2_fft,2); //plot(f1,abs(real(fft(filter(wft,1, s2_filtreWavelet))))); subplot(514) plot(C(sum(L(1:2)):sum(L(1:3))),'b');//detcoef(C,L,2) subplot(515) plot(C(sum(L(1:3)):sum(L(1:4))),'c');//plot(detcoef(C,L,2)) level = 2; [C,L]=wavedec(filter(wft,1, x),level,'haar');wavedecplot(C,L); d1 = detcoef(C, L, level); d1up = dyadup(d1,0); subplot(211) plot(t,x) subplot(212) plot(d1up) freqC = (VBall*19.49)/Fs ;[wft,wfm,fr] = wfir('bp',64,[freqC freqC+0.000001 ],'hm',[-1 -1]); [M5, tt5, f5] = animDensite(filter(wft,1, x),44100, 512 ,64 , 0, -70, 1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); figure();subplot(211);plot(f5/19.49,sum(M5,'r'));subplot(212);plot(tt5,sum(M5,'c')); [m,k] = max(sum(M5,'c')); tt5(k);// temps du shoot [m,k] = max(M5,'c');f5(142)/19.49://vitesse max x = GenereSignalSimu(44100, 4096, 0.03, VClub, VBall, 6000,[1 1 1], 0); N=256; t = (0:size(x,2)-1)/Fs; f1 = Fs*(0:N-1)/N; scales = [1:1:N]; [coef] = cwt(filter(wft,1, x),scales,'mexh'); w=wcodemat(coef,N); cmap=jetcolormap(N); c=ind2rgb(w,cmap); // SIP function imshow(c); figure();plot(t,abs(coef(1,:))); f1(1) = .00001; fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(t,f1/19.49,abs(coef)'); f1 = Fs*(0:N-1)/60;figure();subplot(2,1,1);plot(f1/19.49,sum(coef,'c'));subplot(2,1,2);plot(t,sum(coef,'r')) [m,k] = max(coef); t(k(2)) cwtplot(coef,scales,%t,64);p = graycolormap(256); f = gcf();f.color_map=p;f.background=256; // Calcul de la transformée en ondelettes continue //w=TOC(fct,'OT_Mexicain(t,a,b)',a,b); aa=gca(); // Légende du graphique sur X legGradx=[]; // On veut 6 graduations nbGradX=6 // Position des graduations px=[]; for i=0:nbGradX-1 ind=min(fix(i*size(coef,2)/(nbGradX-1))+1,size(coef,2)); px=[px ind]; legGradx=[legGradx; string(fix(100*t(ind))/100)]; end aa.x_ticks = tlist(["ticks", "locations", "labels"], px', legGradx); figure();plot(t,x); plot2d(f1(k(2)-256:k(2)+1024),abs(real(fft(filter(wft,1, x(k(2)-256:k(2)+1024)))))); [thr,sorh,keepapp] = ddencmp('den','wv',x); xd = wden(x,'heursure','s','one',1,'sym8');figure();plot(t,xd); [M5,tt5,f5]=animDensite(filter(wft,1, xd),44100, 128 ,32 , 0, -550,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); [M5,tt5,f5]=animDensite(filter(wft,1, x(k(2)-256:k(2)+1024)),44100, 1024 ,16 , 0, -75,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M5/19.49); // Calcul de l'angle de décolage zMdfl3#j infini // Vmesure = Vreelle * cos(launchAngle) // on admet que sur la courte distance la vitesse est constante et correspond à // la vitesse max (où la balle et pile poile dans le faisceau avec une incidence à 0) // shoot à 0.06, // le max est 156kmh à 0.1s soit (0.1-0.06)*156/3.6= 1.7333m // et 149.7kmh à 0.25s soit (0.25-0.06)*156/3.6 = 8.233m, soit 0.15s plus tard ==> 0.15*156/3.6 = 6.5m // donc en 6.5m la mesure à perdue 6.3kmh // ainsi Vm2/Vm1 = cos(launchAngle) ==> acos(Vm2/Vm1)*180/%pi = // launchAngle = acos(149.7/156)*180/%pi = 16.34° freqC = (VBall*19.49)/Fs ; f1 = Fs*(0:(size(test,2))-1)/size(test,2); [wft,wfm,fr] = wfir('bp',512,[freqC freqC+0.000001 ],'hm',[-1 -1]); [wft]=ffilt('bp',64,200000,500000); plot(f1,abs(real(fft(test)))/max(abs(real(fft(test))))); plot(f1,abs(real(fft(filter(wft,1, test))))/max(abs(real(fft(filter(wft,1, test))))),'r'); [wft,wfm,fr] = wfir('bp',512,[freqC freqC+0.000001 ],'re',[-1 -1]); figure(); plot(f1,abs(real(fft(test)))/max(abs(real(fft(test))))); plot(f1,abs(real(fft(filter(wft,1, test))))/max(abs(real(fft(filter(wft,1, test))))),'g'); Ref_1 = GenereSignalSimu(44100, 4096, 0.02, VClub, VBall, Spin(2), [1 1 1], 0); Ref_2 = GenereSignalSimu(44100, 4096, 0.02, VClub, VBall, Spin(2), [1 1 0], 0.2*%pi/2); figure();plot([Ref_1 ; Ref_2]'); ////////////////////////////////////////////////////////////////////////// // // // //////////////////////////////////////////////////////// fichier = 'serie211.wav'; //fichier='serie11.wav'; [x,Fs,bits]=wavread(fichier); //x=x(2,:); Fs = 44100; t = (0:size(xx,2)-1)/Fs; figure();plot(t,x);// serie211 : 122.68kmh et 154.23kmh [wft,wfm,fr] = wfir('bp',64,[2000/Fs 6000/Fs ],'re',[-1 -1]); //wft=iir(3,'bp','ellip',[1000/Fs 6000/Fs ],[.08 .03]); //[wfm,fr]=frmag(wft,256); //xx = filter(wfm,1,x); [VBall, VClub, Spin, SpinAxis, xresult]=GetSwing(filter(wft,1,x), Fs, 2000, 6000, 3) [thetaLoft, ShafLeanImp, launchAngle, SpinZ] = LaunchAngle(VBall, VClub, '7') FaceAngle = 0; [t,VOL,Res] = Golfball(18, VClub, '7', 0,FaceAngle, ShafLeanImp ,1); xx = (x(size(x,2)/3:size(x,2)/3*2)); [wft,wfm,fr] = wfir('bp',64,[1500/Fs 6000/Fs ],'re',[-1 -1]); [M5,tt5,f5]=animDensite(filter(wft,1,x),44100, 256 ,32 , 1, -50,1); [tt,f,M1] = animFFT(filter(wft,1,xx),44100,512,16,1,0.5); I=filter(wft,1,2*%pi*cos(t*Fs).*xx); Q=filter(wft,1,2*%pi*sin(t*Fs).*xx); enveloppe = (sqrt(I.^2+Q.^2)); t = (0:size(xx,2)-1)/Fs; figure(); plot(t,enveloppe,'b'); plot(t,xx,'r'); xy = xx(1:99); xy(1) = mean(xx(2:$)); for ii=2:size(xx,2) xy(ii) = mean(xx([1 :ii-1, ii+1: size(xx,2)])); end xy = xy'; ////////////////////////////////////////////////////////////// [tps,VOL,Res] = Golfball(18, 164, 'D', -0, -0, 2, 0); VOL(find(VOL(:,1)==0),1) = 0.00001; VTotale = sqrt(VOL(:,2).^2+VOL(:,4).^2+VOL(:,6).^2); fichier = 'serie211.wav'; //fichier='serie11.wav'; [x,Fs,bits]=wavread(fichier); //x=x(2,:); Fs = 44100; [wft,wfm,fr] = wfir('bp',64,[2150/Fs 4000/Fs ],'re',[-1 -1]); [M5,tt5,f5]=animDensite(filter(wft,1,x),44100, 256 ,32 , 1, -18,1); // angle de décollage // composé de phi pout l'angle la hauteur par rapport à Y vers le haut // théta pour la largeur par raport Z dérive sur la droite/gauche // les radars sont disposés sur l'axe Y et Z? // R1 la référence // R2 30cm à droite sur l'axe Z // R3 30cm en haut sur l'axe Y d = 0.000000001; // pour éviter la division par zéro dz = 0.3; // distance du 2èm ou 3èm radar par rapport au principal position = 1.5; // distance du de la valise par rapport à la balle L =(VOL(:,1)); // Longueur (x)) H = (VOL(:,3));// Hauteur (y)) l = (VOL(:,5));// largeur (z)) VL =(VOL(:,2)); // Longueur (x)) VH = (VOL(:,4));// Hauteur (y)) Vl = (VOL(:,6));// largeur (z)) // elevation phi = asin((H) ./ (sqrt((L + position).^2 + (H).^2 + (l).^2) + d)); // ASIN(Hauteur / (sqrt( Largeur^2+Longueur^2 +Hauteur^2) + d)) phi(1) = 0*%pi/180; phiz = asin((H) ./ (sqrt((L + position).^2 + (l-dz).^2 + (H).^2) + d));// // Phi avec le radar décallé latérallement phiz(1) = 0*%pi/180; phiy = asin((H-dz) ./ (sqrt((L + position).^2 + (l).^2 + (H-dz).^2) + d));// // Phi avec le radar décallé verticallement phiy(1) = -90*%pi/180; figure();title('Phi mesure d''Elevation si on décale de 30cm à droite sur Z le long du sol'); subplot(2,2,1);plot(L,[phi phiz phiy]*180/%pi);xlabel('philongueur phiHauteur m');ylabel('Dégre °');legend(['phi'; 'phil'; 'phiHy']); subplot(2,2,2);plot(L,[(phiz-phi) (phiy-phi)]*180/%pi);xlabel('phi-phiz m');ylabel('Delta Dégre °');legend(['phiz-phi'; 'phiy-phi']); // derive laterale theta = acos((L + position)./(sqrt((L + position).^2+(l).^2 ) + d));// theta(1) = 0; thetaz = asin((l-dz)./(sqrt((L + position).^2+(l-dz).^2 ) + d));// thetaz(1) = 0; title('Lateral mesure de la Derive si on monte de 30cm à droite sur Z le long du sol'); subplot(2,2,3);plot(L,[theta thetaz]*180/%pi);xlabel('thétaZ m');ylabel('Dégre °');legend(['theta'; 'thetaz']); subplot(2,2,4);plot(L,(theta-thetaz)*180/%pi);ylabel('Delta Dégre °');xlabel('théta - thétaZ m');legend(['theta-thetaz']); newV = VTotale.*cos(phi).*cos(theta); newVy = VTotale.*cos(phiy).*cos(theta); newVy(1) = newV(1); newVz = VTotale.*cos(phiz).*cos(thetaz); figure();subplot(1,2,1);plot(L,[VTotale , newV, newVy, newVz]*3.6);legend(['V Reelle'; 'newV R0'; 'newVy Rup'; 'newVz Rright']); subplot(1,2,2);plot(L,H); 155/cos(19*%pi/180) [m,k]=max(M5,'c'); figure();plot(tt5,f5(k)/19.49);figure();plot(f5,sum(M5(:,1:$-1),'r')); figure();plot(tt5,f5(k)'/19.49/3.6.*(tt5)); [n,l]=max(M5(a=find(M5>0.5)),'c'); figure();plot(tt5,f5(l)/19.49);figure();plot(f5,sum(M5(:,1:$-1),'r')); ////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// // DEPHASAGE entre 2 signaux : negatif = retard, positif = avance // phi/lambda = tau/T ==> tau = phi / (lambda*F) // tau = phi/(2*%pi*F) // theta = 10*%pi/180 // D = lambda // phi = (2*%pi/lambda)*D*sin(theta) Fs = 44100; t=0:0.01:5; Vlumiere = 299792458 ; // m/s Freq = 10.525e9; // 1/s lambda = Vlumiere / Freq; F = 3000; // 3kHz wt = 2*%pi*t; dephasage = %pi/4; s1=cos(wt); s2=cos(wt+dephasage); // plot des signaux plot(t,[s1; s2]);legend('s1','s2') //calcul du spectre par TF tfS1=fft(s1); tfS2=fft(s2); tfS12=fft(s1+s2); //soit H la pseudo fct de transfert H=tfS1./tfS2; [fmax Amax]=max(abs(tfS1)); //phase_H=phase(H); phase_H=angle(H); f1 = Fs*(0:(size(tfS1,2))-1)/size(tfS1,2); plot(f1(1:$/2),phase_H(1:$/2)); // On regarde la phase à la frequence ou TfS1 est max phi = phase_H(Amax) //On regarde la conséquence sur FFT plot(f1(1:$/2), abs(real(tfS1(1:$/2)/max(real((tfS1(1:$/2)))))),'r'); plot(f1(1:$/2), abs(real(tfS2(1:$/2)/max(abs(real(tfS2(1:$/2)))))),'b'); // ==> Aucun changement normale ;-) plot(f1(1:$/2),real(tfS1(1:$/2).*conj(tfS1(1:$/2))/max(real((tfS1(1:$/2).*conj(tfS1(1:$/2)))))),'g'); // tau = phi / (lambda*F) Theta = asin(tau * Vlumiere / 0.02) * 180/%pi // tau = sin(10*%pi/180)*0.01/Vlumiere ///////////////////////////////////////////////////////////////////////////// [c, lag] = xcorr(s1,s2); [maxC,I]=max(c); lag(I) //////////////////////////////////////////////////////////////////////////// h1= hilbert(s1); h2= hilbert (s2); P1=unwrap(angle(h1)); P2=unwrap(angle(h2)); dephasageResult = mean(P2-P1) ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// fichier = 'serie211.wav'; //fichier='Serie34.wav'; //fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,:);xd = x(2,:); [x,Fs,bits]=wavread(fichier); xg = x(1,:); Fs = 44100; Vlumiere = 299792458 ; // m/s Freq = 10.525e9; // 1/s lambda = Vlumiere / Freq; v = 156/(1000*3600); w = 5000/9.5493107; t = 0; // Amplitude max pour T = 2*%pi, donc pour t=0; r = 0.04267 /2; Fdopp_B = (2/lambda)*(v + r*w*cos(w*t)) Rpm = (((Fdopp_B*lambda/2) - v) / r)*9.5493107 [wft,wfm,fr] = wfir('bp',64,[800/Fs 5000/Fs ],'rec',[-1 -1]); [M5,tt5,f5]=animDensite(filter(wft,1,x),44100, 256 ,32 , 1, -18,1); xfft = real(abs(fft( filter(wft,1,x)))); xdensite = abs(real(xfft.*conj(xfft))); f1 = Fs*(0:(size(xfft,2))-1)/size(xfft,2); f1 = Fs*(0:(size(xdensite,2))-1)/size(xdensite,2); plot(f1(1:$/2),xfft(1:$/2)/max(xfft(1:$/2))); plot(f1(1:$/2),xdensite(1:$/2),'r'); t=(0:44100)/44100; xhat=1/50*cos ((2995*2*%pi*t) + 0.35* sin( 2*%pi*(800)*t)) ; // x = xhat; // A1*cos(porteuse + A2*sin(signalModulant))) xfft = real(abs(fft( filter(wft,1,x)); f1 = Fs*(0:(size(xfft,2))-1)/size(xfft,2); plot(f1(1:$/2),xfft(1:$/2)/max(xfft(1:$/2)),'r'); plot(xhat,'b'); // 3118.4kmh et 1559.2 kmh // Carrier = Porteuse // y = fmdemod(xModulated, Carrier amplitude signal, Message signal amplitude in volts, Carrier signal amplitude in volts, Carrier signal frequency in Hz, Sampling frequency in samples/sec) f1 = Fs*(0:(size(x($/2.3:$/2.25),2))-1)/size(x($/2.3:$/2.25),2); xfft = real(abs(fft( filter(wft,1,x($/2.3:$/2.25))))); plot(f1(1:$/2), xfft(1:$/2)/max(xfft(1:$/2)),'r'); [A,B] = max(xfft); maxXfft = (f1(B)) y = fmdemod(filter(wft,1,x($/2.3:$/2.25)), 15, maxXfft, Fs);plot(y); f1 = Fs*(0:(size(y,2))-1)/size(y,2); yfft = real(abs(fft( filter(wft,1,y)))); [A,B] = max(yfft); figure();plot(f1(1:$/2), yfft(1:$/2)/max(yfft(1:$/2)),'b'); MAX = (f1(B)) fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,$/1.4:$/1.25);xd = x(2,$/1.4:$/1.25); //xg = x(1,1:$/1.15);xd = x(2,1:$/1.15); [wft,wfm,fr] = wfir('bp',256,[1800/Fs 6000/Fs ],'hm',[-1 -1]); [M52,tt5,f52]=animDensite(filter(wft,1,xg),44100, 256 ,32 , 1, -0, 1); [M51,tt5,f51]=animDensite(filter(wft,1,xd),44100, 256 ,32 , 1, -0, 1); figure();plot(tt5,sum(M51(:,1:$-1),'c'));plot(tt5,sum(M52(:,1:$-1),'c'),'r'); figure();plot(f5,sum(M51(:,1:$-1),'r')/max(sum(M51(:,1:$-1),'r')));plot(f5,sum(M52(:,1:$-1),'r')/max(sum(M52(:,1:$-1),'r')),'r'); figure();plot(f5,sum(M51($/2:$,1:$-1),'r')/max(sum(M51($/2:$,1:$-1),'r')),'b');plot(f5,sum(M52($/2:$,1:$-1),'r')/max(sum(M52($/2:$,1:$-1),'r')),'r'); [a,b] = max(sum(M51(:,1:$-1),'r')) [c,d] = max(sum(M52(:,1:$-1),'r')) //angle entre les 2 radars en degré. //f(b) et f(d) sont les freq max !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! acos(f52(d)/f51(b))*180/%pi [wft1,wfm,fr] = wfir('sb',255,[(f51(b)-50)/Fs (f51(b)+50)/Fs ],'hm',[-1 -1]); [M52,tt5,f52]=animDensite(filter(wft1,1,(filter(wft,1,xg)),44100, 256 ,32 , 1, -0, 1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M51(:,1:$-1)); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5/19.49,M52(:,1:$-1)/19.49); [t,VOL,Res] = Golfball(8,110,'7',10,-15,-10,1); [l,c]=find(M52(:,1:$-1)==1); plot(tt5(l),f5(c),'b*'); //////////////////////////// HILBERT /////////////////////////// /// Frequency demodulation: Demodulates the FM waveform ////// /// by modulating the Hilbert transform of y by a complex ////// /// exponential of frequency -fc Hz and obtains the ////// /// instantaneous frequency of the result. ////// /// F(t) = d(phase)/dt / (2*%pi)) Frequence instantanéé ////// /// fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xd = x(2,1:$); xg = x(1,$/1.4:$/1.25);xd = x(2,$/1.4:$/1.25); //xg = x(1,1:$/1.15);xd = x(2,1:$/1.15); xg = x(1,$/4.:$/1.2);xd = x(2,$/4.:$/1.2); [wft,wfm,fr] = wfir('bp',256,[1500/Fs 5000/Fs ],'re',[-1 -1]); [wft1,wfm,fr] = wfir('sb',255,[2950/Fs 3100/Fs ],'re',[-1 -1]); [wft2,wfm,fr] = wfir('lp',255,[4000/Fs 6000/Fs ],'re',[-1 -1]); plot((diff(unwrap(angle(hilbert(filter(wft,1,filter(wft1,1,xg))))))/(2*%pi*1/Fs))); plot((diff(unwrap(angle(hilbert(filter(wft,1,xg)))))/(2*%pi*1/Fs)),'r'); dt = 1/Fs; fc = 2930; // carrier porteuse = vitesse de la balle df = 500; // modulation excursion fm = 1100; // modulation tAx = dt:dt:0.1; // time axis in seconds u = sin(2*%pi*fc*tAx + (df/fm)*cos(2*%pi*fm*tAx)); u = filter(wft,1,xg); u = filter(wft,1,filter(wft1,1,xg)); // u = signal filtre w = unwrap(angle(hilbert(u))); // xa = hilbert(u); PHASE = angle(hilbert(u)); v = (diff(w)/(2*%pi*dt)); // instantaneous frequency subplot(2,1,1); t=(0:size(u,2)-1)/Fs; plot(t,u/max(u)) subplot(2,1,2); t=(0:size(v,2)-1)/Fs; plot(t,filter(wft2,1,abs(v)),'r'); mean(v(50:$-50)) min(v(50:$-50)) max(v(50:$-50)) // definir l'enveloppe de l'espace de Hilbert et cela défini la plage de fréquence instantanée ==> Démodulation [enveloppe,t] = Enveloppe(v, Fs,1500, 4000); plot(t,enveloppe); y = demod(filter(wft,1,xg),fc,Fs,'fm');plot(y,'r') y = demod(u,fc,Fs,'fm');plot(y);//plot(u) [M52,tt5,f5]=animDensite(u,44100, 256 ,32 , 0, 0,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); xg=x(1,1:$); xg = x(1,$/1.3:$/1.1);xd = x(2,$/1.3:$/1.1); xg = x(1,$/4.:$/1.2);xd = x(2,$/4.:$/1.2); xgf = filter(wft,1,xg); // passe band filtrage centre sur 1kHz 6kHz xa = (hilbert(xgf)); xgi = (imag(hilbert(xgf))); u = filter(wft1,1,xgf); // filtrage coupe bande sur la frequence de la balle xgiu=(u.*xgi); [M52,tt5,f5]=animDensite(xgf,44100, 256 ,32 , 0, -5,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); f=figure();plot(f5,sum(M52($/2:$,1:$-1),'r'),'r'); // vitesse du shaft (1er pic), vitesse de la balle 2eme pic) [M52,tt5,f5]=animDensite(filter(wft,1,xgiu),44100, 256 ,32 , 0, -155,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); scf(f); figure();plot(f5,sum(M52($/2:$,1:$-1),'r'),'b'); // vitesse du club (1er pic), vitesse de la balle 2eme pic) figure();plot([0:size(xa,'c')-1]/Fs,u); plot([0:size(xa,'c')-1]/Fs,abs(xa).^2,'r'); plot(f5,M52(120,1:$-1)) f=figure();f.color_map = jetcolormap(64); w=wigner(xg,ones(1:64),12,128); N = 69; tau = 1 / Fs; // interval temporel de l'echantillonnage t = (0:N - 1) * tau*1000; // construction du vecteur temps plot3d1(t*10000,[1:64]*Fs/(64),abs(w(1:69,1:64))*1000); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(t,[1:64]*Fs/(64*1000),abs(w(1:69,1:64))); tfrqview ////////////////////////////////////////////////////// fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xd = x(2,1:$); u = filter(wft,1,xg); a=((diff(unwrap(angle(hilbert(filter(wft1,1,filter(wft,1,xg($/3.5:$/2)))))))/(2*%pi*1/Fs))); a=((diff(unwrap(angle(hilbert(xg($/3.5:$/2)))))/(2*%pi*1/Fs))); y = sgolayfilt(a,9,69)'; [M52,tt5,f5]=animDensite(a,44100, 256*4 ,32*4 , 0, -150,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); figure();plot(f5,sum(M52($/2:$,1:$-1),'r'),'b'); // vitesse du club (1er pic), vitesse de la balle 2eme pic) [m,k] = max(sum(M52($/2:$,1:$-1),'r'));f5(k) Freq2RpmSpin(f5(k)); fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xd = x(2,1:$); [vBall, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,a] = Info2(filter(wft,1,xg),'7'),fichier N = size(xg,2); dt = 1/Fs; fc = 2930; // carrier porteuse = vitesse de la balle df = 50; // modulation excursion FreqRPM = 800; // modulation//Freq2RpmSpin(833) = 5273.0706 tr/min rpm = 552 rad/s = 1 rad/sec? The answer is 9.54929659643 RPM dFreqRPM = 50; m=dFreqRPM/FreqRPM; vb=1500; // 150 kmh r = 0.043/2; c = 299792458 ; lambda = c /10.525E9; tAx = dt:dt:N/Fs; // time axis in seconds at = 1; modt = 1; sa = at*exp(-%i*2*%pi*fc*tAx); smod = modt*exp(-%i*2*(2*%pi*FreqRPM)*r*sin(2*%pi*FreqRPM*tAx)/lambda); // signal du patch B: // S = modt*cos(2*%pi*fc*tAx+m*sin(2*%pi*FreqRPM*tAx)); clf; F0 = vBall*19.49; D=1.5;//:3; [fm,am,iflaw] = doppler(N,Fs,F0,D,vBall/3.6,1); subplot(211); plot(real(am.*fm));xtitle(("Signal ")); subplot(212); plot(iflaw); [ifhat,t]=instfreq(sigmerge(am.*fm,smod,15),11:502,10); plot(t,ifhat,'g'); xtitle(("Instantaneous frequency")) legend([_("Requested"),_("Observed")]); //[M52,tt5,f5]=animDensite(real(sigmerge((am.*fm)',noisecg(N)',15)),44100, 256 ,32 , 1, -150,1); [M52,tt5,f5]=animDensite(real(sigmerge((am.*fm)',smod,1)),44100, 256 ,32 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r'),'b'); // vitesse du club (1er pic), vitesse de la balle 2eme pic) [Y,IFLAW]=fmsin(N); phi=if2phase(iflaw) ///////////////////////////////// // Modele de signale Echo s(t) // ///////////////////////////////// fichier = uigetfile("*.wav", "D:\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xd = x(2,1:$); [wft,wfm,fr] = wfir('bp',256,[1300/Fs 4000/Fs ],'re',[-1 -1]); [wft1,wfm,fr] = wfir('sb',255,[2900/Fs 3000/Fs ],'re',[-1 -1]); dt = 1/Fs; fc = 2930; // carrier porteuse = vitesse de la balle df = 50; // modulation excursion fm = 800; // modulation//Freq2RpmSpin(833) = 5273.0706 tr/min rpm = 552 rad/s = 1 rad/sec? The answer is 9.54929659643 RPM vb=150; // 150 kmh r = 0.043/2; c = 299792458 ; lambda = c /10.525E9; tAx = dt:dt:0.01; // time axis in seconds at = 1; sa = at*exp(-%i*2*%pi*fc*tAx); modt = 1; smod = modt*exp(-%i*2*(2*%pi*fm)*r*sin(2*%pi*fm*tAx)/lambda); u = real(sa.*smod); plot(tAx,u); uf = filter(wft,1,u); uf1 = filter(wft,1,filter(wft1,1,u)); w = unwrap(angle(hilbert(u))); v = (diff(w)/(2*%pi*dt)); // instantaneous phase differential subplot(2,1,1); t=(0:size(u,2)-1)/Fs; plot(t,u) subplot(2,1,2); t=(0:size(v,2)-1)/Fs; plot(t,abs(v)) [M52,tt5,f5]=animDensite(filter(wft,1,xg),44100, 256 ,32 , 0, -5,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); [vBall, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,xgBall] = Info2(filter(wft,1,xg),'7');fichier [wft1,wfm,fr] = wfir('sb',255,[(vBall*19.49-200)/Fs (vBall*19.49+200)/Fs ],'re',[-1 -1]); [M52,tt5,f5]=animDensite(xgBall,44100, 1024 ,128 , 0, -5,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); figure();plot(f5,max(M52($/2:$,1:$-1),'r'),'b'); // vitesse du club (1er pic), vitesse de la balle 2eme pic) figure();plot(f5,sum(M52(:,1:$-1),'r'),1); [vBall, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,xgBall] = Info2(filter(wft,1,xg),'7');fichier [wft1,wfm,fr] = wfir('bp',256,[(vBall*19.49-200)/Fs (vBall*19.49+200)/Fs ],'re',[-1 -1]); [M52,tt5,f5]=animDensite(filter(wft1,1,xg),44100, 256*8 ,32*8 , 1, -5,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); [m,k]=(find((M52($/2:$,1:$-1))==1)); plot(tt5(m)',f5(k),'o'); [M52,tt5,f5]=animDensite(filter(wft1,1,xg),44100, 256*8 ,32*8 , 0, -5,1); [m,k]=find(M52($/2:$,1:$-1)==1); subplot(2,1,1); plot(tt5(m)',f5(k),'ro'); Dg=(f5(k)/19.49/3.6).*tt5(m)'; subplot(2,1,2); plot(tt5(m),Dg,'ro'); [M52,tt5,f5]=animDensite(filter(wft1,1,xd),44100, 256*8 ,32*8 , 0, -5,1); [m,k]=find(M52($/2:$,1:$-1)==1); subplot(2,1,1); plot(tt5(m)',f5(k),'b*'); subplot(2,1,1); Dd=(f5(k)/19.49/3.6).*tt5(m)'; subplot(2,1,2); plot(tt5(m),Dd,'b*'); figure(); plot(tt5(m),Dd-Dg); /////////////////////// [wft,wfm,fr] = wfir('bp',256,[1300/Fs 6000/Fs ],'re',[-1 -1]); [M52,tt5,f5]=animDensite(filter(wft,1,xg(4410:$)),44100, 256*32 ,32*32 , 0, -5,1); fig = figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M52(:,1:$-1)); [vBall, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,xgBall] = Info2(filter(wft,1,xg),'7');fichier [wft1,wfm,fr] = wfir('sb',255,[(vBall*19.49-200)/Fs (vBall*19.49+200)/Fs ],'re',[-1 -1]); [M52,tt5,f5]=animDensite(filter(wft1,1,xg),44100, 256*32 ,32*32 , 0, -55,1); s2_fft = abs(real(fft(filter(wft,1, test((ii)*nbEchantillon+1:nbEchantillon*(ii+1)))))); h = figure(); for i = 1:size(M52,'r') plot(f5,sum(M52(i,1:$-1),'r'),1); end f=figure();plot(f5,sum(M52($/2:$,1:$-1)/max(sum(M52($/2:$,1:$-1),'r')),'r')); // vitesse du shaft (1er pic), vitesse de la balle 2eme pic) //////////////////// Video Read //////////////////////// function my_eventhandler(win, x, y, ibut) if ibut==-1000 then return,end [x,y]=xchange(x,y,'i2f') xinfo(msprintf('Event code % d %d at mouse position is (%f,%f)',win ,ibut,x,y)); endfunction plot2d() fig = gcf() ; fig.event_handler = 'my_eventhandler' ; fig.event_handler_enable = "on" ; fig.event_handler_enable = "off" ; //suppress the event handler n = camopen(0); sleep(10); im = camread(n); //get a frame imshow(im); camcloseall(); /////////////////////////////// ANN //////////////////////////////// // reseau de neuronnes // // 5 entrées // 20 cachés // 1 sorties N = [5 , 20 , 1]; // training cycles T = 400; // input training // Res = [V0Club,V0Ballkmh, alphaClubPath*180/%pi,gamaFacePath*180/%pi,SpinZ,SpinY,Xchute, Zchute,XX($,1) , ZZ($,1),Ymax,LaunchAngledeg,VerticalLand,sum(t)]; x=[]; // sortie désirées t=[]; for ii=1:1 x($+1,:)=[80+ii/10,6,0,0,-8]; [temps,VOL,Res] = Golfball(8,80+ii/10,'7',0,0,-8,0); t($+1,:)=Res; end // learning rate and threshold lp = [0.1, 0]; W = ann_FF_init(N); // Training W = ann_FF_Std_online(x,t,N,W,lp,T); // full run ann_FF_run(x,N,W); function D = Plage(nb, minA, maxA) a = rand(1:nb); b = (a-min(a)); c = b/max(b); D = c*(max(maxA)-min(minA))+minA; endfunction nb = 2; VC = Plage(nb , 80 , 110); SM = Plage(nb , 1.1 , 1.5); VB = SM.*VC; launchAngleTab = []; for ii=1:size(VC,2), [thetaLoft, ShafLeanImp, launchAngle, SpinZC, gamaFacePath] = LaunchAngle(VC(ii), VB(ii), '7', 0); launchAngleTab($+1) = ShafLeanImp; end [wlaunchAngle,blaunchAngle] = ann_PERCEPTRON([VC' , VB'] , launchAngleTab'); ylaunchAngle = ann_PERCEPTRON_run(P , wlaunchAngle , blaunchAngle); //////////////////////// // // simulation de signal // //////////////////////////// fichier = uigetfile("*.wav", "D:\Users\f009770\Documents\Golf\Radar\");[x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xd = x(2,1:$);xg = xg - mean(xg);xd = xd - mean(xd); xgp = padding(xg,2); xgp = padding2(xg); xgp = padding3(xg); plot(xg); xgpp = [xg,zeros(xg)]; [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5d,f5d] = Info2(xgp,'7',44100*2); x = xgp(PointShoot+600:$) - mean(xgp(PointShoot+600:$)); plot(x,'b'); Ec = 0.5; Em = 0.5; Fs = 44100; fs = Fs; fc = 3000; fm = 800; tfin = 0.1; [x,Vm,Vc]=pmmod(Ec,Em,fm,fc,fs,tfin); [x,Vm,Vc]=fmmod(Ec,Em,fm,fc,fs,tfin); [x,Vm,Vc]=ampmod(Ec,Em,fm,fc,fs,tfin); [wft,wfm,fr] = wfir('bp',254,[1500/Fs 6000/Fs ],'hn',[-1 -1]); [wft1,wfm,fr] = wfir('sb',255,[3000/Fs 3040/Fs ],'hm',[-1 -1]); [wft2,wfm,fr] = wfir('bp',254,[2000/Fs 4000/Fs ],'re',[-1 -1]); [wft3,wfm,fr] = wfir('lp',254,[6000/Fs 4000/Fs ],'re',[-1 -1]); [M52,tt5,f5]=animDensite(filter(wft2,1,x),44100, 256*8 ,32*8 , 1, 0,1); [M52,tt5,f5]=animDensite(x,44100, 256*8 ,32*8 , 1, 0,1); [M52,tt5,f5]=animDensite(filter(wft1,1,filter(wft,1,xgp(PointShoot:$))),44100*2, 256*8 ,32*8 , 1, -10, 1); f=figure();plot(f5,sum(M52($/2:$,1:$-1)/max(sum(M52($/2:$,1:$-1),'r')),'r')); // vitesse du shaft (1er pic), vitesse de la balle 2eme pic) // Longueur onde 10.525Ghz = 2.84838439905 // 24Ghz = 1.249135241667 xgraw = xg.*window('hn',length(xg)); y=real(fft(xg,1)); xgp = padding(xg,2); y=abs(real(fft(padding(xg,size(xg,2),6),1))); // tests sur BARTLETT xgp = padding2(xg); [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5d,f5d] = Info2(xgp,'7',44100*2); [M52,tt5,f5]=animDensite(filter(wft1,1,filter(wft,1,xgp(PointShoot:$))),44100*2, 256*2 ,32 , 1, -150,1); plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); plot(tt5,M52(:,$/2)); plot(f5,M52($/2,2:$)); sm=pspect(32 , 256,'tr',(filter(wft,1,xgp(PointShoot:$))));smsize=max(size(sm));fr=(1:smsize)/smsize;plot(f5(1:$/2)*2,(sm(1:$/2))); f = figure();f.color_map = hotcolormap(4);Sgrayplot(tt5,f5,M52(:,1:$-1)); f = figure();f.color_map = jetcolormap(2);Sgrayplot(tt5,f5,M52(:,1:$-1)); t=0:1/(2*44100):16882/(44100*2); t=t(1:$-1); u = cos(2*3020*%pi*t); demo = xg.*u; demodp = padding2(demo); Ec = 0.5; Em = 0.2; Fs = 44100; fs = Fs; fc = 2728; fm = 0; tfin = 0.1; tfin = (size(xg,2)-1)/Fs; [xp,Vm,Vc,t]=pmmod(Ec,Em,fm,fc,fs,tfin); [xf,Vm,Vc,t]=fmmod(Ec,Em,fm,fc,fs,tfin); [xa,Vm,Vc,t]=ampmod(Ec,Em,fm,fc,fs,tfin); [M52,tt5,f5]=animDensite(xp,44100, 256*2 ,32 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); [M52,tt5,f5]=animDensite(xf,44100, 256*2 ,32 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); [M52,tt5,f5]=animDensite(xg,44100, 256*2 ,32 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5d,f5d] = Info2(xgp,'7',44100); [wft1,wfm,fr] = wfir('sb',255,[(vBall*19.49-130)/Fs (vBall*19.49+130)/Fs],'hm',[-1 -1]); [x]=ampdemod(xg(PointShoot:$), Vc, fc, fs, Em, Ec); [M52,tt5,f5]=animDensite(filter(wft1 ,1,filter(wft,1,x)),44100, 256*4 ,32*4 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); [x,x2] = demod(xg(PointShoot:$), fc, fs, 'fm'); [M52,tt5,f5]=animDensite(filter(wft1 ,1,filter(wft,1,x)),44100, 256*4 ,32*4 , 1, -150,1); figure();plot(f5,sum(M52($/2:$,1:$-1),'r')/size(M52,2)); N=size(xgp(PointShoot:$),2); [fm,am,iflaw]=doppler(N, 44100, 5400, 2, 43.,1); clf; xg = real(am.*fm)'; subplot(211); plot(xg);xtitle(_("Signal ")) subplot(212); plot(iflaw); clf;gcf().color_map= jetcolormap(128); subplot(211);Sgrayplot(tt5,f5,M52(:,1:$-1)); [HT,RHO,THETA] = htl(M52,129,427,1,'plot'); subplot(212);grayplot(RHO,THETA,HT); [m,ind]=max(HT);theta=THETA(ind(2));rho=RHO(ind(1)); xl=N/2-rho*sin(theta)+60*cos(theta)*[-1 1]; yl=N/2+rho*cos(theta)+60*sin(theta)*[-1 1]; xpoly(xl/max(tt5),yl/max(f5)); [MARGT,MARGF,E]=margtfr(M52(:,1:$-1)',tt5,f5); subplot(211); plot(tt5,MARGT); subplot(212); plot(f5,MARGF); subplot(211); plot((0:(size(xg(PointShoot/2:$/2),2)-1))/44100,xg(PointShoot/2:$/2)); [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5d,f5d,xg] = Info2('7',44100); Fs = 44100*2; [wft,wfm,fr] = wfir('bp',254,[1500/Fs 12000/Fs ],'hn',[-1 -1]); [wft1,wfm,fr] = wfir('sb',255,[(vBall*19.49-30)/Fs (vBall*19.49+30)/Fs ],'hm',[-1 -1]); [wft2,wfm,fr] = wfir('bp',254,[(vBall*19.49-1000)/Fs (vBall*19.49+1000)/Fs ],'re',[-1 -1]); [wft3,wfm,fr] = wfir('bp',254,[30/Fs 6000/Fs ],'re',[-1 -1]); [wftb,wfm,fr] = wfir('bp',256,[(FBall/1.5)/Fs (FBall/1)/Fs ],'re',[-1 -1]); // coupe bande autour de la club [x,y] = demod(filter(wft,1,xg(PointShoot:$)), vBall*19.49, Fs,'am'); x=filter(wft2,1,xg(PointShoot:$)); [x2,y2] = demod(x, 800, Fs,'pm'); [M51,tt5,f5]=animDensite(filter(wft1, 1,filter(wft2, 1,xg(PointShoot+600:$))),Fs, 256*16*2 ,32*16*2 , 1, -50,1); [M51,tt5,f5]=animDensite(filter(wft3,1,x2),Fs, 256*16*2 ,32*16*2 , 1, -10,0); [M52,tt5,f5]=animDensite(filter(wft2, 1,xg(PointShoot+600:$)),Fs, 256*16*2 ,32*16*2 , 1, -10,1); plot(f5,sum(M51($/2:$,1:$-1),'r'),'r'); figure();plot(f5,sum(M51($/2:$,1:$-1)/max(sum(M51($/2:$,1:$-1),'r')),'r'),'r'); plot(f5,sum(M52($/2:$,1:$-1)/max(sum(M52($/2:$,1:$-1),'r')),'r')); xgpf = filter(wft,1,filter(wft,1,xgp(9500:$/2))); [SP,F]=frpowerspec(xgpf+0*%i);plot(F*44100*2,SP); [thr,sorh,keepapp] = ddencmp('den','wv',xgpf); xd = wdencmp('gbl',xgpf,'db3',4,thr,sorh,keepapp); plot(xd,'g');plot(xgpf,'r'); [SP,F]=frpowerspec(xd+0*%i);plot(F($/2:$)*44100*2,SP($/2:$)); [m,k]=max(SP($/2+1:$));F(size(SP($/2:$),'r')+k)*44100*2 [xd,SP, F] = Info3('7', 'D:\Users\f009770\Documents\Golf\Radar\2019-02-24-F7-133m-160kmh-5432trm-311trm-cs117.wav'); fichier = uigetfile("*.wav", "D:\Golf\Radar\"); fichier = 'D:\Golf\Radar\2019-02-24-F7-133m-160kmh-5432trm-311trm-cs117.wav'; fichier = 'D:\Users\f009770\Documents\Golf\Radar\2019-05-05-2.wav'; fichier = 'D:\Users\f009770\Documents\Golf\Radar\2019-05-05-debruite.wav'; fichier = 'D:\Users\f009770\Documents\Golf\Radar\1150_TrMin.wav'; fichier = 'D:\Users\f009770\Documents\Golf\Radar\test1_7_dehors_metal.wav'; [x,Fs,bits]=wavread(fichier); xg = x(1,1:$);xg = xg - mean(xg); LeWav =xg;//pour AnaSpecEga xd = x(2,1:$);xd = xd - mean(xd);LeWav=xg;xgp = xg; [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5xd,f5xd] = Info2(xd, '7',44100) [vBall, vBallCorrigee, vClub, SmashFactor,thetaLoft, ShafLeanImp, launchAngle, SpinZC, SpinZM, SpinLR, gamaFacePath,PointShoot,tt5xg,f5xg] = Info2(xg, '7',44100) [Bg,kg]=gsort(tt5xg,'g','i'); figure();plot(Bg,f5xg(kg),'b'); [Bd,kd]=gsort(tt5xd,'g','i'); plot(Bd,f5xd(kd),'r'); xgp = padding2(xg); Fs = Fs*2; [wft,wfm,fr] = wfir('bp',254,[1200/Fs 12000/Fs ],'hn',[-1 -1]); xgpf = filter(wft,1,filter(wft,1,xgp)); [M51,tt5,f5]=animDensite(xgpf,Fs, 256*16*2 ,32*16*2 , 1, -50,1); [M51,tt5,f5]=animDensite3(xgpf,Fs, 256*2 ,32*2 , 1, -50,1); //Denoise [thr,sorh,keepapp] = ddencmp('den','wv',xgpf); xd = wdencmp('gbl',xgpf,'db3',4,thr,sorh,keepapp); [M51,tt5,f5]=animDensite3(xd,Fs, 256*16*4 ,32*16*4 , 1, -50,1); plot(f5,sum(M51(3*$/4:$,1:$)/max(sum(M51(3*$/4:$,1:$),'r')),'r'),'r'); [x1,y] = demod(xd, 3000, Fs,'am'); [wft1,wfm,fr] = wfir('lp',254,[600/Fs 12000/Fs ],'hn',[-1 -1]); x1 = filter(wft1,1,x1); [M51,tt5,f5]=animDensite3(x1,Fs, 256*16*2 ,32*16*2 , 1, -10,1); [x2,y2] = demod(x1, 250, Fs,'pm'); [wft2,wfm,fr] = wfir('lp',254,[300/Fs 12000/Fs ],'hn',[-1 -1]); x2 = filter(wft2,1,x2); [M51,tt5,f5]=animDensite3(x2,Fs, 256*16*2 ,32*16*2 , 1, -10,1); N=size(xd,2); [fm,am,iflaw] = doppler(N,44100,5400/60,0.1,168,1); clf; xg_hat = real(am.*fm)'; plot(xg_hat);xtitle(_("Signal ")) [M51,tt5,f5]=animDensite3(xg_hat,Fs, 256*16*2 ,32*16*2 , 1, -10,1); f1 = Fs*(0:(size(s2_fft,2))-1)/size(s2_fft,2); // Modelisation t=0:1/44100:.3; s_B = signal_B(t,44,5400); s_modb = smod_B(t,44,5400); s_A = signal_A(t,44,5400); [x1,y] = demod(abs(real(s_B)), 3000, 44100,'am'); [wft1,wfm,fr] = wfir('bp',254,[60/44100 6000/44100 ],'hn',[-1 -1]); x1 = filter(wft1,1,x1); [M51,tt5,f5]=animDensite(x1,44100, 256*16*2 ,32*16*2 , 1, -10,1); [x2,y2] = demod(x1, 250, 44100,'pm'); [wft2,wfm,fr] = wfir('lp',254,[300/44100 12000/44100 ],'hn',[-1 -1]); x2 = filter(wft2,1,x2); [M51,tt5,f5]=animDensite(x2,44100, 256*16*2 ,32*16*2 , 1, -10,1); plot(f5,sum(M51(3*$/4:$,1:$-1)/max(sum(M51(3*$/4:$,1:$-1),'r')),'r'),'b'); [M51,tt5,f5]=animDensite((real(s_modb)), 44100, 256*16*2 ,32*16*2 , 1, -10,1); h2=window('hn',63); [TFR,T,F]=tfrsp(xd(9000:$),1:256*8*2,128*8*2,h2); [TFR,T,F]=tfrwv(xd(9000:$)); clf;gcf().color_map= jetcolormap(128); subplot(121);Sgrayplot(T,F(1:$/2)*44100*2,TFR(1:$/2,:)'); subplot(122);plot(fftshift(F'*44100*2),fftshift(TFR(:,100))); tt5=1:64;f5=1:256; clf;gcf().color_map= jetcolormap(128); Sgrayplot(tt5,f5,abs(stft')); for ii=1:25 [j,k] = max(M5Sqr(ii,:)); plot(ii,f5(k),'o') end; [wft,wfm,fr] = wfir('bp',254,[1200/Fs 6000/Fs ],'hn',[-1 -1]); Vitesse = max(afficheVitesse(afficheDenoise(filter(wft,1,xg(getPointShoot(xg,Fs,158):$)),0.01),Fs))/19.49 afficheVitesse(padding2(filter(wft,1,afficheDenoise(xg,0.0))),2*Fs); PoinShoot = getPointShoot(xg,Fs,158) [wft1,wfm,fr] = wfir('bp',254,[1200/Fs 3000/Fs ],'hn',[-1 -1]); xp2 = xg(1:PoinShoot-100); xp2f = filter(wft1,1,padding2(afficheDenoise(xp2,0.0))); [M5,tt5,f5]=animDensite3(xp2f,2*Fs, 256*4 ,32*4 , 0, -15,0); fig=figure();subplot(221); fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M5(:,1:$)); subplot(223);plot(f5,sum(M5(:,1:$)/max(sum(M5(:,1:$),'r')),'r'),'b'); [wft,wfm,fr] = wfir('bp',254,[1000/Fs 6000/Fs ],'hn',[-1 -1]); xp = xg(PoinShoot+200:$); xpf = filter(wft,1,padding2(afficheDenoise(xp,0.0))); [M5,tt5,f5]=animDensite3(xpf,2*Fs, 256*16*2 ,32*16*2 , 0, -15,0); subplot(222); fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M5(:,1:$)); subplot(224);plot(f5,sum(M5(:,1:$),'r'),'b'); freqMax = afficheDemod(xpf, 2*Fs, 153)*60*2 N=size(xpf,2); F0 = 5200; D=1.5;//:3; t=getT(xpf,2*Fs); [fm,am,iflaw] = doppler(N,2*Fs,F0,D,155/3.6,1); subplot(211); plot(t,real(am.*fm)/2);xtitle(("Signal ")); subplot(212); plot(t,iflaw); [ifhat,t]=instfreq(sigmerge(am.*fm,xp,15),11:502,10); plot(t,ifhat,'g'); sig = sum(M5(:,1:$),'r'); pics = find(diff(sig,2)<0); plot(f5(pics),sig(pics));// ici [u, i] = gsort(-sig(pics)) ; hauteur = sig(pics(i)) ; plot(f5(pics(i)), sig(pics(i)) ,'ro') pics2 = find(diff(sig(pics),2)<0); plot(f5(pics2),sig(pics2));// ici s_B = signal_B(t,3000/19.49,5400); [enveloppe,t] = Enveloppe(xg, Fs,2500, 3500); xg_hat = real(enveloppe.*s_B); [M51,tt5,f5]=animDensite3(xg_hat(5000:$), 44100, 256*16 ,32*16 , 0, 0,0); fig=figure();fig.color_map = jetcolormap(64);Sgrayplot(tt5,f5,M51(:,1:$-1)); subplot(223); plot(f5,sum(M51(:,1:$-1)/max(sum(M51(:,1:$-1),'r')),'r'),'b'); [m,k]=max(sum(M51(:,1:$-1),'r')); f5(k) ///Extracting instantaneous amplitude,phase,frequency – application of Analytic signal/Hilbert transform [wft,wfm,fr] = wfir('bp',254,[2500/Fs 3500/Fs ],'hn',[-1 -1]); z = hilbert(filter(wft,1,xg)); //%form the analytical signal inst_amplitude = abs(z); //%envelope extraction inst_phase = unwrap(angle(z));//%inst phase regenerated_carrier = cos(inst_phase); inst_freq = diff(inst_phase)/(2*%pi)*Fs;//%inst frequency plot(t, filter(wft,1,xg)); plot(t,inst_amplitude,'r'); plot(t,regenerated_carrier); plot(t,inst_freq); v = diff(inst_phase)/(2*%pi/Fs); // instantaneous phase differential normalized to Hz plot(t,v); // s=fft(regenerated_carrier); nbEchantillon = size(s,2); f=Fs*(0:(nbEchantillon)-1)/nbEchantillon; plot(f,s); fichier = 'C:\Users\F009770\Documents\Golf\Radar\2019-02-24-F7-133m-160kmh-5432trm-311trm-cs117.wav'; fichier = 'C:\Users\F009770\Documents\Golf\Radar\2019-05-05-2.wav'; fichier = 'C:\Users\F009770\Documents\Golf\Radar\2019-05-05-debruite.wav'; fichier = 'C:\Users\F009770\Documents\Golf\Radar\1150_TrMin.wav'; fichier = 'C:\Users\F009770\Documents\Golf\Radar\test1_7_dehors_metal.wav'; [x,Fs,bits]=wavread(fichier); xg = x(1,1:$);mu= [mean(x);stdev(x)];xg = (xg - mu(1))/mu(2); xg = xg(5000:9095);//Pour mettre la taille en puissance de 2 xd = x(2,1:$);xd = xd - mean(xd); xg_hat = real(signal_B(getT(xg,Fs), 3015.0165/19.49/3.6, 5400)); // stimateur du signal Doppler [wft,wfm,fr] = wfir('bp',254,[300/Fs 8000/Fs ],'re',[-1 -1]); [wft1,wfm,fr] = wfir('bp',254,[10/Fs 300/Fs ],'re',[-1 -1]); xgpf = filter(wft,1,padding3(xg));t=getT(xgpf,2*Fs);plot(t,xgpf); xgpf_hat = filter(wft,1,padding3(xg_hat));t=getT(xgpf_hat,2*Fs);plot(t,xgpf_hat,'r') s=abs(real(fft(xgpf)));s_hat=abs(real(fft(xgpf_hat)));nbEchantillon = size(s,2);f=2*Fs*(0:(nbEchantillon)-1)/nbEchantillon;plot(f,[s', s_hat']); [x1,y] = demod(xgpf, 3015.0165, 2*44100,'am'); [x1_hat,y] = demod(xgpf_hat, 3015.0165, 2*44100,'am'); [py,fy] = pWelch(filter(wft1,1,x1),[],0,length(x1),Fs); [py_hat,fy] = pWelch(filter(wft1,1,x1_hat),[],0,length(x1),Fs); s=abs(real(fft(xgpf)));s_hat=abs(real(fft(xgpf_hat)));nbEchantillon = size(s,2);f=2*Fs*(0:(nbEchantillon)-1)/nbEchantillon;plot(f,[s', s_hat']); plot(fy,[py, py_hat*20]); [x2,y] = demod(filter(wft1,1,x1), 100, 2*44100,'fm'); [x2_hat,y] = demod(filter(wft1,1,x1_hat), 100, 2*44100,'fm'); s=abs(real(fft(x2)));s_hat=abs(real(fft(x2_hat)));nbEchantillon = size(s,2);f=2*Fs*(0:(nbEchantillon)-1)/nbEchantillon;plot(f,[s', s_hat']); [py,fy] = pWelch(filter(wft1,1,x2),[],0,length(xgpf),Fs); [py_hat,fy] = pWelch(filter(wft1,1,x2_hat),[],0,length(xgpf),Fs); plot(fy,[py, py_hat*1]); t=getT(x2, 2*Fs); plot(t,[filter(wft1,1,x2)' filter(wft1,1,x2_hat)']); plot(real(afficheDenoise(xgpf,0.0))); [M51,tt5,f5]=animDensite3(xgpf_hat,2*44100, 256*4*4 ,32*4*4 , 0, -10,1); figure();plot(f5,sum(M51(:,1:$)/max(sum(M51(:,1:$),'r')),'r'),'r'); [M51,tt5,f5]=animDensite3(afficheDenoise(xgpf,0.0),2*44100, 256*4*4 ,32*4 , 0, -1, 1); plot(f5,sum(M51(:,1:$)/max(sum(M51(:,1:$),'r')),'r'),'r'); [M51,tt5,f5]=animDensite3(x1,2*44100, 256*4 ,32*4 , 1, 50,0); [M51,tt5,f5]=animDensite3(filter(wft1,1,x1_hat),2*44100, 256*4 ,32*4 , 1, 50,0); // Create a modulated signal in the same form as in equation (1) A = 1; tp = 2^12; omega1 = 560; omega2 = 1; gamma = %pi/7; beta = 5; t = 0:2*%pi/tp:2*%pi*(1-1/tp); x = A*cos(omega1*t+gamma+beta*sin(omega2*t)); plot(t(1:round(length(x)/omega2)),x(1:round(length(x)/omega2))); //Transform the signal into the frequency domain ff = fft(x); ax = linspace(-tp/%pi/4,(tp-2)/%pi/4,tp); dbf = 20*log10((abs(ff)/length(ff)*2+10E-12)/10E-12); dbf = fftshift(dbf); plot(ax,dbf); //Set negative frequencies to zero, and double all positive frequencies (remember not to //double the zero frequency) and inverse transform back to the time domain to create //the analytic signal gf = ff; //%create dummy variable gf(2:$) = 2*ff(2:$); //%double positive freq’s gf($/2+1:$) = 0; //%set negative freq’s to zero g = ifft(gf); //%transform back to time domain dbg = 20*log10((abs(gf)/length(gf)*2+10E-12)/10E-12); dbg = fftshift(dbg); plot(ax,dbg); //Now calculate the instantaneous angle of the analytic signal and the unwrapped //instantaneous phase of the original signal pha = angle(g); //%instantaneous phase of analytic signal phau = unwrap(pha); //% unwrap phase //If the carrier frequency is known this can be done by multiplying the carrier frequency //by the inverse of the sampling frequency and subtracting from the unwrapped //instantaneous phase, or if the carrier frequency is unknown then the linear fit of the //unwrapped phase will give the estimate of Ωt . This method is used here p = polyfit(t,phau,1); //%linear fit to unwrapped //%phase p(2) = phau(1); omega1t = polyval(p,t); phaus = phau - omega1t; //%subtract linear offset mf = fft(phaus); //%spectrum of phase demodulated signal en rad/s dbmf = 20*log10((abs(mf)/length(mf)*2+10E-12)/10E-12); dbmf = fftshift(dbmf); plot(ax,dbmf); //If the actual linear phase is used then the mass line can be //seen to be removed: phaus2 = phau - omega1*t; //%removal of linear phase increase if carrier freq is known mf2 = fft(phaus2); dbmf2 = 20*log10((abs(mf2)/length(mf2)*2+10E-12)/10E-12); dbmf2 = fftshift(dbmf2); plot(ax,dbmf2); gammae1 = abs(mf(1))/length(mf); betae1 = abs(mf(omega2+1))/length(mf)*2; gammae2 = abs(mf2(1))/length(mf2); phie1 = angle(mf(omega2+1))+%pi/2; betae2 = abs(mf2(omega2+1))/length(mf2)*2; phie2 = angle(mf2(omega2+1))+%pi/2; [wft,wfm,fr] = wfir('bp',254,[300/Fs 8000/Fs ],'re',[-1 -1]); [wft1,wfm,fr] = wfir('bp',254,[10/Fs 300/Fs ],'re',[-1 -1]); t=(0:size(xg,2)-1)/Fs; xgf = filter(wft,1,(xg)); subplot(2,1,1); plot(t,xgf); subplot(2,1,2); plot(t(1:$-1),filter(wft1, 1,abs(diff(unwrap(angle(hilbert(filter(wft,1,xg)))))/(2*%pi*1/Fs))),'r'); endfunction
43b712da2acf6a7b4a9b84a7258201a3101d6ac3
449d555969bfd7befe906877abab098c6e63a0e8
/1646/CH17/EX17.8/Ch017Ex8.sce
ff001444d5074ebfe42fa235d98da6c4b3e2a866
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,578
sce
Ch017Ex8.sce
// Scilab code Ex17.8 : Pg:892 (2011) clc;clear; amu = 931.5; // Energy equivalent of 1 amu, MeV nucleus = cell(4,3); nucleus(1,1).entries = 'F'; nucleus(1,2).entries = 9; nucleus(1,3).entries = 19; M_P = 19.0457; // Mass of product nucleus, amu nucleus(2,1).entries = 'n'; nucleus(2,2).entries = 0; nucleus(2,3).entries = 1; m_i = 1.0087; // Mass of incident particle, amu nucleus(3,1).entries = 'O'; nucleus(3,2).entries = 8; nucleus(3,3).entries = 19; nucleus(4,1).entries = 'H'; nucleus(4,2).entries = 1; nucleus(4,3).entries = 1; m_e = 1.00728; // Mass of emitted particle, amu K_i = 15; // Kinetic energy of incident neutrons, MeV Q = -7.6342; // Q-value of the reaction, MeV K_e = (Q*M_P-(m_i-M_P)*K_i)/(m_e+M_P); // Kinetic energy of emitted photon, MeV E_th = -1*Q*(M_P+m_i)/M_P; // Threshold energy required to initiate the reaction, MeV printf("\nThe kinetic energy of emitted photon = %5.3f MeV", K_e); printf("\nThe threshold energy required to initiate the reaction"); printf("\n\t%s(%d,%d) + %s(%d,%d) --> %s(%d,%d) + %s(%d,%d)", nucleus(1,1).entries, nucleus(1,2).entries, nucleus(1,3).entries, nucleus(2,1).entries, nucleus(2,2).entries, nucleus(2,3).entries, nucleus(3,1).entries, nucleus(3,2).entries, nucleus(3,3).entries, nucleus(4,1).entries, nucleus(4,2).entries, nucleus(4,3).entries); printf("\nis %5.3f MeV", E_th); // Result // The kinetic energy of emitted photon = 6.241 MeV // The threshold energy required to initiate the reaction // F(9,19) + n(0,1) --> O(8,19) + H(1,1) // is 8.039 MeV
c7c8d41d42f33d0d4219f4321f2db857e9e0ac1d
6b85d1958ff11075634ed9e0f6dbef2de9548f1b
/ANN_Toolbox/demos/enc848_m_nb.sci
8872d835cefd239f96030be85818ba25919b281b
[ "Unlicense" ]
permissive
ademarazn/REDES_NEURAIS
8a048c13aab33daa4068f52e18b263cc8325884f
a9a35744476d1f7e8405df04d5e4a9f8e4ed4595
refs/heads/master
2021-05-06T13:09:56.514632
2018-04-25T18:49:30
2018-04-25T18:49:30
113,248,743
1
0
null
null
null
null
UTF-8
Scilab
false
false
905
sci
enc848_m_nb.sci
// Loose 8-4-8 encoder // on a backpropagation network without biases, with momentum // (Note that the tight 8-4-8 encoder will not work without biases) rand('seed',0); // network def. // - neurons per layer, including input N = [8,4,8]; // inputs x = [1,0,0,0,0,0,0,0; 0,1,0,0,0,0,0,0; 0,0,1,0,0,0,0,0; 0,0,0,1,0,0,0,0; 0,0,0,0,1,0,0,0; 0,0,0,0,0,1,0,0; 0,0,0,0,0,0,1,0; 0,0,0,0,0,0,0,1]'; // targets, at training stage is acts as identity network t = x; // learning parameter lp = [2.5,0.1,0.9,0.25]; // init randomize weights between: r = [-1,7]; W = ann_FF_init_nb(N,r); Delta_W_old = hypermat(size(W)'); // 250 epochs are enough to ilustrate T = 250; [W,Delta_W_old] = ann_FF_Mom_online_nb(x,t,N,W,lp,T,Delta_W_old); // full run ann_FF_run_nb(x,N,W) // encoder encoder = ann_FF_run_nb(x,N,W,[2,2]) // decoder decoder = ann_FF_run_nb(encoder,N,W,[3,3])
ba9b53435a402f9048a2750a4c725ee3234bc30f
449d555969bfd7befe906877abab098c6e63a0e8
/213/CH11/EX11.3/11_3.sce
a9c5cd144aecc84e2f907ce023f72773f2fb4415
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
1,773
sce
11_3.sce
//To find radii of stepped pulleys clc //Given: N1=160, N3=N1, N5=N3, N2=60, N4=80, N6=100 //rpm x=720, r1=40 //mm //Solution: //For a crossed belt: //Calcluating the radii of pulleys 2, 3, 4, 5, and 6 r2=r1*(N1/N2) //mm //For pulleys 3 and 4, r4 = r3*(N3/N4), or r3*(N3/N4)-r4 = 0 //For a crossed belt drive, r3+r4 = r1+r2 A=[N3/N4 -1; 1 1] B=[0; r1+r2] V=A \ B r3=V(1) //mm r4=V(2) //mm //For pulleys 5 and 6, r6 = r5*(N5/N6), or r5*(N5/N6)-r6 = 0 //For a crossed belt drive, r5+r6 = r1+r2 A=[N5/N6 -1; 1 1] B=[0; r1+r2] V=A \ B r5=V(1) //mm r6=V(2) //mm //Results: printf("\n\n For a crossed belt,\n r2 = %.1fmm;\n",r2) printf(" r3 = %.1f mm;\n",r3) printf(" r4 = %.1f mm;\n",r4) printf(" r5 = %.1f mm;\n",r5) printf(" r6 = %.1f mm.\n\n",r6) //For an open belt: //Calcluating the radii of pulleys 2, 3, 4, 5, and 6 r2=r1*(N1/N2) //mm //Calculating the length of belt for an open belt drive L=%pi*(r1+r2)+(r2-r1)^2/x+2*x //mm //For pulleys 3 and 4, r4 = r3*(N3/N4), or r3*(N3/N4)-r4 = 0 //Since L is constant, for pulleys 3 and 4, %pi*(r3+r4)+(r4-r3)^2/x+2*x-L = 0 funcprot(0) function y=f(a) r3=a(1) r4=a(2) y(1)=r3*(N3/N4)-r4 y(2)=%pi*(r3+r4)+(r4-r3)^2/x+2*x-L endfunction z=fsolve([1,1],f) r3=z(1) //mm r4=z(2) //mm //For pulleys 5 and 6, r6 = r5*(N5/N6), or r5*(N5/N6)-r6 = 0 //Since L is constant, for pulleys 5 and 6, %pi*(r5+r6)+(r6-r5)^2/x+2*x-L = 0 function y=f(a) r5=a(1) r6=a(2) y(1)=r5*(N5/N6)-r6 y(2)=%pi*(r5+r6)+(r6-r5)^2/x+2*x-L endfunction z=fsolve([1,1],f) r5=z(1) //mm r6=z(2) //mm //Results: printf(" For an open belt,\n r2 = %.1fmm,\n",r2) printf(" r3 = %.1f mm;\n",r3) printf(" r4 = %.1f mm;\n",r4) printf(" r5 = %d mm;\n",r5) printf(" r6 = %d mm.\n\n",r6)
aece649c33fc6c65148a716e730d58d58c877747
3c47dba28e5d43bda9b77dca3b741855c25d4802
/microdaq/tests/AIO_COMPLEX_TEST/test_defines.sce
17d638e1ffad16b8d14468a10b063270f49b26ab
[ "BSD-3-Clause" ]
permissive
microdaq/Scilab
78dd3b4a891e39ec20ebc4e9b77572fd12c90947
ce0baa6e6a1b56347c2fda5583fb1ccdb120afaf
refs/heads/master
2021-09-29T11:55:21.963637
2019-10-18T09:47:29
2019-10-18T09:47:29
35,049,912
6
3
BSD-3-Clause
2019-10-18T09:47:30
2015-05-04T17:48:48
Scilab
UTF-8
Scilab
false
false
393
sce
test_defines.sce
// ------ CONSTATNTS ------ global %microdaq; mprintf("Loading test defines...\n") AI10_24 = [-10.24 10.24]; AI5_12 = [-5.12 5.12]; AI2_56 = [-2.56 2.56]; AI1_28 = [-1.28 1.28]; AI0_64 = [-0.64 0.64]; AO10 = [-10 10]; AO5 = [-5 5]; AO10_0 = [0 10]; AO5_0 = [0 5]; ADC_ID = %microdaq.private.adc_info.id; DAC_ID = %microdaq.private.dac_info.id; SCRIPT_MODE = 0; SIM_MODE = 1; DSP_MODE = 2;
752d6dcfdd37a61c8d7c44d3d8eddff393d9bdb9
449d555969bfd7befe906877abab098c6e63a0e8
/2102/CH2/EX2.25/exa_2_25.sce
fb21807bff60ca103ba5648ba3f299209ed262db
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
299
sce
exa_2_25.sce
// Exa 2.25 clc; clear; close; // Given data q=1.6*10^-19;// in C miu_n= 0.18;// in m^2/v-s N_D= 10^21;// per m^3 N_A= 5*10^20;// per m^3 N_deshD= N_D-N_A;// per m^3 n=N_deshD;// per m^3 sigma= q*n*miu_n;// in (Ωm)^-1 disp(sigma,"Conductivity of the silicon sample in (Ωm)^-1 is : ")
1980ef85ae8cbd58be158455e2ffa1470743a794
449d555969bfd7befe906877abab098c6e63a0e8
/1997/CH4/EX4.2/example2.sce
c69731e54271a6c13206f41b04ba6844af565c36
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
843
sce
example2.sce
//Chapter-4 example 4.2 //============================================================================= clc; clear; //input data F = 1*10^9; //operating frequency of monopulse radar in Hz Vo = 3*10^8; //velocity of EM wave in m/s theta_d = 10 //angle blw los and perpendicular bisector of line joining two antennas PD_d = 20; //phase difference in degrees // calculations lamda = Vo/F //wavelength in m //PD = (2*%pi/lamda)*(d*sin(theta)); theta_r = theta_d*(%pi/180) //degree to radian conversion PD_r = PD_d*(%pi/180) //degree to radian conversion d = (PD_r*lamda)/(2*%pi*sin(theta_r)); //output mprintf('Spacing between the antennas is %3.2f cms',d*100); //===============end of the program============================================
bf4f44baba06049f2cadd59c65a38fa535766410
ffe30bb7dcdef053e8f540de90cab35f8bcb011f
/questao_04.sce
19f7e7a08e06ee36e909fd8452323c4481679342
[]
no_license
jaimedantas/Signal-Processing-Assignments
fca8861401b6f3412bd7fa46d45797c27de1d421
4cf92066551842af94c3e39b4652f2759ebbe3e0
refs/heads/master
2020-05-20T12:59:21.319349
2017-04-07T20:43:46
2017-04-07T20:43:46
80,398,198
0
0
null
null
null
null
UTF-8
Scilab
false
false
802
sce
questao_04.sce
//condicoes iniciais n_c = 2;//numero de condicoes iniciais n_i = 5;//numero de interacoes y(2) = 1;//y(-1) y(1) = 0;//y(-2) //laco de interacao for i = 3:(n_i + n_c) y(i) = (3/4)*y(i-1) -(1/8)*y(i-2) +(1/2)^(i-3); end //deslocamento do vetor y para a possicao 1 for i = 1:(n_i) aux(i) = y(i+n_c); end f = aux'//transposta do vetor resposta //agora o vetor aux eh o vetor y(i) ordemado corretamente a partir da posicao y(1) //f = aux'; //grafico //vetor de n discreto n=[1:1:n_i]; //variáveis auxiliares para o grafico x_min = n(1)-2; x_max= n(length(n)); y_min = min(f); y_max = max(f)+0.5; plot2d3(n-1,f, style = -4, rect = [x_min,y_min,x_max,y_max]);//grafico discreto de y(n) em funcao de n xtitle("",["n"],["y(n)"], boxed = 0);//titulo dos eixos xgrid(4);
7c709dced63802251431942cef5b6901300f75e4
449d555969bfd7befe906877abab098c6e63a0e8
/2282/CH5/EX5.6/ex5_6.sce
30b440b04f52c0d68f10c9dd6c14216d84c9b75e
[]
no_license
FOSSEE/Scilab-TBC-Uploads
948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1
7bc77cb1ed33745c720952c92b3b2747c5cbf2df
refs/heads/master
2020-04-09T02:43:26.499817
2018-02-03T05:31:52
2018-02-03T05:31:52
37,975,407
3
12
null
null
null
null
UTF-8
Scilab
false
false
212
sce
ex5_6.sce
// Example 5.6, page no-190 clear clc printf("comparing given equation with stanard equation, we have,\n Maximum phase deviation = 6 radian\n Maximum frequency deviation = 12*3.14*10^3 radian/s = 6 KHz")