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
88892da4ce0a3ca7aba777a70def5acbbba91469
449d555969bfd7befe906877abab098c6e63a0e8
/2150/CH4/EX4.10/ex_4_10.sce
168108f7349e4ac8aebb62bd08e125ef9a5832c5
[]
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
617
sce
ex_4_10.sce
// Example 4.10 clc; clear; close; // Given data V_CC= 10;// in V V_BE= 0.7;// in V V_CE= 5;// in V bita= 100; I_C= 5;// in mA // Applying KVL to collector circuit, V_CC-V_CE-I_C*R_C =0 R_C= (V_CC-V_CE)/I_C;// in kΩ disp(R_C,"The value of R_C in kΩ is : ") I_B= I_C/bita;// in mA disp(I_B*10^3,"The value of I_B in µA is : ") // Applying KVL to base circuit, V_CC-I_B*R_B-V_BE= 0 R_B= (V_CC-V_BE)/I_B;// in kΩ disp(R_B,"The value of R_B in kΩ is :") // Note: In the book, there is an error in calculating the value of I_B, but they putted the correct value of I_B to evaluate the value of R_B
4917d06a0aff881a0808f0cf474f3b6978308095
a224e73b03e44940d761ce34b72d5b3cee86880b
/exemplo96.sce
8b9d21ef88c516a650d7581d87e9ee0124ede096
[]
no_license
DericsonPablo/controledesistemas
5092eab41134fe752add986b457278776a1bad90
74d4263c4819fa7e4e7b689b38e083dd87440777
refs/heads/master
2020-07-31T05:33:17.109455
2019-09-24T03:10:19
2019-09-24T03:10:19
210,500,755
0
0
null
null
null
null
UTF-8
Scilab
false
false
3,719
sce
exemplo96.sce
// EXEMPLO 9.6 // Projete um compensador para o sistema de modo que opere // com %UP = 20% e redução de Ts à metade. Além disso, o // sistema compensado deve apresentar uma melhoria de 10 // vezes no erro de estado estacionário para rampa. s = %s x = poly(0, 'x') up = 20 // calcular o qsi tendo em maos o up qsi = -log(up/100)/sqrt((log(up/100)^2+%pi^2)) // angulos da reta qsi tetha1 = acosd(qsi) tetha2 = 180-tetha1 G = 1/(s*(s+6)*(s+10)) // função do enunciado evans(G) sgrid(qsi, 0, 5) //p = locate(1) // ponto de intercção entre a reta do lugar das raizes e o qsi para encontar o ponto de operação a = p(1) + %i*p(2) // ponto de operação // com o ponto de operação podemos calcular os angulso dos polos(denominador)e zeros(numerador) ap0 = atand(imag(a)/real(a)) ap0c = 180+ap0 ap6 = atand(imag(a+6)/real(a+6)) ap10 = atand(imag(a+6)/real(a+10)) // contribuição angular Ez - Ep cang = ap0c + ap6 + ap10 // ganho K K = 1/abs(horner(G,a)) Tp = %pi/imag(a) // tempo de pico Ts = 4/real(a) // tempo de assentamento // para calcular o Kv = lim s*K*G quando s -> 0 Kv = K*(1/60) eeerampa = 1/Kv // AGR PROJETAR O SISTEMA USANDO COMPENSADOR COM AVANÇO DE FASE // Tsn = 1/2 Ts Tsn = (1/2)*Ts // n esquecer de usar TS POSITIVO, pq eh tempo // lembrando q Ts = 4 / real(a) // an = -sigman +jwdn sigman = 4 / -Tsn jwdn = sigman*tand(tetha1) an = complex(-sigman, jwdn) // novo ponto de operação para compensador com avanço de fase // contribuição angular para o novo ponto de operação ap0compensador = atand(imag(an)/real(an)) ap0CC = 180+ap0compensador ap6compensador = atand(imag(an+6)/real(an+6)) ap10compensador = atand(imag(an+10)/real(an+10)) az6compensador = atand(imag(an+6)/real(an+6)) // escolha arbitraria para um zero em6 // variavel temporaria para calcular o angulo do polo do compensador // temp = Ez - Ep temp = az6compensador - (ap0CC + ap6compensador + ap10compensador) // temp - angCompensador = +- 180 angCompensador1 = 180-temp angCompensador2 = 180+temp // encontrar o polo do compensador pela trigonometria pc = jwdn/tand(angCompensador2) + sigman Gn = (s+6)/(s*(s+6)*(s+10)*(s+pc)) // nova função transferencia evans(Gn) Kn = 1/abs(horner(Gn,an)) //novo ganho Tpn = %pi / jwdn // novo tempo de pico Kvn = Kn*(1/(10*pc)) eeerampan = 1/Kvn // COMPENSADOR ATRASO AVANÇO // o exercicio pede um EEE rampa 10 vezes menor: // com o erro do compensador de avanço de fase conseguimos encontrar o erro // do compensador atraso avanço eeerampann = eeerampa/10 // com o erro do compensador atraso avanço encontramos o Kvnn do msm Kvnn = 1/eeerampann //sabendo que o compensador por atraso avanço obedece as regras: //z1 < p1 //z2 < p2 //e //z1z2 = p1p2, temos: z1 = 6 z2 = 0.04 // estimado p1 = pc p2 = (z1*z2)/p1 Gnn = ((s+6)*(s+z2))/(s*(s+6)*(s+10)*(s+pc)*(s+p2)) evans(Gnn) // pelo grafico achar o novo ponto de operação ann = -3.575 + 6.979*%i Knn = 1/abs(horner(Gnn, ann)) Tsnn = 4/real(ann) Tpnn = %pi/imag(ann) // verificar se o novo ponto pertecen ao lugar das raizes ap0compensador2 = atand(imag(ann)/real(ann)) ap0CCC = 180+ap0compensador2 ap6compensador2 = atand(imag(ann+6)/real(ann+6)) ap10compensador2 = atand(imag(ann+10)/real(ann+10)) az1_c_atraso_avanço = atand(imag(ann+z1)/real(ann+z1)) az2_c_atraso_avanço = atand(imag(ann+z2)/real(ann+z2)) az2CCC = 180+az2_c_atraso_avanço ap1_c_atraso_avanço = atand(imag(ann+p1)/real(ann+p1)) ap2_c_atraso_avanço = atand(imag(ann+p2)/real(ann+p2)) ap2CCC = 180+ap2_c_atraso_avanço cangCCC = (az1_c_atraso_avanço+az2CCC) - (ap0CCC+ap6compensador2+ap10compensador2+ap1_c_atraso_avanço+ap2CCC) Kv_nn = Knn*((6*z2)/(6*10*pc*p2)) eee_rampa_nn = 1/Kv_nn
04a4fc0e87ba16252a49619ff54c3282caa0fe56
e59f7b8d4c0c495a34f4dfd66df058aa9c228b7b
/RESULTS/6DOFEoM.sci
f04026b05f2039ebc6b314cef647f123565fccc9
[]
no_license
maxxonair/BlueBook-Descent-and-Landing-Analysis-Toolkit-DaLAT
d1b2071adc584cbe1551090834cd01142beb0725
6c71c971c2aa62e9f81f3c00c211d80caf8680eb
refs/heads/master
2021-07-13T07:26:26.655134
2020-05-30T11:28:41
2020-05-30T11:28:41
169,849,595
3
0
null
2020-05-30T11:28:43
2019-02-09T09:09:13
Java
UTF-8
Scilab
false
false
3,467
sci
6DOFEoM.sci
function xdot = EoMQ(t,x) // FLIGHT Equations of Motion // Quaternion Option // November 11, 2018 // =============================================================== // Copyright 2006-2018 by ROBERT F. STENGEL. All rights reserved. // Called by: // odeXX in FLIGHT.m // Functions used by EoMQ.m: // AeroModel.m // event.m // Atmos.m // WindField.m global m Ixx Iyy Izz Ixz S b cBar CONHIS u tuHis deluHis uInc MODEL RUNNING // Select Aerodynamic Model if MODEL == 0 AeroModel = @AeroModelAlpha; end if MODEL == 1 AeroModel = @AeroModelMach; end if MODEL == 2 AeroModel = @AeroModelUser; end D2R = pi/180; R2D = 180/pi; [value,isterminal,direction] = event(t,x); // Earth-to-Body-Axis Transformation Matrix HEB = RMQ(x(10),x(11),x(12),x(13)); // Atmospheric State x(6) = min(x(6),0); // Limit x(6) to <= 0 m [airDens,airPres,temp,soundSpeed] = Atmos(-x(6)); // Body-Axis Wind Field Phi = atan2(2*(x(10)*x(13) + x(11)*x(12)),(1 - 2*(x(10)^2 + x(11)^2))); Theta = asin(2*(x(11)*x(13) - x(10)*x(12))); Psi = atan2(2*(x(12)*x(13) + x(10)*x(11)),(1 - 2*(x(11)^2 + x(12)^2))); windb = WindField(x(3),Phi,Theta,Psi); // Body-Axis Gravity Components gb = HEB * [0;0;9.80665]; // Air-Relative Velocity Vector x(1) = max(x(1),0); // Limit axial velocity to >= 0 m/s Va = [x(1);x(2);x(3)] + windb; V = sqrt(Va' * Va); alphar = atan(Va(3) / abs(Va(1))); // alphar = min(alphar, (pi/2 - 1e-6)); // Limit angle of attack to <= 90 deg alpha = R2D * alphar; betar = asin(Va(2) / V); beta = R2D * betar; Mach = V / soundSpeed; qbar = 0.5 * airDens * V^2; // Incremental Flight Control Effects if CONHIS >=1 && RUNNING == 1 [uInc] = interp1(tuHis,deluHis,t); uInc = (uInc)'; uTotal = u + uInc; else uTotal = u; end // Force and Moment Coefficients; Thrust [CD,CL,CY,Cl,Cm,Cn,Thrust] = AeroModel(x,uTotal,Mach,alphar,betar,V); qbarS = qbar * S; CX = -CD * cos(alphar) + CL * sin(alphar); // Body-axis X coefficient CZ = -CD * sin(alphar) - CL * cos(alphar); // Body-axis Z coefficient // State Accelerations Xb = (CX * qbarS + Thrust) / m; Yb = CY * qbarS / m; Zb = CZ * qbarS / m; Lb = Cl * qbarS * b; Mb = Cm * qbarS * cBar; Nb = Cn * qbarS * b; nz = -Zb / 9.80665; // Normal load factor // Dynamic Equations xd1 = Xb + gb(1) + x(9) * x(2) - x(8) * x(3); xd2 = Yb + gb(2) - x(9) * x(1) + x(7) * x(3); xd3 = Zb + gb(3) + x(8) * x(1) - x(7) * x(2); y = HEB' * [x(1);x(2);x(3)]; xd4 = y(1); xd5 = y(2); xd6 = y(3); xd7 = (Izz * Lb + Ixz * Nb - (Ixz * (Iyy - Ixx - Izz) * x(7) + ... (Ixz^2 + Izz * (Izz - Iyy)) * x(9)) * x(8)) / (Ixx * Izz - Ixz^2); xd8 = (Mb - (Ixx - Izz) * x(7) * x(9) - Ixz * (x(7)^2 - x(9)^2)) / Iyy; xd9 = (Ixz * Lb + Ixx * Nb + (Ixz * (Iyy - Ixx - Izz) * x(9) + ... (Ixz^2 + Ixx * (Ixx - Iyy)) * x(7)) * x(8)) / (Ixx * Izz - Ixz^2); // Quaternion Propagation p = x(7); q = x(8); r = x(9); Q = 0.5*[0, r, -q, p -r, 0, p, q q, -p, 0, r -p, -q, -r, 0]; qVec = [x(10); x(11); x(12); x(13)]; qd = Q*qVec; xdot = [xd1;xd2;xd3;xd4;xd5;xd6;xd7;xd8;xd9;... qd(1);qd(2);qd(3);qd(4)];
eaf45e20f72e62b9e005dad67dd74ce885fa5735
449d555969bfd7befe906877abab098c6e63a0e8
/887/CH11/EX11.5/11_5.sce
9c251ed5e0d74bf3d07ec88ab3b450410973e328
[]
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
349
sce
11_5.sce
clc //ex11.5 R_i=1*10^3; R_o=100; A_voc=100; //I_i=V_i/R_i, I_osc=A_voc*V_i/R_o from these two we get A_isc=(i_osc/I_i)=(A_voc(R_i/R_o)) A_isc=A_voc*(R_i/R_o); disp('The resulting current-amplifier is with an:') disp(R_i,'input resitance in ohms') disp(R_o,'output resistance in ohms') disp(A_isc,'and a short-cut current gain of:')
63249481c177b933ba67352d962ae6e57847a400
a62e0da056102916ac0fe63d8475e3c4114f86b1
/set8/s_Elements_Of_Physical_Chemistry_P._Atkins_1448.zip/Elements_Of_Physical_Chemistry_P._Atkins_1448/CH11/EX11.2.e/E11_2.sce
0265432ca43a78ccc04f5f74fd500d05149638df
[]
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
148
sce
E11_2.sce
errcatch(-1,"stop");mode(2); //Initialization of variables c=1.234 m=2.044 //calculations Ki=c/m //results printf("KI = %.2f ",Ki) exit();
fddcb5b72d85c8bde25baa1a4bec41aafaad28b5
449d555969bfd7befe906877abab098c6e63a0e8
/3526/CH8/EX8.2/EX8_2.sce
c51c3f09ac1d8f8f5b773730c7e26dfc32745b31
[]
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
539
sce
EX8_2.sce
clc;funcprot(0);//EXAMPLE 8.2 //page 222 // Initialisation of Variables tf=0.1;.......//Thickness of cooper to produce in cm %CW1=40;.......//cold work to produce a tensile strengthof 65,000 psi %CW2=45;.......//cold work to produce a tensile strengthof 60,000 psi //CALCULATIONS Tmax=(tf/(1-(%CW1/100)));.........//Maximum thicknessproduced in step1 in cm Tmin=(tf/(1-(%CW2/100)));.........//Minimum thicknessproduced in step2 in cm disp(Tmax,"Maximum thicknessproduced in cm:") disp(Tmin,"Minimum thicknessproduced in cm:")
a1a925f9292d89974a5461f639ee70d24d98ba36
4a1effb7ec08302914dbd9c5e560c61936c1bb99
/Project 2/Experiments/Chi-RW-C/results/Chi-RW-C.led7digit-10-1tra/result9.tst
c69fcff6b8bf30a609d79787b4e37d9fefa05b30
[]
no_license
nickgreenquist/Intro_To_Intelligent_Systems
964cad20de7099b8e5808ddee199e3e3343cf7d5
7ad43577b3cbbc0b620740205a14c406d96a2517
refs/heads/master
2021-01-20T13:23:23.931062
2017-05-04T20:08:05
2017-05-04T20:08:05
90,484,366
0
0
null
null
null
null
UTF-8
Scilab
false
false
535
tst
result9.tst
@relation led7digit @attribute Led1 real[0.0,1.0] @attribute Led2 real[0.0,1.0] @attribute Led3 real[0.0,1.0] @attribute Led4 real[0.0,1.0] @attribute Led5 real[0.0,1.0] @attribute Led6 real[0.0,1.0] @attribute Led7 real[0.0,1.0] @attribute number{0,1,2,3,4,5,6,7,8,9} @inputs Led1,Led2,Led3,Led4,Led5,Led6,Led7 @outputs number @data 0 9 4 9 7 7 8 8 8 8 4 4 4 4 9 9 3 3 8 8 8 8 0 0 1 7 3 7 4 4 4 9 5 5 6 6 3 3 7 7 7 7 0 0 3 3 4 4 5 5 5 5 7 1 2 6 3 ? 3 9 6 ? 7 ? 1 1 2 2 7 7 8 8 8 8 9 9 2 2 2 2 2 ? 7 7 9 8 0 0 2 2 2 8 6 8 7 1 7 7 9 ?
992c3147375d2621a24c619faa0982a54e46830f
449d555969bfd7befe906877abab098c6e63a0e8
/1631/CH3/EX3.8/Ex3_8.sce
d6a5b9106423e78a3b6679b2555410607b6e049e
[]
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
300
sce
Ex3_8.sce
//Caption: Transmission Bandwidth //Example 3.8 //page no 131 //Calculate Transmission Bandwidth //given clc; clear; fm=3*10^3; fs=8*10^3;// sampling frequncy Ts=1/fs; t=0.1*Ts; BW=1/(2*t);//Bandwidth disp("Transmission Bandwidth of PAM signal is "); disp("kHz",BW*10^-3,"BW>=");
4983409823390f21cd18ef6ac2e656796d24cd07
449d555969bfd7befe906877abab098c6e63a0e8
/539/CH14/EX14.2.a/Example_14_2a.sce
d214aea7a3f0647bbf317ea24267a1aa436f0ae8
[]
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
417
sce
Example_14_2a.sce
//Computations of the Density clear; clc; printf("\tExample 14.2\n"); printf("\n\tPart A"); Ac=12.01; //in g/mol Molecular weight of Carbon Ah=1.008; //in g/mol molecular weight of hydrogen a=7.41*10^-8; //in cm b=4.94*10^-8; //in cm c=2.55*10^-8; //in cm Na=6.023*10^23; Vc=a*b*c; n=2; A=(2*Ac)+(4*Ah); density_c=n*A/(Vc*Na); printf("\nDensity is : %f g/cm^3\n",density_c); //End
9740aa9d1c5b6a40aaafc7cef8bb3a21006fca16
449d555969bfd7befe906877abab098c6e63a0e8
/1670/CH8/EX8.6/8_6.sce
e962103ec5e5d8cc28184dad29975d76b8a61ab8
[]
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
8_6.sce
//Example 8.6 //Simpsons 1/3rd Rule and Bessels Quadrature //Page no 271 clc;clear;close; z=[0,0.5;0.25,0.4794;0.5,0.4594;0.75,0.4398;1,0.4207] h=0.25; for i=1:3 printf('\nWhen x = %g',z(i,1)) if i==1 then printf(' clearly we have \n\n') for j=1:5 y(i,j)=1 end elseif i==2 printf(', using Bessels formula \n\n') for j=1:5 if j==1 then y(i,j)=1 else y(i,j)=1+h*(z(i-1,2)*y(i-1,j)+z(i,2)*y(i,j-1))/2 end end else printf(', using Simpsons formula \n\n') for j=1:5 if j==1 then y(i,j)=1+h*(z(i-2,2)+4*z(i-1,2)+z(i,2))/3 else y(i,j)=1+h*(z(i-2,2)*y(i-2,j)+4*z(i-1,2)*y(i-1,j)+z(i,2)*y(i,j-1))/3 end end end for j=1:5 printf('y%i(%g) = %g\n\n',j,z(i,1),y(i,j)) end end
b1fd03c6ee3aade986ebf6893e221d1f585b08c9
449d555969bfd7befe906877abab098c6e63a0e8
/2417/CH4/EX4.2/Ex4_2.sce
204476d2da67d24b9f58b1a0cf8c57c0202e5ab8
[]
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
858
sce
Ex4_2.sce
//scilab 5.4.1 clear; clc; printf("\t\t\tProblem Number 4.2\n\n\n"); // Chapter 4 : The Second Law Of Thermodynamics // Problem 4.2 (page no. 149) // Solution //given data Qin=100; //heat added to the cycle printf("In problem 4.1,\n") //given data t1=1000; //(unit:fahrenheit) //Source temperature t2=80; //(unit:fahrenheit) //Sink temperature //solution //converting temperatures to absolute temperatures; T1=t1+460; //Source temperature //Unit:R T2=t2+460; //Sink temperature //Unit:R printf("Solution for (a)\n"); printf("Efficiency of the engine is %f percentage\n\n",((T1-T2)/T1)*100); printf("Now in problem 4.2,\n") W=0.63*Qin; //W=W/J; //Efficiency in problem 4.1 W=Qin*(W/Qin); //amount of work Qr=Qin-W; //Qin-Qr=W/J //Qr=heat rejected by the cycle printf("The heat removed from the reservoir %f units",Qr);
f27763b7b8e60213c649ed33d2304f7849a2efaf
449d555969bfd7befe906877abab098c6e63a0e8
/1448/CH17/EX17.1.e/E17_1.sce
ee5a8f6ca73c27e4a3f31f06973b45e11ad40cac
[]
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
248
sce
E17_1.sce
clc //Initialization of variables mH=1.673*10^-27 //kg mCl=5.807*10^-26 //kg R=127.4 *10^-12//m //calculations mu=mH*mCl/(mH+mCl) I=mu*R^2 B=1.05457*10^-34 /(4*%pi*I) f=2*B //results printf("Frequency of transistion = %.1f GHz",f/10^9)
47e6ebb70a42e5c0e9da5c0722cbdd26ccc7e9fc
b829a470efb851fdd8700559c2092711adaa42e0
/Data/OVI-CV-03-Facenet/CV-Groups/cv-group-114528472703/OVI-Test/cv-group-114528472703-run-02.tst
1235d0f737903dfb1a17d242a4fd114296301e37
[]
no_license
achbogga/FaceRecognition
6f9d50bd1f32f2eb7f23c7ae56f9e7b225d32325
165ebc7658228d2cceaee4619e129e248665c49a
refs/heads/master
2021-07-04T21:47:57.252016
2017-08-01T18:53:12
2017-08-01T18:53:12
96,568,452
0
0
null
null
null
null
UTF-8
Scilab
false
false
524
tst
cv-group-114528472703-run-02.tst
Huiping\Huiping_013.jpg Huiping\Huiping_011.jpg Don\Don_012.jpg Don\Don_013.jpg Shirley\Shirley_001.jpg Shirley\Shirley_007.jpg Ahmad\Ahmad_011.jpg Ahmad\Ahmad_012.jpg Sima\Sima_007.jpg Sima\Sima_002.jpg SungChun\SungChun_012.jpg SungChun\SungChun_011.jpg Kiran\Kiran_016.jpg Kiran\Kiran_005.jpg Allison\Allison_002.jpg Allison\Allison_007.jpg Amit\Amit_004.jpg Amit\Amit_007.jpg Nara\Nara_010.jpg Nara\Nara_007.jpg Weihong\Weihong_009.jpg Weihong\Weihong_001.jpg Dave\Dave_001.jpg Dave\Dave_002.jpg
08c0dc1efae61e427031acfefc69a5b616fefbd4
449d555969bfd7befe906877abab098c6e63a0e8
/2090/CH16/EX16.3/Chapter16_example3.sce
ef657ddcb4d3e7bb939c8692b119a580970360ed
[]
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
383
sce
Chapter16_example3.sce
clc clear //Input data d=0.09;//The diameter of the bore in m L=0.1;//The length of the stroke in m T=120;//The torque measured in Nm pi=3.141;//Mathematical constant of pi n=4;//Number of cylinders //Calculations pmb=[(4*pi*T)/(L*(pi/4)*d^2*n)]/10^5;//The brake mean effective pressure in bar //Output printf('The brake mean effective pressure = %3.2f bar',pmb)
e2ad759f04b56cf4987eb52bebb592f9ccc34785
449d555969bfd7befe906877abab098c6e63a0e8
/1760/CH1/EX1.18/EX1_18.sce
54cf4666cf87b4bc18ec07d5e7aea9ef69d229b5
[]
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
236
sce
EX1_18.sce
//EXAMPLE 1-18 PG NO-23 E=0.05; //ENERGY i=0.1; //CURRENT L=2*E/i^2 //INDUCTANCE OF COIL disp('i)inductance = '+string (L)+' H')
990f29e9a26349eddbcc5111c01b2b1170421577
449d555969bfd7befe906877abab098c6e63a0e8
/1529/CH23/EX23.6/23_06.sce
7c73cd3aeedb545bae1413c8413ca2caf5226fa3
[]
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
320
sce
23_06.sce
//Chapter 23, Problem 6 clc; f=50; //supply frequency nr=1200/60; //rotor speed s=4; //slip ns=(nr/(1-(s/100))); //synchronous speed printf("synchronous speed = %d rev/min",ns*60);
60e45f7d4a74a796beb2f0f2d9d56d942c7f6cb9
449d555969bfd7befe906877abab098c6e63a0e8
/1370/CH2/EX2.16/example2_16.sce
269dca24ee5db3586654c074a7278e36b7b849a0
[]
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,088
sce
example2_16.sce
//example2.16 clc disp("No load current I=2.5 A,") n=440*2.5 disp(n,"No load input(in W)= (V*I)=") s=440/550 disp(s,"I_sh(in A)=V/R_sh=") disp("In dc shunt motor, I=(I_sh)+(I_a)") a=2.5-0.8 disp(a,"I_a(in A)=I-(I_sh)=") p=1.2*(1.7)^2 format(6) disp(p,"No load armature copper loss(in watts)= (R_a)*(I_a)^2=") disp("Constant losses= No load input- No lpad armature Cu losses") c=1100-3.468 format(9) disp(c,"Therefore, Constant losses(in Z)=") disp("Now, full load line current i.e I=32 A") disp("I=(I_sh)+(I_a)") a=32-0.8 disp(a,"I_a(in A)=I-(I_sh)=") p=1.2*(31.2)^2 disp(p,"Full load armature copper loss=(R_a)*(I_a)^2=") disp("Total losses= Full load armature Cu loss + Constant losses") l=1168.128+1096.532 disp(l,"Therefore, Total losses(in W)=") v=440*32 disp(v,"Full load motor input(in W)= V*I =") v=14080-2264.66 disp(v,"Full load motor output(in W)= Input-Losses=") d=(1181534)/14080 format(6) disp(d,"% efficiency at full load= [(Full load Output)/(full load input)]*100=") disp("Therefore, Efficiency of motor at full load = 83.91%")
f48c630760d07b6d5e54b567aa462f9caab8b927
0cb85cd0c88a9b9f0cca4472742c2bf9febef2d8
/klava/kernel/ntreelib/tests/test.tst
bab18597627c8066b4cfc0c8b3b457f23e89d1d8
[]
no_license
seth1002/antivirus-1
9dfbadc68e16e51f141ac8b3bb283c1d25792572
3752a3b20e1a8390f0889f6192ee6b851e99e8a4
refs/heads/master
2020-07-15T00:30:19.131934
2016-07-21T13:59:11
2016-07-21T13:59:11
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
98
tst
test.tst
trace on create "foo.db" add 1 "'a first signature'" add 2 "'another signature'" print
4eef74dd6ff9b14bebe57e0783d3e1dde9bf4577
27fecbbeb6c49dcf03b9bddf1b867c31e13a3825
/Simulações/Relatório 03/t3_kiu.sci
93027669e4cc9f45cc04ec7ccef4ab54de9f4f7e
[]
no_license
LucasHattoriCosta/Poli
42c9fc2d34c31e01336265fbdac3e4921d56e096
b1ac609c3675539b4e921909c35ea196ffc44df3
refs/heads/master
2023-03-15T12:22:03.745943
2020-06-29T17:32:48
2020-06-29T17:32:48
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
1,156
sci
t3_kiu.sci
//Condições iniciais R = 0.001; ro = 7850; volume = 4*%pi*(R^3)/3; m = ro*volume; g = 9.8; r = 1; s0 = -4*r; v0 = 0; t = linspace(0,10,1000); s= zeros(1,1000); v = zeros(1,1000); funcprot(0); function [ds]=f(t, y) ds1=y(2); ds2=(-g/(4*r))*(y(1)); ds=[ds1;ds2]; endfunction function [z]=h(t, y) z1=16+f(1)^2; z2=f(2); z=[z1;z2] endfunction x = ode("root",[s0;v0],0,t,f,1,h); s = x(1,:); v = x(2,:); t1 = linspace(0,10,999) dv = diff(v) dt = diff(t) for i = 1:(length(dv)) a(i) = dv(i)/dt(i) end T = m*(v^2)/2; V = m*g*(s^2)/(8*r); E = T + V; //Gráficos f1=scf(1); plot(t, s); xtitle("posição em função do tempo", "t","s"); f2=scf(2); plot(t, v); xtitle("velocidade em função do tempo", "t","v"); f3=scf(3); plot(t1, a'); xtitle("aceleração em função do tempo", "t", "a"); f4=scf(4); plot(t, T); xtitle("energia cinética em função do tempo", "t", "T") f5=scf(5); plot(t, V); xtitle("energia potencial em função do tempo", "t", "V") f6=scf(6); plot(t, E); xtitle("energia mecânica em função do tempo", "t", "E") f7=scf(7); plot(s, v); xtitle("velocidade em função do espaço", "espaço", "velocidade")
583b10fc258b6844b00526a4b1689463731ef248
449d555969bfd7befe906877abab098c6e63a0e8
/3689/CH17/EX17.7/17_7.sce
9a37183c41ddb745365850330bbec1e705a19379
[]
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
sce
17_7.sce
//// //Variable Declaration m = 22.7 //Mass of CO2, kg T = 293.0 //Temperature, K L = 1.0 //length of the tube, m d = 0.75 //Diameter of the tube, mm eta = 146 //Viscosity of CO2, muP p1 = 1.05 //Inlet pressure, atm p2 = 1.00 //Outlet pressure, atm atm2pa = 101325 //Conversion for pressure from atm to Pa M = 0.044 //Molecular wt of CO2, kg/mol R = 8.314 //Molar Gas constant, J mol^-1 K^-1 //Calculations p1 = p1*atm2pa p2 = p2*atm2pa F = %pi*(d*1e-3/2)**4*(p1**2-p2**2)/(16.*eta/1.e7*L*p2) nCO2 = m/M v = nCO2*R*T/((p1+p2)/2) t = v/F //Results printf("\n Flow rate is %4.3e m3/s",F) printf("\n Cylinder can be used for %4.3e s nearly %3.1f days",t, t/(24*3600))
8c4c49f325c64584bb5047418340a7c1ff33d9ee
449d555969bfd7befe906877abab098c6e63a0e8
/199/CH4/EX4.2/Example_4_2.sce
e98ecf2d80c28de2f6fffe883068fffedd304b25
[]
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
367
sce
Example_4_2.sce
// Chapter4 // Page.No-121, Figure.No-4.13 // Example_4_2 // Max Output offset voltage // Given clear;clc; R1=1*10^3;Rf=10*10^3; Vio=10*10^-3; // Input offset voltage Aoo=1+Rf/R1; // To find max value of Voo,we reduce input voltage vin to zero. Voo=Aoo*Vio; // Max output offset voltage printf("\n Max output offset voltage is = %.3f V dc \n",Voo) // Result
f3b6679e79bc87d45506d1b04aaee8731fd4b7cb
717ddeb7e700373742c617a95e25a2376565112c
/278/CH15/EX15.4/ex_15_4.sce
b57446f3780d9ffde2daac7d94b442abd73e7e9f
[]
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
790
sce
ex_15_4.sce
//find dia o hnalde,xsec,dia of journal clc //solution //given l=300//mm L=400//mm x=100//mm P=400//N ft=50//N/mm^2 t=40//N/mm62 //let d eb dia M=(1-1/3)*P*l//N-mm //Z=(%pi/32)*d^3=0.0982*d^3 //M=fb*Z=4.91*d^3 d=(M/4.91)^(1/3)//N-mm printf("the dia of handle is,%f mm\n",d) //let t1 be thicnes and B eb width of lvever arm M1=1.25*P*L//N-mm //B=2t //Z1=(1/6)*t*B^2=0.6677*t^3 //ft=M/Z //t1=(M1/(0.667*50))^(1/3)//mm printf("the thcikness is,%f mm\n",(M1/(0.667*50))^(1/3)) //let D be dia of journal printf("the thickness of lever arm is say 20 mm\n") t1=20//mm B=2*t1//mm printf("the width of lever arm is,%f mm\n",B) Te=P*(sqrt((2*(l/3) + x)^2 + L^2 ))//N-mm //Te=(%pi/16)*t*D^3=7.86*D^3 D=(Te/7.86)^(1/3)//mm printf("the dia met of journal is,%f mm\n",D)
7b8184943608ea07477dc23fbf6c09384ea09f6f
449d555969bfd7befe906877abab098c6e63a0e8
/1910/CH4/EX4.9/Chapter49.sce
405abf93b9fe954ab86fbcc730626f58a7a7f6f0
[]
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,198
sce
Chapter49.sce
// Display mode mode(0); // Display warning for floating point exception ieee(1); clear; clc; disp("Introduction to heat transfer by S.K.Som, Chapter 4, Example 9") //Thermal conductivity of aluminium in W/(m*K) k = 198; //Length in m L = 0.18; //Breadth in m b = 0.104; //Initial temperature in °C Ti = 730; //Temperature of surrounding in °C Tinfinity = 30; //Heat transfer coefficient in W/(m^2*K) h = 1100; //Thermal diffusivity in m^2/s alpha = 8.1*(10^(-5)); //Given time in seconds t = 100; //Bar can be considered to be an intersection of two infinite plates of //thickness L1 and L2 in m L1 = L/2; L2 = b/2; //For plate 1 //Fourier number Fo1 = (alpha*t)/(L1^2); //Biot number Bi1 = (h*L1)/k; //From fig. 4.11, at this Fo and (1/Bi), we have dimensionless temperature //ratio to be 0.7 //For plate 2 //Fourier number Fo2 = (alpha*t)/(L2^2); //Biot number Bi2 = (h*L2)/k; //From fig. 4.11, at this Fo and (1/Bi), we have dimensionless temperature //ratio to be 0.47 //Therefore combined dimensionless temperature ratio is multiply of two z = 0.47*0.7; //Temperature in °C T = Tinfinity+z*(Ti-Tinfinity); disp("Tempearture of bar in °C") T
e976223c679074513b5a6725bc0c48010cf0f397
449d555969bfd7befe906877abab098c6e63a0e8
/716/CH2/EX2.1/MatLab_Prog2_1.sce
cd67b0423bf6fe5073b32498cb2a42455094fc6a
[]
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,142
sce
MatLab_Prog2_1.sce
//to generate standard signals like unit impulse,unit step,unit ramp,parabolic,sinusoidal,triangular pulse,signum,sinc and Gaussian signals clc; clear; t=-15:0.1:15; x=1.*(t==0); subplot(3,3,1) plot(t,x); xtitle('unit impulse signal','time t','signal x(t)'); x=1.*(t>=0); subplot(3,3,2) plot(t,x); xtitle('unit step signal','time t','signal x(t)'); x=t.*(t>=0); subplot(3,3,3) plot(t,x); xtitle('unit ramp signal','time t','signal x(t)'); x=0.4*(t^2); subplot(3,3,4) plot(t,x); xtitle('parabolic signal','time t','signal x(t)'); x=sin(%pi/5*t); subplot(3,3,5) plot(t,x); xtitle('sinusoidal signal','time t','signal x(t)'); x=1-abs(t)/2; subplot(3,3,6) plot(t,x); xtitle('triangular signal','time t','signal x(t)'); x=-1.*(t<0)+1.*(t>=0); subplot(3,3,7) plot(t,x); xtitle('signum signal','time t','signal x(t)'); t1=0.01:0.01:15; x1=(sin(t1)./t1).*(t1>0.01) t2=-15:0.01:-0.01 x2=(sin(t2)./t2).*(t2<-0.01) subplot(3,3,8) plot(t1,x1,t2,x2); xtitle('sinc signal','time t','signal x(t)'); t=-15:0.01:15; x=exp(-1*1.*(t.^2)); subplot(3,3,9) plot(t,x); xtitle('guassian signal','time t','signal x(t)');
7b4ef311385c8f4ae02b1775d0dd5104a638f087
4b3c8d2302d37ad5981adb6f68fae3db1d9820c8
/createNewRegfile.sci
d0be8ddb36e9426982f13e5ca95d21a486f53d24
[]
no_license
mayank1513/littleBird_RD_ResourceManagementSystem
002d19579b3b55a314450ec75d2874131741564b
090d016248164580defc9b4629ba54c9dc362949
refs/heads/master
2020-03-15T04:48:31.637752
2018-05-03T09:46:53
2018-05-03T09:46:53
131,970,842
0
0
null
null
null
null
UTF-8
Scilab
false
false
1,697
sci
createNewRegfile.sci
function regNo = createNewRegfile(fc_name,regNoList,nFamily,regColInd,regValues,vilStr,regDate,regN) if regN~=-1 then n = find(regNoList(:,1)==regN); if isempty(n) then btn = messagebox('registration number' + string(regN) + 'does not exist', 'littleBird', 'error', ['Enter Correct Registration Number', 'Cancel'], 'modal'); if btn == 1 then while isempty(n) regN = x_mdialog('Enter Correct Registration Number','GEV'); if isempty(regN) break; end n = find(regNoList(:,1)==regN); end if isempty(n) then return -1; end else return -1; end end if sum(length(stripblanks(regNoList(n,regColInd))~=0)) then mStr = 'Entries already Exist:'; mStr(2:3,1:size(regColInd,2)) = regNo([1 n],regColInd); btn = messagebox(mStr , 'littleBird', 'error', ['Over Write New Values', 'Cancel'], 'modal'); if btn == 1 regNoList(n,regColInd) = regValues; //overwriting if there was any existing entry else return -1; end end regNoList(n,regColInd) = regValues; //overwriting if there was any existing entry // implement check for nFamily return regN; end nReg = size(regNoList,1); [d, m, y] = str2date(regDate); if m<4 then y = y-1; end n = '000'; n = part(n,1:3-length(string(nReg))) + string(nReg); regNo = 'GEV' + string(y) + vilStr + n; regNoList($+1,[1 2 regColInd]) = [regNo nFamily regValues]; csvWrite(regNoList,fc_name); endfunction
23d2b11764884e9066515ab6a4bd3b6ad1989c71
449d555969bfd7befe906877abab098c6e63a0e8
/2699/CH13/EX13.60/Ex13_60.sce
ceed956498917320aeac6ffc3de997ba97ce94d3
[]
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
Ex13_60.sce
//EX13_60 Pg-34 clc clear printf("subtraction of two octal numbers using 8''s complement") printf("\n (316)_8<(451)_8") printf("\n\n (316)_8-(451)_8 =") x=['316'] y=['451'] //octal to decimal conversion// x=oct2dec(x) y=oct2dec(y) y1=bitcmp(y,8)//7's complement of the larger number y2=y1+1;//8's complement of the larger number //subtraction of larger number from smaller number a=x+y2;//the result obtained will have no carry since //the second number is larger than the first number //hence we should take 8's complement of the result a1=bitcmp(a,8)//8's complement of the result a2=a1+1;//final answer s=dec2oct(a2) printf(" -%s",s)//the final result is negative
663f076f3e243b0579ec095eca6a426f2d300ecc
449d555969bfd7befe906877abab098c6e63a0e8
/1709/CH2/EX2.2/2_2.sce
134895bced1d6f66a6d58c534a857312ca078e93
[]
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
211
sce
2_2.sce
clc //Initialization of variables L=0.305 //m v=4.58 //m/s i=10 //A B=1 //W/m^2 //calculations F=i*B*L W=F*v //results printf("Force necessary = %.2f N",F) printf("\n Work per unit time = %.2f W",W)
0267eea4a0afd5ac60f0d375a3e6a7195e302b35
449d555969bfd7befe906877abab098c6e63a0e8
/1034/CH7/EX7.4/7s4.sce
0d7db85a0d078ea57b733e24aa2b90302baaa045
[]
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
7s4.sce
clear; clc; disp("Example 7.4"); function[a1]=insertion(a,n) for k=1:n y=a(k); i=k; while(i>=1) if(y<a(i)) a(i+1)=a(i); a(i)=y; end i=i-1; end end a1=a; disp(a1,"Sorted array is:"); endfunction //Calling Routine: a=[3 1 2] disp(a,"Given Array"); a1=insertion(a,3)
cafba0fd260439e70952c49328828f0b73f3707d
63c8bbe209f7a437f8bcc25dc1b7b1e9a100defa
/test/0091.tst
28e3d0208bf2a46874c9087637fe43a7a1a17f3e
[]
no_license
fmeci/nfql-testing
e9e7edb03a7222cd4c5f17b9b4d2a8dd58ea547c
6b7d465b32fa50468e3694f63c803e3630c5187d
refs/heads/master
2021-01-11T04:09:48.579127
2013-05-02T13:30:17
2013-05-02T13:30:17
71,239,280
0
0
null
2016-10-18T11:01:57
2016-10-18T11:01:55
Python
UTF-8
Scilab
false
false
1,331
tst
0091.tst
SPLiTTEr wK {} fILtER CrfL { nOt be:FC:Ad:aB:Ea:fF >= EF Or noT 2104 <= jrMx OR BitOR (::bDAD:aBd:Ee:a:D1:d/334, +14.93e7, YsW, ) Or NOT V NOT In :: /5 oR BitaND ( , 276.6e18, BitaND ( ), ::Af:2:1:f:d:226.252.217.252, 3.226.247.7/085, BE:F6:Ce:FD:cf:bd , ) Or 99 << 250.205.252.254/3 J IN -0 oR NoT bITOR (Bb:ED:BA:Bd:Bd:bF , 68676, ) OR noT BitOR (+11, , ) oR m In D7d:E::9A0:AC:3:132.238.92.252/91 } fiLter Kb {Not s Or not HAO oR NOt EX Not ow or NoT win } tiXBt -> lU -> r -> h GROUpEr e {MODule A{ } mOduLE JaD{ } AGgREgATe avG(hlj) AS oXe } uNGrOUpeR o { } grouPfilter bN {wk ( bItAnD ( PiM, 253.110.0.253, 251.2.18.131, ), ::f:7:a4:B:d:EA:aDb, ) Or c = -90.21e05 } mERGeR X { MOdULE F { BraNCHeS Y } ModuLe R { BraNcheS R nOT y iN ::d:E7:254.253.61.203 NOT G ( ) } moDUle NdZ { braNChEs V 7e8 > Fb9d O F K oR Nlm fI nQ DeLTA 65S oR n m Nxmv deLta 55mS } MODuLE Xx { bRANChES ZBHMYw Nmsm ( t ) Z > QdwEioGl DeLta 36MS Or qZ eq f deLtA 70S OR h F gFor or Uc Eq x or m Si H deltA 5Ms or cEL M IfX deLTA 51M } moDuLE c { BrANcheS sQ Nh f X deLTa 25Ms oR s fi zHpH DELTA 76MS OR Y FI TC dEltA 693mS oR sy sI t NOt eUfg ( ) } ModULE x { BraNChEs m, O, m edC:c::DA:1:f4C4:EB <= K } mODuLe rlA { BrAncHES k, MeGO NoT J ( ::ABAD:de:123.214.36.0, ) } modULe vh { bRANchES F, G } exPorT ia }
00533a68b3a52970326c86af1a830f9e72ee4819
449d555969bfd7befe906877abab098c6e63a0e8
/1382/CH6/EX6.13/EX_6_13.sce
e954e8f2f645396daf9700d2555c7fa325b2406a
[]
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
364
sce
EX_6_13.sce
// Example 6.12;//feedback factor and bandwidth clc; clear; close; B=4;//bandwidth in mega hertz without feedback Av= 1500;// open loop voltage gain Avf= 150;//GAIN WITH FEEDBACk AvB= ((Av/Avf)-1);//feedback factor BWf=(1+AvB)*B;//bandwidth in mega hertz with feedback disp(AvB,"FEEDBACK FACTOR IS") disp(BWf,"bandwidth in mega hertz with feedback is")
10ad972176c58a79f9d48ab3813f3055067fd56d
01ecab2f6eeeff384acae2c4861aa9ad1b3f6861
/xcos_blocks/Matmul.sci
ca2a6ea1195780a6988d450899eae3ade426acae
[]
no_license
jhasler/rasp30
9a7c2431d56c879a18b50c2d43e487d413ceccb0
3612de44eaa10babd7298d2e0a7cddf4a4b761f6
refs/heads/master
2023-05-25T08:21:31.003675
2023-05-11T16:19:59
2023-05-11T16:19:59
62,917,238
3
3
null
null
null
null
UTF-8
Scilab
false
false
1,929
sci
Matmul.sci
function [x,y,typ]=Matmul(job,arg1,arg2) x=[];y=[];typ=[]; select job case 'plot' then standard_draw(arg1) case 'getinputs' then [x,y,typ]=standard_inputs(arg1) case 'getoutputs' then [x,y,typ]=standard_outputs(arg1) case 'getorigin' then [x,y]=standard_origin(arg1) case 'set' then x=arg1;graphics=arg1.graphics;model=arg1.model;exprs=graphics.exprs; while %t do [ok,num_of_blk,mblif_num,Matmul_A,Matmul_b,fix_loc,exprs]=scicos_getvalue('New Block Parameter',['num_of_blk';'mblif_num';'Matmul_A';'Matmul_b';'fix_loc'],list('vec',-1,'vec',-1,'mat',[-1,-1],'mat',[-1,-1],'vec',-1),exprs); if ~ok then break,end if ok then num_st=4; model.ipar=[num_of_blk,mblif_num]; model.state=[ones(num_st,1);ones(num_st,1)]; model.rpar=[Matmul_A,Matmul_b,fix_loc']; graphics.exprs=exprs; x.graphics=graphics; x.model=model break; end end case 'define' then num_of_blk=1; mblif_num=0; Matmul_A=[1e-6,2e-9,2e-9,2e-9,2e-9,1e-6,2e-9,2e-9,2e-9,2e-9,1e-6,2e-9,2e-9,2e-9,2e-9,1e-6]; Matmul_b=[1e-6 1e-6 1e-6 1e-6]; fix_loc=[0;0;0]; model=scicos_model(); model.sim=list('Matmul_c',5); model.in=[1;1] model.out=4 model.ipar=[num_of_blk,mblif_num]; model.rpar=[Matmul_A,Matmul_b,fix_loc']; model.blocktype='d'; model.dep_ut=[%f %t]; //[block input has direct feedthrough to output w/o ODE block always active] exprs=[sci2exp(num_of_blk);sci2exp(mblif_num);sci2exp(Matmul_A);sci2exp(Matmul_b);sci2exp(fix_loc)]; gr_i=['text=[''Matmul''];';'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');'] x=standard_define([5 3],model, exprs,gr_i) //Numbers define the width and height of block end endfunction
d281ee9d0486d228dd442140a167ca50fa79871e
d658b01ff01f86bad6b11407b5ae8444f753c531
/Endfire.sce
85e650f1bab7254bd48e749302c6957bc613563c
[]
no_license
Amit-Chaurasiya/Hello-World
2bb8151a53e57d97fced694774906282c5010ea7
d8d1389cd3ff6e1ea905ef85c5fd637aebda094a
refs/heads/main
2023-05-11T04:17:37.571068
2023-04-27T19:06:01
2023-04-27T19:06:01
326,378,277
0
0
null
null
null
null
UTF-8
Scilab
false
false
311
sce
Endfire.sce
// Endfire Array clc; clear all; n=10; lambda=1; d=lambda/4; beta=(2*%pi)/lambda; phi=0.001:0.01:2*%pi; del=-(beta*d); psi=beta*d*cos(phi)+del; AF=sin(n.*psi/2)./(n*sin(psi/2)); polarplot(phi,AF); del 1=beta*d; psi=beta*d*cos(phi)+del 1; AF=sin(n.*psi/2)./(n*sin(psi/2)); polarplot(phi,AF);
39757930b78c76138c959aceff43dc215aaf0539
449d555969bfd7befe906877abab098c6e63a0e8
/2204/CH4/EX4.13/ex4_13.sce
b7cf300dc1587a8f30407219903bae2978e14016
[]
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
340
sce
ex4_13.sce
//Exa 4.13 clc; clear; close; // Given data omega= 10000;// in rad/sec GaindB= 20;// peak gain in dB Gain= 10^(GaindB/20); C= 0.01;// in µF C= C*10^-6;// in F // Formula omega= 1/(C*RF) RF= 1/(C*omega);// in Ω R1= RF/Gain;// in Ω disp(RF*10^-3,"The value of RF in kΩ is : ") disp(R1*10^-3,"The value of R1 in kΩ is : ")
eb7b0f6bc9bbbbc024eb8ecf86e6ab0daa2ad73f
449d555969bfd7befe906877abab098c6e63a0e8
/1049/CH4/EX4.9/ch4_9.sce
aa1afc0cbb7fb3a473346513c677e11544c7c22d
[]
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
569
sce
ch4_9.sce
clear; clc; function [I_TAV]=theta(th) I_m=1; //supposition I_av=(I_m/(2*%pi))*(1+cosd(th)); I_rms=sqrt((I_m/(2*%pi))*((180-th)*%pi/360+.25*sind(2*th))); FF=I_rms/I_av; I_rms=35; I_TAV=I_rms/FF; endfunction disp("when conduction angle=180"); th=0; I_TAV=theta(th); printf("avg on current rating=%.3f A",I_TAV); disp("when conduction angle=90"); th=90; I_TAV=theta(th); printf("avg on current rating=%.3f A",I_TAV); disp("when conduction angle=30"); th=150; I_TAV=theta(th); printf("avg on current rating=%.3f A",I_TAV);
f1c5bb924c75d28c95ea3e3603becc8fe9494b6f
449d555969bfd7befe906877abab098c6e63a0e8
/380/CH7/EX7.2/7_2.txt
167c1d07e7ca91339c5727e613c1abc75eda60d9
[]
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
280
txt
7_2.txt
//Caption:Find the pitch factor ///Exa:7.2 clc; clear; close; P=4;//no. of poles S=48;//no. of slots S_p=S/P;//slots per pole S_span=180/S_p;//slot span n=S/(3*P);//no. of coils in phase group C_span=9*S_span;//coil span K_p=sind(C_span/2); disp(K_p,'pitch factor =');
4c58b457cce8e165373fb5377a8cd9a492d17bff
a557f90da8513f81cafd8f65e37e2c0d66449a2f
/Freqres_using_DE.sce
925e1ac9ef6452467b7e7ca9eafa03712b11ed93
[]
no_license
Sahil966121/SCI
484cd77d6247e54fe87d36b4f112965c83ab5d96
cf2921861486a4f2e2e83c3ca813a4e7710d3508
refs/heads/main
2023-03-03T17:43:08.236192
2021-02-03T05:19:43
2021-02-03T05:19:43
324,413,192
0
0
null
null
null
null
UTF-8
Scilab
false
false
301
sce
Freqres_using_DE.sce
clear; clc; close; b=[1]; a=[1 -0.5]; m=0:length(b)-1; p=0:length(a)-1; w=-2*%pi:%pi/100:2*%pi; num=b*exp(-%i*m'*w) den=a*exp(-%i*p'*w) H=num./den; magH=abs(H); angH=atan(imag(H),real(H)); figure; subplot(211),plot2d(w./%pi,magH); xtitle('Magnitude') subplot(212),plot2d(w./%pi,angH); xtitle('Phase')
e6ac666efc9b1b5db6b55f96fba212915197dbca
449d555969bfd7befe906877abab098c6e63a0e8
/1073/CH3/EX3.35/3_35.sce
a6bb9444bb43555b26ae163d50b102a9cd77f8c4
[]
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
781
sce
3_35.sce
clc; clear; //Example 3.35 v=2*10^-5 //[m^2/s] Npr=0.7 //Prandtl number k=0.03 //[W/m.K] D=0.25 //Diameter in [m] L=0.90*D //Characteristic length,let [m] T1=298 //[K] T2=403 //[K] dT=T2-T1 //[K] Tf=(T1+T2)/2 //[K] Beta=1/Tf //[K^-1] A=%pi*(D/2)^2 //Area in[sq m] g=9.81 //[m/s^2] //Case 1: Hot surface facing up Ngr=g*Beta*dT*(L^3)/(v^2) //Grashoff number Nnu=0.15*((Ngr*Npr)^(1.0/3.0)) //Nusselt number h=Nnu*k/L //[W/sq m.K] Q=h*A*dT //[W] printf("\n Heat transferred when hot surface is facing up is %f W\n",Q); //Case 2:For hot surface facing down Nnu=0.27*(Ngr*Npr)^(1.0/4.0); //Grashof Number h=Nnu*k/L //[W/sqm.K] Q=h*A*dT //[W] printf("\n Heat transferred when hot surface is facing down is %f W\n",Q);
77c5ac2c932590575c35233a71062969df51bc76
449d555969bfd7befe906877abab098c6e63a0e8
/1682/CH6/EX6.10/Exa6_10.sce
2d02be671d75406b68ae6d048528d89dc231f498
[]
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,736
sce
Exa6_10.sce
//Exa 6.10 clc; clear; close; //Brand A : disp("Brand A : "); w=12;//in months P=1200;//in Rs/tyre i=12;//in % nominal rate(Compounded anually) i=i/12;//in % compounded monthly //Formula : (A/P,i,n) : ((i/100)*(1+i/100)^n)/(((1+i/100)^n)-1) AE_A=P*((i/100)*(1+i/100)^w)/(((1+i/100)^w)-1);//in RS disp(AE_A,"The annual equivalent for this brand in RS. : "); //Brand B : disp("Brand B : "); w=24;//in months P=1800;//in Rs/tyre i=12;//in % nominal rate(Compounded anually) i=i/12;//in % compounded monthly //Formula : (A/P,i,n) : ((i/100)*(1+i/100)^n)/(((1+i/100)^n)-1) AE_B=P*((i/100)*(1+i/100)^w)/(((1+i/100)^w)-1);//in RS disp(AE_B,"The annual equivalent for this brand in RS. : "); //Brand C : disp("Brand C : "); w=36;//in months P=2100;//in Rs/tyre i=12;//in % nominal rate(Compounded anually) i=i/12;//in % compounded monthly //Formula : (A/P,i,n) : ((i/100)*(1+i/100)^n)/(((1+i/100)^n)-1) AE_C=P*((i/100)*(1+i/100)^w)/(((1+i/100)^w)-1);//in RS disp(AE_C,"The annual equivalent for this brand in RS. : "); //Brand D : disp("Brand D : "); w=48;//in months P=2700;//in Rs/tyre i=12;//in % nominal rate(Compounded anually) i=i/12;//in % compounded monthly //Formula : (A/P,i,n) : ((i/100)*(1+i/100)^n)/(((1+i/100)^n)-1) AE_D=P*((i/100)*(1+i/100)^w)/(((1+i/100)^w)-1);//in RS disp(AE_D,"The annual equivalent for this brand in RS. : "); disp("Here common multiple lives of tyres is considered. This is 144 months. Therefore, the comparison is nade on 144 months basis."); disp("The annual equivalent cost of Brand C is less than that of other brands. hence, it should be used in the vehicles of the trucking company. It should be replaced for times during the 144 months period.");
f8e76828ccd0c1e4b2e72f59c063b5a718e6d266
449d555969bfd7befe906877abab098c6e63a0e8
/1748/CH1/EX1.6.p/prob1_6.sce
c17f755696806422c31b975f6efb18fffa0121b3
[]
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
590
sce
prob1_6.sce
// Prob 1.6 clc; clear; close; format('v',7); // Given data ph=3;//no. of phase P=4;//no. of poles s=36;//no. of slots coilspan=8;//short pitch winding alfa=180/(s/P);//slot pitch in degree m=s/P/ph;//no. of slots per pole per phase Kd=sind(m*alfa/2)/(m*sind(alfa/2));//distribution factor disp(Kd,"Distribution factor : "); coilspan1=s/P;//coil span for full pitch winding s1=coilspan1-coilspan;//no. of slots by which the coil is short pitched Beta=s1*alfa;//angle by which the coil is short pitched in degree Kc=cosd(Beta/2);//pitch factor disp(Kc,"Pitch factor : ");
e8765825e65b69478ff1d21e76a58be6ac5aaa80
449d555969bfd7befe906877abab098c6e63a0e8
/615/CH2/EX2.19/2_19.sce
6cef02b017527683acf3544cef4e3f90c5c2bcd0
[]
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
426
sce
2_19.sce
//acids and bases// //example 2.19// k=1.8*10^-5;//dissociation constant of acetic acid// M=0.01;//molarity of acetic acid// N=M*1;//normality of acetic acid// V=1/N; a=sqrt(k*V)//degree of dissociation for weak acids// printf("degree of dissociation of solution is %f",a); H1=a/V; H=H1/10^-4; printf("\nH+ concentration in solution is %f*10^-4g.ion/lit",H); pH=-log10(H1); printf("\npH of the solution is %f",pH);
3708efb4adf70faedcbccd8805a60c7d327828e1
fa428f297a915e9a041597642bfe29627ab69c42
/app/views/components/listingcard.sce
a4f84c0431fb4a7ad83ddb372b390e68be1b2ef8
[]
no_license
TheBrenny/Web-Dev-and-Security
dff903be92838b14f7126dd1f7092922b86bf2cc
e4abb96dc24e606704b09f5acdd2684d6d5d577d
refs/heads/main
2023-06-17T08:33:35.176024
2021-06-15T05:07:20
2021-06-15T05:07:20
343,603,444
0
0
null
null
null
null
UTF-8
Scilab
false
false
316
sce
listingcard.sce
<a href="/listings/[[item.id]]" class="listing"> <img src="/assets/img/products/[[item.image]]" alt="Listing Image" class="listingImage"> <div class="listingCaption"> <p> [[item.name]] </p> <p type="price"> $[[item.cost]] </p> </div> </a>
f7aeefe362ac005d227f62476521fc2b41ad83b8
449d555969bfd7befe906877abab098c6e63a0e8
/1388/CH6/EX6.10/6_10.sce
424b51f88853bb767fd83aafd14834b4db493252
[]
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
374
sce
6_10.sce
clc //initialisation of variables R= 1.987 //cal/mol K T= 25 //C G1= -193.8 //cal G2= -54.6 //cal G3= -253.1 //cal G4= -253.1 //cal G5= -54.6 //cal G6= -309.7 //cal //CALCULATIONS G= G1+G2-G3 Ph= 10^(-G*10^3/(2.303*R*(273.2+T))) G0= G4+G5-G6 Ph1= 10^(-G0*10^3/(2.303*R*(273.2+T))) p= Ph*100/Ph1 //RESULTS printf (' range of humidity = %.1f percent',p+0.2)
5c98dd71baf0ef7d8e4b80936c9da8cc322a459e
449d555969bfd7befe906877abab098c6e63a0e8
/2732/CH5/EX5.10/Ex5_10.sce
981db26e1323ba75b67d18edc28087eaf2589d1c
[]
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
992
sce
Ex5_10.sce
clc // initialization clear d=10 //cm id=9.99 //cm t=3 //mm E=1.0*10^6 //kg/cm^2 a=2.02*10^-5 // degree/celcius // part(a) Tr=10 //degree C T=(d-id)/id*1/a printf('part(a) \n The sleeve must be heated to %.1f degree C or more for this purpose',T+Tr) //part(b) s_th=a*T*E p=s_th*t*2/(d*10) printf('\n part(b) \n The pressure developed between the rod and sleeve is %d kg/cm^2',p) // part(c) f=0.2 o=10 // overlap: cm A=%pi*d*o F=f*p*A printf('\n part (c) \n The axial force required is %d kg',F) //part (d) // linked to part c T2=20 //degree C a2=1.17*10^-5 // /degree C Ts=(a-a2)*(T2-Tr)*E Ts=s_th-Ts p2=p*Ts/s_th F2=F*Ts/s_th printf('\n part(d)\n The pressure developed between the rod and sleeve is %.1f kg/cm^2',p2) printf('\n The axial force required is %d kg',F2) //part(e) T3=Tr+(s_th/((a-a2)*10^6)) printf('\n part(e) \n The temperature at which the sleeve comes off easily is %.1f C',T3) // calculations in the text: rounding off errors
a857994ca9260df8be58437d543b3f3699faa755
717ddeb7e700373742c617a95e25a2376565112c
/281/CH9/EX9.6/example9_6.sce
a55b3897b5b1f75e9889838c73e52d28b790c620
[]
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
752
sce
example9_6.sce
disp('chapter 9 ex9.6') disp('given') disp('design an astable multivibrator to have a+or-9volt output with frequency f=1kHz') disp('using BIFET op-amp for Vo=+or-9volt') Vo=9 disp('Vcc=+or-(Vo+1)') Vcc=Vo+1 disp('volts',Vcc) disp('select UTP and LTP<Vo') disp('let |UTP|=|LTP|=0.5volt') UTP=0.5 LTP=-0.5 disp('let R2=1Mohm') R2=1*10^(6) disp('I3=(|Vo|-UTP)/R2') I3=(Vo-UTP)/R2 disp('amperes',I3) disp('R3=UTP/I3') R3=UTP/I3 disp('ohms',R3) disp('use 5.6kohm standard value') disp('let C1=0.1*10^(-6)F') C1=0.1*10^(-6) disp('t=1/(2*f)') t=1/(2*f) disp('seconds',t) disp('I1=C1*(UTP-LTP)/t') I1=C1*(UTP-LTP)/t disp('amperes',I1) disp('R1=(Vo-UTP)/I1') R1=(Vo-UTP)/I1 disp('ohms',R1) disp('use 39kohm and3.3kohm in series')
183cabf3113204dfae28fb95a471bd3c067c963a
449d555969bfd7befe906877abab098c6e63a0e8
/3768/CH9/EX9.2/Ex9_2.sce
988b2a60da13da0abb394646d5b8ed712b81b620
[]
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
672
sce
Ex9_2.sce
//Example number 9.2, Page number 203 clc;clear; close; //Variable declaration e=1.6*10**-19; //charge(c) ni=1.5*10**16; //particle density(per m**3) mew_e=0.13; //electron mobility(m**2/Vs) mew_h=0.048; //hole mobility(m**2/Vs) ND=10**23; //density(per m**3) //Calculation sigma_i=ni*e*(mew_e+mew_h); //conductivity(s) sigma=ND*mew_e*e; //conductivity(s) P=ni**2/ND; //equilibrium hole concentration(per m**3) //Result printf("conductivity is %.2e s",sigma_i) printf("\n conductivity is %.3e s",sigma) printf("\n equilibrium hole concentration is %.2e per m^3",P) //answer in the book varies due to rounding off errors
fc2b35a65c2d3297bd7075a767ef06ae0e1584dc
d9e20e3e491ed05049f4f1a44021e96499a581ba
/src/particula.sce
135f9d9a645c893c9beb03785ac4bdb483eff6e7
[]
no_license
josenalde/applied-math
1e13000bec5e92fa828bee3193607cf8a200a604
76a9aab93d69e4be6b564cae72c441bc648444d4
refs/heads/master
2021-01-10T09:21:01.369665
2020-09-21T22:56:42
2020-09-21T22:56:42
46,852,259
3
1
null
null
null
null
UTF-8
Scilab
false
false
1,238
sce
particula.sce
// Derivadas na prática: simulação de fenômeno descrito por equação dif. // Autor: Josenalde Oliveira - Matemática Aplicada II // A velocidade do corpo no tempo é associada à taxa de variação do espaço // percorrido em função do tempo, ou seja, v(t) = ds/dt // Problema: tem-se disponível a relação desta taxa de variação, mas não // sabemos como a partícula se desloca no tempo // Solução: resolver a equação diferencial // intervalo de simulação (integração) h = 0.01; // segundos // amostra inicial - instante discreto: t = k k = 2; tMax = 10; t = 0; // condicao inicial (cm) s(1) = 10; while (t <= tMax) // taxa de variação do espaço percorrido no tempo dsdt = 6*(t^2) -10*t + 3; // taxa de variação do espaço percorrido no tempo s(k) = s(k - 1) + h*(dsdt); // atualizacoes s(k - 1) = s(k); k = k + 1; t = t + h; end // Plotar grafico // vetor do tempo (eixo X) t = 0:h:tMax+h; // Função analítica que descreve o movimento da partícula sreal = 2.*t.^3 - 5.*t.^2 + 3.*t + 4; //plot(t, s); plot(t, s, 'b', t, sreal, 'r'); //legend('Estimado', 'Analítico'); //title('Movimento de uma partícula'); //xlabel('tempo (s)'); //ylabel('cm');
36e67b5132e2860cc7bfcae7777b7b15054d96a9
449d555969bfd7befe906877abab098c6e63a0e8
/323/CH3/EX3.1/ex3_1.sci
3ecc04f03b17385af1329fc258108c29b4265d48
[]
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
98
sci
ex3_1.sci
//Chapter 3,Ex3.1,Pg3.4 clc; Im=15/(sin(2*%pi*3.375*0.001*40)) printf("\n Im=%.0f A \n",Im)
c73d0fd00297d00c855123897ea5c1ecb0fddac6
449d555969bfd7befe906877abab098c6e63a0e8
/2258/CH6/EX6.5/6_5.sce
c15fd6c307a12d4d534642ee65657f7b058fcf3c
[]
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
386
sce
6_5.sce
clc(); clear; // To calculate the capacitance and charge epsilon_0=8.854*10^-12; //f/m A=100; //area in cm^2 A=A*10^-4; //area in m^2 V=100; //potential in V d=1; //plate seperation in cm d=d*10^-2; //plate seperation in m C=(epsilon_0*A)/d; Q=C*V; printf("charge on the plates in F is"); disp(C); printf("charge on the capacitor in coulomb is"); disp(Q);
a9bc807985b41da1cf2efdbb474016be4f50c1c7
449d555969bfd7befe906877abab098c6e63a0e8
/1319/CH3/EX3.3/3_3.sce
7ca2e1e9dee04d8cf00f0d670f59ee72b7838e8c
[]
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
994
sce
3_3.sce
//To determine the potential of the star point and line currents clc; clear; Zr=10*(expm(%i*%pi/6)); Zy=12*(expm(%i*%pi/4)); Zb=15*(expm(%i*2*%pi/9)); V=440; Vph=V/(sqrt(3)); //Phase Voltages Vr=Vph*(expm(%i*0)); Vy=Vph*(expm(%i*-2*%pi/3)); Vb=Vph*(expm(%i*2*%pi/3)); Vs=((Vr/Zr)+(Vy/Zy)+(Vb/Zb))/((1/Zr)+(1/Zy)+(1/Zb)); tvs=atand(imag(Vs)/real(Vs)); // Phase Angle of the star point voltage Ia=(Vr-Vs)/Zr; iat=atand(imag(Ia)/real(Ia)); // Angle of current in phase R Ib=(Vy-Vs)/Zy; ibt=atand(imag(Ib)/real(Ib)); // Angle of current in phase Y Ic=(Vb-Vs)/Zb; ict=atand(imag(Ic)/real(Ic)); // Angle of current in phase B I=Ia+Ib+Ic; I=ceil(real(I)*1000)+%i*(ceil(imag(I)*1000)); printf('The potential of the star point = %g /_%g V \n',abs(Vs),tvs) printf('The line currents are : \n') printf('R phase current = %g /_%g A \n',abs(Ia),iat) printf('Y phase current = %g /_%g A \n',abs(Ib),ibt-180) printf('B phase current = %g /_%g A \n',abs(Ic),ict)
1ab123df393d03c9737cdac56adc26447f994b51
449d555969bfd7befe906877abab098c6e63a0e8
/1658/CH22/EX22.12/Ex22_12.sce
f6fc97b44020362bdbf97c69bf462a3d268f4832
[]
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
158
sce
Ex22_12.sce
clc; //e.g 22.12 RD=100*10**3; gm=1.6*10**-3; rd=44*10**3; Cgs=3*10**-12; Cds=1*10**-12; Cgd=2.8*10**-12; rl=(RD*rd)/(RD+rd); Av=-gm*rl; disp(Av);
9cb0e6152506bdd84c059724b3ad0c406a9c784d
449d555969bfd7befe906877abab098c6e63a0e8
/593/CH14/EX14.4/ex14_4.sce
5b5ff7dad87cd2bb4038b2c662d6ce2debca6136
[]
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,472
sce
ex14_4.sce
clear; //clc(); // Example 14.4 // Page: 382 printf("Example-14.4 Page no.-382\n\n"); //***Data***// T = 300;//[K] Temperature of the centrifuge R = 8.314;//[J/(mol*K)] Universal gas constant // Mole fractions of the two components are y_UF6_238_1 = 0.993; // Mole fraction of UF6 with 238 isotope of uranium in feed y_UF6_235_1 = 0.007;// Mole fraction of UF6 with 235 isotope of uranium in feed M_UF6_238 = 352/1000;//[kg/mol] Molecular weight of UF6 with 238 isotope of uranium M_UF6_235 = 349/1000;//[kg/mol] Molecular weight of UF6 with 235 isotope of uranium r_in = 2/100;//[m] Interanal raddi of the centrifuge r_out = 10/100;//[m] outer raddi of the centrifuge f = 800;//[revolution/second] Rotational frequency of centrifuge // Here the accelaration will come due to centrifugal force and is // g = w^(2)*r , where 'w' is angular speed and its value is w = 2*pie*f and 'r' is radius // But in the present case 'r' is varies as we move away from the axis of centrifuge // After making integration by taking small elements at the distance 'r' we find the expression a = exp((M_UF6_235-M_UF6_238)*(2*3.141592*f)^(2)*(r_out^(2)-r_in^(2))/(2*R*T)); // Now Let the ratio y_i_2/y_i_1 = A // Then we have A = 1/(y_UF6_235_1 + y_UF6_238_1/a); // Now say y_i_1/y_i_2 = 1/A = B , then B = 1/A; printf("The ratio of the mole fraction of UF6 (with uranium 235 isotope) at the 2 cm radius to that at the 10 cm radius is %0.3f",B);
f2578801890b945390b7be4f7ab03ce2782944b9
449d555969bfd7befe906877abab098c6e63a0e8
/2519/CH11/EX11.1/Ex11_1.sce
49f282c625a8ba5959f2654285ae49b306beda59
[]
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
306
sce
Ex11_1.sce
clc clear //Initialization of variables n=1.3 T1=460+60 //R P1=14.7 //psia P2=125 //psia R=1545 M=29 //calculations T2=T1*(P2/P1)^((n-1)/n) wrev=R/M *(T2-T1)/(1-n) //results printf("Work done = %d ft-lbf/lbm",wrev) disp("The answer is a bit different due to rounding off error in textbook")
816b4d5f8906541d48c5294ca28ee7443daa2e01
449d555969bfd7befe906877abab098c6e63a0e8
/2123/CH5/EX5.28/Exa_5_28.sce
c8f1bd5429d8e6104fdbb12b7289c1e8fa24072f
[]
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
384
sce
Exa_5_28.sce
//Example No. 5.28 clc; clear; close; format('v',9); //Given Data : V1=230;//V N=1000;//rpm P=15;//hp Rt=0.2;//ohm Ke=0.03;//V/A-s Kt=0.03;//N-m/A^2 alfa=30;//degree Vm=V1*sqrt(2);//V omega=N*2*%pi/60;//rad/s V=Vm/%pi*(1+cosd(alfa));//V //V=Ke*Ia*omega+Ia*Rt Ia=V/(Ke*omega+Rt);//A disp(Ia,"Motor current in A : "); T=Kt*Ia^2;//N-m disp(T,"Torque in N-m : ");
9de2080f56be78a17f13a06b2451590c785ae55d
b24d354cfcd174c92760535d8b71e22ced005d81
/Signal Processing functions/sfdr.sci
d7821a3b231972a84386852741060f9c8017290a
[]
no_license
shreniknambiar/FOSSEE-Signal-Processing-Toolbox
57ad8e2a71d64f95c4ccfd131e00095cf2b9c6f8
143cf61eff31240870dc0c4f61e32818a4482365
refs/heads/master
2021-01-01T18:25:34.435606
2017-07-25T18:23:47
2017-07-25T18:23:47
98,334,322
0
0
null
2017-07-25T17:48:00
2017-07-25T17:47:59
null
UTF-8
Scilab
false
false
6,264
sci
sfdr.sci
function [varargout]= sfdr(varargin) if(argn(1)<0 | argn(1)>3) then error("Output arguments should lie between 0 and 3"); end if(argn(2)<1 | argn(2)>4) then error("Input arguments should lie between 1 and 4"); end if (~isvector(x) & (type(x) ~=8 | type(x) ~= 1)) then error("x should be a vector of type doule or integer"); end if (~isscalar(fs) & fs<0) then error("fs must be positive scalar"); end if (~isscalar(msd) & msd<0) then error("msd must be positive scalar"); end if(~isvector(sxx) & (type(sxx) ~=8 | type(sxx) ~= 1) & sxx<0) then error("power estimate vector must be non-negative vector of type double or integer"); end if(~isvector(f) & (type(f) ~=8 | type(f) ~= 1)) then error(" f must be a vector of type double or integer"); end if argn(1)==0 then flag=1; else flag=0; end if(argn(2)<2) then x=varargin(1); fs=1; msd=0; [r, spurpow, spurfreq]= timesfdr(x,fs,msd); elseif(argn(2)==2) then x=varargin(1); fs=varargin(2); msd=0; [r, spurpow, spurfreq]= timesfdr(x,fs,msd); elseif(argn(2)==3 & type(varargin(3)~=10)) then x=varargin(1); fs=varargin(2); msd=varargin(3); [r, spurpow, spurfreq]= timesfdr(x,fs,msd); elseif(argn(2) == 3 & strcmpi(varargin(3),'power')) then sxx= varargin(1); f= varargin(2); msd=0; [r, spurpow, spurfreq]= powersfdr(sxx,f,msd); elseif(argn(2)== 4 & strcmpi(varargin(4),'power')) then sxx= varargin(1) ; f= varargin(2); msd= varargin(3); [r, totdistpow]= powersfdr(sxx,f,msd); else error("The valid flag is power"); end endfunction function [r,totdistpow] = timesfdr(flag,x,fs,msd) if max(size(x))==length(x) then x=x(:); end n= length(x); x=x-mean(x); w= window('kr',n,38); rbw= enbw(w,fs); [pxx, f] = periodogram(x,w,n,fs); signalCopy=pxx; pxx(1)= 2*pxx(2); [pfreq,rfreq,ifreq,left,right] = dcremove(pxx,f,rbw,0); pxx(left:right)= 0; dcindex = [left;right]; [pfreq,rfreq,ifreq,left,right] = dcremove(pxx,f,rbw); pxx(left:right)= 0; freqindex = [left;right]; pxx(abs(f-ffreq)<msd) = 0; [s,spurbin] = max(pxx); [pspur, fspur, ispur] = dcremove(pxx, f, rbw, f(spurbin)); r = 10*log10(pfreq/ pspur); spurpow = 10*log10(pspur); spurfreq = fspur; if flag then pfreq = 10*log10(rbw*signalCopy(ifreq)); pspur = 10*log10(rbw*signalCopy((ispur))); ffreq = F(ifund); fspur = F(ispur); plotsfdr(signalCopy,f,rbw,ffreq,pfreq,freqindex,fspur,pspur,dcindex); end endfunction function [leftbin, rightbin] = peakborder(sxx, f, fundfreq, freqbin, msd) leftbin = find(sxx(2:freqbin) < sxx(1:freqbin-1),1,'last'); rightbin = freqbin + find(sxx(freqbin+1:end) > sxx(freqbin:$-1),1,'first')-1; if isempty(leftbin) leftbin = 1; end if isempty(rightbin) rightbin = length(sxx); end leftbinex = find(F <= fundfreq - msd, 1, 'last'); rightbinex = find(fundfreq + msd < f, 1, 'first'); if ~isempty(leftbinex) & leftbinex < leftbin leftbin = leftbinex; end if ~isempty(rightbinex) & rightbinex > rightbin rightbin = rightbinex; end endfunction function[r,spurpow, spurfreq] = powersfdr (flag,sxx,f,msd) if(f(1) ~=0) then error("sxx must be one-sided"); end sigSCopy = sxx; sxx(1) = 2*sxx(1); lastindex = find(sxx(1:$-1)<sxx(2:$),1,'first'); if ~isempty(lastindex) sxx(1:lastindex) = 0; end dcindex = [1; lastindex]; [freqpow, freqbin] = max(sxx); fundfreq = f(freqbin); [leftbin, rightbin] = peakborder(sxx, f, fundfreq, freqbin, msd); sxx(leftbin:rightbin) = 0; freqindex = [leftbin; rightbin]; [spurpow, spurbin] = max(sxx); r = 10*log10(freqpow / spurpow); freqpow = 10*log10(freqpow); spurpow = 10*log10(spurpow); spurfreq = f(spurbin); if flag then plotsfdr(signalCopy,f,1,fundfreq,freqpow,freqindex,spurfreq,spurpow,dcindex); end endfunction function plotsfdr(pxx, f, rbw, ffreq, pfreq, freqindex, fspur, pspur, dcindex) pxx= pxx*rbw; xd= f(freqindex(1):freqindex(2)); yd= 10*log10(pxx(freqindex(1):freqindex(2))); plot(xd,yd,'r'); xd = [f(1:freqindex(1)); %nan; f(freqindex(2):$)]; yd = 10*log10([pxx(1:freqindex(1)); %nan; pxx(freqindex(2):$)]); plot(xd, yd,'g'); xData = F(dcIdx(1):dcIdx(2)); yData = 10*log10(pxx(dcindex(1):dcindex(2))); plot(xd, yd,'b'); endfunction function [power, fr, indextone, indexleft, indexright]= dcremove(pxx, f, rbw, tonefreq) if(f(1)<=tonefreq & tonefreq<=f($)) then [s, indextone] = min(abs(f-tonefreq)); iLeft = max(1,indextone-1); iRight = min(indextone+1,length(pxx)); [s, indexmax] = max(pxx(iLeft:iRight)); indextone = iLeft+indexmax-1; else power = %nan; fr = %nan; indextone = []; indexleft = []; indexright = []; end indexleft = indextone - 1; indexright = indextone + 1; while indexleft > 0 & pxx(indexleft) <= pxx(indexleft+1) indexleft = indexleft - 1; end while indexright <= length(pxx) & pxx(indexright-1) >= pxx(indexright) indexright = indexright + 1; end indexleft = indexleft+1; indexright = indexright-1; ffreq = f(indexleft:indexright); sfreq = pxx(indexleft:indexright); fr = (ffreq.*sfreq) ./ sum(sfreq); if (indexleft<indexright) then power = bandpower(pxx(indexleft:indexright),f(indexleft:indexright),'psd'); elseif 1 < indexright & indexright < length(pxx) power = pxx(indexright) * (f(indexright+1) - f(indexright-1))/2; else power = pxx(indexright) * mean(diff(f)); end if (power < rbw*pxx(indextone)) then power = rbw*pxx(indextone); fr = f(indextone); end endfunction
7fca21db5c75b0d35aeb18db2a89659664e6cf31
449d555969bfd7befe906877abab098c6e63a0e8
/587/CH8/EX8.8/example8_8.sce
21ad7b2ddcd7268883d1e6bb759c4c823a3a47cb
[]
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
975
sce
example8_8.sce
clear; clc; //Example8.8[Heat transfer in the Transition Region] //Given:- xm=0.6;//mass fraction of glycol V=2.6*10^(-4);//Flow rate[m^3/s] d=0.0158;//inside diameter[m] Gr=51770;//grashof number Pr=29.2;//Prandtl number nu=3.12*10^(-6);//[m^2/s] p=1.77;//mu_t/mu_s q=90;//A particular loctaion x with x/d=q //Solution:- Ac=%pi*(d^2)/4; Re=(V/Ac)*d/nu; disp(Re,"Reynolds Number is") //Value of Re lies in transition Region Nu_lam=1.24*(((Re*Pr/q)+(0.025*((Gr*Pr)^(0.75))))^(1/3))*(p^(0.14)); Nu_tur=0.023*(Re^(0.8))*(Pr^0.385)*(q^(-0.0054))*(p^(0.14)); //(a) Nu_tran_a=Nu_lam+((exp((1766-Re)/276)+(Nu_tur^(-0.955)))^(-0.955)); disp(Nu_tran_a,"(a) Nusselt number for re-entrant inlet is") Nu_tran_b=Nu_lam+((exp((2617-Re)/207)+(Nu_tur^(-0.950)))^(-0.950)); disp(Nu_tran_b,"(b) Nusselt number for square edged inlet is") Nu_tran_c=Nu_lam+((exp((6628-Re)/237)+(Nu_tur^(-0.980)))^(-0.980)); disp(Nu_tran_c,"(c) Nusselt number for bell mouth inlet is")
c02c47470c34af016fc1cdcbe32a2f2a454ba1cd
449d555969bfd7befe906877abab098c6e63a0e8
/587/CH5/EX5.6/example5_6.sce
3d27a8876ce2a1b3595cbdce21561691903c1755
[]
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,912
sce
example5_6.sce
clear; clc; //Example5.6[Solar Energy Storage in Trombe Walls] //Given:- hin=10;//[W/m^2] A=3*75;//[m^2] Tin=21;//[degree Celcius] k=0.69;//[W/m.degree Celcius] a=4.44*10^(-7);//diffusivity[m^2/s] kappa=0.77; delx=0.06;//The nodal spacing[m] L=0.3;//Length of wall[m] Tout=0.6,q_solar=360;//Ambient temperature in degree Celcius and Solar Radiation between 7am to 10 am //Solution:- M=(L/delx)+1; disp(M,"No of nodes are") //Stability Criterion del_t=(delx^2)/(3.74*a);//[seconds] disp("s",del_t,"The maximum allowable value of the time step is") //Therefore any step less than del_t can be used to solve this problem,for convinience let's choose delt=900;//[seconds] tao=a*delt/(delx^2); disp(tao,"The mesh Fourier number is") //Initially at 7am or t=0,the temperature of the wall is said to vary linearly between 21 degree Celcius at node 0 and -1 at node 5 //Temp between two neighbouring nodes is temp=(21-(-1))/5;//[degree Celcius] T0_0=Tin; T1_0=T0_0-temp; T2_0=T1_0-temp; T3_0=T2_0-temp; T4_0=T3_0-temp; T5_0=T4_0-temp; T0_1=((1-3.74*tao)*T0_0)+(tao*(2*T1_0+36.5)); T1_1=(tao*(T0_0+T2_0))+(T1_0*(1-(2*tao))); T2_1=(tao*(T1_0+T3_0))+(T2_0*(1-(2*tao))); T3_1=(tao*(T2_0+T4_0))+(T3_0*(1-(2*tao))); T4_1=(tao*(T3_0+T5_0))+(T4_0*(1-(2*tao))); T5_1=(T5_0*(1-(2.70*tao)))+(tao*((2*T4_0)+(0.70*Tout)+(0.134*q_solar))); disp("Nodal temperatures at 7:15am are") disp("degree Celcius",T0_1,"Node0:") disp("degree Celcius",T1_1,"Node1:") disp("degree Celcius",T2_1,"Node2:") disp("degree Celcius",T3_1,"Node3:") disp("degree Celcius",T4_1,"Node4:") disp("degree Celcius",T5_1,"Node5:") Q_wall=hin*A*delt*(((round(T0_1)+T0_0)/2)-Tin);//[J] disp("J",Q_wall,"The amount of heat transfer during the first time step or during the first 15 min period is") //Similarly using values from the table given we can find temperature at various nodes after required time interval
637608967f32f21e36345c58ca5c992518db294f
449d555969bfd7befe906877abab098c6e63a0e8
/3630/CH15/EX15.13/Ex15_13.sce
19edc09fed2fb205beb4de63227d01e53c2768d5
[]
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
Ex15_13.sce
clc; Rf=120000; Rin=1500; AcL=(Rf/Rin)+1; av=1/AcL; AoL=150000; A=1+av*AoL; disp('Feedback factor',A,"A=");//The answers vary due to round off error
f18a36ed93037e19a3d483873fc598850c403479
449d555969bfd7befe906877abab098c6e63a0e8
/3840/CH8/EX8.18/Ex8_18.sce
71888bbc881e0244f5b019e4e1ded9039045b035
[]
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
329
sce
Ex8_18.sce
clear // // // //Variable declaration Vrms=200 //voltage(V) RL=1000 //load resistance(ohm) //Calculation Im=Vrms*sqrt(2)/RL //peak current(A) Idc=2*Im/%pi //average DC current(A) Vdc=int(Idc*RL) //dc voltage(V) x=(Vrms/Vdc)**2 gama=sqrt(x-1)*Vdc //ripple factor(V) //Result
25470f87e4b864a56f687b3c5c4dddea54d5f61a
449d555969bfd7befe906877abab098c6e63a0e8
/575/DEPENDENCIES/8_3_4.sci
405063e0a3c4090b0f5e0cac13330942618f843e
[]
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
37
sci
8_3_4.sci
x=0.6 T1=0 T2=400 ndot=150 //mol/h
ae0610616c0b5e1a334474962ef21bcfe38d82a8
b29e9715ab76b6f89609c32edd36f81a0dcf6a39
/ketpic2escifiles6/Mix.sci
4f06c4378ad42cf7624849c78555fb3535624716
[]
no_license
ketpic/ketcindy-scilab-support
e1646488aa840f86c198818ea518c24a66b71f81
3df21192d25809ce980cd036a5ef9f97b53aa918
refs/heads/master
2021-05-11T11:40:49.725978
2018-01-16T14:02:21
2018-01-16T14:02:21
117,643,554
1
0
null
null
null
null
UTF-8
Scilab
false
false
190
sci
Mix.sci
// 08.05.20 // 08.08.08 // Structure changed // 09.10.11 function M=Mix(varargin) Nargs=length(varargin); M=list(); for I=1:Nargs Da=varargin(I); M(I)=Da; end endfunction
ec4ac92ce82e6c7601e90b90047db66e926fcd61
449d555969bfd7befe906877abab098c6e63a0e8
/2090/CH2/EX2.6/Chapter2_example6.sce
987b51114a7b4bf1abaafd5066c186d6428b7b32
[]
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
674
sce
Chapter2_example6.sce
clc clear //Input data m=30;//The air fuel ratio by mass T1=300;//The temperature of air at the beginning of the compression in K r=16;//The compression ratio CV=42000;//The calorific value of the fuel in kJ/kg g=1.4;//Isentropic index Cp=1.005;//Specific heat at constant prassure in kJ/kgK //Calculations T2=T1*(r^(g-1));//Temperature at point 2 in K T3=[(1/m)*(CV/Cp)]+T2;//Temperature at point 3 in K C=T3/T2;//The cut off ratio n=(1-[(1/r^(g-1))*[((C^g)-1)/(g*(C-1))]])*100;//The ideal efficiency of the engine based on the air standard cycle //Output printf(' The ideal efficiency of the engine based on the air standard cycle = %3.1f percent ',n)
55a5c671920d17b1def263ccff6d978673714182
449d555969bfd7befe906877abab098c6e63a0e8
/2495/CH4/EX4.7.4/Ex4_7_4.sce
58ec167ef5dbe51f717d8345f477b04382678104
[]
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
Ex4_7_4.sce
clear clc XA=0.70; YA=0.35; P=600;//in torr PA=(YA*P)/XA;//vapour pressure of pure A printf('PA=%.1d torr',PA) PB=((1-YA)*P)/(1-XA);//vapour pressure of pure B printf('\nPB=%.1f torr',PB) //page 145
dabead29fe41ab68ca39d0f8efc461b3885e7e90
449d555969bfd7befe906877abab098c6e63a0e8
/174/CH6/EX6.7/example6_7.sce
0442cb27fb7769c4991a9433d38ddaeaeaca3345
[]
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
example6_7.sce
// To find percentage error // Modern Electronic Instrumentation And Measurement Techniques // By Albert D. Helfrick, William D. Cooper // First Edition Second Impression, 2009 // Dorling Kindersly Pvt. Ltd. India // Example 6-7 in Page 163 clear; clc; close; // Given data R = 0.1; //Resistance of the coil in ohm f = 40*10^6; //The frequency at resonance in Hz C = 135*10^-12; //The value of tuning capacitor in F R_i = 0.02; //The value of the insertion resistor in ohm //Calculations w = 2*%pi*f; Q_e = 1/(w*C*R); printf("The effective Q of the coil = %d\n",ceil(Q_e)); Q_i = 1/(w*C*(R+R_i)); printf("The indicated Q of the coil = %d\n",ceil(Q_i)); %error = (Q_e - Q_i)/Q_e*100; printf("The percentage error is = %d %%",ceil(%error)); //Result // The effective Q of the coil = 295 // The indicated Q of the coil = 246 // The percentage error is = 17 %
13a74315e7687f4dcff4d0f6ef4aacb1fe5267c5
449d555969bfd7befe906877abab098c6e63a0e8
/2087/CH5/EX5.9/example5_9.sce
c5bab49fc3f692742a0ea399b89ae3a4ea772543
[]
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
412
sce
example5_9.sce
//example 5.9 //calculate input h.p of pump clc; //given A=20; //area of field H=129; //level to the highest land h1=120.2; //water level in well during discharge Du=800; //duty for rise; eita=0.6; //efficiency of the pump Q=A/Du; w=Q*1000; lift=H-h1; //design lift is taken as 9m wd=w*9; o=wd/75; i=o/eita; mprintf("Input h.p of pump=%i h.p",i);
60afd854a98847d5d1a41194a57c53cbd566d6af
449d555969bfd7befe906877abab098c6e63a0e8
/10/CH1/EX3/cha1_3.sce
44101e047dcff26c97ec021e8145b93f2d0e99f7
[]
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
295
sce
cha1_3.sce
N1=500;I1=10;N2=500;I2=10; Ibafe=3*52*10^-2;A=4*%pi*10^-7; b=1200;Ag=4*10^-4;Ac=4*10^-4; lg=5*10^-3;Ibecore=51.5*10^-2;c=2.067*10^-4; d=4.134*10^-4; F1=N1*I1 F2=N2*I2 Pre=1200*A Rbafe=(Ibafe)/(Pre*Ac) Rg=lg/(A*Ag) Rbecore=Ibecore/(Pre*Ac) Bg=d/(Ag) Hg=Bg/A
3da597e9b3684bff10c3f21480b85f6e176622e3
d4433dc5a6e90f6a26a4c5d9dee686eade240b25
/CMPINF.TST
5ed77458e8c6202717d5257802f80f79ad444c4f
[]
no_license
qb40/all
6e2149ef3c6151717e468ca236840de622cf7d2a
e168acb64fbde09277b04515574507dcbe35161c
refs/heads/master
2022-02-05T17:58:39.207269
2014-01-19T13:28:41
2014-01-19T13:28:41
106,962,623
5
0
null
2017-10-14T21:02:04
2017-10-14T21:02:03
null
UTF-8
Scilab
false
false
1,824
tst
CMPINF.TST
DECLARE FUNCTION peekb$ (addr&) DECLARE FUNCTION peekw$ (addr&) DECLARE FUNCTION peekd$ (addr&) DECLARE FUNCTION tell$ (flag%, bit%) CLS COLOR 15 PRINT "Computer information" PRINT "--------------------" PRINT "" COLOR 14 DEF SEG = &H40 PRINT "COM1 address:"; peekw$(&H0) PRINT "COM2 address:"; peekw$(&H2) PRINT "COM3 address:"; peekw$(&H4) PRINT "COM4 address:"; peekw$(&H6) PRINT "LPT1 address:"; peekw$(&H8) PRINT "LPT2 address:"; peekw$(&HA) PRINT "LPT3 address:"; peekw$(&HC) PRINT "LPT4 address:"; peekw$(&HE) PRINT "" PRINT "Equipment List:" flag% = PEEK(&H10) PRINT "1 IPL diskette"; tell$(flag%, 0) PRINT "2 Math coprocessor"; tell$(flag%, 1) PRINT "3 Pointing device(PS/2)"; tell$(flag%, 2) PRINT "4 Old PC system board RAM < 256K"; tell$(flag%, 3) PRINT "5 Initial video mode"; (flag% AND &H30) \ &H10 PRINT "6 Number of diskette drives"; ((flag% AND &HC0) \ 64) + 1 flag% = PEEK(&H11) PRINT "7 Direct Memory Access(DMA)"; tell$(NOT (flag%), 0) PRINT "8 Number of serial ports"; (flag% AND &HE) \ 2 PRINT "9 Game adapter"; tell$(flag%, 4) PRINT "10 Internal modem(PS/2)"; tell$(flag%, 5) PRINT "11 Number of printer ports"; flag% \ 64 PRINT "" PRINT "PCjr: Infrared keyboard link error count:"; peekb$(&H12) PRINT "Memory Size in KB:"; PEEK(&H13) + CLNG(PEEK(&H14)) * &H100 PRINT "PS/2 BIOS control state:"; peekb$(&H16) FUNCTION peekb$ (addr&) peekb$ = " " + HEX$(PEEK(addr&)) + "h" END FUNCTION FUNCTION peekd$ (addr&) peekd$ = " " + HEX$(PEEK(addr&) + PEEK(addr& + 1) * &H100 + CLNG(PEEK(addr& + 2)) * &H10000 + CLNG(PEEK(addr& + 3)) * &H1000000) + "h" END FUNCTION FUNCTION peekw$ (addr&) peekw$ = " " + HEX$(PEEK(addr&) + CLNG(PEEK(addr& + 1)) * &H100) + "h" END FUNCTION FUNCTION tell$ (flag%, bit%) IF ((flag% AND (2 ^ bit%)) = 1) THEN tell$ = " is present." ELSE tell$ = " is absent." END FUNCTION
e7f7e49b7394853542d996919a01098de071b8d7
449d555969bfd7befe906877abab098c6e63a0e8
/2627/CH1/EX1.6/Ex1_6.sce
afb3a99d459e3d87c7977694b122c212eac10395
[]
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
240
sce
Ex1_6.sce
//Ex 1.6 clc;clear;close; format('v',5); V=12;//V R1=6.8;//ohm R2=4.7;//ohm R3=2.2;//ohm R=1/(1/R1+1/R2+1/R3);//ohm(Effective resistance) I=V/R;//A(Supply current) disp(R,"Effective resistance(ohm)") disp(I,"Supply current(A)");
81152c8ca5a2cec031f7ae528ff6df395f9bfa98
d465fcea94a1198464d7f8a912244e8a6dcf41f9
/system/kiks_draw_robot.sci
1eb339cf8e3020c9bc57408d13d5532401fa59c1
[]
no_license
manasdas17/kiks-scilab
4f4064ed7619cad9e2117a6c0040a51056c938ee
37dc68914547c9d0f423008d44e973ba296de67b
refs/heads/master
2021-01-15T14:18:21.918789
2009-05-11T05:43:11
2009-05-11T05:43:11
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
9,804
sci
kiks_draw_robot.sci
function [] = kiks_draw_robot(id) // Display mode mode(0); // Display warning for floating point exception ieee(1); // ----------------------------------------------------- // (c) 2000-2004 Theodor Storm <theodor@tstorm.se> // http://www.tstorm.se // ----------------------------------------------------- global("KIKS_FIRE_HDL","KIKS_GRIPPER_L_HDL","KIKS_GRIPPER_R_HDL","KIKS_GRIPPER_HDL","KIKS_MMPERPIXEL","KIKS_NR_HDL","KIKS_LINVIS_GR_HDL","KIKS_LINVIS_HDL","KIKS_ROBOT_MATRIX","KIKS_RBT_BODY","KIKS_RBT_LAMP","KIKS_RBT_DIOD","KIKS_RBT_HDL","KIKS_RBTSENS_HDL","KIKS_RBTWHL_HDL","KIKS_RBTLMP_HDL","KIKS_RBTDIOD_HDL","KIKS_WALL_WIDTH","KIKS_WALL_RENDER","KIKS_PROX_DIR","KIKS_PROX_ANG"); global("KIKS_ROBOT_DATA","KIKS_GRIPPER_ACTIVE","KIKS_GRIPPER_XCOORD","KIKS_GRIPPER_YCOORD","KIKS_GRIPPER_GRP_XCOORD","KIKS_GRIPPER_GRP_YCOORD"); KIKS_WALL_WIDTH_SCALED = mtlb_double(KIKS_WALL_WIDTH)/mtlb_double(KIKS_MMPERPIXEL); KIKS_WALL_RENDER_SCALED = mtlb_double(KIKS_WALL_RENDER)/mtlb_double(KIKS_MMPERPIXEL); // !! L.13: Matlab function set not yet converted, original calling sequence used // L.13: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_FIRE_HDL,1),"Visible","off"); kx = mtlb_double(KIKS_ROBOT_MATRIX(id,1,1))/mtlb_double(KIKS_MMPERPIXEL); ky = mtlb_double(KIKS_ROBOT_MATRIX(id,1,2))/mtlb_double(KIKS_MMPERPIXEL); if isempty(KIKS_GRIPPER_ACTIVE) then // !! L.19: Matlab function set not yet converted, original calling sequence used // L.19: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_RBT_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a((mtlb_double(KIKS_ROBOT_DATA(2,2))/mtlb_double(KIKS_MMPERPIXEL))*mtlb_double(KIKS_RBT_BODY(1,:)),kx),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a((mtlb_double(KIKS_ROBOT_DATA(2,2))/mtlb_double(KIKS_MMPERPIXEL))*mtlb_double(KIKS_RBT_BODY(2,:)),ky),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); else // !! L.21: Matlab function set not yet converted, original calling sequence used // L.21: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_RBT_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,mtlb_double(KIKS_RBT_BODY(1,:))*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-mtlb_double(KIKS_RBT_BODY(2,:))*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,mtlb_double(KIKS_RBT_BODY(1,:))*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+mtlb_double(KIKS_RBT_BODY(2,:))*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); end; r = mtlb_s(mtlb_double(KIKS_ROBOT_DATA(2,2)),2); q = mtlb_min(1,mtlb_double(KIKS_ROBOT_DATA(2,2))/29); prox_xvals = mtlb_a((r/mtlb_double(KIKS_MMPERPIXEL))*cos(mtlb_s(mtlb_double(KIKS_PROX_ANG),mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),mtlb_double(KIKS_ROBOT_MATRIX(id,1,1))/mtlb_double(KIKS_MMPERPIXEL)); prox_yvals = mtlb_a((r/mtlb_double(KIKS_MMPERPIXEL))*sin(mtlb_s(mtlb_double(KIKS_PROX_ANG),mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),mtlb_double(KIKS_ROBOT_MATRIX(id,1,2))/mtlb_double(KIKS_MMPERPIXEL)); prox_dirs = mtlb_a(mtlb_double(KIKS_PROX_DIR),mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))); prox_xcord = [1,1,-2,-2]/mtlb_double(KIKS_MMPERPIXEL); prox_ycord = [3,-3,-3,3]/mtlb_double(KIKS_MMPERPIXEL); [tmp,sensors] = size(prox_xvals); for sens = 1:sensors num = 0; pos_x = prox_xvals(sens); pos_y = prox_yvals(sens); coss = cos(-prox_dirs(sens)); sins = sin(-prox_dirs(sens)); // !! L.42: Matlab function set not yet converted, original calling sequence used // L.42: Name conflict: function name changed from set to %set %set(KIKS_RBTSENS_HDL(id,sens),"xdata",mtlb_a(mtlb_s(mtlb_a(mtlb_s(prox_xcord*coss,prox_ycord*sins),pos_x),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(mtlb_a(prox_xcord*sins,prox_ycord*coss),pos_y),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); end; if ~isempty(KIKS_GRIPPER_ACTIVE) then // !! L.45: Matlab function set not yet converted, original calling sequence used // L.45: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_GRIPPER_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,mtlb_double(KIKS_GRIPPER_XCOORD)*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-mtlb_double(KIKS_GRIPPER_YCOORD)*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,mtlb_double(KIKS_GRIPPER_XCOORD)*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+mtlb_double(KIKS_GRIPPER_YCOORD)*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); // !! L.46: Matlab function set not yet converted, original calling sequence used // L.46: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_GRIPPER_L_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,mtlb_double(KIKS_GRIPPER_GRP_XCOORD)*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-mtlb_double(KIKS_GRIPPER_GRP_YCOORD)*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,mtlb_double(KIKS_GRIPPER_GRP_XCOORD)*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+mtlb_double(KIKS_GRIPPER_GRP_YCOORD)*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); // !! L.47: Matlab function set not yet converted, original calling sequence used // L.47: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_GRIPPER_R_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,mtlb_double(KIKS_GRIPPER_GRP_XCOORD)*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-(-mtlb_double(KIKS_GRIPPER_GRP_YCOORD))*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,mtlb_double(KIKS_GRIPPER_GRP_XCOORD)*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+(-mtlb_double(KIKS_GRIPPER_GRP_YCOORD))*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); end; cam_xcoord = [-10*q,10*q,10*q,-10*q]/mtlb_double(KIKS_MMPERPIXEL); cam_ycoord = [-10*q,-10*q,10*q,10*q]/mtlb_double(KIKS_MMPERPIXEL); // !! L.52: Matlab function set not yet converted, original calling sequence used // L.52: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_LINVIS_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,cam_xcoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-cam_ycoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,cam_xcoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+cam_ycoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); gr_xcoord = [-20*q,-10*q,-10*q,-20*q]/mtlb_double(KIKS_MMPERPIXEL); gr_ycoord = [-8*q,-8*q,8*q,8*q]/mtlb_double(KIKS_MMPERPIXEL); // !! L.56: Matlab function set not yet converted, original calling sequence used // L.56: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_LINVIS_GR_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(kx,gr_xcoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-gr_ycoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(ky,gr_xcoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+gr_ycoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); inner = mtlb_s(floor(mtlb_double(KIKS_ROBOT_DATA(2,1))/2),2); outer = ceil(mtlb_double(KIKS_ROBOT_DATA(2,1))/2); whl_xcoord = [0,-7,-7,7,7,0,0,7,7,-7,-7,0]/mtlb_double(KIKS_MMPERPIXEL); whl_ycoord = [-inner,-inner,-outer,-outer,-inner,-inner,inner,inner,outer,outer,inner,inner]/mtlb_double(KIKS_MMPERPIXEL); // !! L.62: Matlab function set not yet converted, original calling sequence used // L.62: Name conflict: function name changed from set to %set %set(mtlb_e(KIKS_RBTWHL_HDL,id),"xdata",mtlb_a(mtlb_s(mtlb_a(whl_xcoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))-whl_ycoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))),kx),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(whl_xcoord*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3)))+whl_ycoord*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))),ky),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); // !! L.64: Matlab function set not yet converted, original calling sequence used // L.64: Name conflict: function name changed from set to %set %set(KIKS_RBTDIOD_HDL(id,1),"xdata",mtlb_a(mtlb_s(mtlb_a(mtlb_a(((22*q)/mtlb_double(KIKS_MMPERPIXEL))*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))+%pi/6),mtlb_double(KIKS_RBT_DIOD(1,:))),kx),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(mtlb_a(((22*q)/mtlb_double(KIKS_MMPERPIXEL))*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))+%pi/6),mtlb_double(KIKS_RBT_DIOD(2,:))),ky),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); // !! L.65: Matlab function set not yet converted, original calling sequence used // L.65: Name conflict: function name changed from set to %set %set(KIKS_RBTDIOD_HDL(id,2),"xdata",mtlb_a(mtlb_s(mtlb_a(mtlb_a(((22*q)/mtlb_double(KIKS_MMPERPIXEL))*cos(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))+%pi/6+%pi/12),mtlb_double(KIKS_RBT_DIOD(1,:))),kx),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED)),"ydata",mtlb_a(mtlb_s(mtlb_a(mtlb_a(((22*q)/mtlb_double(KIKS_MMPERPIXEL))*sin(-mtlb_double(KIKS_ROBOT_MATRIX(id,1,3))+%pi/6+%pi/12),mtlb_double(KIKS_RBT_DIOD(2,:))),ky),floor(KIKS_WALL_WIDTH_SCALED)),floor(KIKS_WALL_RENDER_SCALED))); endfunction
bc02be514aa8678e2c0ea0121d66ef4b4220fdd0
449d555969bfd7befe906877abab098c6e63a0e8
/1436/CH8/EX8.10/ex8_10.sce
4974a6579fa176496eb695fa9f8a79f3c4a4b5a2
[]
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
345
sce
ex8_10.sce
//Example 8.10, page no-512 clear clc R=0.15*10/50 K=1 tow=15 deg=K*R*tow //(i) a=15-deg printf("(i)The actual temperature when instrument reads 15°C is %.2f°C\n The true temperature at 5000 metres = %.2f ",a,a) //(ii) alt_red=deg*50/0.15 h=5000-alt_red printf("\n(ii)\nThe true altitude at which 15°C occurs is %d metres",h)
8ceaffb92d3e787d80ae7c3376fa9928861d8615
449d555969bfd7befe906877abab098c6e63a0e8
/2660/CH2/EX2.3/Ex2_3.sce
eef39fa58e4720263696216e1e6af6558991c333
[]
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
294
sce
Ex2_3.sce
clc K = 1.20 // die-opening factor L = 37.5 // Length of strip in cm T = 2.5 // thickness of strip in mm sigma_ut = 630 // tensile strength in N/mm^2 W = 16*T // width of die opening in mm F = (K*L*10*sigma_ut*T^2)/W // bending force in N printf("\n bending force = %0.1f KN" , F/1000)
a49609b7cc8ff21e9ed97863907fb87b10e8b6c7
449d555969bfd7befe906877abab098c6e63a0e8
/1964/CH1/EX1.33/ex1_33.sce
ec6b2bede4ffc46d5207dcd50c7faf780f648ba6
[]
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
994
sce
ex1_33.sce
//Chapter-1, Example 1.33, Page 46 //============================================================================= clc; clear; //INPUT DATA V1=25;//supply voltage1 of battery in volts V2=45;//supply voltage2 of battery in volts R1=6;//resistance1 in ohms R3=4;//resistance2 in ohms R2=3;//resistance3 in ohms //let I1 be the current in loop1 and I2 current be in loop2 //CALCULATIONS //V1=((R1+R3)*(I1)-(R3*I2));//applying KVL in loop1 -------------eqn(1) //V2=((R3)*(I1)-(R2+R3)*(I2));//applying KVL in loop2 -------------eqn(2) //solving both eqn(1) and eqn(2) [a]=[(R1+R3),-R3;(R3),-(R2+R3)] [b]=[V1;-V2] [c]=inv(a)*(b)//ax=b c1=c(1);//c1 is current in branch FABC measured in A c2=c(2);//c2 is current in branch CDEF measured in A c3=c1-c2;//current in branch CF in A //OUTPUT mprintf("Current in R1 is %1.4f A \n current in R2 is %2.3f A \n current in R3 is %1.3f A\n ",c1,c2,c3); //=================================END OF PROGRAM==============================
64f1aa9ad6555cdfd30dd4653a0d5b88bb60cac8
e2ae697563b1b764d79ea1933b555ab0d5e3849c
/macros/buildmacros.sce
381e418105a049215009627996780e1045ef3299
[]
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
570
sce
buildmacros.sce
// Copyright (C) 2012 - Michael Baudin // Copyright (C) 2008-2009 - INRIA - Michael Baudin // // This file must be used under the terms of the CeCILL. // This source file is licensed as described in the file COPYING, which // you should have received as part of this distribution. The terms // are also available at // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt // function buildMacros() macros_path = get_absolute_file_path("buildmacros.sce"); tbx_build_macros(TOOLBOX_NAME, macros_path); endfunction buildMacros(); clear buildMacros;
f411e491585abd2a72bb2d091c9179068d0d5d18
449d555969bfd7befe906877abab098c6e63a0e8
/3830/CH1/EX1.32/Ex1_32.sce
294e5520b7cce34bce786af4c93fe871302db92b
[]
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
424
sce
Ex1_32.sce
// Exa 1.32 clc; clear; // Given E = 1.2 * 10^4 ; // Phosphor Young's Modulus (kg per mm^2) l = 400; // Length of strip (mm) w = 0.5; // Width of strip (mm) t = 0.08; // Thickness of strip (mm) Theta = 90; // In degrees // Solution T = (E*w*t^2)/(12*l); printf('By using the torque formula having E as youngs modulus, we get T = %.3f kg-mm \n',T); //The answer provided in the textbook is wrong
db41d14d14b45417b34541a50a37929c39be67b2
449d555969bfd7befe906877abab098c6e63a0e8
/3754/CH9/EX9.4/9_4.sce
4ac1516631861f6c7a21912e02037b9b340129c1
[]
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
366
sce
9_4.sce
clear// //Variables VS = 12.0 //Source Voltage (in volts) VT = 10.0 //Terminal Voltage (in volts) RL = 10.0 //Load resistance (in ohm) //Calculation RS = RL*(VS / VT - 1) //Internal Resistance (in ohm) //Result printf("\n The internal resistance of the source is %0.3f ohm.",RS)
2407a1c86c27961c99cec42a01b506f197d96990
449d555969bfd7befe906877abab098c6e63a0e8
/1244/CH9/EX9.13/Example913.sce
4eaaba1d5d6a9dc59f5ef6512c38db3b1f924f32
[]
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,369
sce
Example913.sce
// Display mode mode(0); // Display warning for floating point exception ieee(1); clc; disp("Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 9 Example # 9.13 ") // Provide all given inputs and constants of the problem SIGMA = 0.0000000567;// Stefan-Boltzmann constant (W m^2 K^4) //all F(I,J) are shape factor F(1,1) = 0; F(1,2) = 0.853; F(1,3) = 0.147; F(2,1) = 0.372; F(2,2) = 0.498; F(2,3) = 0.13; F(3,1) = 0.333; F(3,2) = 0.667; F(3,3) = 0; //Area(1)=R1^2*pi in m2 AR(1,1) = 9*%pi; //ESP are total hemispheric emissivity in W/m2 ESP(1,1) = 0.6; ESP(1,3) = 0.9; //Heat exchange in W Q1 = 300000; //Temperature in degree K T(1,3) = 600; //EB blackbody emissive powers in W/m2 EB(1,3) = SIGMA*(T(3)^4); // Evaluate elements of coefficient matrix A(1,1) = 1-F(1,1); A(1,2) = -F(1,2); A(1,3) = -F(1,3); A(2,1) = -F(2,1); A(2,2) = 1-F(2,2); A(2,3) = -F(2,3); A(3,1) = 0; A(3,2) = 0; A(3,3) = 1; // Evaluate elements of right hand side matrix B(1,1) = Q1/AR(1); B(1,2) = 0; B(3) = EB(3); // solve the system of equations for X X = inv(A)*B'; //Required temperature in degree K T(1) = ((X(1)+(Q1*(1-ESP(1)))/(AR(1)*ESP(1)))/SIGMA)^0.25; //solution for temperatures disp("Temperature of surface 1 for the cone in degree K") T1 = T(1)//Value for the required temperature in K
cb08ad447179638429aa34c3e8a3510cd19d536a
449d555969bfd7befe906877abab098c6e63a0e8
/1529/CH21/EX21.19/21_19.sce
9fdf0a437dbb6e97c49bd0c7d9ab03bcffa32bc3
[]
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,303
sce
21_19.sce
//Chapter 21, Problem 19 clc k=400000 //transformer rating v1=5000 //primary current v2=320 //secondary current r1=0.5 //resistance in ohm r2=0.001 //resistance in ohm lfe=2500 //iron loss pf=0.85 //power factor i1=k/v1 //primary current i2=k/v2 //secondary current lcu=(i1^2*r1)+(i2^2*r2) //total copper loss lt=lcu+lfe //total loss pt=k*pf //total output power pi=pt+lt //input power n=(1-(lt/pi))*100 //efficiency lc=lcu*(1/2)^2 //total copper loss at half load lh=lc+lfe //total loss at half loss ph0=(1/2)*pt //output power at half load phi=(ph0+lh) //input power at half load n1=(1-(lh/phi))*100 //efficiency printf("(a) Efficiency on full load = %.3f percent\n\n",n) printf("(b) Efficiency at half load = %.3f percent\n\n",n1)
9f88c65e0c7484832ca830dbdcfee32c372b0286
449d555969bfd7befe906877abab098c6e63a0e8
/2672/CH1/EX1.50/Ex1_50.sce
25ec3958c00c569e2b0fafab85d90e82054f4e4a
[]
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
678
sce
Ex1_50.sce
//Example 1_50 clc; clear; close; format('v',5); //given data : I=8;//A I4=6;//A R1=3;//ohm R2=2;//ohm R3=4;//ohm //Applying KCL//I=I1+I2 //I=V1/R1+V1/R2-V2/R2//eqn(1) A1=[1/R1+1/R2 -1/R2];//Coefficient Matrix B1=[I];//Coefficient Matrix //Applying KCL//I2=I3+I4 //V1/R2-V2/R2-V2/R3=I4//eqn(2) A2=[1/R2 -1/R2-1/R3];//Coefficient Matrix B2=[I4];//Coefficient Matrix A=[A1;A2];//Coefficient Matrix B=[B1;B2];//Coefficient Matrix X=A^-1*B;//solution Matrix V1=X(1);//V V2=X(2);//V I1=V1/R1;//A I2=V1/R2-V2/R2;//A I3=(V2)/R3;//A disp("Current in various branches are : "); disp(I1,"Current I1(A)"); disp(I2,"Current I2(A)"); disp(I3,"Current I3(A)");
3089eb0aedecb38924aa4b04e3c74da21c303109
449d555969bfd7befe906877abab098c6e63a0e8
/548/DEPENDENCIES/9_05data.sci
a1afc814bdcd422048d19fea3a94e8e7e95e6398
[]
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
874
sci
9_05data.sci
Mt=5000;//total mass(Kg) for both the rocket Isp=350;//specific impulse (s)for both rocket g=9.8; //for the single stage rocket: Ms=500;//structural mass(Kg) Mp=4450;//propellent mass(Kg) Ml=50;//payload mass(Kg) Mi=Ms+Mp+Ml;//initial mas(Kg) Mf=Ms+Ml;//final mass(Kg) Vb=g*Isp*log(Mi/Mf)//burnout velocity(m/s) //for the double-stage Rocket Ms1=400;//structural mass (Kg)of first stage Mp1=3450;//propellent mass(Kg)of first stage Ms2=100;//structural mass (Kg)of second stage Mp2=1000;//propellent mass(Kg)of second stage Ml=50;//payload mass(Kg) Mi2=Ms1+Mp1+Ms2+Mp2+Ml;//initial mas(Kg) Mf2=Ms1+Ms2+Ml;//final mass(Kg) //burnout velocity(m/s) of the first stage: Vb1=g*Isp*log((Mp1+Ms1+Mp2+Ms2+Ml)/(Ms1+Mp2+Ms2+Ml)) //increase in velocity by second stage DVb: DVb=g*Isp*log((Mp2+Ms2+Ml)/(Ms2+Ml)) //velocity at burnout of second stage Vb2=Vb1+DVb
c7d5a44b70ee3c7f5c1f87b6181232e757e22a46
449d555969bfd7befe906877abab098c6e63a0e8
/2780/CH7/EX7.16/Ex7_16.sce
2ec858d230e827d3f18b9b276c61289a1e72efe1
[]
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
267
sce
Ex7_16.sce
clc //to calculate uncertainity in the energy h=6.63*10^-34 //plank's constant in J-s delt=2.5*10^-14 //uncertainity in time in s delE=h/(2*%pi*delt*1.6*10^-19) disp("minimum error with which the energy of the state can be measured is delE="+string(delE)+"ev")
317a2b95f39336838c7d6ef0e617f388b0b46264
449d555969bfd7befe906877abab098c6e63a0e8
/647/CH1/EX1.2/Example1_2.sce
90116befdbad283d953d76a972aa6e34e0a3b9ec
[]
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
424
sce
Example1_2.sce
clear; clc; // Example: 1.2 // Page: 5 // Solution printf("Example: 1.2 - Page: 5\n\n"); //*****Data*****// m1 = 1.5;// [mass of the body, kg] m2 = 6*10^(24);// [mass of the Earth, kg] G = 6.672*10^(-11);// [N.square m/square.kg] r = 6000*10^(3);// [m] //************// // According to Newton's universal law of gravity: F = G*m1*m2/r^2;// [N] printf("Gravitational force on the body is %.2f N\n",F);
ffc121667c9c39abe94d0d58ec012b7c38249ad1
d465fcea94a1198464d7f8a912244e8a6dcf41f9
/system/kiks_gui.sci
06d4990cf347484cb3fb8552d7b204efdb29592a
[]
no_license
manasdas17/kiks-scilab
4f4064ed7619cad9e2117a6c0040a51056c938ee
37dc68914547c9d0f423008d44e973ba296de67b
refs/heads/master
2021-01-15T14:18:21.918789
2009-05-11T05:43:11
2009-05-11T05:43:11
null
0
0
null
null
null
null
UTF-8
Scilab
false
false
34,534
sci
kiks_gui.sci
function [fig] = kiks_gui() // Ouput variables initialisation (not found in input variables) fig=[]; // Number of arguments in function call [%nargout,%nargin] = argn(0) // Display mode mode(0); // Display warning for floating point exception ieee(1); // ----------------------------------------------------- // (c) 2000-2004 Theodor Storm <theodor@tstorm.se> // http://www.tstorm.se // ----------------------------------------------------- global("KIKS_GUI_COLOR") loadmatfile("system" + filesep() + "kiks_gui") yadd = 24; // ! L.30: mtlb(mat0) can be replaced by mat0() or mat0 whether mat0 is an M-file or not. // !! L.30: Matlab function figure not yet converted, original calling sequence used. //h0 = figure("CloseRequestFcn","kiks_quit","DoubleBuffer","on","Color",[0,0,0],"Colormap",mtlb(mat0),"FileName","C:\sandbox\kiks\system\kiks_gui.m","Name","KiKS","NumberTitle","off","PaperPosition",[18,180,616,452],"PaperUnits","points","Position",[4,210,147,673+yadd],"RendererMode","manual","Menu","none","KeypressFcn","kiks_matlab_focus","ResizeFcn","kiks_gui_resize","Tag","KiKS","ToolBar","none","Visible","off","WindowButtonDownFcn","kiks_mouse_moveobj down","WindowButtonUpFcn","kiks_mouse_moveobj up"); h0 = figure("event_handler","kiks_gui_eventhandler",'event_handler_enable','on',"DoubleBuffer","on","Color",[0,0,0],"Colormap",mtlb(mat0),"FileName","C:\sandbox\kiks\system\kiks_gui.m","Name","KiKS","NumberTitle","off","PaperPosition",[18,180,616,452],"PaperUnits","points","Position",[4,210,147,673+yadd],"RendererMode","manual","Menu","none","KeypressFcn","kiks_matlab_focus","ResizeFcn","kiks_gui_resize","Tag","KiKS","ToolBar","none","Visible","off","WindowButtonDownFcn","kiks_mouse_moveobj down","WindowButtonUpFcn","kiks_mouse_moveobj up"); // !! L.37: Matlab function uicontrol not yet converted, original calling sequence used. // L.37: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[3,92,143,356],"Style","frame","Tag","Frame1");// !! L.43: Matlab function uicontrol not yet converted, original calling sequence used. // L.43: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[3,448,143,94],"Style","frame","Tag","kiksnet_frame"); // !! L.50: Matlab function uicontrol not yet converted, original calling sequence used. // L.50: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_gui_vis2dtoggle","ListboxTop",0,"Position",[4,92,142,20],"String","enable visualization","Tag","toggle2dvis"); // !! L.59: Matlab function uicontrol not yet converted, original calling sequence used. // L.59: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontName","verdana","FontWeight","bold","ListboxTop",0,"Position",[5,431,140,13],"String","simulation","Style","text","Tag","StaticText1"); // !! L.66: Matlab function uicontrol not yet converted, original calling sequence used. // L.66: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,163,140,13],"String","interpolation limit","Style","text","Tag","text_interpolation_limit"); // ! L.75: mtlb(mat1) can be replaced by mat1() or mat1 whether mat1 is an M-file or not. // !! L.75: Matlab function uicontrol not yet converted, original calling sequence used. // L.75: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat1)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_getlimitlistbox","ListboxTop",0,"Position",[5,143,140,20],"String",options,"Style","popupmenu","Tag","limit_popup","Value",4); // ! L.84: mtlb(mat2) can be replaced by mat2() or mat2 whether mat2 is an M-file or not. // !! L.84: Matlab function uicontrol not yet converted, original calling sequence used. // L.84: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat2)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_gettimescale","ListboxTop",0,"Position",[5,283,140,20],"String",options,"Style","popupmenu","Tag","timescale_popup","Value",2); // ! L.93: mtlb(mat3) can be replaced by mat3() or mat3 whether mat3 is an M-file or not. // !! L.93: Matlab function uicontrol not yet converted, original calling sequence used. // L.93: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat3)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_getstatlistbox","ListboxTop",0,"Position",[5,182,140,20],"String",options,"Style","popupmenu","Tag","stat_popup","Value",4); // !! L.100: Matlab function uicontrol not yet converted, original calling sequence used. // L.100: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,202,140,13],"String","movement limit","Style","text","Tag","text_movement_limit"); // !! L.106: Matlab function uicontrol not yet converted, original calling sequence used. // L.106: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[3,598,143,75],"Style","frame","Tag","arena_frame"); // !! L.115: Matlab function uicontrol not yet converted, original calling sequence used. // L.115: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontName","verdana","FontWeight","bold","ListboxTop",0,"Position",[6,660,138,11],"String","arena","Style","text","Tag","StaticText_arena"); // !! L.123: Matlab function uicontrol not yet converted, original calling sequence used. // L.123: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_arena_window_clear","Enable","off","ListboxTop",0,"Position",[75,112,71,20],"String","redraw","Tag","arena_redraw"); // !! L.130: Matlab function uicontrol not yet converted, original calling sequence used. // L.130: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,344,140,13],"String","simulated robot","Style","text","Tag","StaticText99"); // !! L.139: Matlab function uicontrol not yet converted, original calling sequence used. // L.139: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(makecell([1,1]," ")), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_simulaterobot","ListboxTop",0,"Position",[5,324,140,20],"String",options,"Style","popupmenu","Tag","simulate_popup","Value",1); // !! L.146: Matlab function uicontrol not yet converted, original calling sequence used. // L.146: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,303,140,13],"String","time mode","Style","text","Tag","text_time_mode"); // !! L.153: Matlab function uicontrol not yet converted, original calling sequence used. // L.153: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_arena_new;","ListboxTop",0,"Position",[4,638,71,20],"String","new","Tag","arena_new"); // !! L.160: Matlab function uicontrol not yet converted, original calling sequence used. // L.160: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_arena_edit;","ListboxTop",0,"Position",[75,638,71,20],"String","edit","Tag","arena_edit"); // !! L.168: Matlab function uicontrol not yet converted, original calling sequence used. // L.168: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_arena_edit_mode;","ListboxTop",0,"Position",[4,618,142,20],"String","mode: draw","Tag","arena_edit_mode","visible","off"); // !! L.175: Matlab function uicontrol not yet converted, original calling sequence used. // L.175: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_load;","ListboxTop",0,"Position",[4,618,71,20],"String","load","Tag","arena_load"); // !! L.182: Matlab function uicontrol not yet converted, original calling sequence used. // L.182: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_save;","ListboxTop",0,"Position",[75,618,71,20],"String","save","Tag","arena_save"); // !! L.189: Matlab function uicontrol not yet converted, original calling sequence used. // L.189: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_reset;","ListboxTop",0,"Position",[4,598,71,20],"String","reset","Tag","arena_reset"); // !! L.196: Matlab function uicontrol not yet converted, original calling sequence used. // L.196: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_checkpoint;","ListboxTop",0,"Position",[75,598,71,20],"String","checkpoint","Tag","arena_checkpoint");// !! L.208: Matlab function uicontrol not yet converted, original calling sequence used. // L.208: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","v=get(gco,''Value''); set(gco,''BackgroundColor'',[v/255, v/255, v/255])","Enable","on","ListboxTop",0,"Max",255,"Min",1,"Position",[4,598,142,20],"Style","slider","Tag","arena_color_slider","Value",255,"Visible","off");// !! L.214: Matlab function uicontrol not yet converted, original calling sequence used. // L.214: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[3,543,143,55],"Style","frame","Tag","Frame1"); // !! L.223: Matlab function uicontrol not yet converted, original calling sequence used. // L.223: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontName","verdana","FontWeight","bold","ListboxTop",0,"Position",[5,583,140,14],"String","objects","Style","text","Tag","StaticText2"); // !! L.230: Matlab function uicontrol not yet converted, original calling sequence used. // L.230: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_spawn_object","ListboxTop",0,"Position",[75,562,71,20],"String","add","Tag","addobj"); // !! L.238: Matlab function uicontrol not yet converted, original calling sequence used. // L.238: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_delete_object(10,1)","Enable","off","ListboxTop",0,"Position",[4,542,142,20],"String","delete selected","Tag","deleteobj"); // ! L.246: mtlb(mat4) can be replaced by mat4() or mat4 whether mat4 is an M-file or not. // !! L.246: Matlab function uicontrol not yet converted, original calling sequence used. // L.246: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat4)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[4,562,71,20],"String",options,"Style","popupmenu","Tag","objpopup","Value",1); // !! L.254: Matlab function uicontrol not yet converted, original calling sequence used. // L.254: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_stepsim","Enable","off","ListboxTop",0,"Position",[111,410,35,20],"String","| | >","Tag","stepsim"); // !! L.262: Matlab function uicontrol not yet converted, original calling sequence used. // L.262: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_arena_window_grid","Enable","off","ListboxTop",0,"Position",[4,112,71,20],"String","grid","Tag","arena_grid"); //h1 = uicontrol('Parent',h0,'BackgroundColor',KIKS_GUI_COLOR,'Callback','kiks_gui_ixprox','Enable','off','HorizontalAlignment','left','ListboxTop',0,'Position',[6,120,15,15],'Style','checkbox','Tag','indexprox_chk','Value',1); // ! L.281: mtlb(mat5) can be replaced by mat5() or mat5 whether mat5 is an M-file or not. // !! L.281: Matlab function uicontrol not yet converted, original calling sequence used. // L.281: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat5)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_getcomplistbox","ListboxTop",0,"Position",[5,220,140,20],"String",options,"Style","popupmenu","Tag","compspeed_popup","Value",7); // !! L.289: Matlab function uicontrol not yet converted, original calling sequence used. // L.289: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontSize",14,"ListboxTop",0,"Position",[4,400,71,30],"String","00:00","Style","text","Tag","time"); // !! L.297: Matlab function uicontrol not yet converted, original calling sequence used. // L.297: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontSize",8,"ListboxTop",0,"Position",[4,376,71,30],"String","100% (100%)","Style","text","Tag","speedup"); // !! L.307: Matlab function uicontrol not yet converted, original calling sequence used. // L.307: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0,0,0],"FontWeight","light","ForegroundColor",[0.7,0.75,0.75],"HorizontalAlignment","right","ListboxTop",0,"Position",[113,41,31,13],"String"," ","Style","text","Tag","version"); // !! L.317: Matlab function uicontrol not yet converted, original calling sequence used. // L.317: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0,0,0],"FontWeight","light","ForegroundColor",[0.7,0.75,0.75],"HorizontalAlignment","left","ListboxTop",0,"Position",[4,41,100,13],"String"," ","Style","text","Tag","reginfo"); h1 = uicontrol('Parent',h0,'Units','points','BackgroundColor',KIKS_GUI_COLOR,'HorizontalAlignment','left','ListboxTop',0,'Units','pixels','Position',[25,120,80.25,16],'String','fast proximity sensors','Style','text','Tag','StaticText6'); h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_pausesim","Enable","off","ListboxTop",0,"Position",[75,410,36,20],"String","| |","Tag","pausesim"); // !! L.345: Matlab function uicontrol not yet converted, original calling sequence used. // L.345: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_halt","Enable","off","ListboxTop",0,"Position",[75,390,71,20],"String","halt","Tag","haltsim"); // !! L.353: Matlab function uicontrol not yet converted, original calling sequence used. // L.353: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0.2666666666667,0.2980392156863,0.3686274509804],"Callback","kiks_tou;","ForegroundColor",[0.7,0.75,0.75],"ListboxTop",0,"Position",[4,73,142,16],"String","Terms of Use","Tag","webbtn"); // !! L.361: Matlab function uicontrol not yet converted, original calling sequence used. // L.361: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0.2666666666667,0.2980392156863,0.3686274509804],"Callback","web www.tstorm.se ;","ForegroundColor",[0.7,0.75,0.75],"ListboxTop",0,"Position",[4,55,142,16],"String","http://www.tstorm.se","Tag","webbtn"); // !! L.369: Matlab function uicontrol not yet converted, original calling sequence used. // L.369: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0.3686274509804,0.2980392156863,0.2666666666667],"Callback","kiks_reginfo;","ForegroundColor",[0.7,0.75,0.75],"ListboxTop",0,"Position",[4,23,142,16],"String","license data","Tag","licbtn"); // !! L.378: Matlab function uicontrol not yet converted, original calling sequence used. // L.378: (Warning name conflict: function name changed from uicontrol to %uicontrol). //"TooltipString","enter IP:port of the KiKSnet server you want to connect to." h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"HorizontalAlignment","left","ListboxTop",0,"Position",[48,488,96,18],"String","localhost","Style","edit","Tag","kiksnet_edit"); // !! L.385: Matlab function uicontrol not yet converted, original calling sequence used. // L.385: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_server_connect;","ListboxTop",0,"Position",[4,468,142,20],"String","connect to KiKSnet server","Tag","kiksnet_btn"); // !! L.392: Matlab function uicontrol not yet converted, original calling sequence used. // L.392: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_kiksnet;","ListboxTop",0,"Position",[4,448,142,20],"String","administrate KiKSnet server","Tag","kiksnet_server_btn"); // !! L.401: Matlab function uicontrol not yet converted, original calling sequence used. // L.401: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontName","verdana","FontWeight","bold","ListboxTop",0,"Position",[5,528,140,13],"String","KiKSnet","Style","text","Tag","kiksnet_text"); // !! L.409: Matlab function uicontrol not yet converted, original calling sequence used. // L.409: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"HorizontalAlignment","right","ListboxTop",0,"Position",[4,489,45,15],"String","server : ","Style","text","Tag","StaticText4"); // !! L.417: Matlab function uicontrol not yet converted, original calling sequence used. // L.417: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"HorizontalAlignment","left","ListboxTop",0,"Position",[11,510,70,15],"String","radio turret id : ","Style","text","Tag","StaticText4"); // ! L.426: mtlb(mat6) can be replaced by mat6() or mat6 whether mat6 is an M-file or not. // !! L.426: Matlab function uicontrol not yet converted, original calling sequence used. // L.426: (Warning name conflict: function name changed from uicontrol to %uicontrol). options = strcat(cell2mat(mtlb(mat6)), '|'); h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_getaccmethod;","ListboxTop",0,"Position",[5,242,140,20],"String",options,"Style","popupmenu","Tag","acceleration_method","Value",1); // !! L.433: Matlab function uicontrol not yet converted, original calling sequence used. // L.433: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,262,140,13],"String","time acceleration method","Style","text","Tag","text_time_acceleration_method");// !! L.445: Matlab function uicontrol not yet converted, original calling sequence used. // L.445: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"Callback","kiks_gui_gettargetspeed;","Enable","off","ListboxTop",0,"Max",2000,"Min",100,"Position",[6,219,138,20],"Style","slider","Tag","speed_target","Value",100,"Visible","off"); // !! L.452: Matlab function uicontrol not yet converted, original calling sequence used. // L.452: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_gui_monitorbtn","ListboxTop",0,"Position",[4,370,142,20],"String","monitor simulation details","Tag","monitor"); // !! L.461: Matlab function uicontrol not yet converted, original calling sequence used. // L.461: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontWeight","bold","HorizontalAlignment","left","ListboxTop",0,"Position",[80,510,50,15],"String","n/a","Style","text","Tag","radioid"); // ! L.481: mtlb(mat7) can be replaced by mat7() or mat7 whether mat7 is an M-file or not. // !! L.481: Matlab function axes not yet converted, original calling sequence used. //options = strcat(cell2mat(mtlb(mat7)), '|'); //h1 = axes("Parent",h0,"Units","pixels","Box","on","CameraUpVector",[0,1,0],"CameraUpVectorMode","manual","Color",[1,1,1],"ColorOrder",options,"Layer","top","NextPlot","add","Position",[148,124.43820224719,450,326.12359550562],"Tag","arena_axes","Visible","off","XColor",[0,0,0],"XLim",[0,178],"XLimMode","manual","YColor",[0,0,0],"YDir","reverse","YLim",[0,129],"YLimMode","manual","ZColor",[0,0,0]); // !! L.489: Matlab function text not yet converted, original calling sequence used. //h2 = text("Parent",h1,"Color",[0,0,0],"HandleVisibility","off","HorizontalAlignment","center","Position",[89.198218262806,-2.7699386503068,9.1602540378444],"Tag","arena_axesText4","VerticalAlignment","cap","Visible","off"); // !! L.490: Matlab function get not yet converted, original calling sequence used. // L.490: (Warning name conflict: function name changed from get to %get). // !! L.490: Matlab function set not yet converted, original calling sequence used. // L.490: (Warning name conflict: function name changed from set to %set). //%set(%get(h2,"Parent"),"XLabel",h2); // !! L.499: Matlab function text not yet converted, original calling sequence used. //h2 = text("Parent",h1,"Color",[0,0,0],"HandleVisibility","off","HorizontalAlignment","center","Position",[180.77505567929,64.104294478528,9.1602540378444],"Rotation",90,"Tag","arena_axesText3","VerticalAlignment","baseline","Visible","off"); // !! L.500: Matlab function get not yet converted, original calling sequence used. // L.500: (Warning name conflict: function name changed from get to %get). // !! L.500: Matlab function set not yet converted, original calling sequence used. // L.500: (Warning name conflict: function name changed from set to %set). //%set(%get(h2,"Parent"),"YLabel",h2);// !! L.506: Matlab function text not yet converted, original calling sequence used. //h2 = text("Parent",h1,"Color",[0,0,0],"HandleVisibility","off","Position",[236.67260579065,169.36196319018,9.1602540378444],"Tag","arena_axesText2","Visible","off"); // !! L.507: Matlab function get not yet converted, original calling sequence used. // L.507: (Warning name conflict: function name changed from get to %get). // !! L.507: Matlab function set not yet converted, original calling sequence used. // L.507: (Warning name conflict: function name changed from set to %set). //%set(%get(h2,"Parent"),"ZLabel",h2); // ! L.515: mtlb(mat8) can be replaced by mat8() or mat8 whether mat8 is an M-file or not. // !! L.515: Matlab function text not yet converted, original calling sequence used. //h2 = text("Parent",h1,"Color",[0,0,0],"HandleVisibility","off","HorizontalAlignment","center","Position",mtlb(mat8),"Tag","arena_axesText1","VerticalAlignment","bottom","Visible","off"); // !! L.516: Matlab function get not yet converted, original calling sequence used. // L.516: (Warning name conflict: function name changed from get to %get). // !! L.516: Matlab function set not yet converted, original calling sequence used. // L.516: (Warning name conflict: function name changed from set to %set). //%set(%get(h2,"Parent"),"Title",h2); // !! L.521: Matlab function uicontrol not yet converted, original calling sequence used. // L.521: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"Units","pixels","Position",[0,0,500,23],"Style","frame","Tag","status_dummy"); // !! L.530: Matlab function uicontrol not yet converted, original calling sequence used. // L.530: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"Units","pixels","FontName","Courier New","FontSize",8,"HorizontalAlignment","left","Position",[148,5,250,12],"Style","text","String","","Tag","status");// !! L.536: Matlab function uicontrol not yet converted, original calling sequence used. // L.536: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"Callback","kiks_gui_loghistory","ListboxTop",0,"Position",[4,1,142,18],"String","view log history","Tag","togglelog"); h1 = uicontrol('Parent',h0,'BackgroundColor',[1,1,1],'HorizontalAlignment','left','ListboxTop',0,'Units','pixels','Position',[76,-20,70,20],'FontName','Courier New','FontSize',9,'String','','Style','edit','Tag','kiks_matlab_command','Callback',"g=findobj(''tag'',''toggle_foreground''); set(g,''enable'',''off''); h=findobj(''tag'',''kiks_matlab_command''); command=get(h,''String''); kiks_status([''>> '' command]); disp([''>> '' command]); set(h,''String'''',[''executing evalc('''''' command '''''')...'']); try, res=evalc(command); catch, res=[''??? '' lasterr]; end; set(h,''String'',''''); kiks_status(res); disp(res); g=findobj(''tag'',''toggle_foreground''''); set(g,''enable'',''on'');"); // !! L.557: Matlab function uicontrol not yet converted, original calling sequence used. // L.557: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"Callback","kiks_foreground","ListboxTop",0,"Position",[4,-21,71,20],"String","go active","Tag","toggle_foreground"); // KiKSnet stuff // !! L.568: Matlab function uicontrol not yet converted, original calling sequence used. // L.568: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[5,242,140,17],"String","","Style","text","Tag","t_kiksnet_text_server","FontWeight","bold","Visible","off"); // !! L.577: Matlab function uicontrol not yet converted, original calling sequence used. // L.577: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"FontSize",14,"ListboxTop",0,"Position",[4,171,140,30],"String","?","Style","text","Tag","t_kiksnet_text_ping","Visible","off"); // !! L.585: Matlab function uicontrol not yet converted, original calling sequence used. // L.585: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_gui_placerobot","ListboxTop",0,"Position",[4,303,142,20],"String","place robot","Visible","off","Tag","t_kiksnet_place_robot"); // KiKSnet server stuff // !! L.594: Matlab function uicontrol not yet converted, original calling sequence used. // L.594: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[7,480,135,42],"Style","frame","Visible","off","Tag","t_kiksnetserver_frame1"); // !! L.604: Matlab function uicontrol not yet converted, original calling sequence used. // L.604: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[10,500,35,17],"String","server:","Style","text","Tag","t_kiksnetserver_text_server_text","FontWeight","normal","HorizontalAlignment","left","Visible","off"); // !! L.614: Matlab function uicontrol not yet converted, original calling sequence used. // L.614: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[45,500,90,17],"String","?","Style","text","Tag","t_kiksnetserver_text_server","HorizontalAlignment","right","FontWeight","bold","Visible","off"); // !! L.625: Matlab function uicontrol not yet converted, original calling sequence used. // L.625: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[10,485,35,17],"String","clients:","Style","text","Tag","t_kiksnetserver_text_clients_text","FontWeight","normal","HorizontalAlignment","left","Visible","off"); // !! L.635: Matlab function uicontrol not yet converted, original calling sequence used. // L.635: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[1,1,1],"ListboxTop",0,"Position",[45,485,90,17],"String","?","Style","text","Tag","t_kiksnetserver_text_clients","HorizontalAlignment","right","FontWeight","bold","Visible","off"); options = strcat(cell2mat(makecell([1,4],"Radio ID:","License:","IP:","Score:")), '|'); for i = 0:3 spacing = 70; // !! L.645: Matlab function sprintf not yet converted, original calling sequence used. // !! L.645: Matlab function uicontrol not yet converted, original calling sequence used. // L.645: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[7,323-i*spacing,135,spacing+1],"Style","frame","Visible","off","Tag",sprintf("t_kiksnetserver_clientstats_%d_frame",i+1)); // !! L.656: Matlab function sprintf not yet converted, original calling sequence used. // !! L.656: Matlab function uicontrol not yet converted, original calling sequence used. // L.656: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",[0.3,0.3,0.3],"ForegroundColor",[1,1,1],"ListboxTop",0,"Position",[8,379-i*spacing,133,14],"Style","text","String","","HorizontalAlignment","center","FontWeight","bold","Visible","off","Tag",sprintf("t_kiksnetserver_clientstats_%d_callsign",i+1)); // !! L.665: Matlab function sprintf not yet converted, original calling sequence used. // !! L.665: Matlab function uicontrol not yet converted, original calling sequence used. // L.665: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[8,325-i*spacing,49,53],"Style","text","String",options,"HorizontalAlignment","right","Visible","off","Tag",sprintf("t_kiksnetserver_clientstats_%d_text",i+1)); // !! L.675: Matlab function sprintf not yet converted, original calling sequence used. // !! L.675: Matlab function uicontrol not yet converted, original calling sequence used. // L.675: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"ListboxTop",0,"Position",[59,325-i*spacing,82,53],"Style","text","String","","HorizontalAlignment","left","Visible","off","FontWeight","bold","Tag",sprintf("t_kiksnetserver_clientstats_%d",i+1)); end; // !! L.684: Matlab function uicontrol not yet converted, original calling sequence used. // L.684: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_gui_kiksnet_scroll(-1);","ListboxTop",0,"Position",[7,411,135,18],"String","scroll up","Visible","off","Tag","t_kiksnetserver_scrollup"); // !! L.692: Matlab function uicontrol not yet converted, original calling sequence used. // L.692: (Warning name conflict: function name changed from uicontrol to %uicontrol). h1 = uicontrol("Parent",h0,"BackgroundColor",KIKS_GUI_COLOR,"Callback","kiks_gui_kiksnet_scroll(1);","ListboxTop",0,"Position",[7,393,135,18],"String","scroll down","Visible","off","Tag","t_kiksnetserver_scrolldown"); // !! L.694: Matlab function findobj not yet converted, original calling sequence used. //h = findobj(h0); h = h0; for i = 1:max(size(mtlb_double(h))) // !! L.696: Matlab function get not yet converted, original calling sequence used. // L.696: (Warning name conflict: function name changed from get to %get). p = get(mtlb_e(h,i),"Position"); p = mtlb_i(p,2,mtlb_a(mtlb_e(p,2),yadd)); // !! L.698: Matlab function set not yet converted, original calling sequence used. // L.698: (Warning name conflict: function name changed from set to %set). set(mtlb_e(h,i),"Position",p); end; // !! L.700: Matlab function findobj not yet converted, original calling sequence used. h = findobj("tag","status_dummy"); // !! L.701: Matlab function get not yet converted, original calling sequence used. // L.701: (Warning name conflict: function name changed from get to %get). p = get(h,"Position"); p = mtlb_i(p,2,0); p = mtlb_i(p,4,mtlb_a(mtlb_e(p,4),yadd)); // !! L.704: Matlab function set not yet converted, original calling sequence used. // L.704: (Warning name conflict: function name changed from set to %set). set(h,"Position",p); // !! L.705: Matlab function set not yet converted, original calling sequence used. // L.705: (Warning name conflict: function name changed from set to %set). set(h0,"Visible","on"); if %nargout>0 then fig = h0;end; endfunction
370130f045a862a138353595ce16b3cdabc74fbf
449d555969bfd7befe906877abab098c6e63a0e8
/431/CH2/EX2.6/EX2_6.sce
26993d5dbad1e6c16cbc8d09137a90265e03f5ca
[]
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
456
sce
EX2_6.sce
//Calculating emf generated onopen circuit condition //Chapter 2 //Example 2.6 //page 93 clear; clc; disp("example 2.5") P=8 //number of poles A=8 //number of parallel paths in the armature Z=960 //number of conductors N=400 //speed in rpm phi=0.04 //flux per pole E=(phi*Z*N*P)/(60*A) //emf generated onopen circuit condition printf("emf generated on open circuit condition, E=%d volts",E)
7747c218e117efbec646b639f0c124ccf9befb92
449d555969bfd7befe906877abab098c6e63a0e8
/3792/CH5/EX5.18/Ex5_18.sce
ed54dad1a559eb1416041a9c7d959652f6ceec1f
[]
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,011
sce
Ex5_18.sce
// SAMPLE PROBLEM 5/18 clc;clear;funcprot(0); // Given data omega=2;// rad/s theta=45;// degree OCbar=450;// mm CAbar=225;// mm // Calculation // a_A=(omegadot*r)+(omega*(omega*r))+(2*omega*v_rel)+a_rel // a_A=(omegadot_CA*r_CA)+omega_CA*(omega_CA*r_CA) // a_A=[omegadot_CA*(225/sqrt(2))*(-i-j)]-[4k*(-4k*225/sqrt(2))*(-i-j)] omega=2;// rad/s r=CAbar*sqrt(2);// mm omega_CA=-4;// rad/s v_rel=(-OCbar*sqrt(2));// mm/s // Assume O=omega*(omega*r);O_1=omegadot*r;O_2=(2*omega*v_rel); O_1=0;// mm/s^2 O_2=omega*(omega*r);// mm/s^2 O_2=2*omega*v_rel;// mm/s^2 // a_rel=xdotdot; // [(1/sqrt(2))*(225omegadot_CA+3600)i]+[(1/sqrt(2))*(-225omegadot_CA+3600)j] =(900*sqrt(2))i-(1800*sqrt(2))j+xdotdoti omegadot_CA=(((-1800*sqrt(2))*sqrt(2))-3600)/-225;// rad/s^2 xdotdot=(((225*omegadot_CA)+3600)/sqrt(2))-(-900*sqrt(2));// mm/s^2 printf("\nThe angular acceleration of AC,omega_CA=%2.0f rad/s \nThe acceleration of A relative to the rotating slot in OD,xdotdot=%4.0f mm/s",omegadot_CA,xdotdot);
cb266cef30ae784e1c4848d80292a5d0828e06f1
dacb210e4fc5dbb894a8358ca5b425e801829c17
/Finite Difference, PDE, one-way wave/System of PDEs/lax_fried.sce
487e27ad8eb215ca11c8ad5fa67369a6258115c5
[]
no_license
amiedemmel/Diff-Eq-Projects
ba0fe0a45cee568b65b2b508bd55d193668f7a14
7edbd8a46aec2df62990c8fb11365498cb583335
refs/heads/master
2020-05-30T04:10:56.223423
2015-05-08T15:50:50
2015-05-08T15:50:50
35,286,857
0
0
null
null
null
null
UTF-8
Scilab
false
false
1,093
sce
lax_fried.sce
clear u u1 u2 u3 tr x x1 nu //col1=['-+b'; '-+g'; '-+r'; '-+c']; //col2=['-ob'; '-og'; '-or'; '-oc']; iter=1; flag=1; lambda=input('lambda : '); while(flag) h=1/20; k=lambda*h; ax=-3; bx=3; at=0; bt=2; n=(bt-at)/k + 1; m=(bx-ax)/h + 1; u=zeros(n,m); w=zeros(n,m); x=ax; for i=1:m u(1,i)=1-abs(x); w(1,i)=1-2*abs(x); if u(1,i)<0 u(1,i)=0; end if w(1,i)<0 w(1,i)=0; end x=x+h; end t=0; for j=1:n-1 for i=2:m-1 //Lax-Friedrichs L1=lambda/6*(t-2); L2=lambda/3*(t+1); u(j+1,i)=(.5-L1)*u(j,i+1)+(.5+L1)*u(j,i-1)-k*u(j,i)/3-L2*(w(j,i+1)-w(j,i-1)); L1=lambda/6*(2*t-1); L2=lambda/6*(t+1); w(j+1,i)=(.5-L1)*w(j,i+1)+(.5+L1)*w(j,i-1)+k*w(j,i)/3-L2*(u(j,i+1)-u(j,i-1)); end u(j+1,m)=0; w(j+1,m)=w(j+1,m-1); t=t+k; end iter=iter+1; lambda=input('lambda : '); if lambda == 0 then flag = 0; end end
ca8354fa9c75916056beb5bb897852034c88c46d
f5b5eb0883c7795cf090ef64be0e5f9a59596d8d
/pause.sce
301501494c1675152f34b481640d5fd11b4acff6
[]
no_license
scottb/balljudgement
97bd2278177d3791840e4344be1c69eb354a9373
83635642df25dc3e4b9419e8381a3bee61d82d54
refs/heads/master
2016-09-06T17:44:10.199040
2011-02-17T03:44:39
2011-02-17T03:44:39
1,548,423
0
1
null
null
null
null
UTF-8
Scilab
false
false
640
sce
pause.sce
scenario = "instruction for ball movement judgment without feedback"; no_logfile = true; scenario_type = trials; active_buttons = 1; button_codes = 99; screen_width = 1024; screen_height = 768; screen_bit_depth = 16; default_font_size = 20; begin; picture {} default; trial { trial_type = first_response; trial_duration = forever; picture { text { caption = "Kurze Pause...\n\n\n\n\n\n\n\n\n\nDanach folgt der letzte Block -\nInstruktion und Verlauf wie eben.\n\n\n\n\nWeiter mit Leertaste..."; }; x = 0; y = 0; bitmap { filename = "corr_wob.bmp"; width = 80; height = 80; }; x = 0; y = 130; }; time = 0; };
3e72f089d8f35063f1e232ff126237a4353f15f1
198f44f2fc3dd4ad0c47c7311b8d61836820ff9b
/simulasi3D.sce
6bfcf4bc11d6bee6d7beec0fcc1734e7ccdd89b2
[]
no_license
DandydaKiller/Forecast-Penggunaan-Lahan-Makan-Selama-Pandemi-Jakarta
788509b0f2550a50773340ebcd6c082017d91a0b
7ad3561b6e8dec145dfc68844d8a925b643f3890
refs/heads/main
2023-05-21T16:04:09.978132
2021-06-13T18:52:54
2021-06-13T18:52:54
376,605,665
0
0
null
null
null
null
UTF-8
Scilab
false
false
21,437
sce
simulasi3D.sce
// This GUI file is generated by guibuilder version 4.2.1 ////////// f=figure('figure_position',[340,32],'figure_size',[959,602],'auto_resize','on','background',[33],'figure_name','Graphic window number %d','dockable','off','infobar_visible','off','toolbar_visible','off','menubar_visible','off','default_axes','on','visible','off'); ////////// handles.dummy = 0; handles.main_left_panel=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0,0.0053191,0.2346072,0.9946809],'Relief','default','SliderStep',[0.01,0.1],'String','Left Panel','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','main_left_panel','Callback','') handles.plot_3d= /*uicontrol(f,... "sytle","frame",... "layout","border",... "constraints",createConstraints("border","center"));*/newaxes();/*f.immediate_drawing = "off";plot3d();*/handles.plot_3d.margins = [ 0 0 0 0];handles.plot_3d.axes_bounds = [0.2993631,0.2103546,0.6528662,0.6914894];handles.plot_3d.data_bounds = [0,0,0,0]; handles.logouisi=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0042463,0.8741135,0.2261146,0.1223404],'Relief','default','SliderStep',[0.01,0.1],'String','D:/logouisi2.png','Style','image','Value',[1,1,0,0,0],'VerticalAlignment','middle','Visible','on','Tag','logouisi','Callback','logouisi_callback(handles)') handles.filler_panel_up=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.2346072,0.8014184,0.7632696,0.1985816],'Relief','default','SliderStep',[0.01,0.1],'String','UnName4','Style','frame','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','filler_panel_up','Callback','') //'Position',[0.029724,0.3093617,0.1581741,0.0638298], handles.slider_plot=uicontrol(f,"style", "slider", "Max", 255, "Min", 1, "value", 128, "position", [10 180 200 25],'Callback','slider_plot_callback(handles)') handles.text_panel_input=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','bold','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.017431,0.7039007,0.1942675,0.0567376],'Relief','default','SliderStep',[0.01,0.1],'String','Panel Input','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_panel_input','Callback','') handles.text_panel_control=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','bold','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0350318,0.4097872,0.1528662,0.0602837],'Relief','default','SliderStep',[0.01,0.1],'String','Panel Control','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_panel_control','Callback','') handles.text_rotasi=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.066518,0.3714184,0.096603,0.0336879],'Relief','default','SliderStep',[0.01,0.1],'String','---rotasi plot---','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_rotasi','Callback','') handles.text_simluasi_plot_3d=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[15],'FontUnits','points','FontWeight','bold','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.3390446,0.8114894,0.4579618,0.0992908],'Relief','default','SliderStep',[0.01,0.1],'String','Simulasi Penggunaan Tanah Pemakaman','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_simluasi_plot_3d','Callback','') handles.input_x1=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0323355,0.61,0.0488323,0.0531915],'Relief','default','SliderStep',[0.01,0.1],'String','X','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_x1','Callback','') handles.input_x2=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0892569,0.6099291,0.0498938,0.0549645],'Relief','default','SliderStep',[0.01,0.1],'String','Y','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_x2','Callback','') handles.input_x3=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1512739,0.6110638,0.0498938,0.0531915],'Relief','default','SliderStep',[0.01,0.1],'String','Z','Style','edit','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_x3','Callback','') handles.input_simulasikan=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0624416,0.5131915,0.1082803,0.0443262],'Relief','default','SliderStep',[0.01,0.1],'String','Simulasikan !','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_simulasikan','Callback','input_simulasikan_callback(handles)') handles.input_reset=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1224416,0.0131915,0.0882803,0.0543262],'Relief','default','SliderStep',[0.01,0.1],'String','Reset','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_reset','Callback','input_reset_callback(handles)') handles.input_close=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[1,0,0],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0124416,0.0131915,0.0882803,0.0543262],'Relief','default','SliderStep',[0.01,0.1],'String','close','Style','pushbutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','input_close','Callback','input_close_callback(handles)') handles.text_tampilan=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0643949,0.2841844,0.1019108,0.0265957],'Relief','default','SliderStep',[0.01,0.1],'String','---tampilan plot---','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_tampilan','Callback','') handles.check_tampilan_judul=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0251805,0.2329078,0.118896,0.0319149],'Relief','default','SliderStep',[0.01,0.1],'String','Judul Plot','Style','checkbox','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','check_tampilan_judul','Callback','check_tampilan_judul_callback(handles)') handles.check_tampian_label=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0257325,0.1968085,0.1157113,0.0283688],'Relief','default','SliderStep',[0.01,0.1],'String','Label Plot','Style','checkbox','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','check_tampian_label','Callback','check_tampian_label_callback(handles)') handles.check_tampilan_edge=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.1183652,0.2340426,0.1157113,0.0301418],'Relief','default','SliderStep',[0.01,0.1],'String','Edge Plot','Style','checkbox','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','check_tampilan_edge','Callback','check_tampilan_edge_callback(handles)') /*handles.text_warna=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0691507,0.1519858,0.111465,0.0265957],'Relief','default','SliderStep',[0.01,0.1],'String','---warna plot---','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_warna','Callback','') handles.radio_warna_jetcolor=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.0227176,0.106383,0.1125265,0.0460993],'Relief','default','SliderStep',[0.01,0.1],'String','Jet colormap','Style','radiobutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','radio_warna_jetcolor','Callback','radio_warna_jetcolor_callback(handles)') handles.radio_warna_hotcolor=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.023397,0.074539,0.1210191,0.0336879],'Relief','default','SliderStep',[0.01,0.1],'String','Hot colormap','Style','radiobutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','radio_warna_hotcolor','Callback','radio_warna_hotcolor_callback(handles)') handles.radio_warna_graycolor=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.123397,0.1119858,0.118896,0.037234],'Relief','default','SliderStep',[0.01,0.1],'String','Gray colormap','Style','radiobutton','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','radio_warna_graycolor','Callback','radio_warna_graycolor_callback(handles)')*/ handles.text_informatika_uisi=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','bold','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','center','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.646875,0.88125,0.5046875,0.1475],'Relief','default','SliderStep',[0.01,0.1],'String','Informatika UISI','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','text_informatika_uisi','Callback','') handles.nama_nim=uicontrol(f,'unit','normalized','BackgroundColor',[-1,-1,-1],'Enable','on','FontAngle','normal','FontName','Tahoma','FontSize',[12],'FontUnits','points','FontWeight','normal','ForegroundColor',[-1,-1,-1],'HorizontalAlignment','left','ListboxTop',[],'Max',[1],'Min',[0],'Position',[0.772766,0.8053938,0.2851064,0.0736842],'Relief','default','SliderStep',[0.01,0.1],'String','Dandy Nizam Achmady - 3011710014','Style','text','Value',[0],'VerticalAlignment','middle','Visible','on','Tag','nama_nim','Callback','') handles.frame_style = uicontrol(f,"style", "frame", "Max", 255, "Min", 1, "value", 128, "position", [10 70 200 25], "callback","update_model") handles.frame_style.layout = "grid"; uicontrol(handles.frame_style,... "style","radiobutton",... "backgroundcolor",[1 1 1],... "tag","model3D",... "string","3D Model",... "groupname","model_style",... "callback","update_model"); model2d = uicontrol(handles.frame_style,... "style","radiobutton",... "backgroundcolor",[1 1 1],... "tag","model2D",... "string","2D Model",... "groupname","model_style",... "callback","update_model"); model2d.value = 1; f.visible = "on"; ////////// // Callbacks are defined as below. Please do not delete the comments as it will be used in coming version ////////// function logouisi_callback(handles) //Write your callback for logouisi here endfunction function update_model(handles) plot_axes = gca(); my_figure = gcf(); if get(gcbo,"tag") == "model3D" then /*t=[1:i+1]; t=[0:0.3:2*%pi]'; z=sin(t)*cos(t');*/ // my_figure.color_map = jetcolormap(128); e = 2.718281828; b = 3.125; c = 1; a =- 0.05; // percepatan kematian dikarenakan ada vaktor tambahan seperti wabah A = 0; delta_t = 0.2; //plot3d(A,L,V) X(1) = eval(get(handles.input_x1,"string")); //tekanan aerodinamis awal saat ketinggian pesawat 0 m Y(1) = eval(get(handles.input_x2,"string")); //kecepatan vertical omega di rubah menjadi variable V Z(1) =eval(get(handles.input_x3,"string")); for i=1:25 X(i+1) = X(i) + (a*X(i)) *delta_t; Y(i+1) = Y(i) + (Y(i)+b*a*X(i))*delta_t; Z(i + 1) = Z(i) + ((A - Y(i) + c*(-Y(i))))*delta_t; end delete(gca()); handles.plot_3d= /*uicontrol(f,... "sytle","frame",... "layout","border",... "constraints",createConstraints("border","center"));*/newaxes();/*f.immediate_drawing = "off";plot3d();*/handles.plot_3d.margins = [ 0 0 0 0];handles.plot_3d.axes_bounds = [0.2993631,0.2103546,0.6528662,0.6914894];handles.plot_3d.data_bounds = [0,0,0,0]; t=[1:i]'; // z = X(t) * Y(t'); plot3d(X(t'),Y(t),Z(t')) elseif get(gcbo,"tag") == "model2D" then X(1) = eval(get(handles.input_x1,"string")); //tekanan aerodinamis awal saat ketinggian pesawat 0 m Y(1) = eval(get(handles.input_x2,"string")); //kecepatan vertical omega di rubah menjadi variable V Z(1) = eval(get(handles.input_x3,"string")); //W = 1000; //kg //g = 10; //m/s // e = 2.718281828; b = 3.125; //c = 1; a = 0.05; // percepatan kematian dikarenakan ada vaktor tambahan seperti wabah delta_t = 1; c = e^a*delta_t; T = 3; A = (1-c/a*delta_t) * ((b*a*X(1)*e^a*delta_t)/(a-1)) + ((1-c/e^T)*Y(1)*e^delta_t); //A = 0; delete(gca()); handles.plot_3d= /*uicontrol(f,... "sytle","frame",... "layout","border",... "constraints",createConstraints("border","center"));*/newaxes();/*f.immediate_drawing = "off";plot3d();*/handles.plot_3d.margins = [ 0 0 0 0];handles.plot_3d.axes_bounds = [0.2993631,0.2103546,0.6528662,0.6914894];handles.plot_3d.data_bounds = [0,0,0,0]; for i=1:25 X(i+1) = X(i) + (a*X(i)) *delta_t; Y(i+1) = Y(i) + (Y(i)+b*a*X(i))*delta_t; Z(i + 1) = Z(i) + ((A - Y(i) + c*(-Y(i))))*delta_t; end//t=[1:i+1]; //t=[0:0.3:2*%pi]'; //z=sin(t)*cos(t'); t=[1:i]; handles.plot_3d; //plot3d(A,L,V) // plot3d(X(t),Y(t),Z(t)) plot2d(t,[X(t),Y(t),Z(t)]) h1 = legend(['X (Jumlah Kematian Selama Pandemi)','Y (Jumlah, Lahan Pemakaman yang di isi )','Z (Jumlah Lahan Yang Tersedia)']) xlabel("waktu","fontsize",2) ylabel("ketersediaan tanah","fontsize",2) zlabel("coba","fontsize",2) title(' Pengunaan Tanah Makam',"fontsize",3) end endfunction function slider_plot_callback(handles) //Write your callback for slider_plot here handles plot_3d; my_plot_axes = gca(); my_new_angle = get(gcbo,"value"); if(my_new_angle > 0 & my_new_angle<360)then my_plot_axes.rotation_angles(2) = my_new_angle; end endfunction function input_simulasikan_callback(handles) //Write your callback for input_simulasikan here delete(gca()); handles.plot_3d= /*uicontrol(f,... "sytle","frame",... "layout","border",... "constraints",createConstraints("border","center"));*/newaxes();/*f.immediate_drawing = "off";plot3d();*/handles.plot_3d.margins = [ 0 0 0 0];handles.plot_3d.axes_bounds = [0.2993631,0.2103546,0.6528662,0.6914894];handles.plot_3d.data_bounds = [0,0,0,0]; X(1) = eval(get(handles.input_x1,"string")); //tekanan aerodinamis awal saat ketinggian pesawat 0 m Y(1) = eval(get(handles.input_x2,"string")); //kecepatan vertical omega di rubah menjadi variable V Z(1) = eval(get(handles.input_x3,"string")); //W = 1000; //kg //g = 10; //m/s // e = 2.718281828; b = 3.125; a = 0.05; // percepatan kematian dikarenakan ada vaktor tambahan seperti wabah delta_t = 1; c = e^a*delta_t; T = 3; //A = (1-c/a*delta_t) * ((b*a*X(1)*e^a*delta_t)/(a-1)) + ((1-c/e^T)*Y(1)*e^delta_t); A = 0; for i=1:25 X(i+1) = X(i) + (a*X(i)) *delta_t; Y(i+1) = Y(i) + (Y(i)+b*a*X(i))*delta_t; Z(i + 1) = Z(i) + ((A - Y(i) + c*(-Y(i))))*delta_t; end //t=[1:i+1]; //t=[0:0.3:2*%pi]'; //z=sin(t)*cos(t'); t=[1:i+1]; handles.plot_3d; //plot3d(A,L,V) // plot3d(X(t),Y(t),Z(t)) plot2d(t,[X(t),Y(t),Z(t)]) h1 = legend(['X (Jumlah Kematian Selama Pandemi)','Y (Jumlah, Lahan Pemakaman yang di isi )','Z (Jumlah Lahan Yang Tersedia)']) xlabel("waktu","fontsize",2) ylabel("penggunaan lahan","fontsize",2) zlabel("coba","fontsize",2) title(' Pengunaan Tanah Makam',"fontsize",3) xlabel.visible= "off" endfunction function check_tampilan_judul_callback(handles) //Write your callback for check_tampilan_judul here plot_axes = gca(); if get(gcbo,"value") == 0 then plot_axes.x_title_visible = "off"; // plot_axes.z_label_visible = off; elseif get(gcbo,"value") == 1 then plot_axes.x_title_visible = "on"; // plot_axes.z_label_visble = on; end endfunction function check_tampian_label_callback(handles) //Write your callback for check_tampian_label here plot_axes = gca(); if get(gcbo,"value") == 0 then plot_axes.x_label_visible = "off"; plot_axes.y_label_visible = "off"; // plot_axes.z_label_visible = off; elseif get(gcbo,"value") == 1 then plot_axes.x_label_visible = "on"; plot_axes.y_label_visible = "on"; // plot_axes.z_label_visible = on; end endfunction function check_tampilan_edge_callback(handles) //Write your callback for check_tampilan_edge here plot_axes = gca(); my_plot_3d = plot_axes.children($) if get(gcbo,"value") == 0 then pmy_plot_3d.color_mode = -1; elseif get(gcbo,"value") == 1 then my_plot_3d.color_mode = +1; end endfunction function input_close_callback(handles) close(); end function input_reset_callback(handles) /*a=get("plot_3d") delete(); delete(a.children); delete(a); delete("all");*/ /*current_axes = gca(); delete_axes = scf(current_axes.background); clf(gca(),"reset"); */ set(handles.input_x1,"string","X"); set(handles.input_x2,"string","Y"); set(handles.input_x3,"string","Z"); delete(gca()); handles.plot_3d= /*uicontrol(f,... "sytle","frame",... "layout","border",... "constraints",createConstraints("border","center"));*/newaxes();/*f.immediate_drawing = "off";plot3d();*/handles.plot_3d.margins = [ 0 0 0 0];handles.plot_3d.axes_bounds = [0.2993631,0.2103546,0.6528662,0.6914894];handles.plot_3d.data_bounds = [0,0,0,0]; end /*function radio_warna_jetcolor_callback(handles) //Write your callback for radio_warna_jetcolor here //handles plot_3d my_figure = gcf(); my_figure.color_map = jetcolormap(128); endfunction function radio_warna_hotcolor_callback(handles) //Write your callback for radio_warna_hotcolor here my_figure = gcf(); my_figure.color_map = jetcolormap(128); endfunction function radio_warna_graycolor_callback(handles) //Write your callback for radio_warna_graycolor here my_figure = gcf(); my_figure.color_map = jetcolormap(128); endfunction*/
ebbdf4c2ece6219424da30ec6003e3b1045cbe3c
8217f7986187902617ad1bf89cb789618a90dd0a
/source/2.5/macros/percent/%lss_a_r.sci
12a3e8f838f67fcab68330775f3ffa4960f6ad55
[ "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
121
sci
%lss_a_r.sci
function [s]=%lss_a_r(s1,s2) //s=%lss_a_r(s1,s2) <=> s= s1+s2 //! // Copyright INRIA [s1,s2]=sysconv(s1,s2);s=s1+s2;
34584900f2fa0b17e6c14b09c33089fe39119c66
1553f49678b55a6283e04ec177d0c4174457e834
/códigos/exercicio19.sci
2a036fc70c05c01d48616e20173ec8fb1bbd51cd
[ "MIT" ]
permissive
reneroliveira/Monitoria-ALN-2021
c16a26c208610e7450def04c775e5550886e3ce8
7c746dfe07cdc08921678bf65505389f274416ce
refs/heads/main
2023-05-13T13:01:35.401001
2021-06-09T17:20:06
2021-06-09T17:20:06
344,234,191
3
0
null
null
null
null
UTF-8
Scilab
false
false
507
sci
exercicio19.sci
//Exercícios 13 e 19 - Capítulo 4.5 Poole A = [9 4 8; 4 15 -4;8 -4 9] x0 = [1;1;1] k=5 //Método da Potência Tradicional x0 = x0/max(abs(x0)) x1 = A*x0 for i=2:k modulo_de_lambda = max(abs(x1)) x1 = x1/max(abs(x1)) x1 = A*x1 end disp("|lambda| - Método potência Tradicional:") disp(modulo_de_lambda) //Iteração de Rayleigh x0 = [1;1;1] xk = x0/norm(x0) for i=1:k lambda = (A*xk)'*xk xk = A*xk xk = xk/norm(xk) end disp("lambda - Método potência - Rayleigh:") disp(lambda)
74408675d2422593379c6a9ec5e1108a78881a4c
449d555969bfd7befe906877abab098c6e63a0e8
/1757/CH6/EX6.36/EX6_36.sce
1e7d95a6715bb27fd9dd1223f68e70da563b8f11
[]
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
246
sce
EX6_36.sce
//Example6_36 // Calculate CMRR ratio clc; clear; close; Ad = 10.24 ; Acm = 0.48 ; // the common mode rejection ratio CMRR is defined as CMRRdB = 20*log10(Ad/Acm); disp('THe common mode rejection ratio is = '+string(CMRRdB)+ ' dB' );
17743477722e6eee329f4459c384c6c3c77954ac
449d555969bfd7befe906877abab098c6e63a0e8
/62/CH3/EX3.24/ex_3_24.sce
da1658d1bc0a76e5ef1bba2461a2bef2d7ee5911
[]
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
93
sce
ex_3_24.sce
syms t s a H=laplace(%e^(-a*t)) X=laplace(-%e^(a*t)) Y=X*H y=ilaplace(Y) disp(y,"y(t)=")
6202aaa76e13d896e9fdf39ff83356142eb1d1bf
e41b69b268c20a65548c08829feabfdd3a404a12
/3DCosmos/Data/Scripts/_SSYS.SCI
1997e991173f8672810dc598b1390a72176b6cca
[ "LicenseRef-scancode-khronos", "MIT" ]
permissive
pvaut/Z-Flux
870e254bf340047ed2a52d888bc6f5e09357a8a0
096d53d45237fb22f58304b82b1a90659ae7f6af
refs/heads/master
2023-06-28T08:24:56.526409
2023-03-01T12:44:08
2023-03-01T12:44:08
7,296,248
1
1
null
2023-06-13T13:04:58
2012-12-23T15:40:26
C
UTF-8
Scilab
false
false
16,136
sci
_SSYS.SCI
#Solar System functions au2km=149598000; planetorbitcolor=color(0.0,0.3,0.6,0.6); coseps=0.9174369381; sineps=0.3978812030; zoomf=1; #to be used whenever a 'home' position is needed HLongitude=deg2rad(ReadSetting("Longitude",0)); HLattitude=deg2rad(ReadSetting("Lattitude",51)); function HomeLongitude() { return(HLongitude); } function HomeLattitude() { return(HLattitude); } #converts astronomical units to km function autokm(ival) { return(149598000*ival); } function kmtoau(ival) { return(ival/149598000); } #converts right ascension & declination to ecliptic angle coordinates) function equat2eclipt(alpha,delta) { lr1=coseps*sin(delta)-sineps*cos(delta)*sin(alpha); ecl2=asin(lr1); lr1=cos(alpha); lr2=sin(alpha)*coseps+tan(delta)*sineps; ecl1=angle(lr1,lr2); return(list(ecl1,ecl2)); } function eclipt2equat(ecl1,ecl2,alpha,delta) { xx=cos(ecl1); yy=sin(ecl1)*coseps-tan(ecl2)*sineps; alpha=angle(xx,yy); delta=asin(sin(ecl2)*coseps+cos(ecl2)*sineps*sin(ecl1)); } #returns the viewport function GetViewPort() { return(root.Viewports.main); } #returns a list of all the planets in the Solar System function ssys_getplanetlist() { return(list("Mercurius","Venus","Earth","Mars","Jupiter","Saturnus","Neptunus","Uranus")); } function ssys_createstarback() { starbackframe=root.SC.Universe.addsubframe("StarBackFrame"); starbackframe.nearclipplane=5000*au2km; starbackframe.farclipplane=100000*au2km; tx=starbackframe.createtexture("star",DataDir+"\textures\star3.bmp"); sg=starbackframe.add("StarGlobe","Name":"StarBack"); sg.texture=tx.name; sg.radius=20000*au2km; sg.starsize=70*au2km; sg.DepthTest=DepthTestDisable; sg.RenderFront=false; sg.IsBackGround=true; sg.LineColor=color(0,0.5,1,0.5); } function ssys_showconstellations(status) { if status then root.SC.Universe.StarBackFrame.StarBack.LineSize=60*au2km; else root.SC.Universe.StarBackFrame.StarBack.LineSize=0; } function ssys_createmilkyway() { #galactic pole glong=179.32095/180*Pi; glatt=29.811954/180*Pi; ez=-1*vector(cos(glong)*cos(glatt),sin(glong)*cos(glatt),sin(glatt)); #galactic center glong=266.14097/180*Pi; glatt=-5.52967943/180*Pi; ex=vector(cos(glong)*cos(glatt),sin(glong)*cos(glatt),sin(glatt)); ey=vecnorm(ez*ex); mwf=root.SC.Universe.StarBackFrame.addsubframe("MilkyWay"); mwf.transf.Xaxis=-1*ex; mwf.transf.Yaxis=-1*ey; mwf.transf.Zaxis=ez; tx=mwf.createtexture("MilkyWay",DataDir+"\textures\milkyway.png"); mw=mwf.add("sphere","EnableLight":false); mw.color=color(0.3,0.5,1,0.25); mw.texture=tx.name; mw.IsBackGround=true; mw.BlendType=BlendTransparent;mw.DepthMask=DepthMaskDisable; mw.renderback=true;mw.renderfront=false; mw.radius=20000*au2km; return(mwf); } function ssys_createconstellationnames() { cnf=root.SC.Universe.StarBackFrame.addsubframe("ConstellationNames"); cnf.Transf.rotate(vector(1,0,0),deg2rad(-23.4457889)); filecontent=readtextfile(DataDir+"\AstroData\connames.txt"); radius=20000*au2km; while filecontent.length>0 do { fileline=filecontent.split("~n"); name=fileline.split("~t"); ra=ToScalar(fileline.split("~t"))/180*Pi; dec=ToScalar(fileline.split("~t"))/180*Pi; cnf.add("TextFlat", "Position":(radial2point(radius,ra,dec)), "BlendType":BlendTransparent,"DepthMask":DepthMaskDisable, "Size":(radius/20), "Color":color(0.5,0,0.5,0.5),"isbackground":true, "Content":(name)); } return(cnf); } function ssys_createstarnames() { snf=root.SC.Universe.StarBackFrame.addsubframe("StarNames"); snf.Transf.rotate(vector(1,0,0),deg2rad(-23.4457889)); filecontent=readtextfile(DataDir+"\AstroData\starnames.txt"); radius=2991960000000; while filecontent.length>0 do { fileline=filecontent.split("~n"); starname=fileline.split("~t"); ra=ToScalar(fileline.split("~t"))/180*Pi; dec=ToScalar(fileline.split("~t"))/180*Pi; snf.add("TextFlat", "Position":(radial2point(radius,ra,dec)), "BlendType":BlendTransparent,"DepthMask":DepthMaskDisable, "Size":(radius/40), "Color":color(0,0.5,0.5),"isbackground":true, "Content":(" "+starname)); } } function ssys_getplanetinfo(name) { mp=map; #---------------------------------------------------------------------------------- if name=="Mercurius" then { mp.radius=4880/2; mp.inclin=deg2rad(2.11); mp.rotperiod=58.646*24; mp.rotoffset=0; mp.flattening=1; ls=equat2eclipt(deg2rad(281.01),deg2rad(61.45)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- if name=="Venus" then { mp.radius=12104/2; mp.inclin=deg2rad(177.3); mp.rotperiod=243*24; mp.rotoffset=0; mp.flattening=1; ls=equat2eclipt(deg2rad(272.76),deg2rad(67.16)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- #WARNING: Earth is treated as a special case during construction if name=="Earth" then { mp.radius=6378.0; mp.inclin=deg2rad(23.4457889); mp.rotperiod=0.99726968*24; mp.rotoffset=0; mp.flattening=1; ls=equat2eclipt(deg2rad(0),deg2rad(90)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- if name=="Mars" then { mp.radius=6796/2; mp.inclin=deg2rad(25.19); ls=equat2eclipt(deg2rad(317.68143),deg2rad(52.88650)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); mp.rotperiod=24.6229; mp.rotoffset=2.5;#!!!approximative!!! } #---------------------------------------------------------------------------------- if name=="Jupiter" then { mp.radius=142984/2; mp.inclin=deg2rad(3.13); mp.rotperiod=9.925; mp.rotoffset=0; mp.flattening=0.94; ls=equat2eclipt(deg2rad(268.057),deg2rad(64.496)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- if name=="Saturnus" then { mp.radius=120536/2; mp.inclin=deg2rad(26.73); mp.rotperiod=10+47/60; mp.rotoffset=0; mp.flattening=0.9; ls=equat2eclipt(deg2rad(40.589),deg2rad(83.537)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- if name=="Uranus" then { mp.radius=51118/2; mp.inclin=deg2rad(97.77); mp.rotperiod=17+14/60; mp.rotoffset=0; mp.flattening=1; ls=equat2eclipt(deg2rad(257.311),deg2rad(-15.175)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- if name=="Neptunus" then { mp.radius=24764; mp.inclin=deg2rad(28.32); mp.rotperiod=16+6.5/60; mp.rotoffset=0; mp.flattening=1; ls=equat2eclipt(deg2rad(299,25),deg2rad(42.950)); mp.poledir=@vector(radial2point(1,ls(0),ls(1))); } #---------------------------------------------------------------------------------- return(mp); } #Create Solar system framework function ssys_create() { T_scene_create; vp=T_getviewport; sc=T_getscene; vp.cameradir=vecnorm(vector(0,-1,-0.5)); vp.camerapos=point(0,0,0)-4*au2km*vp.cameradir; vp.cameraupdir=vector(0,0,1); vp.enableusernavigation=true; vp.EnableUserTimeControl=true; vp.NearClipPlane=0.5*au2km; vp.FarClipPlane=20*au2km; vp.FocalDistance=4*au2km; sc.light0pos=point(0,0,0); sc.ambientlightcolor=color(0.05,0.05,0.05); ssys_createstarback; root.SC.universe.AddSubFrame("SolarSystem"); return(root.SC.Universe.SolarSystem); } function ssys_showstarback(newstatus) { root.SC.Universe.StarBackFrame.visible=newstatus; } function ssys_createsun() { sunframe=root.SC.Universe.SolarSystem.addviewdirframe(point(0,0,0),"Sun"); suntx=sunframe.createtexture("suntx",DataDir+"\textures\star1.bmp"); lightpoints=list; lightpoints.add(map("S":autokm(0.10),"C":color(1.0,0.5,0.0))); lightpoints.add(map("S":autokm(0.05),"C":color(1.0,1.0,0.5))); lightpoints.add(map("S":autokm(0.02),"C":color(1.0,1.0,1.0))); foreach lp in lightpoints do { rc=sunframe.add("Rectangle","Position":point(-1*lp.S,-1*lp.S,0),"Axis1":vector(2*lp.S,0,0),"Axis2":vector(0,2*lp.S,0)); rc.Color=lp.C; rc.Texture=suntx.name; rc.BlendType=BlendTransparent;rc.DepthMask=DepthMaskDisable;rc.enablelight=false; } } function ssys_createearth(izoomf) { zoomf=izoomf; earthframe=root.SC.Universe.SolarSystem.addsubframe("Earth"); orb=root.SC.Universe.SolarSystem.add("Curve","Name":"EarthOrbit"); orb.color=planetorbitcolor; orb.Size=2; mt2=MotionCyclOrbit.create(earthframe,"EarthOrbit"); mt2.loadfile("earth",au2km,0.00001); earthframe.motion=mt2; mt2.CreateCurve(orb,root.time,200); inclinframe=earthframe.addsubframe("Inclin"); inclinframe.Transf.rotate(vector(1,0,0),deg2rad(-23.4457889)); globeframe=inclinframe.addsubframe("Globe"); tx=globeframe.createtexture("earth",DataDir+"\textures\earth.jpg"); globerenderframe=globeframe.addsubframe("GlobeRendering"); globerenderframe.Transf.rotate(vector(0,0,1),Pi); if zoomf>0 then { earthglobe=globerenderframe.add("sphere","Name":"Earth"); earthglobe.canbuffer=true; earthglobe.radius=6378.0*zoomf; earthglobe.resolution=40; earthglobe.texture="earth"; } mtr=MotionRotate.create(globeframe); mtr.normdir=vector(0,0,1); mtr.RotSpeed=2*Pi/(24*60*60); mtr.TimeType=ST0; mtr.offsetangle=0; globeframe.motion=mtr; return(earthframe); } #Create the moon of the Earth function ssys_createluna(izoomf) { zoomf=izoomf; earthframe=root.SC.Universe.SolarSystem.Earth; lunaframe=earthframe.addsubframe("Luna"); tx=lunaframe.createtexture("luna",DataDir+"\textures\moon.jpg"); if zoomf>0 then { lunaglobe=lunaframe.add("sphere","Name":"Luna"); lunaframe.transf.origin=point(0.2*au2km,0,0); lunaglobe.radius=1737.4*zoomf; lunaglobe.texture=tx.name; lunaglobe.canbuffer=true; lunaglobe.resolution=40; } mt2=MotionLuna.create(lunaframe,"LunaOrbit"); mt2.load; lunaframe.motion=mt2; orb=root.SC.Universe.SolarSystem.Earth.add("Curve","Name":"LunaOrbit"); orb.color=planetorbitcolor; } #this function calculates the orbit of Luna at a given time function ssys_calclunaorbit(tm,resol) { MotionLuna=root.SC.Universe.SolarSystem.Earth.Luna.Motions.LunaOrbit; LunaOrbit=root.SC.Universe.SolarSystem.Earth.LunaOrbit; MotionLuna.CreateCurve(LunaOrbit,tm,resol); } #Create Saturn rings function ssys_createsaturnusrings(satframe,satradius) { rframe=satframe.addsubframe("Rings"); rframe.transf.rotate(vector(1,0,0),Pi/2); tx=rframe.createtexture("satring",DataDir+"\textures\saturnring.bmp"); rings=list; rings.add(map("ps1":1.2,"ps2":1.70,"fr1":0.00,"fr2":0.6)); rings.add(map("ps1":1.8,"ps2":2.03,"fr1":0.66,"fr2":0.8)); rings.add(map("ps1":2.1,"ps2":2.23,"fr1":0.85,"fr2":1.0)); foreach ring in rings do { cset=FlatContourSet; cset.addpoint(point(satradius*ring.ps1,-0.00001*satradius,0)); cset.addpoint(point(satradius*ring.ps2,-0.00001*satradius,0)); cset.addpoint(point(satradius*ring.ps2,+0.00001*satradius,0)); cset.addpoint(point(satradius*ring.ps1,+0.00001*satradius,0)); cset.close;cset.calcflatnormals; ringobj=rframe.add("SolidObject"); ringobj.Revolve(cset,200); ringobj.texture=tx.name; ringobj.color=color(0.75,0.75,0.75); fnc=functor("(distance(pt,point(0,0,0))/"+str(satradius)+"-1.2)/0.9","pt"); ringobj.GenerateVertexProperty(fnc,VertexPropertyTC1); fnc=functor("0.5","pt"); ringobj.GenerateVertexProperty(fnc,VertexPropertyTC2); ringobj.canbuffer=true; } } #Creates a planet of the Solar System function ssys_createplanet(pname,izoomf) { zoomf=izoomf; if pname=="Earth" then { return(ssys_createearth(zoomf)); } pinfo=ssys_getplanetinfo(pname); planframe=root.SC.Universe.SolarSystem.addsubframe(pname); orb=root.SC.Universe.SolarSystem.add("Curve","Name":(pname+"Orbit")); orb.color=planetorbitcolor; orb.Size=2; orb.BlendType=BlendTransparent; orb.DepthMask=DepthMaskDisable; mt2=MotionCyclOrbit.create(planframe,pname+"Orbit"); mt2.loadfile(pname,au2km,0.00001); planframe.motion=mt2; mt2.CreateCurve(orb,root.time,200); inclinframe=planframe.addsubframe("Inclin"); inclinframe.Transf.Xaxis=vecnorm(pinfo.poledir*vector(0,0,1)); inclinframe.Transf.Yaxis=pinfo.poledir*inclinframe.Transf.Xaxis; inclinframe.Transf.Zaxis=pinfo.poledir; globeframe=inclinframe.addsubframe("Globe"); tx=globeframe.createtexture(pname,DataDir+"\textures\"+pname+".jpg"); globerenderframe=globeframe.addsubframe("GlobeRendering"); globerenderframe.Transf.rotate(vector(0,0,1),Pi); if zoomf>0 then { globe=globerenderframe.add("sphere","Name":pname); globe.radius=pinfo.radius*zoomf; globe.resolution=30; globe.texture=pname; globe.canbuffer=true; if pname=="Saturnus" then ssys_createsaturnusrings(globerenderframe,pinfo.radius*zoomf); } mtr=MotionRotate.create(globeframe); mtr.normdir=vector(0,0,1); mtr.RotSpeed=2*Pi/(pinfo.rotperiod*60*60); mtr.TimeType=UT0; mtr.offsetangle=pinfo.rotoffset; globeframe.motion=mtr; return(planframe); } #returns the frame of the motion of a planet around the sun function GetPlanetFrame(planetname) { return(root.SC.Universe.SolarSystem.get(planetname)); } #returns the position of a planet function GetPlanetPosition(planetname) { return(root.SC.Universe.SolarSystem.get(planetname).Transf.origin); } #returns the frame of the body of a planet function GetPlanetBodyFrame(planetname) { return(root.SC.Universe.SolarSystem.get(planetname).Inclin.Globe); } #returns the orbit object of a planet function GetPlanetOrbit(name) { return(root.SC.Universe.SolarSystem.get(name+"Orbit")); } #returns the frame of the motion of Luna function GetLunaFrame() { return(root.SC.Universe.SolarSystem.Earth.Luna); } #returns the position of Luna relative to Earth function GetLunaPosition() { return(root.SC.Universe.SolarSystem.Earth.Luna.Transf.origin); } function calcpass2(tm,h,alpha,delta,lattit,longit,passtype) { tm.hour=0;tm.min=0;tm.sec=0; rs1=(tm.JD-2415020.0)/36525.0; th=0.276919398+100.0021359*rs1+0.000001075*rs1*rs1; th=th-floor(th); st00=th*2*Pi; csH=(sin(h)-sin(lattit)*sin(delta))/(cos(lattit)*cos(delta)); if abs(csH)>1 then { if fabs(delta-lattit)<=Pi/2 then return(0); else return(-1); } HH1=acos(csH); m0=(alpha-longit-st00)/(2*Pi);m=m0; if passtype==1 then m=m0-HH1/(2*Pi); if passtype==0 then m=m0+HH1/(2*Pi); #else: transit while m>1 do m=m-1; while m<0 do m=m+1; tm=tm+m*24*60*60; return(1); } #sets the universe time at the moment the objectframe passes through local viewers height h, #passtype=1 : rising #passtype=0 : setting function calcpass(objectframe,h,passtype,lattit,longit) { for ctr=1 to 3 do { x=objectframe.transf.origin.x-root.SC.Universe.SolarSystem.Earth.transf.origin.x; y=objectframe.transf.origin.y-root.SC.Universe.SolarSystem.Earth.transf.origin.y; z=objectframe.transf.origin.z-root.SC.Universe.SolarSystem.Earth.transf.origin.z; ecl1=angle(x,y); ecl2=atan(Z/sqrt(X*X+Y*Y)); alpha=0;delta=0; eclipt2equat(ecl1,ecl2,ref(alpha),ref(delta)); tm=root.time; if calcpass2(ref(tm),h,alpha,delta,lattit,longit,passtype)!=1 then return(false); root.time=tm; } }
56fdd9501461ef4887bff1bf1c641dcf4bc04d85
449d555969bfd7befe906877abab098c6e63a0e8
/2258/CH5/EX5.13/5_13.sce
38ee59194f7661c75e93a2299b48e37d3bc6259a
[]
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
225
sce
5_13.sce
clc(); clear; // To calculate the critical temperature p1=1; //1st pressure in mm p2=6; //2nd pressure in mm Tc1=5; //1st critical temp in K Tc2=Tc1*(p2/p1); printf("the critical temperature is %f K",Tc2);
a0c576b6052d9d060fbf5d0c70239bfd71a57e88
01ecab2f6eeeff384acae2c4861aa9ad1b3f6861
/sci2blif/macrocab_gen_fcn.sce
188a915e1b2573d492d4ea112e6ce2f7bca1167b
[]
no_license
jhasler/rasp30
9a7c2431d56c879a18b50c2d43e487d413ceccb0
3612de44eaa10babd7298d2e0a7cddf4a4b761f6
refs/heads/master
2023-05-25T08:21:31.003675
2023-05-11T16:19:59
2023-05-11T16:19:59
62,917,238
3
3
null
null
null
null
UTF-8
Scilab
false
false
71,426
sce
macrocab_gen_fcn.sce
global file_name path fname extension chip_num board_num brdtype macrocab_name folder_name bl_level; function dir_callback() disp(" "); endfunction function MC_folder_name_callback() global folder_name; folder_name_obj = findobj('tag','MC_folder_name'); folder_name = folder_name_obj.string; endfunction function MC_block_name_callback() global macrocab_name; block_name_obj = findobj('tag','MC_block_name'); macrocab_name = block_name_obj.string; endfunction function MC_bl_level_callback() global bl_level; bl_level="5"; // 5: "Mixed sp" 1_1: "level 1" 2: "level 2" bl_level_obj = findobj('tag','Block_level'); bl_level = bl_level_obj.value; if bl_level_obj.value == 1 then messagebox('Please define level of the block.', "Block category error", "error"); abort; elseif bl_level_obj.value == 2 then bl_level="1_1"; // Level 1 elseif bl_level_obj.value == 3 then bl_level="2"; // Level 2 end endfunction function Start_MC_design_callback() global macrocab_name folder_name; // Check to see if the macroblock name was read properly if macrocab_name == [] then messagebox('Macrocab name improperly read, try again', "Macroblock name error", "error"); abort; end // Check to see if the macroblock name starts with a number if isdigit(part(macrocab_name,1)) then messagebox('Macrocab name cannot start with a number', "Macroblock name error", "error"); abort; end // Macro cab block name overlap check fd_r = mopen("/home/ubuntu/rasp30/vpr2swcs/block_list",'r');block_list=mgetl(fd_r);mclose(fd_r); // Default value: frame. l_block_list=size(block_list,1); for ii=1:l_block_list if block_list(ii) == macrocab_name then messagebox('Please change the name of macro-cab block.', "Macroblock name error", "error"); abort; end end file_list=listfiles("/home/ubuntu/rasp30/xcos_blocks/*.sci"); l_file_list=size(file_list,1); for ii=1:l_file_list if file_list(ii) == "/home/ubuntu/rasp30/xcos_blocks/"+macrocab_name+".sci" then messagebox('Please change the name of macro-cab block.', "Macroblock name error", "error"); abort; end end temp_string="/home/ubuntu/RASP_Workspace/"+folder_name; mkdir(temp_string); cd(temp_string); unix_g("cp /home/ubuntu/rasp30/sci2blif/xcos_ref/macrocab_generation/macrocab_xcosref_30_30a.xcos "+macrocab_name+".xcos"); xcos(macrocab_name+".xcos"); messagebox('Make changes based on the provided xcos and Save it',"Design Macro-CAB block", "info", ["OK"], "modal"); endfunction function Generate_MC_callback() clear blk; global macrocab_name bl_level; // Check to see if the block level has been assigned if bl_level == [] then messagebox('Please define level of the block.', "Block category error", "error"); abort; end // Check to see if the macroblock name starts with a number if isdigit(part(macrocab_name,1)) then messagebox('Macrocab name cannot start with a number', "Macroblock name error", "error"); abort; end // Check to see if the macroblock name was read properly if macrocab_name == [] then messagebox('Macrocab name improperly read, try again', "Macroblock name error", "error"); abort; end // Macro cab block name overlap check fd_r = mopen("/home/ubuntu/rasp30/vpr2swcs/block_list",'r');block_list=mgetl(fd_r);mclose(fd_r); // Default value: frame. l_block_list=size(block_list,1); for ii=1:l_block_list if block_list(ii) == macrocab_name then messagebox('Please change the name of macro-cab block.', "Macroblock name error", "error"); abort; end end file_list=listfiles("/home/ubuntu/rasp30/xcos_blocks/*.sci"); l_file_list=size(file_list,1); for ii=1:l_file_list if file_list(ii) == "/home/ubuntu/rasp30/xcos_blocks/"+macrocab_name+".sci" then messagebox('Please change the name of macro-cab block.', "Macroblock name error", "error"); abort; end end xcos(macrocab_name+".xcos"); importXcosDiagram(macrocab_name+".xcos"); no=length(scs_m.objs); objnum=1; numoflink=0; numofblk=0; blk_objs=[]; link_name=zeros(1,no); routing_exception=%F; j=1; for i =1:no if(length(scs_m.objs(i))==5) then // Blocks blk(j,1)=i; blk_name.entries(j)=scs_m.objs(i).gui; blk_objs(objnum)=j; //BLOCK NUMBER actually stored objnum=objnum+1; j=j+1; numofblk=numofblk+1; end end // Get block information input_matrix=[0 0]; output_matrix=[0 0]; j_fgswc=1; fgswc_matrix=["" ""]; j_fgota=1; fgota_matrix=["" ""]; j_ota=1; ota_matrix=["" ""]; j_cap=1; cap_matrix=["" ""]; sum_p=0; // # of rpar parameter in an element for bl=1:length(blk_objs) if (blk_name.entries(bl)=='macrocab_in') then if scs_m.objs(bl).model.rpar(1) ~= "-" then input_matrix(strtod(scs_m.objs(bl).model.rpar(1))+1,1)=strtod(scs_m.objs(bl).model.rpar(1)); input_matrix(strtod(scs_m.objs(bl).model.rpar(1))+1,2)=scs_m.objs(bl).model.ipar(1); end end if (blk_name.entries(bl)=='macrocab_out') then if scs_m.objs(bl).model.rpar(1) ~= "-" then output_matrix(strtod(scs_m.objs(bl).model.rpar(1))+1,1)=strtod(scs_m.objs(bl).model.rpar(1)); output_matrix(strtod(scs_m.objs(bl).model.rpar(1))+1,2)=scs_m.objs(bl).model.ipar(1); end end if (blk_name.entries(bl)=='macrocab_fgswc') then if scs_m.objs(bl).model.rpar(1) ~= "-" then fgswc_matrix(j_fgswc,1) = scs_m.objs(bl).model.rpar(1); fgswc_matrix(j_fgswc,2) = string(scs_m.objs(bl).model.ipar(1)); fgswc_matrix(j_fgswc,3) = string(scs_m.objs(bl).model.ipar(2)); // Add exception for any FGs in routing if(scs_m.objs(bl).model.ipar(2) < 15 ) then routing_exception = %T; end if scs_m.objs(bl).model.rpar(1) == "T" then fgswc_matrix(j_fgswc,4) = scs_m.objs(bl).model.rpar(2); fgswc_matrix(j_fgswc,5) = scs_m.objs(bl).model.rpar(3); sum_p=sum_p+1; end j_fgswc=j_fgswc+1; end end if (blk_name.entries(bl)=='macrocab_fgota0') | (blk_name.entries(bl)=='macrocab_fgota1') then if scs_m.objs(bl).model.rpar(1) ~= "-" then for ii=1:7 fgota_matrix(j_fgota,ii) = scs_m.objs(bl).model.rpar(ii+1); end for ii=1:10 fgota_matrix(j_fgota,ii+7) = string(scs_m.objs(bl).model.ipar(ii)); end j_fgota=j_fgota+1; sum_p=sum_p+3; end end if (blk_name.entries(bl)=='macrocab_ota0') | (blk_name.entries(bl)=='macrocab_ota1') then if scs_m.objs(bl).model.rpar(1) ~= "-" then ota_matrix(j_ota,1) = scs_m.objs(bl).model.rpar(2); ota_matrix(j_ota,2) = scs_m.objs(bl).model.rpar(3); ota_matrix(j_ota,3) = string(scs_m.objs(bl).model.ipar(1)); ota_matrix(j_ota,4) = string(scs_m.objs(bl).model.ipar(2)); j_ota=j_ota+1; sum_p=sum_p+1; end end if (blk_name.entries(bl)=='macrocab_cap0') | (blk_name.entries(bl)=='macrocab_cap1') | (blk_name.entries(bl)=='macrocab_cap2') | (blk_name.entries(bl)=='macrocab_cap3') then if scs_m.objs(bl).model.rpar(1) ~= "-" then cap_matrix(j_cap,1) = scs_m.objs(bl).model.rpar(2); cap_matrix(j_cap,2) = string(scs_m.objs(bl).model.ipar(1)); cap_matrix(j_cap,3) = string(scs_m.objs(bl).model.ipar(2)); cap_matrix(j_cap,4) = string(scs_m.objs(bl).model.ipar(3)); cap_matrix(j_cap,5) = string(scs_m.objs(bl).model.ipar(4)); cap_matrix(j_cap,6) = string(scs_m.objs(bl).model.ipar(5)); cap_matrix(j_cap,7) = string(scs_m.objs(bl).model.ipar(6)); j_cap=j_cap+1; sum_p=sum_p+1; end end end //disp(input_matrix); disp(output_matrix); disp(fgswc_matrix); disp(fgota_matrix); disp(ota_matrix); disp(cap_matrix); numofinput = size(input_matrix,1); numofoutput = size(output_matrix,1); numoffgswc = size(fgswc_matrix,1); if fgswc_matrix == ["" ""] then numoffgswc =0; end numoffgota = size(fgota_matrix,1); if fgota_matrix == ["" ""] then numoffgota =0; end numofota = size(ota_matrix,1); if ota_matrix == ["" ""] then numofota =0; end numofcap = size(cap_matrix,1); if cap_matrix == ["" ""] then numofcap =0; end // arch fd_w= mopen("rasp3_arch_"+macrocab_name+"_1.xml",'wt'); mputl(msprintf("\t\t")+"<model name="""+macrocab_name+""">",fd_w); mputl(msprintf("\t\t\t")+"<input_ports>",fd_w); mputl(msprintf("\t\t\t\t")+"<port name=""in""/>",fd_w); mputl(msprintf("\t\t\t")+"</input_ports>",fd_w); mputl(msprintf("\t\t\t")+"<output_ports>",fd_w); mputl(msprintf("\t\t\t\t")+"<port name=""out""/>",fd_w); mputl(msprintf("\t\t\t")+"</output_ports>",fd_w); mputl(msprintf("\t\t")+"</model>",fd_w); mclose(fd_w); fd_w= mopen("rasp3_arch_"+macrocab_name+"_2.xml",'wt'); mputl(msprintf("\t\t\t")+"<pb_type name="""+macrocab_name+""" blif_model=""."+macrocab_name+""" num_pb=""1"">",fd_w); mputl(msprintf("\t\t\t\t")+"<input name=""in"" num_pins="""+string(numofinput)+"""/>",fd_w); mputl(msprintf("\t\t\t\t")+"<output name=""out"" num_pins="""+string(numofoutput)+"""/>",fd_w); mputl(msprintf("\t\t\t\t")+"<delay_constant max=""1.667e-9"" in_port="""+macrocab_name+".in"" out_port="""+macrocab_name+".out""/>",fd_w); mputl(msprintf("\t\t\t")+"</pb_type>",fd_w); mclose(fd_w); fd_w= mopen("rasp3_arch_"+macrocab_name+"_3.xml",'wt'); // Use direct tag for FGs in routing if routing_exception then if numofinput == 1 then mputl(msprintf("\t\t\t\t")+"<direct name=""crossbar"" input=""cab.I[0]"" output="""+macrocab_name+".in[0]""/>",fd_w); end if numofinput ~= 1 then mputl(msprintf("\t\t\t\t")+"<direct name=""crossbar"" input=""cab.I["+string(numofinput-1)+":0]"" output="""+macrocab_name+".in["+string(numofinput-1)+":0]""/>",fd_w); end else if numofinput == 1 then mputl(msprintf("\t\t\t\t")+"<complete name=""crossbar"" input=""cab.I[12:0]"" output="""+macrocab_name+".in[0]""/>",fd_w); end if numofinput ~= 1 then mputl(msprintf("\t\t\t\t")+"<complete name=""crossbar"" input=""cab.I[12:0]"" output="""+macrocab_name+".in["+string(numofinput-1)+":0]""/>",fd_w); end end if numofoutput == 1 then mputl(msprintf("\t\t\t\t")+"<complete name=""crossbar"" input="""+macrocab_name+"[0].out[0]"" output=""cab.O[4]""/>",fd_w); end if numofoutput ~= 1 then mputl(msprintf("\t\t\t\t")+"<direct name=""crossbar"" input="""+macrocab_name+"[0].out["+string(numofoutput-1)+":0]"" output=""cab.O[4:"+string(4-(numofoutput-1))+"]""/>",fd_w); end mclose(fd_w); // python fd_w= mopen("rasp30_"+macrocab_name+"_2_1.py",'wt'); if numofoutput == 1 then mputl(",''"+macrocab_name+"[0].out[0]''",fd_w); end if numofoutput ~= 1 then mputl(",''"+macrocab_name+"[0].out[0:"+string(numofoutput-1)+"]''",fd_w); end mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_3_1.py",'wt'); if numofinput == 1 then mputl(",''"+macrocab_name+"[0].in[0]''",fd_w); end if numofinput ~= 1 then mputl(",''"+macrocab_name+"[0].in[0:"+string(numofinput-1)+"]''",fd_w); end mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_4.py",'wt'); if numofoutput == 1 then mputl(msprintf("\t\t\t")+"''"+macrocab_name+"[0].out[0]'',[0,"+string(output_matrix(1,2))+"],",fd_w); end if numofoutput ~= 1 then output_string_temp="["+string(output_matrix(1,2)); for ii=2:numofoutput output_string_temp=output_string_temp+","+string(output_matrix(ii,2)); end output_string_temp=output_string_temp+"]"; mputl(msprintf("\t\t\t")+"''"+macrocab_name+"[0].out[0:"+string(numofoutput-1)+"]'',[0,"+output_string_temp+"],",fd_w); end mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_5.py",'wt'); if numofinput == 1 then mputl(msprintf("\t\t\t")+"''"+macrocab_name+"[0].in[0]'',["+string(input_matrix(1,2))+",0],",fd_w); end if numofinput ~= 1 then input_string_temp="["+string(input_matrix(1,2)); for ii=2:numofinput input_string_temp=input_string_temp+","+string(input_matrix(ii,2)); end input_string_temp=input_string_temp+"]"; mputl(msprintf("\t\t\t")+"''"+macrocab_name+"[0].in[0:"+string(numofinput-1)+"]'',["+input_string_temp+",0],",fd_w); end mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_7.py",'wt'); mputl("+[''"+macrocab_name+"'']*1",fd_w); mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_8_1.py",'wt'); mputl(",''"+macrocab_name+"_in'':"+string(numofinput),fd_w); mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_8_2.py",'wt'); mputl(",''"+macrocab_name+"_out'':"+string(numofoutput),fd_w); mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_9.py",'wt'); mputl(msprintf("\t\t\t")+"''"+macrocab_name+"[0]'',[0,0],",fd_w); mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_10.py",'wt'); ls_temp = msprintf("\t\t\t")+"''"+macrocab_name+"_ls[0]'',["; // ls: local switch comma_string=""; ls_flag=0; // 0: off, 1: on if numoffgswc ~= 0 then for ii=1:numoffgswc if fgswc_matrix(ii,1) == "C" then ls_temp=ls_temp+comma_string+"["+fgswc_matrix(ii,2)+","+fgswc_matrix(ii,3)+"]";comma_string=","; ls_flag=1; end end end if numoffgota ~= 0 then for ii=1:numoffgota if fgota_matrix(ii,7) == "0" then ls_temp=ls_temp+comma_string+"["+fgota_matrix(ii,14)+","+fgota_matrix(ii,15)+"],["+fgota_matrix(ii,16)+","+fgota_matrix(ii,17)+"]"; comma_string=","; ls_flag=1; end end end ls_temp = ls_temp + "],"; if ls_flag == 1 then mputl(ls_temp,fd_w); end if numofcap ~= 0 then for ii=1:numofcap // cs: cap switch mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+cap_matrix(ii,1)+"_4x_cs[0]'',["+cap_matrix(ii,2)+","+cap_matrix(ii,3)+"],",fd_w); mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+cap_matrix(ii,1)+"_2x_cs[0]'',["+cap_matrix(ii,4)+","+cap_matrix(ii,5)+"],",fd_w); mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+cap_matrix(ii,1)+"_1x_cs[0]'',["+cap_matrix(ii,6)+","+cap_matrix(ii,7)+"],",fd_w); end end if numoffgota ~= 0 then for ii=1:numoffgota mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+fgota_matrix(ii,1)+"[0]'',["+fgota_matrix(ii,8)+","+fgota_matrix(ii,9)+"],",fd_w); mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+fgota_matrix(ii,3)+"[0]'',["+fgota_matrix(ii,10)+","+fgota_matrix(ii,11)+"],",fd_w); mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+fgota_matrix(ii,5)+"[0]'',["+fgota_matrix(ii,12)+","+fgota_matrix(ii,13)+"],",fd_w); end end if numofota ~= 0 then for ii=1:numofota mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+ota_matrix(ii,1)+"[0]'',["+ota_matrix(ii,3)+","+ota_matrix(ii,4)+"],",fd_w); end end if numoffgswc ~= 0 then for ii=1:numoffgswc if fgswc_matrix(ii,1) == "T" then mputl(msprintf("\t\t\t")+"''"+macrocab_name+"_"+fgswc_matrix(ii,4)+"[0]'',["+fgswc_matrix(ii,2)+","+fgswc_matrix(ii,3)+"],",fd_w); end end end mclose(fd_w); fd_w= mopen("rasp30_"+macrocab_name+"_11.py",'wt'); append1_temp = msprintf("\t\t\t\t\t\t\t\t")+"elif swc_name1 in ["; // append1: local target (FGs) comma_string=""; append1_flag=0; // 0: off, 1: on if numoffgswc ~= 0 then for ii=1:numoffgswc if fgswc_matrix(ii,1) == "T" then append1_temp=append1_temp+comma_string+"''"+macrocab_name+"_"+fgswc_matrix(ii,4)+"[0]''";comma_string=","; append1_flag=1; end end end append1_temp = append1_temp + "]:"; if append1_flag == 1 then mputl(append1_temp,fd_w); mputl(msprintf("\t\t\t\t\t\t\t\t\t")+"swcx.append(1)",fd_w); end append2_temp = msprintf("\t\t\t\t\t\t\t\t")+"elif swc_name1 in ["; // append2: ota bias comma_string=""; append2_flag=0; // 0: off, 1: on if numofota ~= 0 then for ii=1:numofota append2_temp=append2_temp+comma_string+"''"+macrocab_name+"_"+ota_matrix(ii,1)+"[0]''"; comma_string=","; append2_flag=1; end end if numoffgota ~= 0 then for ii=1:numoffgota append2_temp=append2_temp+comma_string+"''"+macrocab_name+"_"+fgota_matrix(ii,1)+"[0]''"; comma_string=","; append2_flag=1; end end append2_temp = append2_temp + "]:"; if append2_flag == 1 then mputl(append2_temp,fd_w); mputl(msprintf("\t\t\t\t\t\t\t\t\t")+"swcx.append(2)",fd_w); end append3_temp = msprintf("\t\t\t\t\t\t\t\t")+"elif swc_name1 in ["; // append3: fgota input FG bias comma_string=""; append3_flag=0; // 0: off, 1: on if numoffgota ~= 0 then for ii=1:numoffgota append3_temp=append3_temp+comma_string+"''"+macrocab_name+"_"+fgota_matrix(ii,3)+"[0]''"; comma_string=","; append3_temp=append3_temp+comma_string+"''"+macrocab_name+"_"+fgota_matrix(ii,5)+"[0]''"; comma_string=","; append3_flag=1; end end append3_temp = append3_temp + "]:"; if append3_flag == 1 then mputl(append3_temp,fd_w); mputl(msprintf("\t\t\t\t\t\t\t\t\t")+"swcx.append(3)",fd_w); end mclose(fd_w); // genswcs.py fd_w= mopen("genswcs_"+macrocab_name+"_2_1.py",'wt'); if numofoutput > 1 then mputl(",''"+macrocab_name+"[0]''",fd_w); end mclose(fd_w); fd_w= mopen("genswcs_"+macrocab_name+"_4_1.py",'wt'); if numofoutput > 1 then mputl(",''"+macrocab_name+"[0]''",fd_w); end mclose(fd_w); fd_w= mopen("genswcs_"+macrocab_name+"_5.py",'wt'); mputl(msprintf("\t\t\t\t")+"elif subckt in [''"+macrocab_name+"'']:",fd_w); mputl(msprintf("\t\t\t\t\t")+"key=ports["+string(numofinput)+"]",fd_w); mclose(fd_w); dir_frame ="/home/ubuntu/rasp30/vpr2swcs/macroblk_generation/frame/"; // .xml (arch) rasp_xml_list={"rasp3";"rasp3a";}; l_rasp_xml_list=size(rasp_xml_list,1); for ii=1:l_rasp_xml_list unix_w("cat "+dir_frame+rasp_xml_list(ii)+"_arch_frame1.xml rasp3_arch_"+macrocab_name+"_1.xml > "+rasp_xml_list(ii)+"_arch_gen1.xml"); unix_w("cat "+dir_frame+rasp_xml_list(ii)+"_arch_frame2.xml rasp3_arch_"+macrocab_name+"_2.xml > "+rasp_xml_list(ii)+"_arch_gen2.xml"); unix_w("cat "+dir_frame+rasp_xml_list(ii)+"_arch_frame3.xml rasp3_arch_"+macrocab_name+"_3.xml > "+rasp_xml_list(ii)+"_arch_gen3.xml"); end // .py (python) rasp_py_list={"rasp30";"rasp30a";}; l_rasp_py_list=size(rasp_py_list,1); for ii=1:l_rasp_py_list //unix_w("cp "+dir_frame+rasp_py_list(ii)+"_frame1.py ."); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame2_1.py",'r');temp2=mgetl(fd_r);mclose(fd_r); fd_r = mopen("rasp30_"+macrocab_name+"_2_1.py",'r');temp2=temp2+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_frame2_1.py",'wt');mputl(temp2,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame2_2.py",'r');temp2=temp2+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_gen2.py",'wt');mputl(temp2,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame3_1.py",'r');temp3=mgetl(fd_r);mclose(fd_r); fd_r = mopen("rasp30_"+macrocab_name+"_3_1.py",'r');temp3=temp3+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_frame3_1.py",'wt');mputl(temp3,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame3_2.py",'r');temp3=temp3+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_gen3.py",'wt');mputl(temp3,fd_w);mclose(fd_w); unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame4.py rasp30_"+macrocab_name+"_4.py > "+rasp_py_list(ii)+"_gen4.py"); unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame5.py rasp30_"+macrocab_name+"_5.py > "+rasp_py_list(ii)+"_gen5.py"); //unix_w("cp "+dir_frame+rasp_py_list(ii)+"_frame6.py ."); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame7.py",'r');temp7=mgetl(fd_r);mclose(fd_r); fd_r = mopen("rasp30_"+macrocab_name+"_7.py",'r');temp7=temp7+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_gen7.py",'wt');mputl(temp7,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame8_1.py",'r');temp8_1=mgetl(fd_r);mclose(fd_r); fd_r = mopen("rasp30_"+macrocab_name+"_8_1.py",'r');temp8_1=temp8_1+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_frame8_1.py",'wt');mputl(temp8_1,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame8_2.py",'r');temp8_2=mgetl(fd_r);mclose(fd_r); fd_r = mopen("rasp30_"+macrocab_name+"_8_2.py",'r');temp8_2=temp8_2+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_frame8_2.py",'wt');mputl(temp8_2,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+rasp_py_list(ii)+"_frame8_3.py",'r');temp8=temp8_1+temp8_2+mgetl(fd_r);mclose(fd_r); fd_w= mopen(rasp_py_list(ii)+"_gen8.py",'wt');mputl(temp8,fd_w);mclose(fd_w); unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame9.py rasp30_"+macrocab_name+"_9.py > "+rasp_py_list(ii)+"_gen9.py"); unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame10.py rasp30_"+macrocab_name+"_10.py > "+rasp_py_list(ii)+"_gen10.py"); unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame11.py rasp30_"+macrocab_name+"_11.py > "+rasp_py_list(ii)+"_gen11.py"); //unix_w("cp "+dir_frame+rasp_py_list(ii)+"_frame12.py ."); end // genswcs.py fd_r = mopen(dir_frame+"genswcs_frame2_1.py",'r');temp2=mgetl(fd_r);mclose(fd_r); fd_r = mopen("genswcs_"+macrocab_name+"_2_1.py",'r');temp2=temp2+mgetl(fd_r);mclose(fd_r); fd_w= mopen("genswcs_frame2_1.py",'wt');mputl(temp2,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+"genswcs_frame2_2.py",'r');temp2=temp2+mgetl(fd_r);mclose(fd_r); fd_w= mopen("genswcs_gen2.py",'wt');mputl(temp2,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+"genswcs_frame4_1.py",'r');temp4=mgetl(fd_r);mclose(fd_r); fd_r = mopen("genswcs_"+macrocab_name+"_4_1.py",'r');temp4=temp4+mgetl(fd_r);mclose(fd_r); fd_w= mopen("genswcs_frame4_1.py",'wt');mputl(temp4,fd_w);mclose(fd_w); fd_r = mopen(dir_frame+"genswcs_frame4_2.py",'r');temp4=temp4+mgetl(fd_r);mclose(fd_r); fd_w= mopen("genswcs_gen4.py",'wt');mputl(temp4,fd_w);mclose(fd_w); unix_w("cat "+dir_frame+"genswcs_frame5.py genswcs_"+macrocab_name+"_5.py > genswcs_gen5.py"); //////////////////////////////////////////////////////////// // Make Block information matrix (mblif_xcos, match_ele) /////////////////////////////////////////////////////////// clear mblif_xcos match_ele; mblif_xcos(1,1)=macrocab_name; mblif_xcos(1,2)=string(numofinput); mblif_xcos(1,3)=string(numofoutput); mblif_xcos(2,1)="2";mblif_xcos(2,2)="1";mblif_xcos(2,3)="2"; mblif_xcos(3,1)=string(sum_p+1); mblif_xcos(4,1)="num_of_blk";mblif_xcos(4,2)="1";mblif_xcos(4,3)="mblif_num";mblif_xcos(4,4)="0"; mblif_xcos(5,1)="num_of_blk";mblif_xcos(5,2)="mblif_num"; No_ele=1; // Row in match_ele col_match=1; // column in match_ele match_ele=[""]; match_ele(No_ele,col_match)=macrocab_name;col_match=col_match+1; // blif block name match_ele(No_ele,col_match)=string(1);col_match=col_match+1; // mblif number match_ele(No_ele,col_match)=string(1);col_match=col_match+1; // vectorized number match_ele(No_ele,col_match)=string(numofinput);col_match=col_match+1; // # of input match_ele(No_ele,col_match)=string(numofoutput);col_match=col_match+1; // # of output if ls_flag == 0 then // # of blif parameters without ls match_ele(No_ele,col_match)=string(sum_p);col_match=col_match+1; end if ls_flag == 1 then // # of blif parameters with ls match_ele(No_ele,col_match)=string(sum_p+1);col_match=col_match+1; end No_rpar=1; // rpar number col_mblif_xcos=1; // column in bmlif xcos ele_index=["#" macrocab_name "bl_no" "1" "1"]; // col_blif=1; // column in blif for ii=1:numofinput // Inputs match_ele(No_ele,col_match)="1";col_match=col_match+1; // external match_ele(No_ele,col_match)=string(ii);col_match=col_match+1; end for ii=1:numofoutput // Outputs match_ele(No_ele,col_match)="1";col_match=col_match+1; // external match_ele(No_ele,col_match)=string(ii+numofinput);col_match=col_match+1; end if ls_flag == 1 then // # of blif parameters with ls match_ele(No_ele,col_match)="0";col_match=col_match+1; match_ele(No_ele,col_match)=macrocab_name+"_ls";col_match=col_match+1; match_ele(No_ele,col_match)="0";col_match=col_match+1; end // Parameter order (Important): 1.fgswc 2.fgota 3.ota 4.cap for ii=1:numoffgswc if fgswc_matrix(ii,1) == "T" then match_ele(No_ele,col_match)="1";col_match=col_match+1; //1:bias match_ele(No_ele,col_match)=macrocab_name+"_"+fgswc_matrix(ii,4);col_match=col_match+1; match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+fgswc_matrix(ii,4); mblif_xcos(4,2*col_mblif_xcos+4)=fgswc_matrix(ii,5); mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+fgswc_matrix(ii,4); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; end end for ii=1:numoffgota // Ibias -> pbias -> nbias match_ele(No_ele,col_match)="1";col_match=col_match+1; // 1:bias match_ele(No_ele,col_match)=macrocab_name+"_"+fgota_matrix(ii,1);col_match=col_match+1; // Ibias match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+fgota_matrix(ii,1); mblif_xcos(4,2*col_mblif_xcos+4)=fgota_matrix(ii,2); mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+fgota_matrix(ii,1); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; match_ele(No_ele,col_match)="1";col_match=col_match+1; // 1:bias match_ele(No_ele,col_match)=macrocab_name+"_"+fgota_matrix(ii,3);col_match=col_match+1; // Ibias_p match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+fgota_matrix(ii,3); mblif_xcos(4,2*col_mblif_xcos+4)=fgota_matrix(ii,4); mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+fgota_matrix(ii,3); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; match_ele(No_ele,col_match)="1";col_match=col_match+1; // 1:bias match_ele(No_ele,col_match)=macrocab_name+"_"+fgota_matrix(ii,5);col_match=col_match+1; // Ibias_n match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+fgota_matrix(ii,5); mblif_xcos(4,2*col_mblif_xcos+4)=fgota_matrix(ii,6); mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+fgota_matrix(ii,5); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; end for ii=1:numofota match_ele(No_ele,col_match)="1";col_match=col_match+1; // 1:bias match_ele(No_ele,col_match)=macrocab_name+"_"+ota_matrix(ii,1);col_match=col_match+1; // Ibias match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+ota_matrix(ii,1); mblif_xcos(4,2*col_mblif_xcos+4)=ota_matrix(ii,2); mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+ota_matrix(ii,1); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; end for ii=1:numofcap match_ele(No_ele,col_match)="3";col_match=col_match+1; // 3:Cap match_ele(No_ele,col_match)=macrocab_name+"_"+cap_matrix(ii,1);col_match=col_match+1; match_ele(No_ele,col_match)=string(No_rpar); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)=macrocab_name+"_"+cap_matrix(ii,1); mblif_xcos(4,2*col_mblif_xcos+4)="1"; mblif_xcos(5,col_mblif_xcos+2)=macrocab_name+"_"+cap_matrix(ii,1); mblif_xcos(6,2*col_mblif_xcos)=string(No_ele); mblif_xcos(6,2*col_mblif_xcos+1)=string(col_match-2); No_rpar=No_rpar+1;col_mblif_xcos=col_mblif_xcos+1;col_match=col_match+1; end mblif_xcos(3,1)=string(No_rpar); mblif_xcos(1,4)=string(No_rpar+2); mblif_xcos(3,col_mblif_xcos+1)=string(col_mblif_xcos+2); mblif_xcos(4,2*col_mblif_xcos+3)="fix_loc''"; mblif_xcos(4,2*col_mblif_xcos+4)="[0;0;0]"; mblif_xcos(5,col_mblif_xcos+2)="fix_loc"; mblif_xcos(6,1)=string(sum_p); mblif_xcos(7,1)=string(No_ele);mblif_xcos(7,2)="0";mblif_xcos(7,3)="0"; // vcc_flag=0, gnd_flag=0 // disp(fgswc_matrix); // disp(fgota_matrix); // disp(ota_matrix); // disp(cap_matrix); // disp(mblif_xcos); // disp(match_ele); ////////////////////////////////// // Write Block information file ////////////////////////////////// fd_w= mopen("/home/ubuntu/rasp30/sci2blif/block_info/bi_"+macrocab_name+".sci",'wt'); str_temp01=mblif_xcos(1,1)+","+mblif_xcos(1,2)+","+mblif_xcos(1,3)+","+mblif_xcos(1,4); str_temp02=mblif_xcos(2,1)+","+mblif_xcos(2,2)+","+mblif_xcos(2,3); str_temp03=mblif_xcos(3,1); str_temp04=mblif_xcos(4,1)+","+mblif_xcos(4,2)+","+mblif_xcos(4,3)+","+mblif_xcos(4,4); str_temp05=mblif_xcos(5,1)+","+mblif_xcos(5,2); str_temp06=mblif_xcos(6,1); j=1; for i=1:strtod(mblif_xcos(6,1)) str_temp03=str_temp03+","+mblif_xcos(3,i+1); str_temp04=str_temp04+","+mblif_xcos(4,2*i+3)+","+mblif_xcos(4,2*i+4); str_temp05=str_temp05+","+mblif_xcos(5,i+2); str_temp06=str_temp06+","+mblif_xcos(6,2*i)+","+mblif_xcos(6,2*i+1); j=i+1; end str_temp03=str_temp03+","+mblif_xcos(3,j+1); str_temp04=str_temp04+","+mblif_xcos(4,2*j+3)+","+mblif_xcos(4,2*j+4); str_temp05=str_temp05+","+mblif_xcos(5,j+2); str_temp07=mblif_xcos(7,1)+","+mblif_xcos(7,2)+","+mblif_xcos(7,3); mputl(str_temp01,fd_w);mputl(str_temp02,fd_w);mputl(str_temp03,fd_w);mputl(str_temp04,fd_w);mputl(str_temp05,fd_w);mputl(str_temp06,fd_w);mputl(str_temp07,fd_w); for i=1:strtod(mblif_xcos(7,1)) temp_col=7; str_temp=match_ele(i,1)+","+match_ele(i,2)+","+match_ele(i,3)+","+match_ele(i,4)+","+match_ele(i,5)+","+match_ele(i,6); for j=1:strtod(match_ele(i,4)) str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; end for j=1:strtod(match_ele(i,5)) str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; end for j=1:strtod(match_ele(i,6)) str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; str_temp=str_temp+','+match_ele(i,temp_col);temp_col=temp_col+1; end mputl(str_temp,fd_w); end mputl("//------ Here, everything should be in Order with no space ------//",fd_w); mputl("// Xcos block name, # of input, # of output, # of Xcos paramters (exprs)",fd_w); mputl("// # of ipar, order",fd_w); mputl("// # of rpar, order",fd_w); mputl("// Xcos parameter, default value, ...",fd_w); mputl("// Xcos parameters - exprs",fd_w); mputl("// # of user defined rpars, BLIF block #, column #, ...",fd_w); mputl("// # of BLIF blocks, # of rpar BLIF parameters,vcc_flag,gnd_flag",fd_w); mputl("// 1st block name, mblif #, vectorized #, # of input, # of output, # of BLIF parameters, input type(0:internal,1:external,2:vcc,3:gnd), number/name, output type, number/name, BLIF parameters type(0:connection,1:bias,2:bias(hidden),3:cap,4:cap(hidden),5:smcap,6:smcap(hidden)), name, value / Xcos parameter # in rpar",fd_w); mclose(fd_w); ////////////////////////////////// // Read Block information file ////////////////////////////////// mblif_xcos_r=[""]; ele_index_r=[""]; fd_r = mopen("/home/ubuntu/rasp30/sci2blif/block_info/bi_"+macrocab_name+".sci",'r'); for i=1:7 str_temp=mgetl(fd_r, 1); str_temp=strsplit(str_temp,[","],100);str_size=size(str_temp); for j=1:str_size(1) mblif_xcos_r(i,j)=str_temp(j) end end for i=1:strtod(mblif_xcos_r(7,1)) str_temp=mgetl(fd_r, 1); str_temp=strsplit(str_temp,[","],100);str_size=size(str_temp); for j=1:str_size(1) ele_index_r(i,j)=str_temp(j) end end mclose(fd_r); //disp(mblif_xcos_r); //disp(ele_index_r); ///////////////////// // Make Xcos block ///////////////////// mblif_name=mblif_xcos_r(1,1); // mblif name input_num=strtod(mblif_xcos_r(1,2)); // # of inputs output_num=strtod(mblif_xcos_r(1,3)); // # of outputs ipar_num=strtod(mblif_xcos_r(2,1)); // # of ipar rpar_num=strtod(mblif_xcos_r(3,1)); // # of rpar ipar_rpar_num=ipar_num+rpar_num; // # of ipar + # of rpar set_str1="";set_str2="";set_str3="";set_ipar="";set_rpar="";define_str=[""];model_in="";model_out="";exprs_str=""; for i=1:ipar_rpar_num set_str1=set_str1+mblif_xcos_r(5,i); set_str2=set_str2+"''"+mblif_xcos_r(5,i)+"''"; set_str3=set_str3+"''vec'',-1"; define_str(i)=" "+mblif_xcos_r(5,i)+"="+mblif_xcos_r(4,2*i)+";"; exprs_str=exprs_str+"sci2exp("+mblif_xcos_r(5,i)+")"; if i~=ipar_rpar_num then set_str1=set_str1+",";set_str2=set_str2+";";set_str3=set_str3+","; exprs_str=exprs_str+";"; end end for i=1:ipar_num set_ipar=set_ipar+mblif_xcos_r(4,2*i-1); if i~=ipar_num then set_ipar=set_ipar+","; end end for i=1:rpar_num set_rpar=set_rpar+mblif_xcos_r(4,2*i+3); if i~=rpar_num then set_rpar=set_rpar+","; end end for i=1:input_num model_in=model_in+"-1"; if i~=input_num then model_in=model_in+";"; end end for i=1:output_num model_out=model_out+"-1"; if i~=output_num then model_out=model_out+";"; end end fd_w= mopen ("/home/ubuntu/rasp30/xcos_blocks/"+macrocab_name+".sci",'wt'); //fd_w= mopen (macrocab_name+"_xcos.sci",'wt'); mputl("function [x,y,typ]="+mblif_name+"(job,arg1,arg2)",fd_w); mputl(" x=[];y=[];typ=[];",fd_w); mputl(" select job",fd_w); mputl(" case ''plot'' then standard_draw(arg1)",fd_w); mputl(" case ''getinputs'' then [x,y,typ]=standard_inputs(arg1)",fd_w); mputl(" case ''getoutputs'' then [x,y,typ]=standard_outputs(arg1)",fd_w); mputl(" case ''getorigin'' then [x,y]=standard_origin(arg1)",fd_w); mputl(" case ''set'' then",fd_w); mputl(" x=arg1;graphics=arg1.graphics;model=arg1.model;exprs=graphics.exprs;",fd_w); mputl(" while %t do",fd_w); mputl(" [ok,"+set_str1+",exprs]=scicos_getvalue(''New Block Parameter'',["+set_str2+"],list("+set_str3+"),exprs);",fd_w); mputl(" if ~ok then break,end",fd_w); mputl(" if ok then",fd_w); mputl(" model.ipar=["+set_ipar+"];",fd_w); mputl(" model.rpar=["+set_rpar+"];",fd_w); mputl(" graphics.exprs=exprs;",fd_w); mputl(" x.graphics=graphics;",fd_w); mputl(" x.model=model",fd_w); mputl(" break;",fd_w); mputl(" end",fd_w); mputl(" end",fd_w); mputl(" case ''define'' then",fd_w); mputl(define_str,fd_w); mputl(" model=scicos_model();",fd_w); mputl(" model.sim=list(''"+mblif_name+"_c'',5);",fd_w); mputl(" model.in=["+model_in+"];",fd_w); mputl(" model.in2=["+model_in+"];",fd_w); mputl(" model.intyp=["+model_in+"];",fd_w); mputl(" model.out=["+model_out+"];",fd_w); mputl(" model.out2=["+model_out+"];",fd_w); mputl(" model.outtyp=["+model_out+"];",fd_w); mputl(" model.ipar=["+set_ipar+"];",fd_w); mputl(" model.rpar=["+set_rpar+"];",fd_w); mputl(" model.blocktype=''d'';",fd_w); mputl(" model.dep_ut=[%f %t]; //[block input has direct feedthrough to output w/o ODE block always active]",fd_w); mputl(" ",fd_w); mputl(" exprs=["+exprs_str+"];",fd_w); mputl(" gr_i=[''text=[''''"+mblif_name+"''''];'';''xstringb(orig(1),orig(2),txt,sz(1),sz(2),''''fill'''');'']",fd_w); mputl(" x=standard_define([5 3],model, exprs,gr_i) //Numbers define the width and height of block",fd_w); mputl(" end",fd_w); mputl("endfunction",fd_w); mclose(fd_w); ////////////////////////////////////////////// // Generate rasp_design function ////////////////////////////////////////////// fd_w= mopen ("/home/ubuntu/rasp30/sci2blif/rasp_design_added_blocks/"+macrocab_name+".sce",'wt'); //fd_w= mopen (macrocab_name+"_rasp_design.sce",'wt'); mputl("style.fontSize=12;",fd_w); mputl("style.displayedLabel="""+mblif_name+""";",fd_w); mputl("pal"+bl_level+"=xcosPalAddBlock(pal"+bl_level+","""+mblif_name+""",[],style);",fd_w); mclose(fd_w); ////////////////////////////////////////////// // Generate sci2blif function ////////////////////////////////////////////// blif_bl_num=strtod(mblif_xcos_r(7,1)); // # of BLIF blocks fd_w= mopen ("/home/ubuntu/rasp30/sci2blif/sci2blif_added_blocks/"+macrocab_name+".sce",'wt'); //fd_w= mopen (macrocab_name+"_sci2blif.sce",'wt'); mputl("//**************************** "+mblif_name+" **********************************",fd_w); mputl("if (blk_name.entries(bl) == """+mblif_name+""") then",fd_w); mputl(" for ss=1:scs_m.objs(bl).model.ipar(1)",fd_w); mputl(" mputl(""# "+mblif_name+" ""+string(bl)+"" ""+string(scs_m.objs(bl).model.ipar(2))+"" ""+string(ss),fd_w);",fd_w); for i=1:blif_bl_num sci2blif_str=""; str_line=1; sci2blif_str(str_line)=" sci2blif_str= "".subckt "+ele_index_r(i,1)+""""; k=7; for j=1:strtod(ele_index_r(i,4)) // # of inputs sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" in["+string(j-1)+"]="; if strtod(ele_index_r(i,k))==0 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_"+"""+string(bl)+""_""+string(ss)"; end if strtod(ele_index_r(i,k))==1 then if strtod(ele_index_r(i,k+1)) <= input_num then sci2blif_str(str_line)=sci2blif_str(str_line)+"net""+string(blk(blk_objs(bl),"+string(strtod(ele_index_r(i,k+1))+1)+"))+""_""+string(ss)"; end if strtod(ele_index_r(i,k+1)) > input_num then sci2blif_str(str_line)=sci2blif_str(str_line)+"net""+string(blk(blk_objs(bl),"+string(strtod(ele_index_r(i,k+1))+1-input_num)+"+numofip))+""_""+string(ss)"; end end if strtod(ele_index_r(i,k))==2 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+""""; end if strtod(ele_index_r(i,k))==3 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+""""; end k=k+2; end for j=1:strtod(ele_index_r(i,5)) // # of outputs sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" out["+string(j-1)+"]="; if strtod(ele_index_r(i,k))==0 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_"+"""+string(bl)+""_""+string(ss)"; end if strtod(ele_index_r(i,k))==1 then if strtod(ele_index_r(i,k+1)) <= input_num then sci2blif_str(str_line)=sci2blif_str(str_line)+"net""+string(blk(blk_objs(bl),"+string(strtod(ele_index_r(i,k+1))+1)+"))+""_""+string(ss)"; end if strtod(ele_index_r(i,k+1)) > input_num then sci2blif_str(str_line)=sci2blif_str(str_line)+"net""+string(blk(blk_objs(bl),"+string(strtod(ele_index_r(i,k+1))+1-input_num)+"+numofip))+""_""+string(ss)"; end end k=k+2; end for j=1:strtod(ele_index_r(i,6)) // # of parameters if strtod(ele_index_r(i,k))==0 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+" ="+ele_index_r(i,k+2)+""""; end if strtod(ele_index_r(i,k))==1 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+" =""+string(sprintf(''%e'',scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss)))"; end if strtod(ele_index_r(i,k))==2 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+" ="+ele_index_r(i,k+2)+""""; end if strtod(ele_index_r(i,k))==3 then str_line=str_line+1; if j==1 then sci2blif_str(str_line)=" sci2blif_str=sci2blif_str+"" #"""; end if j~=1 then sci2blif_str(str_line)=" sci2blif_str=sci2blif_str+""&"""; end sci2blif_str(str_line)=sci2blif_str(str_line)+";"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 1 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_1x_cs =1""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 2 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_2x_cs =2""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 3 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_1x_cs =3"+"&"+ele_index_r(i,k+1)+"_2x_cs =0""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 4 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_4x_cs =4""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 5 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_1x_cs =5"+"&"+ele_index_r(i,k+1)+"_4x_cs =0""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 6 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_2x_cs =6"+"&"+ele_index_r(i,k+1)+"_4x_cs =0""; end"; str_line=str_line+1; sci2blif_str(str_line)=" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss) == 7 then sci2blif_str=sci2blif_str+"""+ele_index_r(i,k+1)+"_1x_cs =7"+"&"+ele_index_r(i,k+1)+"_2x_cs =0"+"&"+ele_index_r(i,k+1)+"_4x_cs =0""; end"; str_line=str_line+1; end if strtod(ele_index_r(i,k))==4 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end if strtod(ele_index_r(i,k+2)) == 1 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_1x_cs =1"""; end if strtod(ele_index_r(i,k+2)) == 2 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_2x_cs =2"""; end if strtod(ele_index_r(i,k+2)) == 3 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_1x_cs =3"+"&"+ele_index_r(i,k+1)+"_2x_cs =0"""; end if strtod(ele_index_r(i,k+2)) == 4 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_4x_cs =4"""; end if strtod(ele_index_r(i,k+2)) == 5 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_1x_cs =5"+"&"+ele_index_r(i,k+1)+"_4x_cs =0"""; end if strtod(ele_index_r(i,k+2)) == 6 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_2x_cs =6"+"&"+ele_index_r(i,k+1)+"_4x_cs =0"""; end if strtod(ele_index_r(i,k+2)) == 7 then sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+"_1x_cs =7"+"&"+ele_index_r(i,k+1)+"_2x_cs =0"+"&"+ele_index_r(i,k+1)+"_4x_cs =0"""; end end if strtod(ele_index_r(i,k))==5 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+" =""+string(scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+ele_index_r(i,k+2)+"-1)+ss))"; end if strtod(ele_index_r(i,k))==6 then if j==1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+"" #"; end if j~=1 then sci2blif_str(str_line)=sci2blif_str(str_line)+"+""&"; end sci2blif_str(str_line)=sci2blif_str(str_line)+ele_index_r(i,k+1)+" ="+ele_index_r(i,k+2)+""""; end k=k+3; end mputl(sci2blif_str,fd_w); mputl(" mputl(sci2blif_str,fd_w);",fd_w); mputl(" mputl("" "",fd_w);",fd_w); sum_p=sum_p+1; mputl(" if scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+string(sum_p)+"-1)+1) == 1 then",fd_w); mputl(" plcvpr = %t;",fd_w); mputl(" plcloc=[plcloc;''net''+string(blk(blk_objs(bl),2+numofip))+""_""+string(ss),string(scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+string(sum_p)+"-1)+1+2*ss-1))+'' ''+string(scs_m.objs(bl).model.rpar(scs_m.objs(bl).model.ipar(1)*("+string(sum_p)+"-1)+1+2*ss))+'' 0''];",fd_w); mputl(" end",fd_w); end mputl(" end",fd_w); //mputl(" mputl("""",fd_w);",fd_w); mputl("end",fd_w); mclose(fd_w); dir_py="/home/ubuntu/rasp30/vpr2swcs/"; dir_arch="/home/ubuntu/rasp30/vpr2swcs/arch/"; //////////////////////////// // Update files to folders /////////////////////////// for ii=1:l_rasp_xml_list unix_w("cp "+rasp_xml_list(ii)+"_arch_gen1.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame1.xml"); unix_w("cp "+rasp_xml_list(ii)+"_arch_gen2.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame2.xml"); unix_w("cp "+rasp_xml_list(ii)+"_arch_gen3.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame3.xml"); end for ii=1:l_rasp_xml_list unix_w("cat "+dir_frame+rasp_xml_list(ii)+"_arch_frame1.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame2.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame3.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame4.xml "+"> "+dir_arch+rasp_xml_list(ii)+"_arch.xml"); end for ii=1:l_rasp_py_list unix_w("cp "+rasp_py_list(ii)+"_frame2_1.py "+dir_frame+rasp_py_list(ii)+"_frame2_1.py"); unix_w("cp "+rasp_py_list(ii)+"_gen2.py "+dir_frame+rasp_py_list(ii)+"_gen2.py"); unix_w("cp "+rasp_py_list(ii)+"_frame3_1.py "+dir_frame+rasp_py_list(ii)+"_frame3_1.py"); unix_w("cp "+rasp_py_list(ii)+"_gen3.py "+dir_frame+rasp_py_list(ii)+"_gen3.py"); unix_w("cp "+rasp_py_list(ii)+"_gen4.py "+dir_frame+rasp_py_list(ii)+"_frame4.py"); unix_w("cp "+rasp_py_list(ii)+"_gen5.py "+dir_frame+rasp_py_list(ii)+"_frame5.py"); unix_w("cp "+rasp_py_list(ii)+"_gen7.py "+dir_frame+rasp_py_list(ii)+"_frame7.py"); unix_w("cp "+rasp_py_list(ii)+"_frame8_1.py "+dir_frame+rasp_py_list(ii)+"_frame8_1.py"); unix_w("cp "+rasp_py_list(ii)+"_frame8_2.py "+dir_frame+rasp_py_list(ii)+"_frame8_2.py"); unix_w("cp "+rasp_py_list(ii)+"_gen8.py "+dir_frame+rasp_py_list(ii)+"_gen8.py"); unix_w("cp "+rasp_py_list(ii)+"_gen9.py "+dir_frame+rasp_py_list(ii)+"_frame9.py"); unix_w("cp "+rasp_py_list(ii)+"_gen10.py "+dir_frame+rasp_py_list(ii)+"_frame10.py"); unix_w("cp "+rasp_py_list(ii)+"_gen11.py "+dir_frame+rasp_py_list(ii)+"_frame11.py"); end for ii=1:l_rasp_py_list unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame1.py "+dir_frame+rasp_py_list(ii)+"_gen2.py "+dir_frame+rasp_py_list(ii)+"_gen3.py "+dir_frame+rasp_py_list(ii)+"_frame4.py "+dir_frame+rasp_py_list(ii)+"_frame5.py "+dir_frame+rasp_py_list(ii)+"_frame6.py "+dir_frame+rasp_py_list(ii)+"_frame7.py "+dir_frame+rasp_py_list(ii)+"_gen8.py "+dir_frame+rasp_py_list(ii)+"_frame9.py "+dir_frame+rasp_py_list(ii)+"_frame10.py "+dir_frame+rasp_py_list(ii)+"_frame11.py "+dir_frame+rasp_py_list(ii)+"_frame12.py "+"> "+dir_py+rasp_py_list(ii)+".py"); end unix_w("cp genswcs_frame2_1.py "+dir_frame+"genswcs_frame2_1.py"); unix_w("cp genswcs_gen2.py "+dir_frame+"genswcs_gen2.py"); unix_w("cp genswcs_frame4_1.py "+dir_frame+"genswcs_frame4_1.py"); unix_w("cp genswcs_gen4.py "+dir_frame+"genswcs_gen4.py"); unix_w("cp genswcs_gen5.py "+dir_frame+"genswcs_frame5.py"); unix_w("cat "+dir_frame+"genswcs_frame1.py "+dir_frame+"genswcs_gen2.py "+dir_frame+"genswcs_frame3.py "+dir_frame+"genswcs_gen4.py "+dir_frame+"genswcs_frame5.py "+dir_frame+"genswcs_frame6.py > "+dir_py+"genswcs.py"); // Update routing exception list to be used by swcsFromLi in genu if routing_exception then routing_exception_file = mopen("/home/ubuntu/rasp30/vpr2swcs/routing_exception_list", "at") for input_index=1:1:numofinput ex_str = macrocab_name + "[0].in[" + string(input_index-1) + "]"; mputl(ex_str, routing_exception_file); end mclose(routing_exception_file); end ///////////////////////////////////////////////////// // Macro cab block name update for overlap checking //////////////////////////////////////////////////// fd_r = mopen("/home/ubuntu/rasp30/vpr2swcs/block_list",'r');block_list=mgetl(fd_r);mclose(fd_r); // Default value: frame. l_block_list=size(block_list,1); block_list(l_block_list+1)=macrocab_name; fd_w = mopen("/home/ubuntu/rasp30/vpr2swcs/block_list",'wt');mputl(block_list,fd_w);mclose(fd_w); unix_w("cp "+macrocab_name+".xcos /home/ubuntu/rasp30/sci2blif/xcos_ref/macrocab_generation/"); disp("Macro-CAB block has been generated."); filebrowser(); endfunction //Deletes a block by deleting //Lines from rasp3.arch, rasp3a.arch, rasp30.py, rasp30a.py, genswcs, block_list, and routing_exception list //Matching .sci and .sce files function Delete_MC_callback() global macrocab_name folder_name; namecheck = 0; // Check macroblock list against input name fd_r = mopen("/home/ubuntu/rasp30/vpr2swcs/block_list",'r');block_list=mgetl(fd_r);mclose(fd_r); // Default value: frame. l_block_list=size(block_list,1); for ii=1:l_block_list if block_list(ii) == macrocab_name then namecheck = 1; end; end file_list=listfiles("/home/ubuntu/rasp30/xcos_blocks/*.sci"); l_file_list=size(file_list,1); for ii=1:l_file_list if file_list(ii) == "/home/ubuntu/rasp30/xcos_blocks/"+macrocab_name+".sci" then namecheck=1; end; end // If input macroblock isn't in block list, throw error and exit if namecheck == 0 then messagebox('Block does not exist.', "Macroblock name error", "error"); abort; end //Delete relevent lines in frames deleteFrameFileLines("rasp3_arch_frame1.xml", macrocab_name); deleteFrameFileLines("rasp3a_arch_frame1.xml", macrocab_name); deleteFrameFileLines("rasp3_arch_frame2.xml", macrocab_name); deleteFrameFileLines("rasp3a_arch_frame2.xml", macrocab_name); deleteFrameFileLines("rasp3_arch_frame3.xml", macrocab_name); deleteFrameFileLines("rasp3a_arch_frame3.xml", macrocab_name); deleteFrameFileLines("rasp30_frame2_1.py", macrocab_name); deleteFrameFileLines("rasp30a_frame2_1.py", macrocab_name); deleteFrameFileLines("rasp30_frame3_1.py", macrocab_name); deleteFrameFileLines( "rasp30a_frame3_1.py", macrocab_name); deleteFrameFileLines("rasp30_frame4.py", macrocab_name); deleteFrameFileLines("rasp30a_frame4.py", macrocab_name); deleteFrameFileLines("rasp30_frame5.py", macrocab_name); deleteFrameFileLines("rasp30a_frame5.py", macrocab_name); deleteFrameFileLines("rasp30_frame7.py", macrocab_name); deleteFrameFileLines("rasp30a_frame7.py", macrocab_name); deleteFrameFileLines("rasp30_frame8_1.py", macrocab_name); deleteFrameFileLines("rasp30a_frame8_1.py", macrocab_name); deleteFrameFileLines("rasp30_frame8_2.py", macrocab_name); deleteFrameFileLines("rasp30a_frame8_2.py", macrocab_name); deleteFrameFileLines("rasp30_frame9.py", macrocab_name); deleteFrameFileLines("rasp30a_frame9.py", macrocab_name); deleteFrameFileLines("rasp30_frame10.py", macrocab_name); deleteFrameFileLines("rasp30a_frame10.py", macrocab_name); deleteFrameFileLines("rasp30_frame11.py", macrocab_name); deleteFrameFileLines("rasp30a_frame11.py", macrocab_name); deleteFrameFileLines("genswcs_frame5.py", macrocab_name); //Regenerate frames combineFiles(); //Recreate rasp3.arch, rasp3a.arch, rasp30.py, rasp30a.py, and genswcs from the frames updateFrametoFiles(); //Delete block name in block_list and routing_exception_list deleteLineinList("block_list", macrocab_name); deleteLineinList("routing_exception_list", macrocab_name); //Delete relevant files unix_w("rm /home/ubuntu/rasp30/xcos_blocks/" + macrocab_name + ".sci"); unix_w("rm /home/ubuntu/rasp30/sci2blif/rasp_design_added_blocks/" + macrocab_name + ".sce"); unix_w("rm /home/ubuntu/rasp30/sci2blif/sci2blif_added_blocks/" + macrocab_name + ".sce"); unix_w("rm /home/ubuntu/rasp30/sci2blif/xcos_ref/macrocab_generation/" + macrocab_name + ".xcos"); unix_w("rm /home/ubuntu/rasp30/sci2blif/block_info/bi_" + macrocab_name + ".sci"); disp("Deleted Macrocab"); endfunction //Recreates rasp3.arch, rasp3a.arch, rasp30.py, rasp30a.py, and genswcs from the frames function updateFrametoFiles() //Directories of the different files dir_frame ="/home/ubuntu/rasp30/vpr2swcs/macroblk_generation/frame/"; dir_py="/home/ubuntu/rasp30/vpr2swcs/"; dir_arch="/home/ubuntu/rasp30/vpr2swcs/arch/"; //Lists to iterate between both chips rasp_xml_list={"rasp3";"rasp3a";}; l_rasp_xml_list=size(rasp_xml_list,1); rasp_py_list={"rasp30";"rasp30a";}; l_rasp_py_list=size(rasp_py_list,1); //Generate arch xml files for ii=1:l_rasp_xml_list unix_w("cat "+dir_frame+rasp_xml_list(ii)+"_arch_frame1.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame2.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame3.xml "+dir_frame+rasp_xml_list(ii)+"_arch_frame4.xml "+"> "+dir_arch+rasp_xml_list(ii)+"_arch.xml"); end //Generate py files for ii=1:l_rasp_py_list unix_w("cat "+dir_frame+rasp_py_list(ii)+"_frame1.py "+dir_frame+rasp_py_list(ii)+"_gen2.py "+dir_frame+rasp_py_list(ii)+"_gen3.py "+dir_frame+rasp_py_list(ii)+"_frame4.py "+dir_frame+rasp_py_list(ii)+"_frame5.py "+dir_frame+rasp_py_list(ii)+"_frame6.py "+dir_frame+rasp_py_list(ii)+"_frame7.py "+dir_frame+rasp_py_list(ii)+"_gen8.py "+dir_frame+rasp_py_list(ii)+"_frame9.py "+dir_frame+rasp_py_list(ii)+"_frame10.py "+dir_frame+rasp_py_list(ii)+"_frame11.py "+dir_frame+rasp_py_list(ii)+"_frame12.py "+"> "+dir_py+rasp_py_list(ii)+".py"); end //Generate genswcs unix_w("cat "+dir_frame+"genswcs_frame1.py "+dir_frame+"genswcs_gen2.py "+dir_frame+"genswcs_frame3.py "+dir_frame+"genswcs_gen4.py "+dir_frame+"genswcs_frame5.py "+dir_frame+"genswcs_frame6.py > "+dir_py+"genswcs.py"); endfunction //Combines the partial frame numbers (i.e 2_1, 2_2) together into the gen frames //Note that each of these frames are only single lines function combineFiles() prefix = "/home/ubuntu/rasp30/vpr2swcs/macroblk_generation/frame/"; //rasp30 frame2_1 + frame2_2 = frame_gen2 line1 = getLine(prefix + "rasp30_frame2_1.py"); line2 = getLine(prefix + "rasp30_frame2_2.py"); writeLine(prefix + "rasp30_gen2.py", line1+line2); //rasp30 frame3_1 + frame3_2 = frame_gen3 line1 = getLine(prefix + "rasp30_frame3_1.py"); line2 = getLine(prefix + "rasp30_frame3_2.py"); writeLine(prefix + "rasp30_gen3.py", line1+line2); //rasp30 frame8_1 + frame8_2 = frame_gen8 line1 = getLine(prefix + "rasp30_frame8_1.py"); line2 = getLine(prefix + "rasp30_frame8_2.py"); line3 = getLine(prefix + "rasp30_frame8_3.py"); writeLine(prefix + "rasp30_gen8.py", line1+line2+line3); //rasp30a frame2_1 + frame2_2 = frame_gen2 line1 = getLine(prefix + "rasp30a_frame2_1.py"); line2 = getLine(prefix + "rasp30a_frame2_2.py"); writeLine(prefix + "rasp30a_gen2.py", line1+line2); //rasp30a frame3_1 + frame3_2 = frame_gen3 line1 = getLine(prefix + "rasp30a_frame3_1.py"); line2 = getLine(prefix + "rasp30a_frame3_2.py"); writeLine(prefix + "rasp30a_gen3.py", line1+line2); //rasp30a frame8_1 + frame8_2 = frame_gen8 line1 = getLine(prefix + "rasp30a_frame8_1.py"); line2 = getLine(prefix + "rasp30a_frame8_2.py"); line3 = getLine(prefix + "rasp30a_frame8_3.py"); writeLine(prefix + "rasp30a_gen8.py", line1+line2+line3); //genswcs frame2_1 + frame2_2 = frame_gen2 line1 = getLine(prefix + "genswcs_frame2_1.py"); line2 = getLine(prefix + "genswcs_frame2_2.py"); writeLine(prefix + "genswcs_gen2.py", line1+line2); //genswcs frame4_1 + frame4_2 = frame_gen2 line1 = getLine(prefix + "genswcs_frame4_1.py"); line2 = getLine(prefix + "genswcs_frame4_2.py"); writeLine(prefix + "genswcs_gen4.py", line1+line2); endfunction //Writes a line to a file function writeLine(fileName, line) f_d = mopen(fileName, 'w'); mputl(line,f_d); mclose(fileName); endfunction //Retrieves all lines from a file function [line] = getLine(fileName) f_d = mopen(fileName, 'r+'); line = mgetl(f_d); mclose(fileName); endfunction //Deletes a line from either block_list or routing_exception_list function deleteLineinList(fileName, mcName) //Directory prefix prefix = "/home/ubuntu/rasp30/vpr2swcs/"; fileNameComplete = prefix + fileName; //Read all lines in the file allLines = getLine(fileNameComplete); //Open the file for writing f_d = mopen(fileNameComplete, 'w'); s = size(allLines); //While not at the end of the file i = 1; while i <= s(1) //Read a line line = allLines(i); //If the line is not the block to be deleted if(line ~= mcName) then //Write it back into the file mputl(line,f_d); end i = i+1; end mclose(fileNameComplete); endfunction //Master function to delete lines from the frames function deleteFrameFileLines(fileName, mcName) //Frame directory prefix prefix = "/home/ubuntu/rasp30/vpr2swcs/macroblk_generation/frame/"; fileNameComplete = prefix + fileName; //Read all lines in the file allLines = getLine(fileNameComplete); //Open the file for writing f_d = mopen(fileNameComplete, 'w'); s = size(allLines); //While lines are still left in the file i = 1; while i <= s(1) j = 0; check = 0; line = allLines(i); newLine = ""; //Call the correct function for the input file name select fileName case "rasp3_arch_frame1.xml" then [check,j] = checkArchFrames(line, mcName,1); case "rasp3a_arch_frame1.xml" then [check,j] = checkArchFrames(line, mcName,1); case "rasp3_arch_frame2.xml" then [check,j] = checkArchFrames(line, mcName,2); case "rasp3a_arch_frame2.xml" then [check,j] = checkArchFrames(line, mcName,2); case "rasp3_arch_frame3.xml" then [check,j] = checkArchFrames(line, mcName,3); case "rasp3a_arch_frame3.xml" then [check,j] = checkArchFrames(line, mcName,3); case "rasp30_frame2_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,2); case "rasp30a_frame2_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,2); case "rasp30_frame3_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,3); case "rasp30a_frame3_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,3); case "rasp30_frame4.py" then [check,j, newLine] = checkPyFrames(line, mcName,4); case "rasp30a_frame4.py" then [check,j, newLine] = checkPyFrames(line, mcName,4); case "rasp30_frame5.py" then [check,j, newLine] = checkPyFrames(line, mcName,5); case "rasp30a_frame5.py" then [check,j, newLine] = checkPyFrames(line, mcName,5); case "rasp30_frame7.py" then [check,j, newLine] = checkPyFrames(line, mcName,7); case "rasp30a_frame7.py" then [check,j, newLine] = checkPyFrames(line, mcName,7); case "rasp30_frame8_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,81); case "rasp30a_frame8_1.py" then [check,j, newLine] = checkPyFrames(line, mcName,81); case "rasp30_frame8_2.py" then [check,j, newLine] = checkPyFrames(line, mcName,82); case "rasp30a_frame8_2.py" then [check,j, newLine] = checkPyFrames(line, mcName,82); case "rasp30_frame9.py" then [check,j, newLine] = checkPyFrames(line, mcName,9); case "rasp30a_frame9.py" then [check,j, newLine] = checkPyFrames(line, mcName,9); case "rasp30_frame10.py" then [check,j, newLine] = checkPyFrames(line, mcName,10); case "rasp30a_frame10.py" then [check,j, newLine] = checkPyFrames(line, mcName,10); case "rasp30_frame11.py" then [check,j, newLine] = checkPyFrames(line, mcName,11); case "rasp30a_frame11.py" then [check,j, newLine] = checkPyFrames(line, mcName,11); case "genswcs_frame5.py" then [check,j] = checkGenswcs(line, mcName); else disp("Error in deleteFileLines: Invalid filename input"); check = 0; end //If the macrocab name was found, and the file has more than one line if check == 1 & j ~= -1 then //Skip j number of lines i = i+j; //If the file has more than one line elseif j == -1 //Write the modified line back mputl(newLine,f_d); //If the macrocab name was not found else //Write the line back to the file mputl(line,f_d); end i = i+1; end mclose(fileNameComplete); endfunction //Checks a line from one of the arch frames for the macrocab to be deleted function [check,j] = checkArchFrames(line,mcName,frameNum) //Split the line around double quotes lineSplit = strsplit(line,'""'); sizeSplit = size(lineSplit); nameCheck = ""; //If the split resulted in 6+ strings and we are testing frame 3 if sizeSplit(1) >= 6 & frameNum == 3 then //Split the 6th string again around a period lineSplit2 = strsplit(lineSplit(6),'.'); //This gives us the name of the macrocab to check nameCheck = lineSplit2(1); //Skip 1 additional line if macrocab name matches j = 1; //If the split resulted in 2+ strings and we are testing frame 2 or 1 elseif sizeSplit(1) >=2 & (frameNum == 2 | frameNum == 1) //The macrocab name is in the second string nameCheck = lineSplit(2); //If frame 1, skip 7 additional lines if name matches if frameNum == 1 then j = 7; //If frame 2, skip 4 additional lines if name matches elseif frameNum == 2 then j = 4; end end //If the extracted name matches, check is positive if nameCheck == mcName then check = 1; //If not, skip no lines and check is negative else j = 0; check = 0; end endfunction //Checks a line from genswcs for the macrocab to be deleted function [check,j] = checkGenswcs(line,mcName) //Split the line around single quotes lineSplit = strsplit(line,"''"); sizeSplit = size(lineSplit); nameCheck = ""; //If the split resulted in 2+ strings if sizeSplit(1) >=2 then //Check the second string for the name nameCheck = lineSplit(2); //Default to just taking first string (always incorrrect) else nameCheck = lineSplit(1); end //If the name matches if nameCheck == mcName then //Check is positive, and skip one line check = 1; j = 1; else j = 0; check = 0; end endfunction //Checks the .py frames for the macrocab to be deleted function [check,j,lineNew] = checkPyFrames(line,mcName,frameNum) //If frame2, frame3, frame7, frame8_1 or frame8_2 //These frames are all only 1 line if frameNum == 2 | frameNum == 3 | frameNum == 7 | frameNum == 81 | frameNum == 82 then delimiter = ""; splitToken = ""; lineNew = ""; //Assign a start to the line, a delimiter for the first split, and a splitToken for the second split if frameNum == 2 then lineNew = " li_sm_0b = [''fgota[0].out[0]''"; splitToken = "["; delimiter = ","; elseif frameNum == 3 then lineNew = " li_sm_1 = [''fgota[0].in[0:1]''"; splitToken = "["; delimiter = ","; elseif frameNum == 7 then lineNew = " self.dev_types =[''fgota'']*1 "; splitToken = "''"; delimiter = "+"; elseif frameNum == 81 then lineNew = " self.dev_pins ={''fgota_in'':2"; splitToken = "''"; delimiter = ","; elseif frameNum == 82 then lineNew = ""; splitToken = "''"; delimiter = ","; end //Split the line by the assigned delimeter lineSplit = strsplit(line,delimiter); sizeStr = size(lineSplit); check = 0; i = 1; //While haven't read each split string //Skipping first split because we know it won't match while i < sizeStr(1) i = i+1; //Split string by assigned splitToken lineSplit2 = strsplit(lineSplit(i),splitToken); //If the macrocab name does not match, then add string back to frame line if (frameNum == 2 | frameNum ==3) & "''" + mcName ~= lineSplit2(1) then lineNew = lineNew + delimiter + lineSplit(i); elseif (frameNum == 7) & mcName ~= lineSplit2(2) then lineNew = lineNew + delimiter + lineSplit(i); elseif frameNum == 81 & mcName + "_in" ~= lineSplit2(2) then lineNew = lineNew + delimiter + lineSplit(i); elseif frameNum == 82 & mcName + "_out" ~= lineSplit2(2) then lineNew = lineNew + delimiter + lineSplit(i); end end //Return j=-1 to tell deleteFrameFileLines that this is a 1 line file j = -1; //If frame4, frame5, frame9, frame10 or frame11 //These frames are multi-line elseif frameNum == 4 | frameNum == 5 | frameNum == 9 | frameNum == 10 | frameNum == 11 then //Split around a left bracket lineSplit = strsplit(line,"["); nameCheck = ""; //If frame is 5,4, or 9 if frameNum == 5 | frameNum == 4 | frameNum == 9 then //Macrocab name is the first split string (whitespace removed) nameCheck = stripblanks(lineSplit(1),%t); //If the frame is 11 elseif frameNum == 11 then //Split an additional time splitSize = size(lineSplit); //Take the second split if possible //(first is always wrong, default) if splitSize(1) >= 2 then lineSplit = lineSplit(2); else lineSplit = lineSplit(1); end end //If the frame is 10 or 11 if frameNum == 10 | frameNum == 11 then //Split again around "_" lineSplit2 = strsplit(lineSplit(1),"_"); //Check to see how many "_" the macrocab name has compare = strsplit(mcName,"_"); numArr = size(compare); numSplit = size(lineSplit2); nameCheck = ""; i = 1; //While less than the number of split "_" in the macrocab name //And less than the number of "_" splits in the line while i <= numArr(1) & i <= numSplit(1) //Special case where macrocab has no "_" if i == 1 then nameCheck = lineSplit2(i); //Add a "_" to the nameCheck to reconstruct macrocab name from frame line else nameCheck = nameCheck + "_" + lineSplit2(i); end i = i+1; end //Strip whitespace nameCheck = stripblanks(nameCheck,%t); end //If macrocab names match if "''" + mcName == nameCheck then //Return positive check check = 1; //Skip 0 lines unless frame 11 j = 0; if frameNum == 11 then j = 1; end else check = 0; j = 0; end //Returned line not used because j =/= -1 lineNew = line; end endfunction
b9d81b4009265330e01c87a5611a9ce8e2e915cd
449d555969bfd7befe906877abab098c6e63a0e8
/575/DEPENDENCIES/3_4_2.sci
5c61516192cb56add3137567b18264debc27b7df
[]
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
76
sci
3_4_2.sci
P0=10.4*1.013*10^5 /10.33//m H2O D=1000 //kg/m^3 g=9.807 //m/s^2 h=30 //m
ba02f9b1d54f3e2a574d31b1f03c593499a7b352
99b4e2e61348ee847a78faf6eee6d345fde36028
/Toolbox Test/polyscale/polyscale5.sce
81bc8cd8b7bd8837fd094148f7762c3f6f834bb0
[]
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
266
sce
polyscale5.sce
//i/p arg x contains only negative elements x=[-12 -3 -4 -5 -6 -7 -8 -9]; a=5; y=polyscale(x,a); disp(y); //output // column 1 to 5 // // - 12. - 15. - 100. - 625. - 3750. // // column 6 to 8 // // - 21875. - 125000. - 703125. //>>
42bf2fef74e83eb7103ef82f9ebf867a47ed6aea
449d555969bfd7befe906877abab098c6e63a0e8
/1223/CH3/EX3.5/Ex3_5.sce
ab107732b612e3f73f779ac585c596fb85d7ae7b
[]
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
510
sce
Ex3_5.sce
clear; clc; //Example 3.5 b=100; Vbe=0.7;//(V) Vce=0.2;//(V) Vbb=8;//(v) Rb=220;//(KOhm) Ib=(Vbb-Vbe)/Rb printf('\nbase current=%f mA\n',Ib) //transistor in active region Ic=b*Ib; printf('\ncollector current=%.3f mA\n',Ic) Vcc=10;//(V) Rc=4;//(KOhm) Vce=Vcc-Ic*Rc; printf('\ncollector emitter voltage=%.2f V\n',Vce) //saturation Vce=0.2;//(V) Ic=(Vcc-Vce)/Rc; printf('\nsaturation collector current=%.2f mA\n',Ic) x=Ic/Ib //which is <b Ie=Ic+Ib; printf('\nemitter current=%f mA\n',Ie)
e8454f00ea9003156c1683d75396fcdde9119a20
99b4e2e61348ee847a78faf6eee6d345fde36028
/Toolbox Test/slewrate/slewrate11.sce
15da168099c4f1f440b8bc85c930842e9715f69e
[]
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
246
sce
slewrate11.sce
//check o/p when i/p is a real valued matrix x=[1.2, 5, 10,;-20, 12, 23]; t=1:length(x); s=slewrate(x, t); disp(s) //output // !--error 10000 //Argument X must be vector. //at line 52 of function slewrate called by : //s=slewrate(x, t);
61cbcc310be9dee7bb6241d4cdf1fe9b261fa7f7
449d555969bfd7befe906877abab098c6e63a0e8
/1049/CH3/EX3.12/ch3_12.sce
6717fa441964214c91f5dba61983d1e1994cce0a
[]
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
476
sce
ch3_12.sce
clear; clc; V_s=230;//V R=1000;//ohm R_D=20;//ohm V_m=sqrt(2)*V_s; I_om=V_m/(R+R_D); printf("peak load current=%.4f A",I_om); I_o=I_om/%pi; printf("\ndc load current=%.5f A",I_o); V_D=I_o*R_D-V_m/%pi; printf("\ndc diode voltage=%.1f V",V_D); V_on=V_m/%pi; printf("\nat no load, load voltage=%.3f V",V_on); V_o1=I_o*R; printf("\nat given load, load voltage=%.3f V",V_o1); vr=(V_on-V_o1)*100/V_on; printf("\nvoltage regulation(in percent)=%.3f",vr);
ba7b3f2b5060a9fc0ce64ba11dd3ae94229f0884
449d555969bfd7befe906877abab098c6e63a0e8
/752/CH1/EX1.5.1/1_5_1.sce
ea644d99ba80985c67408a5c107cc375a617abb9
[]
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
731
sce
1_5_1.sce
clc; // page no 21 // prob no 1_5_1 //Series tuned resonant ckt is given which is tuned at 25 MHz with //series resistance 5 ohm self capacitance 7 pF and inductance 1 uH C=7*10^-12;R=5;L=10^-6;f=25*10^6; //Determination of self resonant freq of coil denoted as Fsr Fsr=1/(2*3.14*(L*C)^0.5); disp('MHz',Fsr/(10^6),+'The value of self resonant freq is'); //Determination of Q-factor of coil,excluding self-capacitive effects Q=(2*3.14*f*L)/R; disp(Q,'The value of Q-factor is'); //Determination of effective inductance Leff=L/(1-(f/Fsr)^2); disp('uH',Leff*(10^6),+'The value of effective inductance is'); //Determination of effective Q-factor Qeff=Q*(1-(f/Fsr)^2); disp(Qeff,'The value of effective Q-factor is');
f32019c5e599204189036bcbb4850c1f48dd2506
99b4e2e61348ee847a78faf6eee6d345fde36028
/Toolbox Test/lsf2poly/lsf2poly6.sce
a62167b2cef6ac10f60087db4a2044d43ec36045
[]
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
301
sce
lsf2poly6.sce
//check o/p when i/p is a 1*1 matrix x=[3.14]; a=lsf2poly(x); disp(a); //output //!--error 10000 //Input should be vector of length more than one or matrix. //at line 40 of function lsf2poly called by : //a=lsf2poly(x); //at line 3 of exec file called by : //poly/lsf2poly6.sce', -1