blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 6 214 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 6 87 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 15 values | visit_date timestamp[us]date 2016-08-04 09:00:04 2023-09-05 17:18:33 | revision_date timestamp[us]date 1998-12-11 00:15:10 2023-09-02 05:42:40 | committer_date timestamp[us]date 2005-04-26 09:58:02 2023-09-02 05:42:40 | github_id int64 436k 586M ⌀ | star_events_count int64 0 12.3k | fork_events_count int64 0 6.3k | gha_license_id stringclasses 7 values | gha_event_created_at timestamp[us]date 2012-11-16 11:45:07 2023-09-14 20:45:37 ⌀ | gha_created_at timestamp[us]date 2010-03-22 23:34:58 2023-01-07 03:47:44 ⌀ | gha_language stringclasses 36 values | src_encoding stringclasses 17 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 1 class | length_bytes int64 5 10.4M | extension stringclasses 15 values | filename stringlengths 2 96 | content stringlengths 5 10.4M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
514fa96e56c79ad4f82cc2e95e37a599dbce2f4e | 449d555969bfd7befe906877abab098c6e63a0e8 | /1631/CH2/EX2.14/Ex2_14.sce | ffba5f420df4dc5088cb8785a579cc685cb963b1 | [] | 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 | 259 | sce | Ex2_14.sce | //Caption: Probability
//Example 2.14
//page no 54
//find the probability
clc;
clear;
function y=f(x),
y=12*x^3-21*x^2+10*x,//Probability Density Function
endfunction
a=0;
b=1/2;
P=intg(a,b,f);
disp(P,"P(X<=1/2)=");
disp(1-P,"P(X>1/2)=");
|
3b30098f39f9147e708ae27307538aafb51cc974 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2825/CH15/EX15.2/Ex15_2.sce | 8fdf963fd0fc2fc837a43367d941f07b4113072f | [] | 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 | 330 | sce | Ex15_2.sce | //Ex15_2 Pg-774
clc
Ic=100 //carrier current in A
m=80/100 //modulation of 80%
disp("Total current = carrier current*(1+m^2/2)")
It=Ic*sqrt(1+m^2/2) //total power
printf(" = %.1f A \n",It)
change_I=It-Ic //change in current
printf("Therefore, increase in current due to modulation = %.1f A",change_I)
|
e67217ca07496b69ddbeadb43ff5089ac7b073de | 54ec7978b285c41cc02aec8197e1d57dd5dbc31e | /scilab/gflim.sci | 99daba6976bc6730b646044bced31e5bc73f0ace | [] | no_license | Xx220xX/Projeto-Controle-digital | a6c95ac67e3cc16ea0a659b7df526e08b2fb7716 | 188ca2e55b1c11d2d5736077549406bc30352314 | refs/heads/main | 2023-06-19T22:00:48.607530 | 2021-06-16T00:03:41 | 2021-06-16T00:03:41 | 376,072,300 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 145 | sci | gflim.sci | function gflim(lim)
ax=gca(),// gat the handle on the current axes
a = ax.data_bounds
a(3:$) = lim
ax.data_bounds=a;
endfunction
|
e310b8a6e5a41b9876ae50c16b660c116df8eb82 | 0e5a67d0e8ecb5cefda5fbad81450df1ba99b829 | /lab_08_6_1/tests/FuncTests/0.1.tst | e6371be98e72427fa7384fe51e5b17586a2e8b3f | [] | no_license | Dimkashow/BMSTU-C | 62266f002534826d7978dd32ae82ec163313e391 | f4dd614b3d7fb1e9c28ffe4ee0c8e45171dafe7b | refs/heads/master | 2023-05-01T20:00:27.402085 | 2021-05-15T17:16:25 | 2021-05-15T17:16:25 | 367,689,033 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 10 | tst | 0.1.tst | 3
1 2 3
-1 |
54206a9b7b916515787e99104e6b62276a400da6 | 1a4e5a346a90668d59b27c30165808da6847ad5e | /bomberpersuit.txt | c99b67570b275edab5cb9436845dc3b22eebc3ae | [] | no_license | Abhishekgupta299/simulation-and-modeling | 1bde7b5b4692bace25b5906dd58a557287f48156 | 29523977a1a7baec012999e3311e338db49d39f4 | refs/heads/master | 2022-07-22T12:08:03.495362 | 2020-05-21T17:14:45 | 2020-05-21T17:14:45 | 261,087,469 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,157 | txt | bomberpersuit.txt | //Parameters definitinos
xb=[80;90;99;108;116;125;133;141;151; 160;169;179;180] //x position array of bomber
yb=[0;-2;-5;-9;-15;-18;-23;-29;-28;-25;-21;-20;-17] //y position array of bomber
xf=0 //initial x position of fighter plane
yf=50 // iniitial y positino of fighter plane
V=20 //velocity of the figher plane in Km/s
// user defined functions
function[D]=Dist(XB,YB, XF,YF) //functino to calculate the distance between bomber and fighter planes
D=sqrt((YB-YF)^2+(XB-XF)^2)
endfunction
function[xf,yf]=NextPos(XB,YB,XF,YF,V) //function to calculate the next position of fighter plane
[d]=Dist(XB,YB,XF,YF)
sin0=(YB-YF)/d
cos0=(XB-XF)/d
xf=XF+V*cos0
yf=YF+V*sin0
endfunction
//main simulation program
for i=1:12
[d]=Dist(xb(i),yb(i),xf,yf)
disp(d)
if d <=10 then //if distance between bomber and figher is less than or equal to 10 km bomber is shot down by fighter
disp("bombed")
break
elseif i > 11 then // if the attack window of 11 minutes is done the bomber is escaped
disp("bomber escaped")
else
[xf,yf]=NextPos(xb(i),yb(i),xf,yf,V)
end
end;
|
4504b66590c734f5381e40ddcb25c0acd6f2f312 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3733/CH24/EX24.15/Ex24_15.sce | 40d368c7d0bfbe936ae7d26f77771ffd3d04670b | [] | 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,044 | sce | Ex24_15.sce | // Example 24_15
clc;funcprot(0);
//Given data
m_a=10;// kg/sec
p_r=6;// Pressure ratio
T_1=300;// K
p_1=1;// bar
T_6=1073;// K
e=0.75;// The effectiveness of regenerator
n_c=0.80;// Isentropic efficiency of compressor
n_t=0.85;// Isentropic efficiency of turbine
C_pa=1;// kJ/kg.K
r=1.4;// Specific heat ratio
m=1;// kg
//Calculation
p_3=p_1*p_r;// bar
p_2=sqrt(p_1*p_3);// bar
T_2a=T_1*(p_2/p_1)^((r-1)/r);// K
T_2=((T_2a-T_1)/n_c)+T_1;// K
//W_c=W_c1+W_c2=2*W_c1 (as intercooling is perfect)
W_c=2*m*C_pa*(T_2-T_1);// kJ/kg
// As T_3=T_1 and p_r=(p_2/p_1)=(p_3/p_2)
T_4=T_2;// K
T_7a=T_6/(p_3/p_1)^((r-1)/r);// K
T_7=T_6-(n_t*(T_6-T_7a));// K
W_t=C_pa*(T_6-T_7);// kJ/kg
T_5=T_4+(e*(T_7-T_4));// K
Q_s=m*C_pa*(T_6-T_5);// kJ/kg
W_n=W_t-W_c;// kJ/kg
P=m_a*W_n;//Power capacity of the plant in kW
n_th=(W_n/Q_s)*100;// Thermal Efficiency in percentage
printf('\nPower capacity of the plant=%0.0f kW\nThe thermal efficiency of the plant=%0.1f percentage',P,n_th);
// The answer vary due to round off error
|
139e6270a47232a6ba5ce01bd31c19cd721cefc8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1223/CH4/EX4.9/Ex4_9.sce | 27299a6589dcaf74675e09ffb7e8c870f0a77a0c | [] | 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 | 342 | sce | Ex4_9.sce | clear;
clc;
//Example 4.9
Ic=0.894;
i_C=2*Ic;
printf('\nmaximum possible symmetrical peak to peak ac collector current=%.3f mA\n',i_C)
Rc=5;
Rl=2;
vo=i_C*Rc*Rl/(Rc+Rl);
printf('\nmaximum possible symmetrical peak to peak output voltage=%.2f V\n',vo)
iC=Ic+i_C*1/2;
printf('\nmaximum instantaneous collector current=%.3f mA\n',iC)
|
5b7405dbc6557958e2c9c5b9c48ddce102c8f1ae | d465fcea94a1198464d7f8a912244e8a6dcf41f9 | /system/kiks_error.sci | d11c02d4234012e8ee67b52f31b6b8667cb69bf7 | [] | 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 | 440 | sci | kiks_error.sci | function [] = kiks_error(errstr)
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
// -----------------------------------------------------
// (c) 2000-2004 Theodor Storm <theodor@tstorm.se>
// http://www.tstorm.se
// -----------------------------------------------------
// !! L.8: Matlab function errordlg not yet converted, original calling sequence used
errordlg(errstr,"KiKS error");
endfunction
|
0a3856d559346bbeecfff0339ce2a3c2eae03a95 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1332/CH11/EX11.3/11_3.sce | f25a0d62688c817b875089591c1e18cd7bc75ad9 | [] | 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,588 | sce | 11_3.sce | //Example 11.3
//Danilevsky Method
//Page no. 341
clc;close;clear;
A=[-1,0,0;1,-2,3;0,2,-3];
G=[A;eye(3,3)];
disp(G);
//transformation to frobenius matrix
for k=3:-1:2
g(k)=0;
for j=1:k-1
if(g(k)<G(k,j))
g(k)=G(k,j)
p=j;
end
end
if(g(k)~=0)
for j=1:3
r(1,j)=G(k,j)
end
for i=1:6
G(i,k-1)=G(i,k-1)/g(k)
end
disp(G)
for j=1:3
if(j~=k-1)
l=G(k,j)
for i=1:6
G(i,j)=G(i,j)-l*G(i,k-1)
end
end
end
disp(G)
end
for j=1:3
for i=1:3
c(i,1)=G(i,j)
end
G(k-1,j)=0
for i=1:3
G(k-1,j)=G(k-1,j)+r(1,i)*c(i,1)
end
end
disp(G)
end
//partition g
for i=4:6
for j=1:3
T(i-3,j)=G(i,j)
end
end
disp(T,'T=')
//eigenvalues computation
printf('\n\n\nCharateristic polynomial:')
p=poly(A,'x')
disp(p)
printf('\n\n\nEigenvalues:')
a=roots(p)
disp(a')
//eigenvectors computation
for k=1:3
m=2
for l=1:3
y(l,k)=a(k,1)^(m)
m=m-1;
end
end
printf('\n\n')
disp(y,'y=')
//eigenvector computation
for k=1:3
for l=1:3
y1(l,1)=y(l,1)
y2(l,1)=y(l,2)
y3(l,1)=y(l,3)
end
x1=T*y3;
x2=T*y2;
x3=T*y1;
end
printf('\n\nEigenvectors :\n')
for i=1:3
printf('|%.1f|\t\t|%.1f|\t\t|%.1f|',x1(i,1),x2(i,1),x3(i,1))
printf('\n')
end
|
4126e443a7e8156bb8d6e8221bbb791ee28af916 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/CF20.prev.tst | a546038d205e0de27c208d6e5f31ed73d05d0a21 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | gfis/ramath | 498adfc7a6d353d4775b33020fdf992628e3fbff | b09b48639ddd4709ffb1c729e33f6a4b9ef676b5 | refs/heads/master | 2023-08-17T00:10:37.092379 | 2023-08-04T07:48:00 | 2023-08-04T07:48:00 | 30,116,803 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 194 | tst | CF20.prev.tst | 0 0
1 1
2 1;2
3 1;1,2
4 2
5 2;4
6 2;2,4
7 2;1,1,1,4
8 2;1,4
9 3
10 3;6
11 3;3,6
12 3;2,6
13 3;1,1,1,1,6
14 3;1,2,1,6
15 3;1,6
16 4
17 4;8
18 4;4,8
19 4;2,1,3,1,2,8
20 4;2,8
|
68b2a7c2a4d254013031cd7f06c735186bed17da | 449d555969bfd7befe906877abab098c6e63a0e8 | /587/CH11/EX11.6/example11_6.sce | 2169148dcb157d2cddb13a2be14f77d1ed2d7837 | [] | 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 | 850 | sce | example11_6.sce | clear;
clc;
//Example11.6[Cooling of Water in an Automotive Radiator]
//Given:-
m=0.6;//Mass Flow rate of water[kg/s]
Th_in=90,Th_out=65,Tc_in=20,Tc_out=40;//[degree Celcius]
Di=0.005;//[m]
L=0.65;//[m]
n=40;//No of tubes
Cp=4195;//[J/kg.degree Celcius]
//Solution:-
Q=m*Cp*(Th_in-Th_out);//[W]
disp("W",Q,"The rate of heat transfer in the radiator from the hot water to the air is")
Ai=n*%pi*Di*L;//[m^2]
del_T1=Th_in-Tc_out;//[degree Celcius]
del_T2=Th_out-Tc_in;//[degree Celcius]
del_T_lm=(del_T1-del_T2)/log(del_T1/del_T2);//[degree Celcius]
disp("degree Celcius",del_T_lm,"The log mean temperature difference for the counter flow arrangement is")
F=0.97;//Correction Factor for this situation
Ui=Q/(Ai*F*del_T_lm);//[W/m^2.degree Celcius]
disp("W/m^2.degree Celcius",round(Ui),"the overall heat transfer coefficient is")
|
bf244866df29ba576de926fcd104ff741c5ddadb | 8217f7986187902617ad1bf89cb789618a90dd0a | /source/2.4.1/macros/scicos/mark_newpars.sci | 63c8844a34d4430dd34a2f2264753ce709c65ee0 | [
"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 | 529 | sci | mark_newpars.sci | function newparameters=mark_newpars(k,newparametersb,newparameters)
// k block index in x
//
// Copyright INRIA
o=scs_m(k)
model=o(3)
if model(1)=='super'|model(1)=='csuper'
for npb=newparametersb
ok=%t;
for np=newparameters
if np==[k npb] then
ok=%f;break,
end
end
if ok then
newparameters(size(newparameters)+1)=[k npb];
end
end
else
ok=%t
for np=newparameters
if np==k then
ok=%f;break;
end
end
if ok then
newparameters(size(newparameters)+1)=k
end
end
|
82ae3f4b6662f1bb7348f4048e38deac00988ab0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1943/CH1/EX1.8/Ex1_8.sce | a950e16a456ac000a435c1b28e42da76d273c6fa | [] | 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 | 959 | sce | Ex1_8.sce |
clc
clear
//Input data
C=200//Installed capacity of the plant in MW
CC=400//Capital cost in Rs crores
ID=12//Rate of interest and depreciation in percent
AC=5//Annual cost of fuel, salaries and taxation in Rs. crores
L=0.5//Load factor
AL2=0.6//Raised Annual load
Y=8760//Number of hours in a year of 365 days
//Calculations
AvL=(C*L)//Average Load in MW
E=(AvL*1000*Y)//Energy generated per year in kWh
IDC=((ID/100)*CC*10^7)//Interest and depreciation (fixed cost) in Rs
T=(IDC+(AC*10^7))//Total annual cost in Rs
CP1=(T/E)*100//Cost per kWh in paise
AvL2=(C*AL2)//Average Load in MW
E2=(AvL2*1000*Y)//Energy generated per year in kWh
CP2=(T/E2)*100//Cost per kWh in paise
S=((CP1)-(CP2))//Saving in cost per kWh in paise
S1=ceil(S)//Rounding off to next higher integer
//Output
printf('Cost of generation per kWh is %3.0f paise \n Saving in cost per kWh if the annual load factor is raised to 60 percent is %3.0f paise',CP1,S1)
|
281f11458c0aa11c458c98ffc38b979b020f7ebf | 449d555969bfd7befe906877abab098c6e63a0e8 | /2414/CH5/EX5.3/Ex5_3.sce | e897499062bbd86d0aabfe424856265d3bb38718 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 299 | sce | Ex5_3.sce | clc;
//page no 150
//prob no. 5.3
//Refer figure 5-10
N=5;
M=8;
fi=4;// in MHz
f0=M/N*fi;
disp('MHz',f0,'(a) The output frequency is f0=');
f1=fi/N;
disp('MHz',f1,'(b) The frequency f1 is');
f2=f0/M;
disp('MHz',f2,' The frequency f2 is ');
//The two frequencies are same as required
|
7ccba71e12e6f315649e800538ab76935c5ca87d | 8fe55d112060809ed521b7cedb7fdc8bde130268 | /assets/scene/test.sce | cf51e45b51430c3a8f14176610d742f1905daee8 | [] | no_license | excfergodst/dod | 9e74d67d75575c0227ff7c3a268349ac7e41e7c0 | b25896d75b7efba8d2c5248360dafbd798081939 | refs/heads/master | 2023-01-10T04:39:43.529750 | 2020-11-08T14:07:23 | 2020-11-08T14:07:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 44,042 | sce | test.sce | {
"Scene": {
"ptr_wrapper": {
"id": 2147483649,
"data": {
"value0": 15,
"value1": 0,
"value2": {
"Tag": "Player",
"Id": {
"uuid": "46f33447-86e7-41ca-9a6e-8e3b3e24d745"
}
},
"value3": 1,
"value4": {
"Tag": "Ground",
"Id": {
"uuid": "1669f3e8-2bcf-4c27-8e90-131ed02eacb0"
}
},
"value5": 2,
"value6": {
"Tag": "Camera",
"Id": {
"uuid": "5be9941c-4864-458d-b0cf-691637e372a2"
}
},
"value7": 3,
"value8": {
"Tag": "boxA",
"Id": {
"uuid": "6e4c224e-ccdf-4e51-97f9-c8967d22174b"
}
},
"value9": 1048580,
"value10": {
"Tag": "boxB",
"Id": {
"uuid": "670e8c8f-21cb-44ed-9b76-1be1e60c979b"
}
},
"value11": 5,
"value12": {
"Tag": "boxC",
"Id": {
"uuid": "dac44efe-5506-4691-99bf-51857ee3757f"
}
},
"value13": 7,
"value14": {
"Tag": "boxD",
"Id": {
"uuid": "e3ae84f0-a91e-4ea4-92fd-71c6b5a50097"
}
},
"value15": 1048582,
"value16": {
"Tag": "boxE",
"Id": {
"uuid": "3be5cf04-2d96-4fa7-829d-fcc058935ec1"
}
},
"value17": 8,
"value18": {
"Tag": "boxG",
"Id": {
"uuid": "87822344-d4e7-4053-9cb1-bb7bca5b800d"
}
},
"value19": 9,
"value20": {
"Tag": "boxH",
"Id": {
"uuid": "50dc6c75-8182-4ab2-97a1-77d2686b7e9b"
}
},
"value21": 10,
"value22": {
"Tag": "GroundB1",
"Id": {
"uuid": "f92dee0c-dadb-441f-8c89-8cb590c502b4"
}
},
"value23": 11,
"value24": {
"Tag": "GroundB2",
"Id": {
"uuid": "e42f1d5c-f8e7-4b5c-af0b-1c5325d02f10"
}
},
"value25": 12,
"value26": {
"Tag": "GroundB2 (1)",
"Id": {
"uuid": "44ef079d-b075-4386-ae35-a88c5de4d336"
}
},
"value27": 13,
"value28": {
"Tag": "Box Spawner",
"Id": {
"uuid": "ecd01f1d-7f74-45b1-9911-4d3f10de6553"
}
},
"value29": 14,
"value30": {
"Tag": "GroundB2 (1)",
"Id": {
"uuid": "45a5f6d4-e3a0-4a1f-9a2f-0dfa76bba199"
}
},
"value31": 15,
"value32": 0,
"value33": {
"translate": {
"x": 0.012045703828334809,
"y": 3.2110748291015627,
"z": -1.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value34": 1,
"value35": {
"translate": {
"x": 3.468397617340088,
"y": -1.1680338382720948,
"z": 5.0
},
"scale": {
"x": 12.427576065063477,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value36": 3,
"value37": {
"translate": {
"x": -1.9694408178329468,
"y": -0.12600000202655793,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value38": 1048580,
"value39": {
"translate": {
"x": 2.155916213989258,
"y": -0.12600000202655793,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value40": 5,
"value41": {
"translate": {
"x": 2.643825054168701,
"y": 0.8788117170333862,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value42": 7,
"value43": {
"translate": {
"x": 3.1827099323272707,
"y": -0.12600000202655793,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value44": 1048582,
"value45": {
"translate": {
"x": 5.947334289550781,
"y": 0.8788117170333862,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value46": 8,
"value47": {
"translate": {
"x": 6.410275936126709,
"y": -0.12600000202655793,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value48": 9,
"value49": {
"translate": {
"x": 5.364497184753418,
"y": -0.12600000202655793,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value50": 10,
"value51": {
"translate": {
"x": -8.64245891571045,
"y": -15.789331436157227,
"z": 5.0
},
"scale": {
"x": 12.427576065063477,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value52": 11,
"value53": {
"translate": {
"x": -15.415482521057129,
"y": -10.070779800415039,
"z": 5.0
},
"scale": {
"x": 12.427576065063477,
"y": 1.0,
"z": 1.0
},
"rotate": 90.0
},
"value54": 12,
"value55": {
"translate": {
"x": -12.658415794372559,
"y": 4.108467102050781,
"z": 5.0
},
"scale": {
"x": 12.427576065063477,
"y": 1.0,
"z": 1.0
},
"rotate": -28.100000381469728
},
"value56": 14,
"value57": {
"translate": {
"x": -1.905991554260254,
"y": -10.070779800415039,
"z": 5.0
},
"scale": {
"x": 12.427576065063477,
"y": 1.0,
"z": 1.0
},
"rotate": 90.0
},
"value58": 13,
"value59": {
"translate": {
"x": -16.763797760009767,
"y": 12.03515625,
"z": 0.0
},
"scale": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"rotate": 0.0
},
"value60": 2,
"value61": {
"translate": {
"x": -0.25786304473876955,
"y": 2.9960997104644777,
"z": 0.0
},
"scale": {
"x": 8.88888931274414,
"y": 5.0,
"z": 1.0
},
"rotate": 0.0
},
"value62": 13,
"value63": 0,
"value64": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets/texture/1.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value65": 1,
"value66": {
"Color": {
"x": 1.0,
"y": 0.9999899864196777,
"z": 0.9999899864196777,
"w": 1.0
},
"Texture": "assets\\texture\\dev_128_gr_032x.jpg",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value67": 3,
"value68": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value69": 1048580,
"value70": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value71": 5,
"value72": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value73": 7,
"value74": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value75": 1048582,
"value76": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value77": 8,
"value78": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value79": 9,
"value80": {
"Color": {
"x": 1.0,
"y": 1.0,
"z": 1.0,
"w": 1.0
},
"Texture": "assets\\texture\\RTS_Crate.png",
"UseTexture": true,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value81": 10,
"value82": {
"Color": {
"x": 0.5588235259056091,
"y": 0.5588179230690002,
"z": 0.5588179230690002,
"w": 1.0
},
"Texture": "assets/texture/1.png",
"UseTexture": false,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value83": 11,
"value84": {
"Color": {
"x": 0.5588235259056091,
"y": 0.5588179230690002,
"z": 0.5588179230690002,
"w": 1.0
},
"Texture": "assets/texture/1.png",
"UseTexture": false,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value85": 12,
"value86": {
"Color": {
"x": 0.5588235259056091,
"y": 0.5588179230690002,
"z": 0.5588179230690002,
"w": 1.0
},
"Texture": "assets/texture/1.png",
"UseTexture": false,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value87": 14,
"value88": {
"Color": {
"x": 0.5588235259056091,
"y": 0.5588179230690002,
"z": 0.5588179230690002,
"w": 1.0
},
"Texture": "assets/texture/1.png",
"UseTexture": false,
"UseAsSubTexture": false,
"setting": {
"type": 0,
"leftUpper": {
"x": 0.0,
"y": 0.0
},
"size": {
"x": 0.0,
"y": 0.0
},
"pos": {
"x": 0.0,
"y": 0.0
},
"cellSize": {
"x": 0.0,
"y": 0.0
},
"spriteGridSize": {
"x": 1.0,
"y": 1.0
}
},
"tiling": 1.0
},
"value89": 1,
"value90": 2,
"value91": {
"camera": {
"value0": {
"projection": {
"col0": {
"x": 0.22499999403953553,
"y": 0.0,
"z": 0.0,
"w": 0.0
},
"col1": {
"x": 0.0,
"y": 0.4000000059604645,
"z": 0.0,
"w": 0.0
},
"col2": {
"x": 0.0,
"y": 0.0,
"z": -0.0010000000474974514,
"w": 0.0
},
"col3": {
"x": -0.0,
"y": -0.0,
"z": -0.0,
"w": 1.0
}
}
},
"orthoSize": 5.0,
"orthoNear": -1000.0,
"orthoFar": 1000.0,
"aspect": 1.7777777910232545
},
"lockAspect": true,
"primary": true
},
"value92": 0,
"value93": 3,
"value94": 0,
"value95": {
"instance": {
"polymorphic_id": 2147483649,
"polymorphic_name": "rl::PlayerController",
"ptr_wrapper": {
"id": 2147483650,
"data": {
"walkAccel": 5.0,
"walkSpeedLimit": 7.0,
"jumpSpeed": 7.0
}
}
},
"script_name": "rl::PlayerController",
"valid": false
},
"value96": 2,
"value97": {
"instance": {
"polymorphic_id": 2147483650,
"polymorphic_name": "rl::Cinemachine2D",
"ptr_wrapper": {
"id": 2147483651,
"data": {
"cameraTransSpeed": 2.0,
"startTransSpeed": 1.0,
"endTransSpeed": 1.0,
"target": {
"uuid": "46f33447-86e7-41ca-9a6e-8e3b3e24d745"
},
"targetName": "Player"
}
}
},
"script_name": "rl::Cinemachine2D",
"valid": false
},
"value98": 13,
"value99": {
"instance": {
"polymorphic_id": 2147483651,
"polymorphic_name": "rl::Spawner",
"ptr_wrapper": {
"id": 2147483652,
"data": {
"SpawnPerSecond": 5.0
}
}
},
"script_name": "rl::Spawner",
"valid": false
},
"value100": 13,
"value101": 1,
"value102": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 3.4028234663852887e38,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value103": 0,
"value104": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 10.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value105": 3,
"value106": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 10.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value107": 1048580,
"value108": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value109": 5,
"value110": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value111": 7,
"value112": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value113": 1048582,
"value114": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value115": 8,
"value116": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value117": 9,
"value118": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 5.0,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value119": 10,
"value120": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 3.4028234663852887e38,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value121": 11,
"value122": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 3.4028234663852887e38,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value123": 12,
"value124": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 3.4028234663852887e38,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value125": 14,
"value126": {
"angularVelocity": 0.0,
"angle": 0.0,
"velocity": {
"x": 0.0,
"y": 0.0
},
"friction": 0.20000000298023225,
"mass": 3.4028234663852887e38,
"force": {
"x": 0.0,
"y": 0.0
},
"torque": 0.0,
"keepingForce": false,
"attachPoint": {
"x": 0.0,
"y": 0.0
},
"showAttachPoint": false,
"RestrictRotation": false
},
"value127": 13,
"value128": 0,
"value129": {
"x": 0.0,
"y": -0.15000000596046449,
"w": 0.5,
"h": 0.5
},
"value130": 1,
"value131": {
"x": 0.0,
"y": 0.0,
"w": 12.428000450134278,
"h": 1.0
},
"value132": 3,
"value133": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value134": 1048580,
"value135": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value136": 5,
"value137": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value138": 7,
"value139": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value140": 1048582,
"value141": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value142": 8,
"value143": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value144": 9,
"value145": {
"x": 0.0,
"y": 0.0,
"w": 1.0,
"h": 1.0
},
"value146": 10,
"value147": {
"x": 0.0,
"y": 0.0,
"w": 12.428000450134278,
"h": 1.0
},
"value148": 11,
"value149": {
"x": 0.0,
"y": 0.0,
"w": 12.428000450134278,
"h": 1.0
},
"value150": 12,
"value151": {
"x": 0.0,
"y": 0.0,
"w": 12.428000450134278,
"h": 1.0
},
"value152": 14,
"value153": {
"x": 0.0,
"y": 0.0,
"w": 12.428000450134278,
"h": 1.0
},
"value154": 0
}
}
}
} |
a27c17e67a29a712ed924971f528232f3c19d0bc | 449d555969bfd7befe906877abab098c6e63a0e8 | /405/CH11/EX11.3/11_3.sce | 714a7764a1a62ea815a8fa4a7c6cb9a8dda1dde9 | [] | 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,030 | sce | 11_3.sce | clear;
clc;
printf("\t\t\tExample Number 11.3\n\n\n");
// Wet-bulb temperature
// Example 11.3(page no.-590-591)
// solution
Pg = 2107;// [Pa] from steam table at 18.3 degree celcius
Pw = Pg*18;// [Pa]
Rw = 8315;// [J/mol K] gas constant
Tw = 273.15+18.3;// [K]
RHOw = Pw/(Rw*Tw);// [kg/cubic meter]
Cw = RHOw;// [kg/cubic meter]
RHOinf = 0;// since the free stream is dry air
Cinf = 0;
P = 1.01325*10^(5);// [Pa]
R = 287;// [J /kg K]
T = Tw;// [K]
RHO = P/(R*T);// [kg/cubic meter]
Cp = 1004;// [J/kg degree celsius]
Le = 0.845;
Hfg = 2.456*10^(6);// [J/kg]
// now using equation(11-31)
Tinf = (((Cw-Cinf)*Hfg)/(RHO*Cp*(Le^(2/3))))+Tw;// [K]
Tin = Tinf-273.15;// [degree celsius]
printf("temperature of dry air is %f degree celsius",Tin);
printf("\n\n these calculations are now recalculated the density at the arithmetic-average temperature between wall and free-stream conditions");
printf("\n\n with this adjustments these results are RHO = 1.143 kg/m^(3) and Tinf = 55.8 degree celcius");
|
44bb26bde6d02586ed71081f74868539febe12c4 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.3.1/Unix-Windows/scilab-2.3/macros/scicos/add_palette.sci | f09184aad322841cdc8957f315f1d6bff6bf220f | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | 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 | 434 | sci | add_palette.sci | function palettes=add_palette(palettes,path,kpal)
path=stripblanks(path(:))
n=size(path,1)
for k=size(palettes)+1:max(kpal), palettes(k)=list(),end
for k=1:n
pk=path(k)
lp=length(pk)
if pk==emptystr()
elseif part(pk,lp-4:lp)=='.cosf' then
exec(pk,-1);
palettes(kpal(k))=scs_m
elseif part(pk,lp-3:lp)=='.cos' then
load(pk)
palettes(kpal(k))=scs_m
else
message('Unknown palette file type '+pk)
end
end
|
707a78bb944cbe961adf6563710db0c65651fc02 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.2/Unix/scilab-2.2/macros/scicos/draw.sci | 7048519b347993ad709521e9bc0d05a319542b5e | [
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain",
"MIT"
] | 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 | 144 | sci | draw.sci | function draw(x)
nx=size(x)
for k=2:nx
o=x(k)
if o(1)<>'Link' then
execstr(o(5)+'(''plot'',o)')
else
drawlink(o)
end
end
|
4745aae88dc71d20555fa89af257a366f8293284 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1553/CH6/EX6.14/6Ex14.sce | 6eec28e6a59705e1c1b41e469fac451255a01d8e | [] | 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 | 147 | sce | 6Ex14.sce | //chapter 6 Ex 14
clc;
clear;
close;
score=87; inc=3; n=17;
avg17= score-(n-1)*inc;
mprintf("The average after 17th inning is %d",avg17);
|
211dd4728855502439ee45d6330cf6c26ef49a5c | 449d555969bfd7befe906877abab098c6e63a0e8 | /1964/CH4/EX4.8/ex4_8.sce | 2d5263e50e39bd28b42d49083fcd59523229155a | [] | 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 | ex4_8.sce | //Chapter-4, Example 4.8, Page 136
//=============================================================================
clc
clear
//let the current peak value of sinusoidal and rectangular waves are Im.
//CALCULATIONS
Im=1;//let im current value be 1(just for calculation purposes)
rms1=sqrt(((Im)^2*%pi)/(%pi));//rms current value of rectangular wave
function y1=f1(x),y1=(Im^2)*(sin(x))^2,endfunction
a1=(intg(0,%pi,f1));
a1=a1/(%pi);//mean square value in A
rms=sqrt(a1);//rms value in A
z=((rms)^2/(rms1)^2);//relative heating effects
mprintf("relative heating effects is %1.1f",z);
//=================================END OF PROGRAM==============================
|
b193ab6515f160bb26b3a93562fb613a69f30cc9 | eb7eeb04a23a477e06f3c0e3d099889caee468b4 | /src/examples/scilab/scilab_shallowwater/animshallowwater.sce | 129e0486e68cc18d793ca5eb7a4f44836b04ae9b | [] | no_license | mikeg64/iome | 55699b7d7b3d5c1b006d9c82efe5136b8c909dfd | cc1c94433133e32776dcf16704ec4ec337b1b4a0 | refs/heads/master | 2020-03-30T15:57:33.056341 | 2016-04-13T09:24:27 | 2016-04-13T09:24:27 | 151,387,236 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,078 | sce | animshallowwater.sce | //animation of mesh generated by shallowwater solver
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
// !! L.3: Matlab function figure not yet converted, original calling sequence used.
figure(1)
//Animation of H wave propogating
// ! L.6: mtlb(t) can be replaced by t() or t whether t is an M-file or not.
for index = 1:max(size(mtlb_double(mtlb(t))))
// ! L.7: mtlb(x) can be replaced by x() or x whether x is an M-file or not.
// ! L.7: mtlb(y) can be replaced by y() or y whether y is an M-file or not.
// ! L.7: mtlb(h) can be replaced by h() or h whether h is an M-file or not.
// !! L.7: Unknown function h not converted, original calling sequence used.
// !! L.7: Matlab function mesh not yet converted, original calling sequence used.
mesh(mtlb(x),mtlb(y),h(":",":",index))
set(gca(),"data_bounds",matrix([0,100000,0,100000,4990,5010],2,-1))
title("AERSP 423 Computer Project Part II")
xlabel("X Domain [m]")
ylabel("Y Domain [m]")
zlabel("Height [m]")
xpause(1000*0.02)
end;
|
6910213da2d08469816a6f5abce2c6a800b8fa25 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2627/CH2/EX2.7/Ex2_7.sce | 094cfbe4855319fafdd13995d1cccdb201846559 | [] | 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 | 471 | sce | Ex2_7.sce | //Ex 2.7
clc;clear;close;
format('v',6);
c=400;//mm(circumference)
A=500;//mm^2(Cross sectional area)
N=200;//turns
//Part (a)
I=2;//A
H=N*I/(c*10^-3);//A/m
B=1.13;//T(Corresponding Flux density)
fi=B*A*10^-6;//Wb(total flux)
L=N*fi/I*1000;//mH
disp(L,"(a) Inductance of coil(mH)");
//Part (a)
I=10;//A
H=N*I/(c*10^-3);//A/m
B=1.63;//T(Corresponding Flux density)
fi=B*A*10^-6;//Wb(total flux)
L=N*fi/I*1000;//mH
disp(L,"(b) Inductance of coil(mH)");
|
3ab28b1f9f1ecf412e2c36e31cec452fcc1d1462 | 449d555969bfd7befe906877abab098c6e63a0e8 | /43/CH10/EX10.12/ex1012.sce | 333b6c315e10982e393dd71c5de4adecebeb8fb1 | [] | 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 | ex1012.sce | //Ex 1012
//Convolution of two sequences
//[1 1 1 1 1]
//[1 2 3]
clc;
n1=0:1:4;
n2=0:1:2;
x=[1 1 1 1 1]
h=[1 2 3]
y=convol(x,h);
l=length(y);
n3=0:1:l-1;
figure
title('Sequence x')
plot2d3(n1,x);
figure
title('Seequence h')
plot2d3(n2,h);
figure
title('Sequence y')
plot2d3(n3,y); |
591749c39168eb94fd3f2714ed446ae06f43b2d3 | a62e0da056102916ac0fe63d8475e3c4114f86b1 | /set6/s_Electronic_Circuits_M._H._Tooley_995.zip/Electronic_Circuits_M._H._Tooley_995/CH1/EX1.9/Ex1_9.sce | 3a8fbbb917085c390340110e5425a89512c30d98 | [] | 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 | 146 | sce | Ex1_9.sce | errcatch(-1,"stop");mode(2);//Exa:1.9
;
;
c_mA=7.25;//given
c_A=c_mA*1000;
printf("%f milliampere current is %f ampere",c_mA,c_A);
exit();
|
54fa23d353ec5090100864f8f7c71c1d20d1b01e | 449d555969bfd7befe906877abab098c6e63a0e8 | /3269/CH5/EX5.6/Ex5_6.sce | 7143fadb65408a6b24c8a9bd4cf1c122e5f40c53 | [] | 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 | 485 | sce | Ex5_6.sce | // Example 5.6
clear all;
clc;
// Given data
S = 10^7; // Strength of neutron source in neutrons/sec
r = 15; // Distance over which neutron flux is to be calculated in cm
// Using the data given in Table 5.2,
L_T = 2.85; // Thermal diffusion length in cm
D_bar = 0.16; // Diffusion coefficient in cm
// Calculation
phi_T = S*exp(-r/L_T)/(4*%pi*D_bar*r);
// Result
printf('\n Neutron flux = %3.2E neutrons/cm^2-sec \n',phi_T);
|
07644906bfebb4d735fae02b2be3113fad14ab0c | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.4.1/Unix-Windows/scilab-2.4.1/macros/util/sp2adj.sci | 58d18a6ac00595c0893d7884217e4cbfa46e5980 | [
"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 | 581 | sci | sp2adj.sci | function [lp,ls,v]=sp2adj(A)
// A = n x m sparse matrix
// lp, ls, v = adjacency representation of A i.e:
// lp(j+1)-lp(j) = # of non zero entries in row j
// ls = column index of the non zeros entries
// in row 1, row 2,..., row n.
// v = values of non zero entries
// in row 1, row 2,..., row n.
// lp is a (column) vector of size n+1
// ls is an integer (column) vector of size nnz(A).
// v is a real vector of size nnz(A).
[ij,v,n]=spget(A');
N=n(1);
if ij == [] then,
lp=ones(n(2)+1,1);ls=[];v=[];
else,
[lp,la,ls]=m6ta2lpd(ij(:,1)',ij(:,2)',N+1,N)
lp=lp(:);ls=ls(:);
end;
|
4262f8528fe6ea0b96d90ca7b1c6790b87f0c797 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1373/CH6/EX6.6/Chapter6_Example6.sce | 71a5cb5153b5dde47caebdb82cbab20511678355 | [] | 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 | 942 | sce | Chapter6_Example6.sce | //Chapter-6, Example 6.6, Page 247
//=============================================================================
clc
clear
//INPUT DATA
p=0.8;//Dynamic viscosity in N.s/m^2
k=0.15;//Thermal conductivity in W/m.K
Tb=10;//Temperature of bearing in degree C
Ts=30;//Temperature of the shaft in degree C
C=0.002;//Clearance between bearig and shaft in m
U=6;//Velocity in m/s
//CALCULATIONS
qb=(((-p*U^2)/(2*C))-((k/C)*(Ts-Tb)))/1000;//Surface heat flux at the bearing in kW/m^2
qs=(((p*U^2)/(2*C))-((k/C)*(Ts-Tb)))/1000;//Surface heat flux at the shaft in kW/m^2
Tmax=Tb+(((p*U^2)/(2*k))*(0.604-0.604^2))+((Ts-Tb)*0.604);//Maximum temperature in degree C occurs when ymax=0.604L
//OUTPUT
mprintf('Maximum temperature rise is %3.3f degree C \n Heat fux to the bearing is %3.1f kW/m^2 \n Heat fux to the shaft is %3.1f kW/m^2',Tmax,qb,qs)
//=================================END OF PROGRAM==============================
|
d394368c405b9e88a99f1658c93a858bb5ae75e7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /611/CH3/EX3.8/Chap3_Ex8_R1.sce | c7ec5ce33a77dee61e8a66762818e504bdc9c06a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 3,437 | sce | Chap3_Ex8_R1.sce | // Y.V.C.Rao ,1997.Chemical Engineering Thermodynamics.Universities Press,Hyderabad,India.
//Chapter-3,Example 8,Page 57
//Title:Volume using Cardan's method
//================================================================================================================
clear
clc
//INPUT
T=427.85;//temperature in K
P=0.215;//saturation pressure in MPa
a=3.789;//van der Waals constant in Pa(m^3/mol)^2
b=2.37*10^-4;//van der Waals constant in m^3/mol
R=8.314;//universal gas constant in (Pa m^3)/(mol K)
//CALCULATION
//The Cardan's method simplifies the equation of state into a cubic equation which can be solved easily
//The general form of the cubic equation is (Z^3)+(alpha*Z^2)+(beeta*Z)+gaamma=0, where alpha,beeta and gaamma are determined using established relations
A=(a*P*10^6)/(R*T)^2;//calculation of A to determine alpha,beeta and gaamma by using Eq.(3.25)
B=(b*P*10^6)/(R*T);//calculation of B to determine alpha,beeta and gaamma by using Eq.(3.26)
alpha=-1-B;//calculation of alpha for van der Waals equation of state using Table (3.2)
beeta=A;//calculation of beeta for van der Waals equation of state using Table (3.2)
gaamma=-(A*B);//calculation of gaamma for van der Waals equation of state using Table (3.2)
p=beeta-(alpha^2)/3;//calculation of p to determine the roots of the cubic equation using Eq.(3.29)
q=((2*alpha^3)/27)-((alpha*beeta)/3)+gaamma;//calculation of q to determine the roots of the cubic equation using Eq.(3.30)
D=(((q)^2)/4)+(((p)^3)/27);//calculation of D to determine the nature of roots using Eq.(3.31)
if D>0 then
Z=((-q/2)+(sqrt(D)))^(1/3)+((-q/2)-(sqrt(D)))^(1/3)-(alpha/3);//One real root given by Eq.(3.32)
vf=((Z)*R*T)/(P*10^6);//Volume of saturated liquid calculated as vf=(Z*R*T)/P in m^3/mol
vg=((Z)*R*T)/(P*10^6);//Volume of saturated vapour calculated as vg=(Z*R*T)/P in m^3/mol
else if D==0 then
Z1=((-2*(q/2))^(1/3))-(alpha/3);//Three real roots and two equal given by Eq.(3.33)
Z2=((q/2)^(1/3))-(alpha/3);
Z3=((q/2)^(1/3))-(alpha/3);
Z=[Z1 Z2 Z3];
vf=(min(Z)*R*T)/(P*10^6);//Volume of saturated liquid calculated as vf=(Z*R*T)/P in m^3/mol
vg=(max(Z)*R*T)/(P*10^6);//Volume of saturated vapour calculated as vg=(Z*R*T)/P in m^3/mol
else
r=sqrt((-(p^3)/27));//calculation of r using Eq.(3.38)
theta=acos((-(q)/2)*(1/r));//calculation of theta in radians using Eq.(3.37)
Z1=(2*(r^(1/3))*cos(theta/3))-(alpha/3);
Z2=(2*(r^(1/3))*cos(((2*%pi)+theta)/3))-(alpha/3);//Three unequal real roots given by Eqs.(3.34,3.35 and 3.36)
Z3=(2*(r^(1/3))*cos(((4*%pi)+theta)/3))-(alpha/3);
Z=[Z1 Z2 Z3];
vf=(min(Z)*R*T)/(P*10^6);//Volume of saturated liquid calculated as vf=(Z*R*T)/P in m^3/mol
vg=(max(Z)*R*T)/(P*10^6);//Volume of saturated vapour calculated as vg=(Z*R*T)/P in m^3/mol
end
end
//OUTPUT
mprintf('\n The volume occupied by n-octane (saturated liquid) obtained by Cardans method= %e m^3/mol\n',vf);
mprintf('\n The volume occupied by n-octane (saturated vapour) obtained by Cardans method= %f m^3/mol\n',vg);
//===============================================END OF PROGRAM===================================================
//DISCLAIMER: THE COMPUTED VALUE OF Z2 IS 0.0213 AND NOT 0.0187 AS PRINTED IN THE TEXTBOOK. THIS HAS BEEN CORRECTED IN THE ABOVE PROGRAM.
|
e04c7ed6a878d6b2fd43a2652cd4bd91cc7f81c3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /181/CH6/EX6.16/example6_16.sce | cb9458ce996a4f29f097c4be8571b08e5021bf4d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 522 | sce | example6_16.sce | // Determine Rd
// Basic Electronics
// By Debashis De
// First Edition, 2010
// Dorling Kindersley Pvt. Ltd. India
// Example 6-16 in page 289
clear; clc; close;
// Given data
K=0.25*10^-3; // Constant in mA/V^2
Vt=2; // Voltage given in V
Vdd=16; // Drain voltage in V
Vgg=[4 10]; // Gate voltage values in V
// Calculation
for i=1:2
id=K*(Vgg(i)-2)^2;
rd=(16-(Vgg(i)-2))/id;
printf("Rd when Vgg is %d V = %0.1e ohm\n",Vgg(i),rd);
end
// Result
// (a) Rd = 14 K-ohm
// (b) 500 ohm |
647090efb95df40f0f3b3a3e4190ed9b4104f7f9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /69/CH3/EX3.2/3_2.sce | e635b0fcf63298ec0cd3841b12a1678b34ae9e89 | [] | 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 | 331 | sce | 3_2.sce | clear; clc; close;
//part a
Ib = 30*10^(-6);
Vce = 7.5;
Ic = 3.3*10^(-3);
disp(Ic,'Ic(A) is : ');
//part b
Vce = 15;
Vbe = 0.7;
Ib = 20*10^(-6);
Ic = 2.5*10^(-3);
disp(Ic,'Ic(A) ate the intersection of Ib & Vceis :');
//part c
Ib = 4*10^(-6);
Vce = 15;
Ic = 800*10^(-6);
disp(Ic,'Ic(A) in this case is : ');
|
0c836b02a606b40a91e9ccfc9eb2ad6deb6f2254 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3821/CH7/EX7.11/Example7_11.sce | 29c3e59d4010ffc6a99ff6cde7093fe34f7a2d79 | [] | 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 | Example7_11.sce | ///Chapter No 7 Fluid Mechanics
//Example 7.11 Page No 121
//#Input data
clc;
clear;
Z=15; //Pressure due to column in m
S=0.85; //Oil of specific gravity
g=9.81; //Gravity
///Calculation
rho=S*10^3; //Density of oil in kg/m**3
P=rho*g*Z; //Pressure in N/m**2 or kPa
///Output
printf('Density of oil= % f kg/m^3 \n ',rho);
printf('Pressure= %f N/m**2 \n ',P);
|
da267f23db8958c35f8b2482c8f7523a9ccc5b95 | f708de8b70d2f3c38b5eb963efe5d71de1a0de49 | /src/goahead/test/stress/upload.tst | 3b28ed20981edfb6c3d4ffa8e7d0564d037dcf45 | [] | no_license | baobao-skl/SmartSDK | 7225208110f223f950477f577947dbbe2577f439 | 7c81b63a66f3c0cf98ff3c2f1330a3a5e226dbe6 | refs/heads/master | 2020-05-28T01:47:07.809576 | 2014-08-12T14:20:21 | 2014-08-12T14:20:21 | 19,645,700 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 1,297 | tst | upload.tst | /*
upload.tst - Stress test uploads
*/
const HTTP = App.config.uris.http || "127.0.0.1:8080"
const TESTFILE = "upload-" + hashcode(self) + ".tdat"
/* This test requires chunking support */
if (App.config.bit_upload) {
let http: Http = new Http
/* Depths: 0 1 2 3 4 5 6 7 8 9 */
var sizes = [ 1, 2, 4, 8, 16, 32, 64, 128, 256, 512 ]
// Create test data
buf = new ByteArray
for (i in 64) {
for (j in 15) {
buf.writeByte("A".charCodeAt(0) + (j % 26))
}
buf.writeByte("\n".charCodeAt(0))
}
// Create test data file
f = File(TESTFILE).open({mode: "w"})
for (i in (sizes[test.depth] * 1024)) {
f.write(buf)
}
f.close()
try {
if (test.threads == 1) {
size = Path(TESTFILE).size
http.upload(HTTP + "/action/uploadTest", { file: TESTFILE })
assert(http.status == 200)
http.close()
let uploaded = Path("../web/tmp").join(Path(TESTFILE).basename)
assert(uploaded.size == size)
// MOB - remove need for diff
Cmd.sh("diff " + uploaded + " " + TESTFILE)
}
}
finally {
Path(TESTFILE).remove()
}
} else {
test.skip("Upload not enabled")
}
|
00b1208c5ef9c3d3abb58dff360245ef0c38a309 | 449d555969bfd7befe906877abab098c6e63a0e8 | /275/CH1/EX1.1.54/Ch1_1_54.sce | c26281a950033ed8b0c74824dc6b0328c60a61fd | [] | 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 | 508 | sce | Ch1_1_54.sce | clc
disp("Example 1.54")
printf("\n")
disp("Find the forward voltage drop at 100c and dynamic resistance")
T1=25
T2=100
Vft1=0.6 //forward voltage drop at 25c
IT1=26*10^-3 //forward current(constant)
IT2=IT1
//for silicon diode we know that
v=(-1.8*10^-3)
Vft2=Vft1+((T2-T1)*v)
IF=26*10^-3
rd1=(26*10^-3/IF)*((T1+273)/298)
rd2=(26*10^-3/IF)*((T2+273)/298)
printf("Forward voltage drop at 100c=\n%f volt\n",Vft2)
printf("Dynamic resistance at 25c and 100c=\n%f ohm\n%f ohm\n",rd1,rd2)
|
b9ffeff94e68ce7335afc3d7fccf60bfebfa168d | 449d555969bfd7befe906877abab098c6e63a0e8 | /260/CH6/EX6.9/6_9.sce | bf2c82c1ffb91c008034d4797aa292a8d86733c4 | [] | 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 | 114 | sce | 6_9.sce | //Eg-6.9
//pg-294
clear
clc
//Theoretical Problem
disp("The example is solved analytically.") |
964443091287138f7bef589646bcb93c4ab64d52 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3311/CH4/EX4.4/Ex4_4.sce | 110c274d802f06d0954d5980f9290e6ee1a88a4a | [] | 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,141 | sce | Ex4_4.sce | // chapter 4
// example 4.4
// Calculate the number of thyristors
// page-132
clear;
clc;
// given
Es=7.5; // in kV (total applied voltage)
Im=1000; // in A (total forward current)
E_D=500; // in V (thyristor voltage)
I_T=75; // in A (thyristor current)
neta=14; // in percentage (derating factor)
// calculate
Es=Es*1E3; // changing unit from kV to V
neta=neta/100; //changing efficiency from percentage to ratio
// since neta=1-(Es/(n_s*E_D)) therefore
n_s_float=Es/(E_D*(1-neta)); // calculation of number of thyristos in series
n_s= int16(n_s_float)+1; // since n_s will be reduced by decimal value it contaisn if type conversion is done because the decimal part would be removed so we need to add 1 to it
// since neta=1-(Im/(n_s*I_T)) therefore
n_p_float=Im/(I_T*(1-neta)); // calculation of number of thyristos in parallel
n_p= int16(n_p_float)+1; // since n_p will be reduced by decimal value it contaisn if type conversion is done because the decimal part would be removed so we need to add 1 to it
printf("\nThe number of thyristors in series is \t n_s=%.f",n_s);
printf("\nThe number of thyristors in parallel is n_p=%.f",n_p); |
45dc1f8c461101fb260ddaddfdb9f53851d80558 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2774/CH3/EX3.4/Ex3_4.sce | acf8595bb806439a0962c39e4a1f1c1545248331 | [] | 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 | 727 | sce | Ex3_4.sce | clc//
//initialization of variables
M=100 // mass in kg
d=3 // depth by which mass drops in m
V=0.002 // increased volume in m^3
g=9.81 // gravitational accleration in m/sec^2
Pgauge=100*1000// gauge pressure in N/m
Patm =100*1000 // atmospheric pressure in N/m
P=Pgauge+Patm // to get absolute pressure
//calculate work done by paddle wheel
Wpaddlewheel=(-M*g*d) // work is negative as it is done on the system
//calculate work done on piston it
Wboundary=P*V // area mulitiplied by height is volume thus W=P.V
//net work
Wnet=Wpaddlewheel+Wboundary; // Work in joule as SI units are used
printf("The Net Work done is "+string(Wnet)+" J")
// in textbook answer is 2450 J which is when we assume g=9.80
|
75d80d56447530f6307e5d31554cd530a9ec7211 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2135/CH2/EX2.15/Exa_2_15.sce | 239419a812ab50974c057ddf8772246a486dffc5 | [] | 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 | 478 | sce | Exa_2_15.sce | //Exa 2.15
clc;
clear;
close;
format('v',7);
//Given Data :
m=1;//Kg
V1=0.3;//m^3
p=3.2*100;//Kpa
p1=3.2*100;//Kpa
p2=3.2*100;//Kpa
V2=2*V1;//m^3
Cp=1.003;//KJ/KgK
R=0.2927;//KJ/kgK
//p*V=m*R*T
T1=p1*V1/m/R;//kelvin
T2=p2*V2/m/R;//kelvin
Q=m*Cp*(T2-T1);//KJ
disp(Q,"Heat Added in KJ : ");
W=p*(V2-V1);//KJ
disp(W,"Work done in KJ : ");
disp(round(T1),"Initial temperature of air in kelvin : ");
disp(round(T2),"Final temperature of air in kelvin : ");
|
3c403897982471d3c0a540284f9bd84a7248c70e | 449d555969bfd7befe906877abab098c6e63a0e8 | /3750/CH2/EX2.2/EX2_2.sce | 2c93ceb04f5fbaa11026c0000f0246f9260b48d5 | [] | 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,807 | sce | EX2_2.sce | //Strength Of Material By G.H.Ryder
//Chapter 2
//Example 2
//To Find the dimensions so that the strength shall be same against all type of failure
clc();
//Initialization of Variables
d=5; //diameter of rod , Unit in cm
f=1.25; //thickness of cotter , Unit in cm
StressTension=300; //Permissible stress in tension, Unit in cm
StressShearMember=150; //Permisible shear stress in members, Unit in N/mm^2
StressShearCotter=225; //Permissible shear cotter in members, Unit in N/mm^2
StressCrushing=450; //Permissible Crushing stress in members, Unit in N/mm^2
//Calculations
//(1) Load (P)
P=StressTension*(%pi)*(d*10)^2/4; //load, Unit in N
//(2) Shear fo cotton:StressShearCotter=P/(2*e*f*10)
e=P/(2*f*10*StressShearCotter); // Cotter , Unit in mm, The answer vary due to round off error
//(3)Shear of right-handed member
//ShearStressMember=P/(4*a*b)
aMultiplyb=P/(4*StressShearMember); // Unit in mm^2
//(4)Shear of left-handed member
//ShearStressMember=P/(2*c*h)
cMultiplyh=P/(2*StressShearMember) //Unit in mm^2
//(5) Crusing between right hand member and cotter
//StressCrushing=P/(2*a*f*10)
a=P/(2*f*10*StressCrushing); //Unit in mm, The answer vary due to round off error
b=aMultiplyb/a; //from (3), Unit in mm, The answer vary due to round off error
//(6)Crushing between left hand member and cotter
//StressCrusing=P/(f*10*h)
h=P/(f*10*StressCrushing); //Unit in mm, The answer vary due to round off error
c=cMultiplyh/h; //from (4), Unit in mm, The answer vary due to round off error
//Results
printf("Given: d=%.0fmm, f=%.2fmm\n",d,f)
printf("The other dimension required are:\n\t")
printf(" a=%.1f mm\n\t b=%.1f mm \n\t c=%.1f mm \n\t h=%.1f mm \n\t e=%.0f mm \n\t",a,b,c,h,e) //The answer vary due to round off error
|
b216e5f0a05651f0050da3512eedffcbabbcb004 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3845/CH10/EX10.1/Ex10_1.sce | a47665a1ca59796739f97a33b090c1a8701cbdde | [] | 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 | 572 | sce | Ex10_1.sce | //Example 10.1
delta_omega=250;//Angular velocity (rpm)
delta_omega=250*2*%pi/60;//Angular velocity (rad/s)
delta_t=5.00;//Time taken (s)
alpha=delta_omega/delta_t;//Angular acceleration (rad/s^2)
printf('a.Angular acceleration = %0.2f rad/s^2',alpha)
delta_omega_b=-delta_omega;//Angular velocity (rad/s)
alpha_b=-87.3;//Angular acceleration (rad/s^2)
delta_t_b=delta_omega_b/alpha_b;//Time taken (s)
printf('\nb.Time taken for the wheel to stop = %0.3f s',delta_t_b)
//Openstax - College Physics
//Download for free at http://cnx.org/content/col11406/latest
|
5cbd4fefdf42b85adcc45c6faaf7462fb18a0424 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2414/CH12/EX12.7/Ex12_7.sce | 49a9d74339d2033270cc9e59e2c067cdd7e38cfc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 178 | sce | Ex12_7.sce | clc;
close();
clear();
//page no 408
//prob no. 12.7
R=50 ; //ohm
G=10^8; //gain
kT0=4*10^-21;
So=G*kT0;
mprintf('Output spectral density So(f)=%.0f fW/Hz',So*10^15);
|
72723f30244ff5175499c7503ae1e48bd9efaae7 | 01ecab2f6eeeff384acae2c4861aa9ad1b3f6861 | /sci2blif/rasp_design_added_blocks/in2in_x6.sce | 54e64e5dbcae930127f09717e894d0d6ee22a2dc | [] | 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 | 262 | sce | in2in_x6.sce | style.fontSize=12;
style.displayedLabel="<table> <tr> <td align=center><b>in1<br>in1<br>in2<br>in2<br>in3<br>in3<br>in4<br>in4<br>in5<br>in5<br>in6<br>in6</b></td> <td align=center>In2In_x6</td></tr></table>";
pal10 = xcosPalAddBlock(pal10,"in2in_x6",[],style);
|
8e07844aad2c92cc914ad9d0a54e6c050160ed3c | 8495bf24a31d40b332b836da95e8474877e27bbd | /referencia/guiaRefEj1c.sci | f37b8843410af145196893c0d56037616f8a7c13 | [] | no_license | Marian0/mcfich | 3c39b4c48e209c254c00a5ed303da0d4d6152d17 | 8e234e5dc57c2d08497dffa889210a9eb6da4c1e | refs/heads/master | 2016-09-06T09:51:25.142659 | 2013-04-19T13:24:23 | 2013-04-19T13:24:23 | 9,545,942 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 794 | sci | guiaRefEj1c.sci | //A0 : Condicion Dirichlet en x=0
//dx : separacion de nodos
//l0,lx : dimension de la barra
//funcion fuente, depende de x
function f = F(x)
if(x <= 1)
f = -10;
else if(x <= 2)
f = 5;
else
f = -1;
end
end
endfunction
function [x,A,b] = ej1c(A0,dx,l0,lx)
n = (lx-l0)/dx;
A = zeros(n,n); //stencil
A(1,1) = -2;
A(1,2) = 1;
for i = 2:(n-1)
A(i,i) = -2;
A(i,i-1) = 1;
A(i,i+1) = 1;
end
A(n,n-1) = 2;
A(n,n) = -2;
b = zeros(n,1);
pos = [l0:dx:lx];
for i = 1:n
b(i) = (dx^2) * (-1) * F(pos(i)); //terminos independientes
end
b(1) = b(1) - A0; //por cond. dirichlet
x = A\b;
x = [A0;x]; //agrega el valor inicial de Dirichlet
endfunction |
1f328866e96a9b3b1198f3d6e2f9114f35c246cb | 449d555969bfd7befe906877abab098c6e63a0e8 | /1727/CH11/EX11.6/11_6.sce | f9754ac2f2365dddddd112578a5ee264bb79469f | [] | 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 | 11_6.sce | clc
//Initialization of variables
U=50*1000/3600 //m/s
cd1=0.34
cd2=1.33
//calculations
disp("On solving for both convex and concave surfaces,")
w=18.26 //m/s
N=w/(2*%pi) *60
//results
printf("rotational speed = %.1f rpm",N)
|
69ed75da956f1b77c39fea50149e7116f0e1caa0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1475/CH7/EX7.35/Example_7_35.sce | da9e2623c43f3ad0bcae8a7f159a986d39b874a0 | [] | 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 | 311 | sce | Example_7_35.sce | //Example 7.35 In calculating a certain cost of living index number the following weights were used
clc;
clear;
I=[32 54 47 78 58];
W=[15 3 4 2 1];
Avg=sum(I.*W)/sum(W);
disp(100+Avg,"Cost of living index",Avg,"Average percentage increase for all groups taken together",I,"Average % Increase in Price");
|
08d7e0d665cd3a0559f26a91b499834cb4611f80 | 449d555969bfd7befe906877abab098c6e63a0e8 | /689/CH17/EX17.2/2.sce | ea0ebc51e3819e57d769a30dad2b40a135369232 | [] | 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 | 315 | sce | 2.sce | clc; funcprot(0);
//Example 17.2 Time to Climb Altitude
//Variable Initialisation
RC0 = 1000; //Rate of climb at sea level
H = 15000; //Absolute Ceiling
h = 7000; // Height to climb
//Calculation
t = H*log(H/(H-h))/RC0;
//Results
disp(t,"Time to climb (min) : ");
|
b5826d4b5c4c43623ea3bfa73a5c24d0d680a8df | 449d555969bfd7befe906877abab098c6e63a0e8 | /683/CH13/EX13.1/CKJ_1.sce | 4e138a3ea159d3baadcf53a519a762d342cd2eff | [] | 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 | 631 | sce | CKJ_1.sce | //sum 13-1
clc;
clear;
F=25*10^3;
sigat=50;
Ta=40;
pa=80;
d=sqrt((4*F)/(%pi*sigat));
d=26;
t=d/4;
t=7;
d1=1.2*d;
d1=32;
pc=F/(d1*t);
t=10;
c=0.75*d;
c=20;
d2=44;
tw=(d2-d1)/2;
b=F/(2*t*Ta);
b=34;
a=0.5*d;
d3=(F/(pa*t))+d1;
d3=64;
e=F/(Ta*(d3-d1));
d4=sqrt((F*4/(%pi*pa))+d1^2);
d4=40;
f=0.5*d;
sigbc=3*F*d3/(t*b^2*4);
// printing data in scilab o/p window
printf(" d is %0.0f mm ",d);
printf("\n d1 is %0.0f mm ",d1);
printf("\n d2 is %0.0f mm ",d2);
printf("\n d3 is %0.0f mm ",d3);
printf("\n d4 is %0.0f mm ",d4);
printf("\n sigbc is %0.1f MPa ",sigbc); |
68ee74547a2f3d65791937d84daa07c468b54ac8 | 089894a36ef33cb3d0f697541716c9b6cd8dcc43 | /NLP_Project/test/blog/bow/bow.9_19.tst | 3a4118768f0e394ad35136d57a07c24b3503f595 | [] | no_license | mandar15/NLP_Project | 3142cda82d49ba0ea30b580c46bdd0e0348fe3ec | 1dcb70a199a0f7ab8c72825bfd5b8146e75b7ec2 | refs/heads/master | 2020-05-20T13:36:05.842840 | 2013-07-31T06:53:59 | 2013-07-31T06:53:59 | 6,534,406 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 4,995 | tst | bow.9_19.tst | 9 36:0.125 40:1.0 148:0.3333333333333333 165:1.0 317:1.0 375:1.0 458:0.3333333333333333 519:1.0
9 11:0.3333333333333333 36:0.125 40:1.0 53:0.09090909090909091 114:0.3333333333333333 158:0.25 339:1.0 735:1.0
9 4:0.16666666666666666 15:1.0 36:0.125 40:1.0 48:0.1 60:0.07142857142857142 99:1.0 126:1.0 148:0.3333333333333333 171:1.0 355:1.0 612:1.0 748:1.0
9 1:0.037037037037037035 74:1.0 208:0.2 317:1.0 330:0.3333333333333333 936:1.0
9 1:0.037037037037037035 4:0.16666666666666666 15:1.0 53:0.09090909090909091 60:0.07142857142857142 74:1.0 76:0.3333333333333333 93:0.1 112:1.0 113:1.0 121:1.0 298:1.0 317:1.0 485:1.0 633:0.5 731:1.0
9 1:0.037037037037037035 84:1.0 156:0.5 215:0.3333333333333333 221:1.0 317:1.0 354:1.0 731:1.0
9 1:0.037037037037037035 62:0.3333333333333333 148:0.3333333333333333 166:1.0 259:2.0 481:0.5 762:1.0 889:1.0
9 1:0.037037037037037035 36:0.125 53:0.09090909090909091 76:0.3333333333333333 259:2.0 481:0.5 640:1.0 762:1.0
9 1:0.05555555555555555 10:0.1 36:0.25 62:0.6666666666666666 95:0.3333333333333333 156:0.5 208:0.4 316:1.0 494:0.5 603:1.0 1002:1.0
9 1:0.018518518518518517
9 1:0.018518518518518517 4:0.16666666666666666 51:1.0 166:1.0
9 1:0.018518518518518517 148:0.3333333333333333 171:1.0 350:1.0 609:1.0
9 1:0.018518518518518517 36:0.125 40:1.0 248:1.0 561:1.0
9 1:0.018518518518518517 36:0.125 372:0.3333333333333333 754:1.0
9 1:0.018518518518518517 17:0.09090909090909091 34:1.0 60:0.07142857142857142 480:1.0 611:1.0
9 1:0.018518518518518517 36:0.125 48:0.1 148:0.3333333333333333 162:1.0 218:1.0 228:1.0 273:1.0 317:1.0 339:1.0 372:0.6666666666666666
9 1:0.018518518518518517 10:0.1 17:0.09090909090909091 62:0.3333333333333333 122:1.0 126:1.0 568:1.0 679:1.0 1013:1.0
9 4:0.16666666666666666 22:1.0 53:0.09090909090909091 69:0.2 93:0.1 114:0.6666666666666666 192:0.3333333333333333 198:0.16666666666666666 372:0.3333333333333333 400:0.2 436:1.0 482:1.0 647:1.0
9 1:0.037037037037037035 17:0.09090909090909091 40:1.0 60:0.07142857142857142 208:0.2 240:0.25 383:1.0 408:1.0 420:1.0 476:1.0 481:0.5 733:1.0
9 1:0.018518518518518517 2:1.0 15:1.0 36:0.125 60:0.07142857142857142 76:0.3333333333333333 93:0.1 243:1.0 252:0.5 395:1.0 428:1.0 568:1.0
9 4:0.16666666666666666 17:0.18181818181818182 36:0.125 44:1.0 48:0.1 62:0.3333333333333333 69:0.2 121:1.0 252:0.5 258:0.3333333333333333 283:1.0 298:1.0 353:1.0 402:1.0 491:1.0 612:1.0 633:1.0 781:1.0 891:1.0
9 4:0.3333333333333333 17:0.09090909090909091 36:0.125 60:0.14285714285714285 62:0.3333333333333333 104:1.0 252:0.5 261:1.0 313:1.0 633:0.5 886:1.0
9 1:0.037037037037037035 4:0.16666666666666666 10:0.1 17:0.09090909090909091 36:0.25 53:0.09090909090909091 84:1.0 93:0.1 104:1.0 112:1.0 113:1.0 126:1.0 171:1.0 208:0.2 252:0.5 410:1.0 458:0.6666666666666666 462:1.0 485:1.0 568:1.0 679:1.0 797:1.0 937:1.0
9 1:0.018518518518518517 11:0.3333333333333333 40:1.0 93:0.1 158:0.25 252:0.5 688:1.0 796:1.0
9 1:0.037037037037037035 2:1.0 15:1.0 17:0.09090909090909091 36:0.375 48:0.1 60:0.14285714285714285 75:1.0 83:1.0 148:0.3333333333333333 158:0.25 420:1.0 568:2.0 734:1.0 1008:1.0
9 1:0.018518518518518517 10:0.1 15:1.0 27:1.0 51:1.0 76:0.3333333333333333 93:0.1 95:0.3333333333333333 197:1.0 208:0.2 210:1.0 228:1.0 235:1.0 240:0.25 241:0.5 243:1.0 315:1.0 876:1.0
9 1:0.037037037037037035 2:1.0 4:0.16666666666666666 14:1.0 53:0.09090909090909091 126:1.0 144:1.0 176:0.3333333333333333 240:0.5 298:1.0 317:1.0 568:1.0 886:1.0 1037:1.0 1163:0.3333333333333333
9 1:0.018518518518518517 4:0.16666666666666666 36:0.25 60:0.07142857142857142 76:0.3333333333333333 93:0.1 124:1.0 192:0.3333333333333333 208:0.2 414:1.0 480:1.0 568:1.0 1259:1.0
9 122:1.0 347:0.3333333333333333
9 84:1.0 113:1.0 209:0.16666666666666666 762:1.0
9 15:1.0 62:0.3333333333333333 118:0.5 134:1.0 1060:1.0
9 126:1.0 176:0.3333333333333333 240:0.25 1054:1.0
9 1:0.037037037037037035 4:0.16666666666666666 17:0.09090909090909091 53:0.09090909090909091 240:0.25 330:0.6666666666666666 347:0.3333333333333333 437:1.0 826:1.0 1163:0.3333333333333333 1206:1.0
9 1:0.018518518518518517 2:2.0 4:0.16666666666666666 10:0.1 17:0.09090909090909091 36:0.125 111:1.0 158:0.25 198:0.16666666666666666 232:1.0 240:0.25 330:0.3333333333333333 372:0.3333333333333333 437:1.0 679:1.0 1008:2.0
9 1:0.018518518518518517 4:0.16666666666666666 19:1.0 51:1.0 126:1.0 148:0.3333333333333333 176:0.3333333333333333 240:0.25 437:1.0 886:1.0
9 1:0.018518518518518517 4:0.16666666666666666 36:0.125 84:1.0 126:1.0 228:1.0 243:1.0 259:1.0 353:1.0 375:1.0 385:1.0 395:1.0 506:0.5 633:0.5 750:1.0 1213:1.0
9 4:0.16666666666666666 36:0.25 44:1.0 51:1.0 53:0.09090909090909091 85:1.0 240:0.25 249:1.0 407:1.0
9 4:0.16666666666666666 17:0.09090909090909091 53:0.09090909090909091 233:1.0 240:0.5 243:1.0 317:1.0 330:0.6666666666666666 383:1.0 886:1.0
9 1:0.037037037037037035 2:1.0 4:0.3333333333333333 36:0.25 40:1.0 62:0.3333333333333333 79:1.0 125:1.0 156:0.5 158:0.25 208:0.2 243:1.0 298:1.0 343:0.1111111111111111 347:0.3333333333333333 420:1.0 491:1.0 801:1.0
|
47948912a15f4484f6fc6ecc5dcb814898c45483 | 449d555969bfd7befe906877abab098c6e63a0e8 | /213/CH13/EX13.12/13_12.sce | 3ec839da8a4258bde7ceb53210e705a10961f10f | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 357 | sce | 13_12.sce | //To find speed of shaft
clc
//Given:
TB=80, TC=82, TD=28
NA=500 //rpm
//Solution:
//Calculating the number of teeth on wheel E
TE=TB+TD-TC
//Calculating the values of x and y
y=800
x=-y*(TE/TB)*(TC/TD)
//Calculating the speed of shaft F
NF=x+y //Speed of shaft F, rpm
//Results:
printf("\n\n Speed of shaft F = %d rpm, anticlockwise.\n\n",NF) |
2f7ab4418d2f43c7a75070e1df4206f46744a2fc | 449d555969bfd7befe906877abab098c6e63a0e8 | /2006/CH6/EX6.16/ex6_16.sce | 9b6bc5f349f4a5859a82fbe6866b71a742bf8f1e | [] | 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,339 | sce | ex6_16.sce | clc;
m=1; // Mass of saturated steam in kg
T=100; // Teamperature of steam in degree celcius
T0=303; // temperature of Surroundings in kelvin
hfg=2257; // Latent heat of evaporation in kJ/kg
sfg=6.048; // specific entropy in kJ/kg K
// (a).Entropy change
Q=m*hfg; // Heat transfer
del_Ssystem=-m*sfg; // Change of entropy of system
del_Ssurr=Q/T0; // Change of entropy of surroundings
del_Suniverse=del_Ssystem+del_Ssurr; // Change of entropy of universe
disp ("kJ/K",del_Suniverse,"Change of entropy of universe =","kJ/K",del_Ssurr,"Change of entropy of surroundings =","kJ/K",del_Ssystem,"Change of entropy of system =","(a).Entropy change");
// (b).Effect of heat transfer
del_Suniverse=0; // process is reversible
del_Ssurr=del_Suniverse-del_Ssystem; //Change of entropy of surroundings
QH=hfg; // Heat transfer from the condensing steam to reversible heat engine
QL=T0*del_Ssurr; // Heat receiveded by the surroundins reversible heat engine
W=QH-QL; //work output of reversible heat engine
disp ("Difference between QH & QL is converted into work output in a reversible cyclic process","kJ",W,"work output of reversible heat engine =","kJ",QL,"Heat receiveded by the surroundins reversible heat engine =","kJ",QH,"Heat transfer from the condensing steam to reversible heat engine =","(b).Effect of heat transfer");
|
6686d9f086c02cc7e17fdbea18a8aa7c0a97978c | 01ecab2f6eeeff384acae2c4861aa9ad1b3f6861 | /sci2blif/rasp_design_added_blocks/fgswitch.sce | 125c167b13348e26f4810afdf41f06b336a48052 | [] | 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 | 80 | sce | fgswitch.sce | style.displayedLabel="fgswitch"
pal2=xcosPalAddBlock(pal2,"fgswitch",[],style);
|
4274eb07a99ffb079ef290f2851651a0703bdebf | 449d555969bfd7befe906877abab098c6e63a0e8 | /3137/CH17/EX17.24/Ex17_24.sce | 03cb1c69bc128f805c6f4a74d76a74acf07d3f42 | [] | 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 | 546 | sce | Ex17_24.sce | //Initilization of variables
Wa=161 //lb
Wb=193.2 //lb
Wc=322 //lb
v1=5 //ft/s
lc=6 //in
k=6 //lb/ft
l=4 //ft
u=0.2 //coefficient of friction
g=32.2 //ft/s^2
//Calculations
Ib=(1/2)*(Wb/g)*(1/2)^2 //Moment of inertia
w1=v1/0.5 //rad/s
T1=(0.5*(Wc/g)*v1^2)+(0.5*Ib*w1^2)+(0.5*(Wa/g)*v1^2) //ft-lb
//Work Done on the system
//The textbook is ambigious on the calculations hence the result is dispalyed directly
U=26.4 //ft-lb
//Velocity Calculations
v=sqrt((T1+U)/9) //ft/s
//Result
printf('The velocity of the block is %f',v)
|
ccb6a0d853b668081b1d8d3e29e1acd9bccc0cc5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1332/CH20/EX20.1/20_1.sce | ba5d7e975d16d822168077a0192888bacc1e472c | [] | 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 | 291 | sce | 20_1.sce | //Example 20.1
//Direct Method
//Page no. 682
clc;clear;close;
h=1/3;
A=[-4,1,1,0;1,-4,0,1;1,0,-4,1;0,1,1,-4]
x=0;
for i=1:4
x=x+h
if i==4 then
B(i,1)=0
else
B(i,1)=-1*sin(x*%pi)^2
end
end
disp(A,'A =')
disp(B,'B =')
U=inv(A)*B
disp(U,'U =') |
a5e9662706ccf0642fc9728d423effee92f6e785 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3556/CH4/EX4.13/Ex4_13.sce | f2925dfe02ad0fc9bb3b989e5ddb28a38bba7014 | [] | 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 | 801 | sce | Ex4_13.sce | clc
// Fundamental of Electric Circuit
// Charles K. Alexander and Matthew N.O Sadiku
// Mc Graw Hill of New York
// 5th Edition
// Part 1 : DC Circuits
// Chapter 4 : Circuit Theorems
// Example 4 - 13
clear; clc; close;
//
// Given data
R2 = 2.00;
R3 = 3.00;
R6 = 6.00;
R12 = 12.00;
Vth = 22.00;
//
// Calculations
// Series R2 and R3
Rs1 = R2 + R3;
// Parallel R6 and R12
Rp1 = (R6*R12)/(R6 + R12);
// Resistance Total
Rt = Rs1 + Rp1;
// Calculations Maximum Power
Pmax = (Vth^2)/(4*Rt);
//
// Display the result
disp("Example 4-13 Solution : ");
printf(" \n Rth = Rl = %.3f Ohm",Rt)
printf(" \n Pmax = Maximum Power = %.3f Watt",Pmax)
|
f42a9ce32d57832869a60572f3944a1a1f8a6dba | 449d555969bfd7befe906877abab098c6e63a0e8 | /1061/CH5/EX5.11/Ex5_11.sce | 0601560963e7c0bb854bee035e8945ee6508ccb2 | [] | 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 | 534 | sce | Ex5_11.sce | //Ex:5.11
clc;
clear;
close;
L=6*10^-2;// beat length in m
dy=6*10^-9;// spectral width in m
y=1.3*10^-6;// operating wavelength in m
BF=y/(L);//model birefrigence in um
Lc=y^2/(BF*dy);// coherence length in m
db=2*3.14/(L);// difference beween two propagation constants
dB=(2*3.14*BF)/y;
printf("The model birefrigence =%f um", BF*10^6);
printf("\n The coherence length=%f m", Lc);
printf("\n The difference beween two propagation constants=%f", db);
printf("\n The difference beween two propagation constants=%f", dB); |
fe2b3b611eaeb1e5ed338a95c1369dedb976ea98 | 1573c4954e822b3538692bce853eb35e55f1bb3b | /DSP Functions/zpklp2lp/test_4.sce | c162f8a5a9d12f1576fc025095929c0913915121 | [] | no_license | shreniknambiar/FOSSEE-DSP-Toolbox | 1f498499c1bb18b626b77ff037905e51eee9b601 | aec8e1cea8d49e75686743bb5b7d814d3ca38801 | refs/heads/master | 2020-12-10T03:28:37.484363 | 2017-06-27T17:47:15 | 2017-06-27T17:47:15 | 95,582,974 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 276 | sce | test_4.sce | // Test # 4 : Checking the type for Input Argument #3
exec('./zpklp2lp.sci',-1);
[z,p,k,n,d]=zpklp2lp(0.43,0.2,[0.2 0.4],0.1,0.6);
// !--error 10000
//K must be a scalar
//at line 57 of function zpklp2lp called by :
//[z,p,k,n,d]=zpklp2hp(0.43,0.2,[0.2,0.4],0.1,0.6)
|
66a83e59b9f8e76033ae59c57563293ef40b0145 | 449d555969bfd7befe906877abab098c6e63a0e8 | /965/CH9/EX9.20/20.sci | ba6b28a7d751cac8cc549515b5f57af1fc597ae5 | [] | 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 | 728 | sci | 20.sci | clc;
clear all;
disp("cylindrical drum")
d=0.35;// m diameter
ts=80;// degree C
rhol=956.4;//kg/m^3
k=68.23*10^(-2);//W/m.C
mu=283*10^(-6);// kg/ms
hfg=2201.6*10^3;// J/kg
vg=0.885;// m^3/kg
rhov=1/vg;//kg/m^3
g=9.81;// m/s
m=70/3600;// kg/s
tsat=120.2;// degree C
disp("delL=(4*k*mu*(tsat-ts)*L/(g*rhol*(rhol-rhov)*hfg))^0.25")
a=(4*k*mu*(tsat-ts)/(g*rhol*(rhol-rhov)*hfg))^0.25
disp("delL=a*L^0.25")
disp("hL=4*k/(3*delL)")
b=1.2*4*k/(3*a)//hl=b*L^(-0.25)
//Q=h*%pi*d*L*(tsat-ts)
Q=m*hfg;
L=(Q/(b*%pi*d*(tsat-ts)))^(4/3);
disp("mm",L*1000,"length of drum =")
delL=(4*k*mu*(tsat-ts)*L/(g*rhol*(rhol-rhov)*hfg))^0.25;
disp("mm",delL,"Thickness of condensate layer =")
Re=4*m/(mu*d);
disp(Re,"Re =")
|
7b4da0dcd6bffcc2a0a039b394df11fa2b2b1083 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2873/CH10/EX10.11/Ex10_11.sce | 4c9e9edc217bd27cd829dc2611c43f0aa305e94c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 1,155 | sce | Ex10_11.sce | // Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clear;
clc;
disp("Engineering Thermodynamics by Onkar Singh Chapter 10 Example 11")
BP=50;//brake power output at full load in KW
BP1=40.1;//brake power output of 1st cylinder in KW
BP2=39.5;//brake power output of 2nd cylinder in KW
BP3=39.1;//brake power output of 3rd cylinder in KW
BP4=39.6;//brake power output of 4th cylinder in KW
BP5=39.8;//brake power output of 5th cylinder in KW
BP6=40;//brake power output of 6th cylinder in KW
disp("indicated power of 1st cylinder=BP-BP1 in KW")
BP-BP1
disp("indicated power of 2nd cylinder=BP-BP2 in KW")
BP-BP2
disp("indicated power of 3rd cylinder=BP-BP3 in KW")
BP-BP3
disp("indicated power of 4th cylinder=BP-BP4 in KW")
BP-BP4
disp("indicated power of 5th cylinder=BP-BP5 in KW")
BP-BP5
disp("indicated power of 6th cylinder=BP-BP6 in KW")
BP-BP6
disp(" total indicated power(IP)in KW")
IP=9.9+10.5+10.9+10.4+10.2+10
disp("mechanical efficiency(n_mech)=BP/IP")
n_mech=BP/IP
disp("in percentage")
n_mech=n_mech*100
disp("so indicated power=61.9 KW")
disp("mechanical efficiency=80.77%")
|
eb3c3b96de9f9837529f52d694039f35947138b7 | a006a53d954de031fd82f26f4fc82c8fb610293c | /demos/cpp_find.dem.sce | 5d9c7512b3d3df9f8246effa525b2e2bd652096d | [] | no_license | Siddharth11235/CSDP-basic | cba775450ad5f7271ecc00ada0831c3ed1518958 | 97c441b8a6eea4c6b4466c03828f048e2c0fc37a | refs/heads/master | 2021-06-20T23:43:51.881537 | 2017-07-17T12:30:00 | 2017-07-17T12:30:00 | 96,966,653 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 563 | sce | cpp_find.dem.sce | //
// This file is released under the 3-clause BSD license. See COPYING-BSD.
function demo_cpp_find()
mode(-1);
lines(0);
disp("cpp_find(''Scilab is a numerical computational package'',''numerical'')");
disp('position : ' + string(cpp_find('Scilab is a numerical computational package','numerical')));
disp("cpp_find(''Scilab is a numerical computational package'',''package'')");
disp('position: ' + string(cpp_find('Scilab is a numerical computational package','package')));
endfunction
demo_cpp_find();
clear demo_cpp_find; |
95404e153e76eeac05a55531bb8991d8a8ef51f2 | bce0c755bfdc527c8cc0737e8e1e59467267cff9 | /macros/findContours.sci | 15e60c1772373e94ea4a1256a27877b4d38a8bfd | [] | no_license | shubham0108/FOSSEE-Image-Processing-Toolbox | bacc26e6c7139383a374ea16f6c62565a7ff0603 | 68cddb2ca8dabddfe47251ac6647011acb849a2c | refs/heads/master | 2021-06-16T02:27:39.886532 | 2020-05-01T09:23:39 | 2020-05-01T09:23:39 | 97,078,162 | 0 | 0 | null | 2017-07-13T03:57:21 | 2017-07-13T03:57:21 | null | UTF-8 | Scilab | false | false | 1,757 | sci | findContours.sci | // Copyright (C) 2015 - IIT Bombay - FOSSEE
//
// 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
// Author: Abhilasha Sancheti, Shubham Lohakare, Sukul Bagai
// Organization: FOSSEE, IIT Bombay
// Email: toolbox@scilab.in
//
function [outputMat]= findContours(inputImage, Mode, method, point_x, point_y)
//Finds contours in an image
//
//Calling Sequence
//outputMat = findContours(inputImage, Mode, method, point_x, point_y)
//
//Parameters
//inputImage : The input image
//Mode : Contour retrieval mode (Enter 1 for CV_RETR_EXTERNAL, 2 for CV_RETR_LIST, 3 for CV_RETR_CCOMP, 4 for CV_RETR_TREE)
//method : Contour approximation method (Enter 1 for CV_CHAIN_APPROX_NONE, 2 for CV_CHAIN_APPROX_SIMPLE, 3 for CV_CHAIN_APPROX_TC89_L1, 4 for CV_CHAIN_APPROX_TC89_KCOS)
//point_x : x-coordinate for point offset
//point_y : y-coordinate for point offset
//
//Description
//The function retrieves contours from the images using the algorithm [Suzuki85]. The contours are a useful tool for shape analysis and object detection and recognition.
//
//Examples
//a = imread("lena.jpeg");
//k = finContours(a,3,2,10,10);
//
//Examples
//a = imread("photo.jpeg");
//k = findContours(a,1,1,40,60);
//
//Examples
//a = imread("photo1.jpg");
//k = findContours(a,2,3,50,50);
//
//Authors
//Abhilasha Sancheti
//Shubham Lohakare
//Sukul Bagai
inputList=mattolist(inputImage);
outputList=raw_findContours(inputList,Mode, method, point_x, point_y)
for i=1:size(outputList)
outputMat(:,:,i)=outputList(i)
end
endfunction
|
10a1baa199b00a7651018232fafb347857aaffec | d7087cf730b37f76170323e080c090f8094979ac | /test/exec/if_command_imbrication_2.tst | 620f5a4925bbd696d1fddf8dcfc673f9911fc976 | [] | no_license | VladimirMeshcheriakov/42sh | 025dffe358b86f48eaf7751a5cb08d4d5d5366c4 | 52d782255592526d0838bc40269f6e71f6a51017 | refs/heads/master | 2023-03-15T17:26:20.575439 | 2015-06-26T12:44:05 | 2015-06-26T12:44:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 2,228 | tst | if_command_imbrication_2.tst | <cmd>
../build/42sh</cmd>
<ref>
bash</ref>
<stdin>
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
if echo true ;then
echo joseph;
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
fi
</stdin>
|
7d592a0b2a5d103aa8ad30fdf7083a8ce330d898 | 4cff0a330e6c7bdfd8b9eee83a4e410964acf129 | /Sem4/Data Communication/Practical 5/amplitude shift key.sce | ed43f7610f09d0278af1246729d004f856e82243 | [] | no_license | Shivamshaiv/University_LabCodes | 777f306ff577bc99bbc3fd5127ee6c92e7ed3ab9 | 450304a2d652e25501e1b49f8a2998b233c525a5 | refs/heads/master | 2022-03-06T07:29:43.820955 | 2019-11-11T10:02:12 | 2019-11-11T10:02:12 | 103,494,899 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 873 | sce | amplitude shift key.sce |
funcprot(0);
function ask(g,f)
[%nargout,%nargin] = argn(0)
if (f<1) then
error("Frequency must be bigger than 1");
end;
t = 0:(2*%pi)/99:2*%pi;
cp = [];sp = [];
mod = [];mod1 = [];bit = [];
for n = 1:max(size((g)))
if g(n)==0 then
die = 0*ones(1,100);
se = zeros(1,100);
else g(n)==1;
die = 1*ones(1,100);
se = ones(1,100);
end;
c = sin((f)*t);
cp = [cp,die];
mod = [mod,c];
bit = [bit,se];
end;
ask = cp .*mod;
subplot(2,1,1);plot(bit,"LineWidth",1.5);set(gca(),"grid",[1,1]);
title("Binary Signal");
set(gca(),"data_bounds",matrix([0,100*max(size((g))),-2.5,2.5],2,-1));
subplot(2,1,2);plot(ask,"LineWidth",1.5);set(gca(),"grid",[1,1]);
title("ASK modulation");
set(gca(),"data_bounds",matrix([0,100*max(size((g))),-2.5,2.5],2,-1));
endfunction
ask([1,0,1,1,0,0,1,0,1,0,1,1,0,0,1,0,0,1],2);
|
0568bfdf1cd04c97b8cb872c13b26c13aa57e351 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3885/CH6/EX6.12/Ex6_12.sci | b76533c30750bb6e66fb24eae3f2031dc69f8a19 | [] | 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 | 905 | sci | Ex6_12.sci | //control systems by Nagoor Kani A
//Edition 3
//Year of publication 2015
//Scilab version 6.0.0
//operating systems windows 10
// Example 6.12
clc;
clear;
s=poly(0,'s')
//given tranfer function g(s)=100/(s+1)*(s+2)*(s+5)
h=syslin('c',100/(s+1)*(s+2)*(s+5))
pm=60//given phase margin
w=0.5//given gain cross over frequency in rad/sec
//put s=jw in G(s) magnitude of G(jw) gives A1 and angle of G(jw) gives phi1 at w
A1=8.63
phi=-46//in degrees
theta=pm-134//desired pm -pm of uncompensated system
ki=(-w)*sind(theta)/A1//integral constant
kp=cosd(theta)/A1//proportional constant
disp(ki,kp,'the values of integral constant and proportional constant are')
//transfer function of PI controller is (kp+ki/s)
hc=syslin('c', 0.056*(1+0.57*s)/s)
disp(hc,'the transfer function of PD controller is')
hcmp=syslin('c', h*hc)
disp(hcmp,'the transfer function of compensated system is')
|
7e40aa6e0ec1326568961ef72c7a6d603c2bf874 | 13525377024c6d91a5eee2f120caf1f837b42683 | /Scilab/Moniteur_Skel.sce | da9c49fb4d730e0c1f96a177a790ff83bc4eb3ef | [] | no_license | BASARANOMO/water-distribution-network-convex-optimization | b6ea0b6c17734ff00f04065ff3a4b216166acffd | 454e87fa668cfbabe3e62991c87b24d679df6c75 | refs/heads/main | 2023-02-25T12:39:50.978120 | 2021-02-03T08:55:07 | 2021-02-03T08:55:07 | 335,556,035 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,329 | sce | Moniteur_Skel.sce | ///////////////////////////////////////////////////////////////////////////////
// //
// MONITEUR D'ENCHAINEMENT POUR LE CALCUL DE L'EQUILIBRE D'UN RESEAU D'EAU //
// //
///////////////////////////////////////////////////////////////////////////////
clear;
// ------------------------------------------
// Fonctions fournies dans le cadre du projet
// ------------------------------------------
// Donnees du problemes
exec('Probleme_R.sce');
exec('Structures_N.sce');
// Affichage des resultats
exec('Visualg.sci');
// Verification des resultats
exec('HydrauliqueP.sci');
exec('HydrauliqueD.sci');
exec('Verification.sci');
// ------------------------------------------
// Fonctions a ecrire dans le cadre du projet
// ------------------------------------------
// ---> Charger les fonctions associees a l'oracle du probleme,
// aux algorithmes d'optimisation et de recherche lineaire.
//
// Exemple 1 - la fonction "optim" de Scilab :
//
// exec('OraclePG.sci');
// exec('Optim_Scilab.sci');
// titrgr = "Fonction optim de Scilab, probleme primal";
//
// Exemple 2 - le gradient a pas fixe :
//
// exec('OraclePG.sci');
// exec('Gradient_F.sci');
// titrgr = "Gradient a pas fixe, probleme primal";
//
// Exemple 3 - le gradient a pas variable :
//
// exec('OraclePG.sci');
// exec('Gradient_V.sci');
// exec('Wolfe.sci');
// titrgr = "Gradient a pas variable, probleme primal";
// -----> A modifier...
// -----> A modifier...
// -----> A modifier...
// ------------------------------
// Initialisation de l'algorithme
// ------------------------------
// Initialisation pour le probleme primal (de dimension : n-md)
//
//xini = 0.1 * rand(n-md,1);
// Initialisation pour le probleme dual (de dimension : md)
//
//xini = 100 + (10*rand(md,1));
// -----> A modifier...
// -----> A modifier...
// -----> A modifier...
// ----------------------------
// Minimisation proprement dite
// ----------------------------
// ---> Executer la fonction d'optimisation presente dans l'environnement
//
// Exemple 1 - la fonction "optim" de Scilab :
//
// [fopt,xopt,gopt] = Optim_Scilab(OraclePG,xini);
//
// Exemple 2 - le gradient a pas fixe :
//
// [fopt,xopt,gopt] = Gradient_F(OraclePG,xini);
//
// Exemple 3 - le gradient a pas variable :
//
// [fopt,xopt,gopt] = Gradient_V(OraclePG,xini);
// -----> A modifier...
// -----> A modifier...
// -----> A modifier...
// --------------------------
// Verification des resultats
// --------------------------
// Verification sur le probleme primal
//[q,z,f,p] = HydrauliqueP(xopt);
// Verification sur le probleme dual
//[q,z,f,p] = HydrauliqueD(xopt);
// -----> A modifier...
// -----> A modifier...
// -----> A modifier...
Verification(q,z,f,p);
//
|
9644847fc581bae19476d4c4df4a45f6443aa02b | 449d555969bfd7befe906877abab098c6e63a0e8 | /1514/CH16/EX16.3/16_3.sce | b08ca9721912d289d4ae51499f31c38611bd3d0e | [] | 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 | 701 | sce | 16_3.sce | //chapter 16
//example 16.3
//page 477
clear all;
clc ;
//given
Vr=2;//ripple voltage
Eo=20;//supply voltage
Eomin=Eo-1;
Eomax=Eo+1;
theta=65;//in degrees
T2=4.17;//time for 90 degrees ms
T3=3;//time for theta ms
Il=40;//mA
t2=1.17;//ms
t1=T2+T3;
C=Il*t1/Vr;
printf("\nReservoir capacitor is %d microF,use standard value 150 microF",(C))
//diode peak repetitive current
Ifm=(Il*(t1+t2)/t2);//mA
printf("\ndiode peak repetitive current IFM(rep)=%d mA",Ifm)
//diode avg forward current
Io=Il/2;
printf("\ndiode average forward current(Io)=%d mA",Io);
//diode maximum reverse voltage
Vp=Eomax+2*0.7;//Vf=0.7V
Er=Vp;
printf("\nEr=%.1f V",Er);
printf("\n1N4001 is required")
|
d4a671ef87988b972b2bb0039490ebb3c823be76 | 449d555969bfd7befe906877abab098c6e63a0e8 | /812/CH4/EX4.16/4_16.sce | 4feb7092ba101187a0130ab44fd51fe6f92edb5f | [] | 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 | 4_16.sce | //Rate of heat//
pathname=get_absolute_file_path('4.16.sce')
filename=pathname+filesep()+'4.16-data.sci'
exec(filename)
//Velocity at exit(in ft/sec):
V2=m*R*(T2+460)/A2/p2/144
//As power input is to CV, Ws=-600
//Rate of heat transfer(in Btu/sec):
Q=Ws*550/778+m*cp*(T2-T1)+m*V2^2/2/32.2/778
printf("\n\nRESULTS\n\n")
printf("\n\nRate of heat transfer: %.3f Btu/sec\n\n",Q)
|
6a77902e3474ea0c71d39f979ddafdc59d49ab6d | 6e257f133dd8984b578f3c9fd3f269eabc0750be | /ScilabFromTheoryToPractice/CreatingPlots/testparam3d.sce | 45091dfcb7ec6977854970c6e99dd520bdbd70f6 | [] | no_license | markusmorawitz77/Scilab | 902ef1b9f356dd38ea2dbadc892fe50d32b44bd0 | 7c98963a7d80915f66a3231a2235010e879049aa | refs/heads/master | 2021-01-19T23:53:52.068010 | 2017-04-22T12:39:21 | 2017-04-22T12:39:21 | 89,051,705 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 258 | sce | testparam3d.sce | function [x,y,z]=helix(t)
x=cos(t)
y=sin(t)
z=t
endfunction
// compute coordinates of points
t=[-5*%pi:0.02:5*%pi];
[x,y,z]=helix(t);
// display the curve
clf;
param3d(x,y,z,alpha=15,theta=50)
E=gce();E.foreground=5 // modify the curve's color
|
b82a79b580e16abf9eb82e1f12cb2d04289279c7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2024/CH5/EX5.3/5_3.sce | 8fdfe3f1dc035a8998da72cab50239601e9ad011 | [] | 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 | 361 | sce | 5_3.sce | clc
clear
//Initialization of variables
Tr=1000 //R
Ta=3000 //R
Q=300 //Btu/min
p=5 //hp
J=778
//calculations
n1=1-Tr/Ta
nt=p*33000/(J*Q)
//results
printf("Theoretical efficiency = %.3f",nt)
printf("\n Claimed efficiency = %.3f",n1)
if n1>nt then
printf("\n Inventor claims are true")
else
printf("\n Inventor claims are false")
end
|
c90749a8566af414dc057aad08b14cf75b70b21e | 449d555969bfd7befe906877abab098c6e63a0e8 | /3869/CH1/EX1.46/Ex1_46.sce | e5fc30b16acc58a7c381e7699e41a890d1b725cf | [] | 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 | 328 | sce | Ex1_46.sce | clear
//
//
//
//Variable declaration
lamda=6000*10**-8 //wavelength(cm)
n=1
mew=1.5 //refractive index
r=50*%pi/180 //angle of refraction(radian)
//Calculation
t=n*lamda/(2*mew*cos(r)) //least thickness of glass plate(cm)
//Result
printf("\n least thickness of glass plate is %0.2f *10**-5 cm",t*10**5)
|
d5f65d71c6b7904b6aa10f771aa6c7a1dc70aa74 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2078/CH12/EX12.2/Example12_2.sce | 98dac594adba13c669110e8a8577222cdbcb6573 | [] | 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 | 491 | sce | Example12_2.sce | //Exa 12.2
clc;
clear;
close;
format('v',5);
//Given data :
V=132*1000;//V
f=50;//Hz
r=10/1000;//m
d1=4;//m
d2=4;//m
d3=d1+d2;//m
epsilon_o=8.854*10^-12;//constant
l_tl=192*1000;//length of transmission line in m
C=2*%pi*epsilon_o/log((d1*d2*d3)^(1/3)/r)*l_tl;//in Farad
L=1/3/(2*%pi*f)^2/C;//H
disp(L,"Necessary Inductance of peterson coil in H : ");
VP=V/sqrt(3);//V
IL=VP/(2*%pi*f)/L;//A
Rating=VP*IL/1000;//kVA
disp(Rating/1000,"Rating of supressor coil in MVA :");
|
4f551b5b3c1a2cb212998d9be7f4d6fad937620e | d6c6e5351a55752775a06471ab1e767b959dba02 | /Taller 4/main_serial/main_Serial2.sci | 58d6b7e41bc3bc61fa7cfba82f0c55ff19f3d171 | [] | no_license | hectornauta/Repoduino | f0a685840d7484f78ddb40c1704ce0d7d174aa41 | 05229fc5d70ecc4bd45102cbb02703cb912a5d14 | refs/heads/master | 2020-08-06T09:07:22.888804 | 2019-12-09T13:17:44 | 2019-12-09T13:17:44 | 212,917,573 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 627 | sci | main_Serial2.sci | function [elementos_json] = captura(puerto, baudios)
config = string(baudios) + ",n,8,1";
arduino = openserial(puerto, config);
captura_serial = readserial(arduino);
elementos_json = JSONParse(captura_serial);
endfunction
function graficar(elementos_json, atributos)
//i = 1;
n = length(elementos_json)
n_atributos = size(atributos, 'c') //devuelve la cantidad de columnas que tiene el arreglo
for i = 1:n_atributos
for j = 1:n
dato = elementos_json(j);
dato = dato(atributos(i))
plot(j, dato,'d*-');
drawnow();
end
end
end |
51f5a06ed79a5f2106d67dbaa6c3f4892f082fd2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1301/CH16/EX16.15/ex16_15.sce | 881886360d21b7091c4b83bdc61de00478415d6c | [] | 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 | 201 | sce | ex16_15.sce | clc;
v=343; //velocity in m/sec
vs=20; //velocity in m/sec
fs=500; //original frquency
f1=(fs*v)/(v-vs); //doppler effect
disp(f1,"Percieved frequency in Hz = "); //diplaying result |
7eb9ae149502ec8f53670e5746400dfdaa5f2882 | 449d555969bfd7befe906877abab098c6e63a0e8 | /548/DEPENDENCIES/4_05data.sci | 0a9d4e207d13452d5887324c790fe2881d2368e3 | [] | 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 | 130 | sci | 4_05data.sci | R=0.1524;//radius(m) of semicircular cross section
V=30.48;//velocity(m/s) of free stream
D=1.23;//density(Kg/m^3)of free stream |
bee7d78a3b461fed4798cf630d760c2a090166c6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /845/CH2/EX2.13/Ex2_13.sce | eb4c6330f04315b62c877ffdda4da460fdaa5bb2 | [] | 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 | 310 | sce | Ex2_13.sce | //Example 2.13
clc
clear
a = [-6 11 -6 1];
maxit = 3;
for iter = 1:maxit
a = [a(4)^2 -(a(3)^2 -2*a(2)*a(4)) (a(2)^2 - 2*a(1)*a(3)) -a(1)^2];
root = abs([a(4)/a(3) a(3)/a(2) a(2)/a(1)])^(1/(2^iter));
end
root = round(root*10^5) / 10^5;
disp(root,"Estimated roots for the polynomial are: ")
|
9a39e4351e687e137e208d62a987f86a121508e9 | fda4ef2a0b488d4a352bc0579474ba974cae086e | /Linear Convolution.sce | f3bb4fb3cb24d12becea4669e9f91d09648bf286 | [] | no_license | Sid-149/Linear-Convolution | 6d5acfad57ff8f1e11764e1deeed8a8b7ada830c | 7c1b5ddfc1b6c2eb8f4fddbf5598f89376b1dac1 | refs/heads/main | 2023-01-21T17:27:18.429401 | 2020-11-17T03:51:32 | 2020-11-17T03:51:32 | 313,500,471 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 417 | sce | Linear Convolution.sce | clear
x=input('Enter i/p sequence=');
h=input('Enter impulse response=');
y1=convol(x,h);
N1=length(x)
N2=length(h)
N=N1+N2-1;
h=[h zeros(1,N1-1)];
for n=0:1:N-1
y(n+1)=0;
for k=0:1:N1-1
if (n-k+1>0) then
y(n+1)=y(n+1)+x(k+1)*h(n-k+1)
end
end
end
disp('Linear Convolution by formula:');
disp(y);
disp("Linear Convolution by inbuilt function:");
disp(y1); |
9b87d244595f39826c5cbfae3344a62438ea95de | 85fe3541d4988b676b5ab7c8ed719a26fe38e3c8 | /Examples/dependent2.sce | e6884e090012b10962e761dd4c56abf816821739 | [
"Unlicense"
] | permissive | UnknowableCoder/SimCampEl | c115105b2b5837b3a1eb012d1acb89015eade17f | 9bd83c6316e16a161d19393ad79a4e3bdcb30679 | refs/heads/main | 2023-03-13T23:07:25.000479 | 2021-03-12T13:38:35 | 2021-03-12T13:38:35 | 347,071,759 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 114 | sce | dependent2.sce | 1
0 0 0 0 0 1 0 0 0 1 1 1 The Lone Charger
-100 -100 -10 100 100 100
sin(z)
0
0
0
0
0
299792448 5 0
|
6e437456b8dfaa601e640688e4f56c8cb58913e0 | 05b2bd67239938195f6ea021fd482c06f69c9145 | /p2.sci | 96b1706f7e244d1d58d2bc40b0d4ee091bd0c7e1 | [] | no_license | ZimmSebas/Metodos | 213aa8af793726409cf0346c3315663aa59ae835 | 5fb6f28413064194ae8f625da48914b471bb50f7 | refs/heads/master | 2020-03-31T15:18:35.349807 | 2019-12-21T23:19:21 | 2019-12-21T23:19:21 | 152,331,779 | 5 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,853 | sci | p2.sci | old = 'f';
n = 20
for i=1:n
new = 'd'+string(i)+'f';
deff('y='+new+'(x)','y=numderivative('+old+',x,0.1)');
old=new;
end
// Ejercicio 1
function r = misraices(p)
c = coeff(p, 0)
b = coeff(p, 1)
a = coeff(p, 2)
if(b < 0)
r(1) = (2*c)/(-b + sqrt(b**2 - 4*a*c))
r(2) = (-b + sqrt(b**2 - 4*a*c))/(2*a)
else
r(1) = (-b - sqrt(b**2 - 4*a*c))/(2*a)
r(2) = (2*c)/(-b - sqrt(b**2 - 4*a*c))
end
endfunction
p = poly([-0.0001 10000 0.0001], "x", "coeff");
misraices(p)
function y=cuad(x)
y=x**2
endfunction
function y=f(x)
y=%e**x
endfunction
function y = errorcalc(a,b)
y(1) = abs(a - b)
y(2) = abs(a - b)/abs(a)
mprintf("error absoluto %0.15f \n", y(1))
mprintf("error relativo %0.15f \n", y(2))
endfunction
function y = reverse(arr)
n = length(arr)
y = (1:n)
for i = 1:n
y(n+1-i) = arr(i)
end
endfunction
function y = taylor(f,n,v0,v) //Funcion, numero de derivadas, punto inicial, punto a ver.
coeficientes(1) = 0
for j = 1:n
coeficientes(j+1) = der(v0,j)/factorial(j)
mprintf("coef: deriv: %f fact: %f coef: %f\n ",der(v0,j),factorial(j),coeficientes(j+1));
end
y = horner(reverse(coeficientes),v-v0) + f(v0)
endfunction
function y = der(x,k)
deff('y=foo(x)','y=d'+string(k)+'f(x)');
y = foo(x)
endfunction
function y = horner(arr,x)
n = length(arr);
y = arr(1);
for j = 2:n
y = y*x + arr(j);
end
endfunction
function y = hornerder(arr,x) //arreglo = an + an-1 + an-2...
n = length(arr);
y(1) = arr(1);
if (n>1)
y(2) = arr(2);
end
for j = 2:n
y(1) = y(1)*x + arr(j)
if (n>1 & j>2)
y(2) = y(2)*x + arr(j);
end
end
endfunction // retorna el resultado y el resultado de la derivada
|
74194bddf023e98b9db938f01dcef6de5b754a71 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2339/CH3/EX3.40.1/Ex3_40.sce | 908a28816483192b8d4f42393052e15f01f570a5 | [] | 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 | 515 | sce | Ex3_40.sce | clc
clear
//Inputs
//The Values in the program are as follows:
//Temperature in Celcius converted to Kelvin(by adding 273)
//Pressure in bar converted to kPa (by multiplying 100)
//Volume in m^3
//Value of R,Cp and Cv in kJ/kg K
R=0.29;
Cp=1.005;
P1=2.75;
P2=P1;
V1=0.09;
T1=185+273;
T2=15+273;
//Calculations
V2=(V1*T2)/T1;
m=(P1*100*V1)/(R*T1);
Q=m*Cp*(T2-T1);
printf('The Heat Transfer: %3.3f kJ',Q);
printf('\n');
W=P1*100*(V2-V1);
printf('The Work done: %3.3f kJ',W);
printf('\n');
|
380b2f5259a105d596f2f0aa5b54672b8b26c50b | 449d555969bfd7befe906877abab098c6e63a0e8 | /2609/CH11/EX11.7/ex_11_7.sce | ee1c18df0707534875c10558219aad0df350a700 | [] | 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 | 567 | sce | ex_11_7.sce | ////Ex 11.7
clc;
clear;
close;
format('v',6);
k=1;//for the givn connection
//(a)
Vin=5;//V
Vout=-k*log10(Vin/0.1);//V
disp(Vout,"For 5V input, Output Voltage(V)");
//(b)
Vin=2;//V
Vout=-k*log10(Vin/0.1);//V
disp(Vout,"For 2V input, Output Voltage(V)");
//(c)
Vin=0.1;//V
Vout=-k*log10(Vin/0.1);//V
disp(Vout,"For 0.1V input, Output Voltage(V)");
//(d)
Vin=50;//mV
Vout=-k*log10(Vin/1000/0.1);//V
disp(Vout,"For 50mV input, Output Voltage(V)");
//(a)
Vin=5;//mV
Vout=-k*log10(Vin/1000/0.1);//V
disp(Vout,"For 5mV input, Output Voltage(V)");
|
7d03482557ea03bb0affb1214cb9e8f8ae954cd2 | 717ddeb7e700373742c617a95e25a2376565112c | /1592/CH10/EX10.5/example_10_5.sce | 7c4224bb56432964bf57b58f5a1b7505830600b0 | [] | 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 | 387 | sce | example_10_5.sce | //Scilab Code for Example 10.5 of Signals and systems by
//P.Ramakrishna Rao
//Auto Correlation
clear;
clc;
clear x n a;
k=1;
a=0.8;
for n=-30:30;
x(k)=a^(-n)*u(-n);
k=k+1;
end
length(x)
//computation of auto correlation sequence;
r = xcorr(x);
n=-60:60;
a=gca();
a.x_location="origin";
a.y_location="origin";
plot2d3(n,r,-4);
title('rxx_auto-correlation');
|
fd421129b5964b1a4cd40c4e6f50e569b65aee4e | 449d555969bfd7befe906877abab098c6e63a0e8 | /686/CH4/EX4.5/Ex4_5.sci | 184d059075d7867781745e21b1bc6b7dae0ed907 | [] | 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 | 614 | sci | Ex4_5.sci | clc();
clear;
// To calculate the depth and yearly temperature fluctuations penetrate the ground
a = 0.039; // thermal diffusivity of claylike soil
to = 24; // time for daily fluctuations in hr
x = 1.6*sqrt(%pi*a*to); // depth of penetration for daily fluctuation in ft
xy = sqrt(365)*x; // depth of penetration for yearly fluctuation in ft
printf("The depth of penetration for daily fluctuation is %.2f ft and depth of penetration for yearly fluctuation is %.2f ft",x, xy);
|
cc8724a06e1a82fcdace8945774eafc63916bb6b | 449d555969bfd7befe906877abab098c6e63a0e8 | /1427/CH19/EX19.9/19_9.sce | b5217da380efa3286486460a511c5734b9d6b8ff | [] | 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 | 305 | sce | 19_9.sce | //ques-19.9
//Calculating kinetic energy of a moving electron
clc
w=4.8;//wavelength (in pm)
m=9.11*10^-31;//mass of electron (in kg)
h=6.63*10^-34;//(in Js)
v=h/(m*w*10^-12);//velocity of electron (in m/s)
KE=(1/2)*m*v^2;
printf("The kinetic energy of the electron is %.3f*10^-14 J.",KE*10^14);
|
d85e942d419dad345eb4cbd65607124a4295678f | 449d555969bfd7befe906877abab098c6e63a0e8 | /2075/CH1/EX1.7/pe1_7.sce | 532397fe4f0ce87217072eea6b1d49f4a91670f3 | [] | 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 | 298 | sce | pe1_7.sce | //example 1.7
clc; funcprot(0);
// Initialization of Variable
Vs=18;//V
Rl=8;//load resistance
Pll=100;//power
//calculation
Vlp=Vs-4;
Vlr=Vlp/(2^.5);
disp(Vlr,"rms voltage in V:")
Pl=(Vlr^2)/Rl;
disp(Pl,"power delivered in W:")
Vl=(Pll*Rl)^.5;
disp(Vl,"load voltage in V:")
clear()
|
ec9df11250855bffb5428fc5b71d5adc57e1d8e0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3886/CH22/EX22.4/22_4.sce | ec7aa2d4090cd33288a00a32684ae978090c7007 | [] | 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 | 509 | sce | 22_4.sce | //Length of crank
//refer fig. 22.6 (a)
//angular velocity
omega=(1500*2*%pi)/(60) //rad/sec
r=0.100
//Tangential velocity of end B
vB=r*omega //m/sec
//Consider motion of connecting rod BC
theta=asind((100*sind(30))/(250)) //degree
//Refer fig. 22.6
//Let omega' be the angular velocity of BC
omega1=13.6035/0.244 //rad/sec
//Considering horizontal component of velocities
vC=15.7080*cosd(60)+0.25*55.547*sind(11.5378) //m/sec
printf("\nomega1=%.3f rad/sec\nvC=%.2f m/sec",omega1,vC)
|
5022216c98cef6ca3feb58418f0e6adaca376ee3 | 6e4685c43410247fe08cba5e6e1237b9df99443f | /renju.sce | 32978e902839b934be741c0172f7968c1431f0fa | [] | no_license | jpblabatut/renju | 03edb2f140a6bbea18a8e29d9c305a6cec0625c5 | 497b75187946f95a3f89fc5e473cd2bb866472ba | refs/heads/master | 2021-01-24T18:47:05.765382 | 2017-03-09T18:46:21 | 2017-03-09T18:46:21 | 84,474,642 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 39,587 | sce | renju.sce | ////////////////////////////////////////////////////////////////////////////////
//
// COMMENTAIRES
//
// Nom renju.sce
// Auteur Jérôme LABATUT
// Date de création 2017-02-17
//
// Version Scilab 5.5.2
// Module Atoms requis Aucun
//
// Objectif Implémentation du jeu de Renju
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// INITIALISATION
funcprot(0)
clearglobal()
clear()
xdel(winsid())
tohome()
clc()
global JEU
//
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
//
// CONSTANTES
//
////////////////////////////////////////////////////////////////////////////////
function affecterParametres()
global JEU
// Paramètres du modèle (damier et joueurs)
JEU.DAMIER.DIRECTIONS_NOMBRE = 8
JEU.DAMIER.DIRECTIONS_ANGLES = ((1:JEU.DAMIER.DIRECTIONS_NOMBRE) - 1)'/JEU.DAMIER.DIRECTIONS_NOMBRE*2*%pi
JEU.DAMIER.DIRECTIONS = round([cos(JEU.DAMIER.DIRECTIONS_ANGLES), sin(JEU.DAMIER.DIRECTIONS_ANGLES)])
JEU.DAMIER.IMPOSSIBLE = [0, 0];
JEU.ALGORITHME.Humain = 1;
JEU.ALGORITHME.Robot = 2; // Choix aléatoire parmi les meilleures cases
JEU.ALGORITHME.Robot1 = 3; // Choix déterministe parmi les meilleures cases
JEU.ETAT.Inactif = 0;
JEU.ETAT.Actif = 1;
JEU.ETAT.Bloque = 2;
RExt = 0.4;
RMed = 0.25;
RInt = 0.1;
Croix.Code = 1;
Croix.Algorithme = JEU.ALGORITHME.Humain;
Croix.Etat = JEU.ETAT.Actif;
Croix.Nom = "Croix";
Croix.Adjectif = "cruciforme";
xCroix = RInt/2*(sqrt(1 + 2*((RExt/RInt)^2 - 1)) + 1);
yCroix = RInt/2*(sqrt(1 + 2*((RExt/RInt)^2 - 1)) - 1);
Croix.X = 0.5 + [ RInt, xCroix, yCroix, ...
0, - yCroix, - xCroix, ...
- RInt, - xCroix, - yCroix, ...
0, yCroix, xCroix, ...
RInt ]';
Croix.Y = 0.5 + [ 0, yCroix, xCroix, ...
RInt, xCroix, yCroix, ...
0, - yCroix, - xCroix, ...
- RInt, - xCroix, - yCroix, ...
0 ]';
Croix.CouleurRVB = [1, 0, 0];
Croix.CouleurCode = color("red");
Rond.Code = 2;
Rond.Algorithme = JEU.ALGORITHME.Robot1;
Rond.Etat = JEU.ETAT.Actif;
Rond.Nom = "Rond";
Rond.Adjectif = "rond";
angle = (0:360)'/360*2*%pi;
angle2 = flipdim(angle, 1);
Rond.X = 0.5 + [RExt*cos(angle); RMed*cos(angle2)];
Rond.Y = 0.5 + [RExt*sin(angle); RMed*sin(angle2)];
Rond.CouleurRVB = [0, 0, 1];
Rond.CouleurCode = color("blue");
Triangle.Code = 3;
Triangle.Algorithme = JEU.ALGORITHME.Robot1;
Triangle.Etat = JEU.ETAT.Inactif;
Triangle.Nom = "Triangle";
Triangle.Adjectif = "triangulaire";
angle = %pi/2 + [0, 2*%pi/3, 4*%pi/3, 2*%pi]';
angle2 = flipdim(angle, 1);
Triangle.X = 0.5 + [RExt*cos(angle); RMed*cos(angle2)];
Triangle.Y = 0.5 + [RExt*sin(angle); RMed*sin(angle2)];
Triangle.CouleurRVB = [0, 1, 0];
Triangle.CouleurCode = color("green");
Carre.Code = 4;
Carre.Algorithme = JEU.ALGORITHME.Robot1;
Carre.Etat = JEU.ETAT.Inactif;
Carre.Nom = "Carre";
Carre.Adjectif = "carré";
angle = - %pi/4 + [0, %pi/2, %pi, 3*%pi/2, 2*%pi]';
angle2 = flipdim(angle, 1);
Carre.X = 0.5 + [RExt*cos(angle); RMed*cos(angle2)];
Carre.Y = 0.5 + [RExt*sin(angle); RMed*sin(angle2)];
Carre.CouleurRVB = [0, 0.5, 0.5];
Carre.CouleurCode = color("yellow");
JEU.JOUEURS = list(Croix, Rond, Triangle, Carre);
JEU.JOUEURS_NOMBRE = length(JEU.JOUEURS);
//
// Paramètres des vues (interface, damier et bandeau)
JEU.INTERFACE.Nom = "Interface";
JEU.INTERFACE.Titre = "OXO/Tic-tac-toe/Morpion";
JEU.INTERFACE.Position = [0, 0];
JEU.INTERFACE.Taille = [700, 700];
JEU.INTERFACE.CouleurRVB = [0.8 0.8 0.8];
JEU.DAMIER.Position = [0, 0, 0.75, 0.75];
JEU.DAMIER.Marges = [0, 0, 0, 0];
JEU.DAMIER.Selection = 3; // 3 - Clic gauche
JEU.DAMIER.Confirmation = 4; // 4 - Clic centre
JEU.DAMIER.Annulation = 11; // 11 - Double-clic centre
JEU.CASE.X = [0; 1; 1; 0];
JEU.CASE.Y = [0; 0; 1; 1];
JEU.CASE.CouleurCode = color("white");
JEU.CASE.CouleurRVB = [1 1 1];
JEU.CASE.TaillePolice = 15;
JEU.BANDEAU.Nom = "BandeauInformations";
JEU.BANDEAU.Position = [10 10 500 100];
JEU.BANDEAU.TaillePolice = 12;
JEU.BANDEAU.CouleurRVB = [0.7 0.7 0.7];
//
// Parametres des contrôleurs (menus, boutons et partie)
JEU.MENUS.Nom11 = "SélectionNombreJoueurs";
JEU.MENUS.Nom12 = "SélectionTaille";
JEU.MENUS.Nom13 = "SélectionJoueurHumain";
JEU.MENUS.Nom13Choix = ["SélectionJoueurHumainNoir"; ...
"SélectionJoueurHumainBlanc"; ...
"SélectionJoueurHumainRouge"; ...
"SélectionJoueurHumainBleu"; ...
"SélectionJoueurHumainViolet"; ...
"SélectionJoueurHumainJaune"; ...
"SélectionJoueurHumainVert"; ...
"SélectionJoueurHumainOrange"];
JEU.BOUTONS.Nom15 = "ControleurPartie";
JEU.BOUTONS.Nom25 = "ControleurAffichageProbabilités";
JEU.BOUTONS.Nom35 = "ControleurDécimation";
JEU.BOUTONS.Nom45 = "ArretPartie";
JEU.BOUTONS.Nom55 = "SortieJeu";
JEU.BOUTONS.Espace = 0.2;
JEU.BOUTONS.Bordure = 1/10*JEU.BOUTONS.Espace;
JEU.BOUTONS.Taille = JEU.BOUTONS.Espace - 2*JEU.BOUTONS.Bordure;
JEU.BOUTONS.Position = [JEU.BOUTONS.Bordure, JEU.BOUTONS.Bordure, JEU.BOUTONS.Taille, JEU.BOUTONS.Taille];
JEU.BOUTONS.Position15 = [4*JEU.BOUTONS.Espace 4*JEU.BOUTONS.Espace 0 0] + JEU.BOUTONS.Position;
JEU.BOUTONS.Position25 = [4*JEU.BOUTONS.Espace 3*JEU.BOUTONS.Espace 0 0] + JEU.BOUTONS.Position;
JEU.BOUTONS.Position35 = [4*JEU.BOUTONS.Espace 2*JEU.BOUTONS.Espace 0 0] + JEU.BOUTONS.Position;
JEU.BOUTONS.Position45 = [4*JEU.BOUTONS.Espace JEU.BOUTONS.Espace 0 0] + JEU.BOUTONS.Position;
JEU.BOUTONS.Position55 = [4*JEU.BOUTONS.Espace 0 0 0] + JEU.BOUTONS.Position;
JEU.BOUTONS.CouleurRVB = [0.9 0.9 0.9];
JEU.BOUTONS.TaillePolice = 15;
JEU.ETAT_PARTIE.ACTIVABLE = 10; // Sélection à faire ou à confirmer
JEU.ETAT_PARTIE.ACTIVE = 11; // Partie en cours
JEU.ETAT_PARTIE.BLOQUEE = 12; // Partie bloquée : tous les joueurs sont bloqués
JEU.ETAT_PARTIE.INTERROMPUE = 13; // Partie interrompue par l'utilisateur
JEU.ETAT_PARTIE.COMPLETEE = 14; // Damier complété
JEU.ETAT_PARTIE.GAGNEE = 15; // Une direction remplie par un des joueurs
JEU.ETAT_PARTIE.REINITIALISABLE = 16; // Partie terminée : vainqueur affiché, effacage du damier en attente
JEU.Partie.NombreParties = 1; //5 // Nombre de parties d'affilée
JEU.Partie.NombreJoueurs = 2;
JEU.Partie.Taille = 7;
JEU.Partie.Renju = 3;
JEU.Partie.CodeHumain = 1;
JEU.Partie.Etat = JEU.ETAT_PARTIE.ACTIVABLE;
JEU.Partie.AffichageAide = 0;
// 0 : pas d'affichage
// 1 : tableau
// 2 : matrices
JEU.Partie.AffichageLignesRemplies = 0;
// 0 : pas d'affichage
// 1 : indices des lignes, colonnes et diagonales pleines
JEU.Partie.Decimation = 0;
// 0 : pas de sélection
// 1 : sélection confirmée, à exécuter
JEU.Partie.AffichageGrille = 1;
// 0 : pas de grille
// 1 : grille du morpion
JEU.Partie.PAUSE = 250;
//
endfunction
////////////////////////////////////////////////////////////////////////////////
//
// FONCTIONS MODELE
//
// Fonction principale du jeu
// Pose d'un pion dans une case jouable et retournement des pions
// Enlèvement des pions sélectionnés
// Calcul d'une grille de départ de taille donnée
//
// Joueur Heuristique du robot aléatoire
// Joueur Heuristique du robot déterministe
// Joueur Calcul du tenseur de probabilités (de victoire)
// Joueur Sélection d'une case par le joueur humain
// Joueur Sélection d'un rectangle de cases à décimer
//
// Arbitre Calcul des cases jouables (coordonnées, score et "connectivité")
// Arbitre Calcul du score d'une case (0 si elle n'est pas jouable)
// Arbitre Calcul des effectifs par ordre décroissant
// Arbitre Mise à jour du damier
// Arbitre Proclamation de victoire éventuelle
//
////////////////////////////////////////////////////////////////////////////////
function GrilleS = jouerPartie(Grille)
global JEU
JEU.Partie.Voisinages = calculerVoisinages(JEU.Partie.Taille)
JEU.Partie.Etat = JEU.ETAT_PARTIE.ACTIVE; // Activation de la partie
for Code = 1:JEU.Partie.NombreJoueurs // Activation de tous les joueurs sélectionnés
JEU.JOUEURS(Code).Etat = JEU.ETAT.Actif;
end
JEU.Partie.CodeVainqueur = 0;
Code = 1;
while (JEU.Partie.Etat == JEU.ETAT_PARTIE.ACTIVE) // Début de la boucle sur les critères d'arrêt de jeu
Etat = JEU.JOUEURS(Code).Etat; // Etat du joueur courant
Algorithme = JEU.JOUEURS(Code).Algorithme; // Algorithme du joueur courant
if (JEU.Partie.Decimation == 1) // Décimation des pions sélectionnés
Grille = enleverPions(Grille, JEU.Selection)
controlerDecimationPions()
end
if (Etat == JEU.ETAT.Actif) // Affichage des cases jouables pour les joueurs actifs
if (JEU.Partie.AffichageAide == 1)
voirProbabilites(Grille, JEU.Partie.CodeHumain)
sleep(JEU.Partie.PAUSE)
end
if (JEU.Partie.AffichageAide == 2)
voirProbabilites(Grille, Code)
sleep(JEU.Partie.PAUSE)
end
end
// // Sélection du coup par le joueur courant s'il est actif ...
if (Etat == JEU.ETAT.Actif)|(Etat == JEU.ETAT.Bloque)
select Algorithme
case JEU.ALGORITHME.Humain // ... et humain (choix de l'utilisateur)
Coup = jouerHumain(Grille, Code)
case JEU.ALGORITHME.Robot // ... et robot (choix aléatoire parmi les cases libres)
Coup = choisirAuHasard(Grille)
case JEU.ALGORITHME.Robot1 // ... et robot (choix aléatoire parmi les coups optimum)
Coup = calculerCoupOptimum(Grille, Code) // Coup optimum : coup de gain maximum ou sinon de nuisance maximum
end
if isequal(Coup, JEU.DAMIER.IMPOSSIBLE)
JEU.JOUEURS(Code).Etat = JEU.ETAT.Bloque;
Etat = JEU.JOUEURS(Code).Etat;
voirDamier("Pions", Grille) // Forçage de l'actualisation du bandeau
voirBandeau("PartieBloquée", Grille)
else
JEU.JOUEURS(Code).Etat = JEU.ETAT.Actif;
Etat = JEU.JOUEURS(Code).Etat;
voirDamier("Pions", Grille) // Forçage de l'actualisation du bandeau
voirBandeau("CoupPossible", Grille, Code, Coup)
end
end
if (Etat == JEU.ETAT.Actif) // Si le joueur courant peut jouer au moins un coup
Grille = jouerCoup(Grille, Code, Coup) // Actualisation du damier
NombreCouleurs = zeros(JEU.Partie.NombreDirections, JEU.Partie.NombreVoisinages);
for CCode = 1:JEU.Partie.NombreJoueurs // Recherche d'un éventuel vainqueur
[NombreCases, NombreCasesVides, Probabilites] = calculerProbabilites(Grille, CCode, JEU.Partie.Voisinages)
for d = 1:JEU.Partie.NombreDirections // Balayage des directions
for z = 1:JEU.Partie.NombreVoisinages // Balayage des voisinages
if (NombreCases(d, z) == JEU.Partie.Renju)
JEU.Partie.CodeVainqueur = CCode;
JEU.Partie.CodeDirection = d;
JEU.Partie.CodeVoisinage = z;
end
end
end
NombreCouleurs = NombreCouleurs + (NombreCases ~= 0);
end
for d = 1:JEU.Partie.NombreDirections // Recherche des directions bloquées
for z = 1:JEU.Partie.NombreVoisinages // Recherche des voisinages bloqués
if (NombreCouleurs(d, z) > 1)
mprintf("Voisinage " + string(z) + " dans la direction " + string(d) + " bloqué\n")
voirDamier("CasesSélectionVoisinage", JEU.Partie.Voisinages(d, :, z), color("grey"))
end
end
end
mprintf("\n")
// // Si il y a un vainqueur > Partie terminée
if (JEU.Partie.CodeVainqueur ~= 0)
JEU.Partie.Etat = JEU.ETAT_PARTIE.GAGNEE;
end
// // Si toutes les directions sont bloquées > Partie bloquée
if (prod(NombreCouleurs > 1) == 1)
JEU.Partie.Etat = JEU.ETAT_PARTIE.BLOQUEE;
end
// // Si le damier est rempli sans vainqueur > Partie bloquée
if (JEU.Partie.CodeVainqueur == 0)&(prod(Grille ~= 0))
JEU.Partie.Etat = JEU.ETAT_PARTIE.BLOQUEE;
end
sleep(JEU.Partie.PAUSE)
end
if (Code == JEU.JOUEURS_NOMBRE) // Passage au joueur suivant
Code = 1;
else
Code = Code + 1;
end
drawnow()
end // Fin de la boucle sur les critères d'arrêt de jeu
GrilleS = Grille;
select JEU.Partie.Etat
case JEU.ETAT_PARTIE.INTERROMPUE then // Partie interrompue
voirBandeau("PartieInterrompue", GrilleS)
voirDamier("Pions", GrilleS) // Forçage de l'actualisation du bandeau
case JEU.ETAT_PARTIE.BLOQUEE then // Partie bloquée (grille pleine sans vainqueurs)
voirBandeau("PartieBloquée", GrilleS)
voirDamier("Pions", GrilleS) // Forçage de l'actualisation du bandeau
case JEU.ETAT_PARTIE.GAGNEE then // Partie gagnée : annonce du vainqueur
voirBandeau("PartieVictoire", GrilleS, JEU.Partie.CodeVainqueur, JEU.Partie.CodeDirection)
JEU.Partie.Voisinage = JEU.Partie.Voisinages(JEU.Partie.CodeDirection, :, JEU.Partie.CodeVoisinage)
voirDamier("CasesSélectionVoisinage", JEU.Partie.Voisinage, JEU.JOUEURS(JEU.Partie.CodeVainqueur).CouleurCode)
end
endfunction
function GrilleS = jouerCoup(Grille, Code, Coup)
GrilleS = Grille;
if (Grille(Coup(1, 1), Coup(1, 2)) == 0)
GrilleS(Coup(1, 1), Coup(1, 2)) = Code;
voirDamier("Pions", GrilleS) // Actualisation de la vue du damier
voirBandeau("CoupPossible", Grille, Code, Coup)
else
voirBandeau("CoupImpossible", Grille)
end
endfunction
function GrilleS = enleverPions(Grille, Rectangle)
GrilleS = Grille;
voirBandeau("Décimation", Grille, Rectangle)
GrilleS(Rectangle(1, 1):Rectangle(2, 1), Rectangle(1, 2):Rectangle(2, 2)) = 0;
voirDamier("Pions", GrilleS)
voirDamier("CasesEffacées")
voirInterface("DécimationTerminée")
endfunction
function Coup = calculerCoupOptimum(Grille, Code)
global JEU
ListeCoups = [];
for CCode = 1:JEU.Partie.NombreJoueurs
[NombreCases, NombreCasesVides, Probabilites] = calculerProbabilites(Grille, CCode, JEU.Partie.Voisinages)
if (CCode == Code)&(length(ListeCoups) == 0) // Choix des cases de plus grande probabilité de victoire pour le joueur Robot
if (max(Probabilites) > 0) // (gagnantes si max(Probabilites) = 1)
ListeCoups = find(Probabilites == max(Probabilites));
end
end
if (CCode ~= Code) // Choix des cases bloquantes pour les autres joueurs (prioritaire)
if (sum(Probabilites == 1) > 0)
ListeCoups = find(Probabilites == 1); //[ListeCoups, find(Probabilites == 1)];
end
end
end
if (length(ListeCoups) == 0) // Si aucune case ne se distingue, choix des cases libres
ListeCoups = find(Grille == 0);
end
indiceL = 1 + floor((length(ListeCoups) - 1)*rand()); // Choix au hasard parmi les cases de même valeur stratégique
indice = ListeCoups(1, indiceL);
Coup = [modulo((indice - 1), JEU.Partie.Taille) + 1, floor((indice - 1)/JEU.Partie.Taille) + 1];
endfunction
function Coup = choisirAuHasard(Grille)
global JEU
ListeCoups = find(Grille == 0);
indiceL = 1 + floor((length(ListeCoups) - 1)*rand());
indice = ListeCoups(1, indiceL);
Coup = [modulo((indice - 1), JEU.Partie.Taille) + 1, floor((indice - 1)/JEU.Partie.Taille) + 1];
endfunction
function Coup = jouerHumain(Grille, Code)
global JEU
AttendreSelection = %T;
while (AttendreSelection)
Coup = JEU.DAMIER.IMPOSSIBLE;
Reponse = xgetmouse();
x = Reponse(1);
y = Reponse(2);
Action = Reponse(3);
if (Action == JEU.DAMIER.Selection)
Coup = [min(1 + floor(x), JEU.Partie.Taille), ...
min(1 + floor(y), JEU.Partie.Taille)];
end
if (Coup ~= JEU.DAMIER.IMPOSSIBLE)
CaseVide = (Grille(Coup(1, 1), Coup(1, 2)) == 0);
if (CaseVide)
AttendreSelection = %F;
end
end
end
endfunction
function [Rectangle, SelectionEffectuee] = selectionnerRectangle(Mode)
global JEU
select Mode
case "Humain" // Mode automatique : l'usager sélectionne
ContinuerSelection = %T;
NombreSelections = 0;
Rectangle = JEU.DAMIER.IMPOSSIBLE;
while (ContinuerSelection)
[Action, x, y] = xclick(); // Force pause dans l'exécution de la partie
NombreSelections = NombreSelections + 1;
select Action
case JEU.DAMIER.Selection then
if (NombreSelections == 1)
Liste = min(1 + floor([x, y]), JEU.Partie.Taille);
Rectangle = [Liste; Liste];
end
if (NombreSelections > 1)
Liste = [Liste; min(1 + floor([x, y]), JEU.Partie.Taille)];
i = Liste(($ - 1):$, 1);
j = Liste(($ - 1):$, 2);
Rectangle = [[min(i), min(j)]; [max(i), max(j)]];
end
voirDamier("CasesEffacées")
voirDamier("CasesSélectionRectangle", Rectangle, color("orange"))
case JEU.DAMIER.Confirmation then
ContinuerSelection = %F;
SelectionEffectuee = %T;
case JEU.DAMIER.Annulation then
ContinuerSelection = %F;
SelectionEffectuee = %F;
end
end
case "Aléatoire" // Un joueur humain : décimation aléatoire
i = fix(1 + JEU.Partie.Taille*rand(2, 1));
j = fix(1 + JEU.Partie.Taille*rand(2, 1));
Rectangle = [[min(i), min(j)]; [max(i), max(j)]];
SelectionEffectuee = %T;
voirDamier("CasesEffacées")
voirDamier("CasesSélectionRectangle", Rectangle, color("red"))
end
endfunction
function Voisinages = calculerVoisinages(Taille)
global JEU
VecteurC = (1:JEU.Partie.Renju) - 1;
VecteurL = ((1:JEU.Partie.Renju) - 1)*JEU.Partie.Taille;
VecteurD = ((1:JEU.Partie.Renju) - 1)*(JEU.Partie.Taille + 1);
VecteurE = ((1:JEU.Partie.Renju) - 1)*(JEU.Partie.Taille - 1);
VoisinagesC = zeros(JEU.Partie.Taille, JEU.Partie.Renju, JEU.Partie.NombreVoisinages)
VoisinagesL = zeros(JEU.Partie.Taille, JEU.Partie.Renju, JEU.Partie.NombreVoisinages)
VoisinagesD = zeros(JEU.Partie.NombreVoisinages, JEU.Partie.Renju, JEU.Partie.NombreVoisinages)
VoisinagesE = zeros(JEU.Partie.NombreVoisinages, JEU.Partie.Renju, JEU.Partie.NombreVoisinages)
for x = 1:JEU.Partie.Taille
for z = 1:JEU.Partie.NombreVoisinages
Origine = 1 + (x - 1)*JEU.Partie.Taille + (z - 1);
VoisinagesC(x, :, z) = Origine + VecteurC;
end
end
for x = 1:JEU.Partie.Taille
for z = 1:JEU.Partie.NombreVoisinages
Origine = 1 + (x - 1) + (z - 1)*JEU.Partie.Taille;
VoisinagesL(x, :, z) = Origine + VecteurL;
end
end
for x = 1:JEU.Partie.NombreVoisinages
for z = 1:JEU.Partie.NombreVoisinages
Origine = 1 + (x - 1)*JEU.Partie.Taille + (z - 1);
VoisinagesD(x, :, z) = Origine + VecteurD;
end
end
for x = 1:JEU.Partie.NombreVoisinages
for z = 1:JEU.Partie.NombreVoisinages
Origine = JEU.Partie.Renju + (x - 1) + (z - 1)*JEU.Partie.Taille;
VoisinagesE(x, :, z) = Origine + VecteurE;
end
end
Voisinages = [VoisinagesC; VoisinagesL; VoisinagesD; VoisinagesE];
endfunction
function [NombreCases, NombreCasesVides, Probabilites] = calculerProbabilites(Grille, Code, Voisinages)
global JEU
Probabilites = zeros(size(Grille, 1), size(Grille, 2));
for d = 1:JEU.Partie.NombreDirections
for z = 1:JEU.Partie.NombreVoisinages
// // Nombre de cases occupées par voisinage
NombreCases(d, z) = sum(Grille(Voisinages(d, :, z)) == Code);
// // Nombre de cases vides par voisinage
NombreCasesVides(d, z) = sum(Grille(Voisinages(d, :, z)) == 0);
end
end
for d = 1:JEU.Partie.NombreDirections
for z = 1:JEU.Partie.NombreVoisinages
// // Recherche des voisinages sans cases de couleur différente
if (NombreCasesVides(d, z) ~= 0)&(NombreCases(d, z) + NombreCasesVides(d, z) == JEU.Partie.Renju)
Probabilites(Voisinages(d, :, z)) = Probabilites(Voisinages(d, :, z)) + 1/NombreCasesVides(d, z);
end
end
end
for l = 1:JEU.Partie.Taille
for c = 1:JEU.Partie.Taille
if (Grille(l, c) ~= 0) // Elimination des cases déjà occupées
Probabilites(l, c) = 0;
end
end
end
endfunction
function [Effectifs, Codes] = calculerEffectifs(Grille)
global JEU
Effectifs = [];
for Code = 1:JEU.Partie.NombreJoueurs
Effectifs = [Effectifs; sum(Grille == Code)];
end
[Effectifs, Codes] = gsort(Effectifs);
endfunction
////////////////////////////////////////////////////////////////////////////////
//
// FONCTIONS VUES
//
// Interface Gestion des menus de sélection et des boutons d'action
// Damier Gestion de l'affichage du damier, des cases et des pions
// Bandeau Messages d'information dans le bandeau
//
////////////////////////////////////////////////////////////////////////////////
function voirInterface(Action)
global JEU
select Action
case "Création" then
// Création de l'interface
interfaceJeu = figure('figure_position', JEU.INTERFACE.Position)
interfaceJeu.Tag = JEU.INTERFACE.Nom;
interfaceJeu.figure_size = JEU.INTERFACE.Taille;
interfaceJeu.auto_resize = 'on';
interfaceJeu.figure_name = JEU.INTERFACE.Titre;
interfaceJeu.backgroundcolor = JEU.INTERFACE.CouleurRVB;
delmenu(interfaceJeu.figure_id, gettext('File'))
delmenu(interfaceJeu.figure_id, gettext('?'))
delmenu(interfaceJeu.figure_id, gettext('Tools'))
toolbar(interfaceJeu.figure_id, 'off')
//
// Création du damier
voirDamier("Création", JEU.Partie.Taille)
voirDamier("Initialisation", JEU.Partie.Taille)
//
// Création du bandeau d'information
voirBandeau("Création", [])
voirBandeau("Initialisation", [])
//
// Menu de sélection du nombre de joueurs
menu1 = uimenu(interfaceJeu, "Tag", JEU.MENUS.Nom11, "Label", "Nombre de joueurs");
uimenu(menu1, "Label", "2 joueurs", "Callback", "selectionnerNombre(2)")
uimenu(menu1, "Label", "3 joueurs", "Callback", "selectionnerNombre(3)")
uimenu(menu1, "Label", "4 joueurs", "Callback", "selectionnerNombre(4)")
//
// Menu de sélection de la taille de la grille
menu2 = uimenu(interfaceJeu, "Tag", JEU.MENUS.Nom12, "Label", "Tailles");
for taille = 8:2:20
uimenu(menu2, "Label", string(taille) + " x " + string(taille), ...
"Callback", "selectionnerTaille(" + string(taille) + ")")
end
//
// Menu de sélection du joueur humain // Pas plus d'un niveau d'arborescence pour les pointeur
menu3 = uimenu(interfaceJeu, "Tag", JEU.MENUS.Nom13, "Label", "Joueur humain");
uimenu(menu3, "Label", "Aucun", "Callback", "selectionnerHumain(0)")
uimenu(menu3, "Label", "")
for code = 1:JEU.JOUEURS_NOMBRE
uimenu(menu3, "Tag", JEU.MENUS.Nom13Choix(code), ...
"Label", JEU.JOUEURS(code).Nom, ...
"Callback", "selectionnerHumain(" + string(code) + ")")
end
//
// Commande de lancement de la partie
bouton15 = uicontrol(interfaceJeu, "style", "pushbutton");
bouton15.Tag = JEU.BOUTONS.Nom15;
bouton15.Units = "normalized";
bouton15.Position = JEU.BOUTONS.Position15;
bouton15.FontSize = JEU.BOUTONS.TaillePolice;
bouton15.String = "Jouer";
bouton15.BackgroundColor = JEU.BOUTONS.CouleurRVB;
bouton15.Callback = "controlerPartie()";
bouton15.Relief = "raised";
//
// Commande d'affichage des coups jouables
bouton25 = uicontrol(interfaceJeu, "style", "pushbutton");
bouton25.Tag = JEU.BOUTONS.Nom25;
bouton25.Units = "normalized";
bouton25.Position = JEU.BOUTONS.Position25;
bouton25.FontSize = JEU.BOUTONS.TaillePolice;
bouton25.String = "Suggèrer";
bouton25.BackgroundColor = JEU.BOUTONS.CouleurRVB;
bouton25.Callback = "controlerAffichageAide()";
bouton25.Relief = "raised";
bouton25.Visible = "off";
//
// Commande de décimation (aléatoire si un joueur humain, sélective sinon)
bouton35 = uicontrol(interfaceJeu, "style", "pushbutton");
bouton35.Tag = JEU.BOUTONS.Nom35;
bouton35.Units = "normalized";
bouton35.Position = JEU.BOUTONS.Position35;
bouton35.FontSize = JEU.BOUTONS.TaillePolice;
bouton35.String = "Décimer";
bouton35.BackgroundColor = JEU.BOUTONS.CouleurRVB;
bouton35.Callback = "controlerDecimationPions()";
bouton35.Relief = "raised";
bouton35.Visible = "off";
//
// Commande d'interruption de la partie
bouton45 = uicontrol(interfaceJeu, "style", "pushbutton");
bouton45.Tag = JEU.BOUTONS.Nom45;
bouton45.Units = "normalized";
bouton45.Position = JEU.BOUTONS.Position45;
bouton45.FontSize = JEU.BOUTONS.TaillePolice;
bouton45.String = "Arrêter partie";
bouton45.BackgroundColor = JEU.BOUTONS.CouleurRVB;
bouton45.Callback = "arreterPartie()";
bouton45.Relief = "raised";
bouton45.Visible = "off";
//
// Commande de sortie du jeu
bouton55 = uicontrol(interfaceJeu, "style", "pushbutton");
bouton55.Tag = JEU.BOUTONS.Nom55;
bouton55.Units = "normalized";
bouton55.Position = JEU.BOUTONS.Position55;
bouton55.FontSize = JEU.BOUTONS.TaillePolice;
bouton55.String = "Sortir";
bouton55.BackgroundColor = JEU.BOUTONS.CouleurRVB;
bouton55.Callback = "sortir()";
bouton55.Relief = "raised";
bouton55.Visible = "on";
//
case "GrilleSélectionnée" then
for code = 1:JEU.Partie.NombreJoueurs
set(get(JEU.MENUS.Nom13Choix(code, 1)), "Visible", "on")
end
for code = (JEU.Partie.NombreJoueurs + 1):JEU.JOUEURS_NOMBRE
set(get(JEU.MENUS.Nom13Choix(code, 1)), "Visible", "off")
end
case "PartieRéinitialisée" then
set(get(JEU.MENUS.Nom11), "Visible", "on")
set(get(JEU.MENUS.Nom12), "Visible", "on")
set(get(JEU.MENUS.Nom13), "Visible", "on")
set(get(JEU.BOUTONS.Nom15), "String", "Jouer", "Relief", "raised", "Enable", "on")
set(get(JEU.BOUTONS.Nom25), "Visible", "off")
set(get(JEU.BOUTONS.Nom35), "Visible", "off")
set(get(JEU.BOUTONS.Nom45), "Visible", "off")
set(get(JEU.BOUTONS.Nom55), "Visible", "on")
case "PartieEnCours" then
set(get(JEU.MENUS.Nom11), "Visible", "off")
set(get(JEU.MENUS.Nom12), "Visible", "off")
set(get(JEU.MENUS.Nom13), "Visible", "off")
set(get(JEU.BOUTONS.Nom15), "Relief", "flat", "Enable", "off")
set(get(JEU.BOUTONS.Nom25), "Visible", "on")
set(get(JEU.BOUTONS.Nom35), "Visible", "on")
set(get(JEU.BOUTONS.Nom45), "Visible", "on")
set(get(JEU.BOUTONS.Nom55), "Visible", "off")
case "PartieTerminée" then
set(get(JEU.MENUS.Nom11), "Visible", "on")
set(get(JEU.MENUS.Nom12), "Visible", "on")
set(get(JEU.MENUS.Nom13), "Visible", "on")
set(get(JEU.BOUTONS.Nom15), "String", "Effacer", "Relief", "raised", "Enable", "on")
set(get(JEU.BOUTONS.Nom25), "Visible", "off")
set(get(JEU.BOUTONS.Nom35), "Visible", "off")
set(get(JEU.BOUTONS.Nom45), "Visible", "off")
set(get(JEU.BOUTONS.Nom55), "Visible", "on")
case "CaseJouables" then
set(get(JEU.BOUTONS.Nom25), "Relief", "flat")
case "CaseJouablesMasquées" then
set(get(JEU.BOUTONS.Nom25), "Relief", "raised")
case "Décimation" then
set(get(JEU.BOUTONS.Nom35), "Enable", "off", "Relief", "flat")
case "DécimationTerminée" then
set(get(JEU.BOUTONS.Nom35), "Enable", "on", "Relief", "raised")
end
drawnow()
endfunction
function voirDamier(Action, varargin)
global JEU
select Action
case "Création" then
Taille = varargin(1)
damier = newaxes(get(JEU.INTERFACE.Nom));
damier.tag = "Damier";
damier.axes_bounds = JEU.DAMIER.Position;
damier.margins = JEU.DAMIER.Marges;
damier.axes_visible = "off";
damier.x_location = "top";
damier.y_location = "left";
damier.box = "off";
damier.isoview = "on";
damier.data_bounds = [0, 0; Taille, Taille];
case "Initialisation" then
Taille = varargin(1)
for i = 1:Taille
for j = 1:Taille
JEU.Cases(i, j) = "CaseL" + string(i) + "C" + string(j);
xfpoly(i - 1 + JEU.CASE.X, j - 1 + JEU.CASE.Y, JEU.CASE.CouleurCode)
set(gce(), "Tag", JEU.Cases(i, j))
JEU.Cadres(i, j) = "CadreL" + string(i) + "C" + string(j);
xpoly(i - 1 + JEU.CASE.X, j - 1 + JEU.CASE.Y, "lines")
set(gce(), "Tag", JEU.Cadres(i, j))
JEU.Pions(i, j) = "PionL" + string(i) + "C" + string(j);
xfpoly(i - 1, j - 1, JEU.CASE.CouleurCode)
set(gce(), "Tag", JEU.Pions(i, j))
end
end
case "Destruction" then
Taille = varargin(1)
objet = get("Damier")
delete(objet.children)
objet.data_bounds = [0, 0; Taille, Taille]; // Actualisation des dimensions du damier
JEU.Cases = "";
JEU.Cadres = "";
JEU.Pions = "";
case "Pions" then
Grille = varargin(1)
for i = 1:JEU.Partie.Taille
for j = 1:JEU.Partie.Taille
if (Grille(i, j) == 0)
set(get(JEU.Pions(i, j)), "Data", [i - 1, j - 1], "Background", - JEU.CASE.CouleurCode)
end
if (Grille(i, j) ~= 0)
set(get(JEU.Pions(i, j)), ...
"Data", [i - 1 + JEU.JOUEURS(Grille(i, j)).X, ...
j - 1 + JEU.JOUEURS(Grille(i, j)).Y], ...
"Background", JEU.JOUEURS(Grille(i, j)).CouleurCode);
end
end
end
case "CasesSélectionVoisinage" then
Voisinage = varargin(1)
CodeCouleur = varargin(2)
for i = 1:size(Voisinage, 2)
set(get(JEU.Cases(Voisinage(1, i))), "Background", CodeCouleur)
end
case "CasesSélectionRectangle" then
Rectangle = varargin(1)
CodeCouleur = varargin(2)
for i = Rectangle(1, 1):Rectangle(2, 1)
for j = Rectangle(1, 2):Rectangle(2, 2)
set(get(JEU.Cases(i, j)), "Background", CodeCouleur)
end
end
case "CasesProbabilités" then
Probabilites = varargin(1)
ProbabilitesMaximum = max(Probabilites)
CodeCouleur = varargin(2)
for i = 1:JEU.Partie.Taille
for j = 1:JEU.Partie.Taille
if (Grille(i, j) == 0)
X = [0, 1, 1, 0]';
if (ProbabilitesMaximum == 0)
Y = [0, 0, 0, 0]';
else
Y = [0, 0, 1, 1]'*Probabilites(i, j)/ProbabilitesMaximum;
end
set(get(JEU.Pions(i, j)), ...
"Data", [i - 1 + X, j - 1 + Y], ...
"BackGround", CodeCouleur );
end
end
end
case "CasesEffacées" then
for i = 1:JEU.Partie.Taille
for j = 1:JEU.Partie.Taille
set(get(JEU.Cases(i, j)), "Background", JEU.CASE.CouleurCode)
end
end
end
drawnow()
endfunction
function voirProbabilites(Grille, Code)
if (Code ~= 0)
[NombreCases, NombreCasesVides, Probabilites] = calculerProbabilites(Grille, Code, JEU.Partie.Voisinages);
voirDamier("CasesProbabilités", Probabilites, JEU.JOUEURS(Code).CouleurCode)
end
endfunction
function voirBandeau(Action, Grille, varargin)
global JEU
if (Action ~= "Création")&(Action ~= "Initialisation")
ligne1 = string(JEU.Partie.Taille) + " x " + string(JEU.Partie.Taille) + " cases | ";
ligne1 = ligne1 + string(JEU.Partie.NombreJoueurs) + " joueurs | ";
if (JEU.Partie.CodeHumain == 0)
ligne1 = ligne1 + "Mode automatique";
else
ligne1 = ligne1 + "Humain joue " + JEU.JOUEURS(JEU.Partie.CodeHumain).Nom;
end
ligne2 = "";
[Effectifs, Codes] = calculerEffectifs(Grille)
for code = 1:JEU.Partie.NombreJoueurs
if (Effectifs(code, 1) ~= 0)
Nom = part(JEU.JOUEURS(Codes(code, 1)).Nom, 1:3);
ligne2 = ligne2 + Nom + " (" + string(Effectifs(code, 1)) + ") ";
end
end
end
select Action
case "Création" then
bandeau = uicontrol(get(JEU.INTERFACE.Nom), "Style", "text");
bandeau.Tag = JEU.BANDEAU.Nom;
bandeau.Position = JEU.BANDEAU.Position;
bandeau.FontSize = JEU.BANDEAU.TaillePolice;
bandeau.FontWeight = "bold";
bandeau.HorizontalAlignment = "left";
bandeau.String = "";
bandeau.BackgroundColor = JEU.BANDEAU.CouleurRVB;
case "Initialisation" then
ligne1 = "Taille de 8 à 20 | 2 à 4 joueurs | 1 joueur humain maximum";
ligne2 = "";
ligne3 = "";
case "Sélection" then
ligne3 = "Sélectionnez grille | taille | joueur humain";
case "CoupPossible" then
Code = varargin(1);
Coup = varargin(2);
ligne3 = JEU.JOUEURS(Code).Nom;
ligne3 = ligne3 + " joue en case (";
ligne3 = ligne3 + string(Coup(1, 1)) + ", " + string(Coup(1, 2)) + ")";
case "CoupImpossible" then
ligne3 = "La case (" + string(l) + ", " + string(c) + ") est déjà remplie";
case "Décimation" then
Rectangle = varargin(1);
ligne3 = "Eradication dans le rectangle [";
ligne3 = ligne3 + string(Rectangle(1, 1)) + ", " + string(Rectangle(1, 2)) + "; ";
ligne3 = ligne3 + string(Rectangle(2, 1)) + ", " + string(Rectangle(2, 2)) + "]";
case "PartieInterrompue" then
ligne3 = "Interruption de la partie";
case "PartieBloquée" then
ligne3 = "Partie bloquée : aucune direction gagnable";
case "PartieVictoire" then
NomVainqueur = JEU.JOUEURS(varargin(1)).Nom;
CodeDirection = varargin(2);
if (CodeDirection >= 1)&(CodeDirection <= JEU.Partie.Taille)
NomDirection = "ligne";
NomPreposition = "à";
NomIndice = " " + string(CodeDirection);
end
if (CodeDirection > JEU.Partie.Taille)&(CodeDirection <= 2*JEU.Partie.Taille)
NomDirection = "colonne";
NomPreposition = "à";
NomIndice = " " + string(CodeDirection - JEU.Partie.Taille);
end
if (CodeDirection == 2*JEU.Partie.Taille + 1)
NomDirection = "seconde diagonale";
NomPreposition = "sur";
NomIndice = "";
end
if (CodeDirection == 2*JEU.Partie.Taille + 2)
NomDirection = "première diagonale";
NomPreposition = "sur";
NomIndice = "";
end
ligne3 = "Joueur " + NomVainqueur + " vainqueur " + NomPreposition + " la " + NomDirection + NomIndice;
case "MessageFinPartie" then
if (JEU.Partie.CodeVainqueur == 0)
message = "Pas de vainqueur !"
else
select JEU.JOUEURS(JEU.Partie.CodeVainqueur).Algorithme
case 1 then message = "Bravo ! L''Homme a vaincu la Machine !";
case 2 then message = "Le hasard mène le monde ...";
case 3 then message = "Votre fin est inéluctable, faibles créatures organiques";
end
end
messagebox(message)
else
ligne1 = "Erreur d''argument d''entrée :";
ligne2 = "action " + Action;
ligne3 = "non traitée par la fonction voirBandeau()";
end
if (Action ~= "Création")
//mprintf(ligne1 + "\n" + ligne2 + "\n" + ligne3 + "\n\n")
set(get(JEU.BANDEAU.Nom), "String", "$\textbf{" + ligne1 + "}\\ \textbf{" + ligne2 + "}\\ \textbf{" + ligne3 + "}$")
end
drawnow()
endfunction
////////////////////////////////////////////////////////////////////////////////
//
// FONCTIONS CONTROLEURS
//
// Menu Sélection du nombre de joueurs
// Menu Sélection de la taille de la grille
// Menu Sélection du joueur humain
//
// Bouton Nouvelle partie
// Bouton Affichage des probabilités
// Bouton Elimination de pions pour prolonger la partie
// Bouton Arrêt de la partie en cours
// Bouton Sortie du jeu
//
////////////////////////////////////////////////////////////////////////////////
function selectionnerNombre(NombreJoueurs)
global JEU
JEU.Partie.NombreJoueurs = NombreJoueurs;
for code = 1:JEU.Partie.NombreJoueurs
JEU.JOUEURS(code).Etat = JEU.ETAT.Actif;
if (code ~= JEU.Partie.CodeHumain)
JEU.JOUEURS(code).Algorithme = JEU.ALGORITHME.Robot;
end
end
for code = (JEU.Partie.NombreJoueurs + 1):JEU.JOUEURS_NOMBRE
JEU.JOUEURS(code).Etat = JEU.ETAT.Inactif;
JEU.JOUEURS(code).Algorithme = JEU.ALGORITHME.Robot;
end
voirInterface("GrilleSélectionnée")
voirDamier("Pions", JEU.Partie.GrilleDebut)
voirBandeau("Sélection", JEU.Partie.GrilleDebut)
endfunction
function selectionnerTaille(Taille)
global JEU
JEU.Partie.Taille = Taille;
JEU.Partie.GrilleDebut = zeros(JEU.Partie.Taille, JEU.Partie.Taille);
JEU.Partie.NombreDirections = 2*JEU.Partie.Taille + 2;
JEU.Partie.NombreVoisinages = JEU.Partie.Taille - JEU.Partie.Renju + 1;
voirDamier("Destruction", JEU.Partie.Taille);
voirDamier("Initialisation", JEU.Partie.Taille);
voirDamier("Pions", JEU.Partie.GrilleDebut);
voirBandeau("Sélection", JEU.Partie.GrilleDebut)
endfunction
function selectionnerHumain(CodeHumain)
global JEU
JEU.Partie.CodeHumain = CodeHumain;
for Code = 1:JEU.Partie.NombreJoueurs
JEU.JOUEURS(Code).Algorithme = JEU.ALGORITHME.Robot1;
end
if (CodeHumain ~= 0)
JEU.JOUEURS(CodeHumain).Algorithme = JEU.ALGORITHME.Humain;
end
voirDamier("Pions", JEU.Partie.GrilleDebut)
voirBandeau("Sélection", JEU.Partie.GrilleDebut)
endfunction
function controlerPartie()
global JEU
select JEU.Partie.Etat
case JEU.ETAT_PARTIE.REINITIALISABLE then // Effacement de la partie précédente
JEU.Partie.GrilleDebut = zeros(JEU.Partie.Taille, JEU.Partie.Taille);
voirDamier("CasesEffacées")
voirDamier("Pions", JEU.Partie.GrilleDebut)
voirInterface("PartieRéinitialisée")
JEU.Partie.Etat = JEU.ETAT_PARTIE.ACTIVABLE;
case JEU.ETAT_PARTIE.ACTIVABLE then // Lancement d'une nouvelle partie
JEU.Partie.GrilleDebut = zeros(JEU.Partie.Taille, JEU.Partie.Taille);
voirDamier("Pions", JEU.Partie.GrilleDebut)
voirInterface("PartieEnCours")
JEU.Partie.GrilleFin = jouerPartie(JEU.Partie.GrilleDebut)
voirInterface("PartieTerminée") // Fin de la nouvelle la partie
JEU.Partie.Etat = JEU.ETAT_PARTIE.REINITIALISABLE;
end
endfunction
function controlerAffichageAide()
global JEU
select JEU.Partie.AffichageAide
case 0 then // Pas d'affichage = > Affichage pour le joueur humain
JEU.Partie.AffichageAide = 1;
if (JEU.Partie.CodeHumain == 0)
controlerAffichageAide()
end
voirInterface("CasesJouables")
case 1 then // Affichage pour le joueur humain => Affichage pour tous les joueurs
JEU.Partie.AffichageAide = 2;
voirInterface("CasesJouables")
case 2 then // Affichage pour tous les joueurs => Pas d'affichage
JEU.Partie.AffichageAide = 0;
voirInterface("CasesJouablesMasquées")
end
endfunction
function controlerDecimationPions()
global JEU
select JEU.Partie.Decimation
case 0 then // Sélection des pions à décimer
voirInterface("Décimation")
if (JEU.Partie.CodeHumain == 0)
[Rectangle, SelectionEffectuee] = selectionnerRectangle("Humain")
else
[Rectangle, SelectionEffectuee] = selectionnerRectangle("Aléatoire")
end
if (SelectionEffectuee)
JEU.Selection = Rectangle;
voirDamier("CasesEffacées")
voirDamier("CasesSélectionRectangle", JEU.Selection, color("red"))
JEU.Partie.Decimation = 1;
else
voirDamier("CasesEffacées")
voirInterface("DécimationTerminée")
JEU.Partie.Decimation = 0;
end
case 1 then // Décimation des pions sélectionnés
voirInterface("DécimationTerminée")
JEU.Partie.Decimation = 0;
end
endfunction
function arreterPartie()
global JEU
JEU.Partie.Etat = JEU.ETAT_PARTIE.INTERROMPUE;
endfunction
function sortir()
xdel(winsid())
endfunction
////////////////////////////////////////////////////////////////////////////////
//
// PROGRAMME PRINCIPAL
//
////////////////////////////////////////////////////////////////////////////////
affecterParametres()
voirInterface("Création")
//Essai = 3;
//Essai = 5;
Essai = 9;
select Essai
case 3 then
selectionnerTaille(3)
selectionnerNombre(2)
selectionnerHumain(0)
JEU.JOUEURS(2).Algorithme = JEU.ALGORITHME.Robot;
case 5 then
selectionnerTaille(5)
selectionnerNombre(4)
selectionnerHumain(0)
JEU.JOUEURS(2).Algorithme = JEU.ALGORITHME.Robot;
JEU.JOUEURS(3).Algorithme = JEU.ALGORITHME.Robot;
JEU.JOUEURS(4).Algorithme = JEU.ALGORITHME.Robot;
case 9 then
selectionnerTaille(9)
selectionnerNombre(4)
selectionnerHumain(0)
JEU.JOUEURS(2).Algorithme = JEU.ALGORITHME.Robot;
JEU.JOUEURS(3).Algorithme = JEU.ALGORITHME.Robot;
JEU.JOUEURS(4).Algorithme = JEU.ALGORITHME.Robot;
case 10 then
selectionnerTaille(10)
selectionnerNombre(4)
selectionnerHumain(0)
end |
fef942b55a3e8d2d1347613a249f5596cf761ad1 | 964a1ce44b6391e555c0e2aeff6c55dda847d718 | /Mini Compiler for LaTeX/test result/verb_res.tst | 31a9858ebfd45b1d1ee6c7f52ba281ebe26a176e | [] | no_license | kennethwty/mini-compiler-latex | 6c165567298c216d39a806fa7cc05ed67f1babfc | d1b99a4fbbac906bf61242a977886578e1eb3594 | refs/heads/master | 2021-09-28T10:08:02.927880 | 2018-11-16T17:45:46 | 2018-11-16T17:45:46 | 104,703,352 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 301 | tst | verb_res.tst |
Checking that a simple verbatim works
Single is for Single spacing
Verbatim allows text that matches the
Itemize uses ticks to indicate items
Center allows a block to be centered
Does this start off correctly with 1 |
a653cf7d18f10ec457c27fdd4f191ffe6c2edbe0 | 11b48ab2e0fbc782931cc1162673a725c914a3ee | /M2/M3DA/Mecanique/Fichiers/Fichiers/KtriangleSimple.sci | da6d8dc70f9e9bf5623ce029739de92a21dc5445 | [] | no_license | naitabdelaziz/M2 | 1fcaa366c5993e6a879af49b40d43d32d1c2387b | c88aba0ae384c804c74e136e8c831b25032c4d0a | refs/heads/master | 2020-06-11T19:40:05.884042 | 2014-11-01T11:56:17 | 2014-11-01T11:56:17 | 26,049,488 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 1,053 | sci | KtriangleSimple.sci | function [Kelement, Cont, B]=KtriangleSimple(P1,P2,P3,E,Poisson)
P(:,1)=P1;
P(:,2)=P2;
P(:,3)=P3;
// positions en X et Y des noeuds 1, 2 et 3 du triangle
x1 = P1(1);
y1 = P1(2);
x2 = P2(1);
y2 = P2(2);
x3 = P3(1);
y3 = P3(2);
// matrice pour créer les fonctions d'interpolation
Matrice = [ 1 1 1;
x1 x2 x3;
y1 y2 y3];
// matrice des fonctions d'interpolation linéaire
Interpol = inv(Matrice);
b1=Interpol(1,2);
c1=Interpol(1,3);
b2=Interpol(2,2);
c2=Interpol(2,3);
b3=Interpol(3,2);
c3=Interpol(3,3);
// matrice donnant la deformation en fonction des déplacements:
B = zeros(3,6);
B = [b1,0,b2,0,b3,0;0,c1,0,c2,0,c3;c1,b1,c2,b2,c3,b3];
//// loi de hooke:
C = E/(1-Poisson*Poisson)*[1 Poisson 0;Poisson 1 0;0 0 (1-Poisson)/2];
//
//// Aire du triangle:
Aire=det(Matrice)/2
//// Matrice de raideur de l'élément:
Kelement = Aire * (B' * C * B);
//// Matrice de contrainte de l'élément:
//Cont = zeros(3,6);
Cont = C*B;
endfunction
|
dcee02710e053ff4aed584076fd4a4781815ee9a | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.0/Unix/scilab-2.0/macros/percent/%lns.sci | 3cf6ce68f1ad47eaf9b92ecc1feaf36343ae788f | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | 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 | 140 | sci | %lns.sci | //[r]=%lns(l1,l2)
//%lns(l1,l2) correspond a l'operation logique l1==l2 avec l1 une liste
//et l2 une matrice de scalaires
//!
r=%t
//end
|
2b0a87c5c2d0bfbbc2037dd2c1ddf6336fb51d01 | 449d555969bfd7befe906877abab098c6e63a0e8 | /746/DEPENDENCIES/8_11.sci | 33248b034108ef0f2d54b58d85cd93ad67acb5ca | [] | 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 | 307 | sci | 8_11.sci | //Volume flw rate of ai(in m^3/sec):
Q=1;
//Diameter of pipe(in m):
D=0.25;
//Density of air (in kg/m^3):
d1=1.23;
//Acceleration due to gravity(in m/s^2):
g=9.8;
//Density of water(in kg/m^3):
d2=999;
//Maxmum range of manometer(in m):
h=0.3;
//Kinematic viscosity(in m^2/s):
v=1.46*10^-5;
|
dfeb019d5dba0cf5c2ea56bdc953a1250da03cd7 | 089894a36ef33cb3d0f697541716c9b6cd8dcc43 | /NLP_Project/test/blog/bow/bow.1_13.tst | 4f24eb3cf4e865acccecd95ecbe6d9cabf6f1660 | [] | no_license | mandar15/NLP_Project | 3142cda82d49ba0ea30b580c46bdd0e0348fe3ec | 1dcb70a199a0f7ab8c72825bfd5b8146e75b7ec2 | refs/heads/master | 2020-05-20T13:36:05.842840 | 2013-07-31T06:53:59 | 2013-07-31T06:53:59 | 6,534,406 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 4,102 | tst | bow.1_13.tst | 1 10:0.3333333333333333 19:0.043478260869565216 30:0.14285714285714285 66:0.3333333333333333 149:1.0 203:0.5
1 4:0.1 11:1.0 49:0.125 249:0.14285714285714285 345:1.0
1 3:1.0 13:0.5 14:0.07142857142857142 17:0.020833333333333332 28:1.0 30:0.14285714285714285 84:0.16666666666666666 187:1.0 298:1.0 883:1.0
1 4:0.1 6:1.0 10:0.3333333333333333 14:0.07142857142857142 17:0.041666666666666664 25:0.3333333333333333 74:0.2 84:0.16666666666666666 665:1.0 721:1.0
1 4:0.1 84:0.16666666666666666 150:1.0 156:1.0 542:1.0
1 6:1.0 13:0.5 14:0.03571428571428571 19:0.043478260869565216
1 6:1.0 10:0.3333333333333333 13:0.5 14:0.03571428571428571 17:0.041666666666666664 19:0.043478260869565216 49:0.125 68:1.0 69:0.6666666666666666 137:1.0 181:0.3333333333333333 517:1.0
1 14:0.03571428571428571 17:0.041666666666666664 25:0.3333333333333333 30:0.14285714285714285 72:1.0 121:0.5 404:1.0 469:1.0 475:1.0 698:1.0
1 13:0.5 19:0.08695652173913043 20:0.5 55:0.3333333333333333 74:0.4 159:0.1111111111111111 160:0.25
1 13:0.5 14:0.03571428571428571 17:0.020833333333333332 30:0.14285714285714285 69:0.3333333333333333 121:0.5 149:1.0 160:0.5 183:0.25 226:1.0 249:0.14285714285714285 286:1.0 556:1.0 611:0.3333333333333333 1077:1.0 1304:1.0
1 4:0.1 6:1.0 10:0.3333333333333333 14:0.03571428571428571 54:0.5 84:0.16666666666666666 86:1.0 93:0.5 569:1.0 663:1.0
1 25:0.3333333333333333 396:1.0 494:1.0 1029:0.5 1446:1.0
1 25:0.3333333333333333 30:0.14285714285714285 84:0.16666666666666666 148:1.0 286:1.0 326:1.0 409:1.0
1 3:1.0 6:1.0 13:0.5 14:0.10714285714285714 25:0.3333333333333333 28:1.0 29:1.0 42:0.3333333333333333 43:0.5 56:0.25 60:1.0 181:0.3333333333333333 207:0.5 214:2.0 236:0.5 237:1.0 409:1.0 480:0.07142857142857142 556:1.0 581:0.25 794:1.0 920:1.0
1 54:0.5 69:0.3333333333333333 236:0.5 448:1.0 556:1.0 652:1.0
1 4:0.1 14:0.03571428571428571 54:0.5 64:0.3333333333333333 171:0.3333333333333333 598:1.0 1336:1.0 1403:1.0
1 4:0.1 14:0.03571428571428571 19:0.043478260869565216 25:0.3333333333333333 69:0.3333333333333333 542:1.0 851:0.5
1 349:0.3333333333333333
1 10:0.3333333333333333 13:0.5 25:0.3333333333333333 69:0.3333333333333333 70:1.0 193:0.5 1214:1.0
1 25:0.3333333333333333 30:0.14285714285714285 64:0.3333333333333333 67:1.0 70:1.0 183:0.25 1174:1.0
1 279:1.0
1 14:0.03571428571428571 69:0.3333333333333333 1363:1.0
1 6:1.0 14:0.03571428571428571 30:0.14285714285714285
1 4:0.1 19:0.043478260869565216 25:0.3333333333333333 66:0.3333333333333333 679:1.0
1 10:0.3333333333333333 19:0.043478260869565216 25:0.3333333333333333 66:0.3333333333333333 199:0.125 237:1.0 394:1.0 959:1.0
1 19:0.043478260869565216 69:0.3333333333333333 84:0.16666666666666666 121:0.5 189:0.5 249:0.14285714285714285 355:1.0 489:1.0 511:1.0 1117:1.0
1 3:1.0 6:1.0 14:0.07142857142857142 17:0.041666666666666664 19:0.08695652173913043 20:0.5 21:1.0 74:0.2 91:1.0 181:0.3333333333333333 226:1.0 249:0.14285714285714285 274:1.0 602:1.0 705:1.0 856:1.0 911:1.0
1 17:0.041666666666666664 19:0.043478260869565216 837:1.0 842:1.0 1401:1.0
1 6:1.0 14:0.03571428571428571 17:0.041666666666666664 69:0.6666666666666666 381:1.0 486:1.0 611:0.3333333333333333 837:1.0
1 14:0.03571428571428571 17:0.020833333333333332 20:0.5 30:0.14285714285714285 184:0.5 250:1.0 349:0.3333333333333333 625:1.0 924:1.0 1207:1.0 1276:0.5
1 3:1.0 4:0.2 349:0.3333333333333333
1 6:1.0 14:0.07142857142857142 17:0.020833333333333332 30:0.14285714285714285 133:1.0 226:1.0 377:1.0 465:1.0
1 25:0.3333333333333333 167:1.0 901:1.0
1 6:1.0 13:1.0 14:0.10714285714285714 17:0.041666666666666664 19:0.043478260869565216 49:0.125 74:0.2 84:0.16666666666666666 256:1.0 442:1.0 553:1.0 837:1.0 1080:1.0 1440:1.0 1472:1.0
1 17:0.020833333333333332 20:0.5 25:0.3333333333333333 147:1.0 171:0.6666666666666666 284:1.0 828:1.0
1 13:0.5 127:1.0 249:0.14285714285714285 441:1.0
1 14:0.03571428571428571 17:0.020833333333333332 475:1.0 883:1.0
1 4:0.1 13:0.5 202:0.2 1200:1.0
1 19:0.043478260869565216 20:0.5 21:1.0 43:0.5
1 3:1.0 14:0.07142857142857142 17:0.020833333333333332 25:0.6666666666666666 28:1.0 84:0.16666666666666666 298:1.0 326:1.0 462:1.0 716:1.0 1224:1.0
|
37ae8b29645a11cbf0cb5cc4fee3cd6c92b6c58a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2417/CH9/EX9.7/Ex9_7.sce | 172c0f2abc37ba463a2ad2069e050fa2409982c1 | [] | 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 | 451 | sce | Ex9_7.sce | //scilab 5.4.1
clear;
clc;
printf("\t\t\tProblem Number 9.7\n\n\n");
// Chapter 9 : Gas Power Cycles
// Problem 9.7 (page no. 468)
// Solution
//For four cycle engine,
//Using the results of problem 9.6,
pm=1000; //Unit:kPa //mean effective pressure //Unit:psia
N=4000/2; //Power strokes per minute //2L engine //Unit:rpm
LA=2 //Mean //Unit:liters
hp=(pm*LA*N)/44760; //The horsepower //Unit:hp
printf("The horsepower is %f hp",hp);
|
9f7a6a9309efa18a47ec2f4a9a2612e5ebcd4dec | a62e0da056102916ac0fe63d8475e3c4114f86b1 | /set9/s_Engineering_Mechancis-schaum_Series_Mclean_3137.zip/Engineering_Mechancis-schaum_Series_Mclean_3137/CH9/EX9.21/Ex9_21.sce | 79ce70723a0103e7e74540484ae97ccf22681e0f | [] | 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 | 235 | sce | Ex9_21.sce | errcatch(-1,"stop");mode(2);//Initilization of variables
d=760 //mm
W=500 //N
a=0.305 //mm coefficient of rolling resisatnce
r=d/2 //mm
//Calculations
P=(W*a)/r //N
//Result
printf('The force necessary is P=%fN',P)
exit();
|
3e9f130b0504a935904eb667164c4ca11d0df587 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1322/CH23/EX23.2/203ex1.sce | 7738098469b9610614e5fd771f71721fe1456e05 | [] | 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 | 324 | sce | 203ex1.sce |
//1/(sqrt(5)-sqrt(2))
clear;
clc;
close;
//rationalising the denominator
function[denom1]=inputs(a,b)
denom1=(sqrt(a)+sqrt(b))*(sqrt(a)-sqrt(b))
endfunction
[denom1]=inputs(5,2);
denom1=string(denom1);
numer1=string('(sqrt(5)+sqrt(2))');
val=string(numer1+'/'+denom1)
mprintf("i.e.,")
val=evstr(val)
|
12dad6aa2fbefe85ec7434821cfbc523f8b79e83 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1862/CH6/EX6.6/C6P6.sce | b79e2d7b9493b81a060650ab1648b10dc37c255f | [] | 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,102 | sce | C6P6.sce |
clear
clc
//to find final velocity of combination of 1st and 2nd glider
// GIVEN::
//refer to problem 6-5 from page no. 127
//we consider +ve x direction as initial motion of first glider
//mass of first glider
m1 = 1.25//in kg
//initial velocity of first glider in +ve x direction
v1ix = 3.62//in m/s
//mass of second glider
m2 = 2.30//in kg
//initial velocity of second glider in +ve x direction
//since 2nd glider is initially at rest
v2ix = 0//in m/s
// SOLUTION:
//applying conservation of momentum
//final velocitiy of second glider in +ve x direction
vfx = (m1*v1ix)/(m1 + m2)//in m/s
//change in momentums for glider having mass m1
delta_p1x = m1*(vfx-v1ix)//in Kg.m/s
//change in momentums for glider having mass m2
delta_p2x = m2*(vfx-v2ix)//in Kg.m/s
printf ("\n\n Final velocity of combination of 1st and 2nd glider vfx = \n\n %.2f m/s",vfx);
printf ("\n\n Change in momentums for glider having mass m1 delta_p1x = \n\n %.2f Kg.m/s",delta_p1x);
printf ("\n\n Change in momentums for glider having mass m2 delta_p2x = \n\n %.2f Kg.m/s",delta_p2x);
|
6ee23e7c7d68fabd1b6d09885ceac7bf8626f3a1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /291/CH12/EX12.5a/12_5anew.sce | d67290f905679bc06d94eea7d023c992e0ae83f5 | [] | 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 | 819 | sce | 12_5anew.sce | function result= fact(num)
if(num<=0)
result= 1
else
result = factorial(num)
end
endfunction
function result = proba(n,m,k)
if(pmodulo(k,2)==0)
k=k/2;
result = 2*fact(m-1)*fact(n-1)*fact(n)*fact(m)/(fact(k-1)^2*fact(m-k)*fact(n-k)*fact(n+m));
else
k = (k-1)/2;
result = fact(m-1)*fact(n-1)*fact(n)*fact(m)/(fact(k-1)*fact(k)*fact(m-k)*fact(n-k-1)*fact(n+m)) + fact(m-1)*fact(n-1)*fact(n)*fact(m)/(fact(k-1)*fact(k)*fact(m-k-1)*fact(n-k)*fact(n+m));
end
endfunction
r1 = 20;
n1 = 20;
m1=10;
ans1 =0;
for i=1:19
ans1 =ans1 + proba(n1,m1,i);
//disp(proba(n,m,i));
//disp(ans1)
end
if(ans1<0.5)
pvalue1 = 2*ans1;
else
pvalue1 = 2*(1-ans1);
end
disp(pvalue1, "P-value is") |
d6d4b08f93d1a2a7bdda6a4cba3d939d2bf623f2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /43/CH6/EX6.10/ex6_10.sce | 9e467ca2e608cc8852182ea6a0e02eaab0fc89aa | [] | 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 | 121 | sce | ex6_10.sce | //Ex 6.10
//Obtain the Bode plot
clc;
H=syslin('c',10*(1+%s/2)/(%s*(1+%s/.1)*(1+%s/.5)*(1+%s/10)));
bode(H,0.01,100); |
aa3f8a97beac9ab29213143b311edd5a902ba8cf | 99b4e2e61348ee847a78faf6eee6d345fde36028 | /Toolbox Test/latc2tf/latc2tf6.sce | a5dfcb07f6c466e831773d84d3a99623ad90d34d | [] | 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 | 234 | sce | latc2tf6.sce | k=[1 2 3 4 5 7];
num = latc2tf(k,'FIR');
disp(num);
disp(den);
//output
// Columns 1 through 5
//
// 1 76 1013 2512 1859
//
// Columns 6 through 7
//
// 292 7
//
// 1
//
|
405be78f200c015af2111c46ed5cd9e5cd2e0687 | 449d555969bfd7befe906877abab098c6e63a0e8 | /213/CH7/EX7.8/7_8.sce | d960fd903b6947918a1d95044bcf0e7b6ce9ab09 | [] | 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,003 | sce | 7_8.sce | //To find speed and time ratio
clc
//Given:
NAO1=60 //rpm
O1A=85,rQ=50 //mm
//Solution:
//Refer Fig. 7.20 and Fig. 7.21
//Calculating the angular velocity of AO1
omegaAO1=2*%pi*NAO1/60 //rad/s
//Calculating the velocity of A with respect to O1
vAO1=omegaAO1*O1A //mm/s
vA=vAO1
//By measurement from the velocity diagram, Fig. 7.20(b),
vDO2=410 //mm/s
O2D=264 //mm
angleB1O2B2=60*%pi/180 //rad
funcprot(0) //To vary the Scilab function 'beta'
alpha=120,beta=240 //degrees
//Calculating the angular velocity of the quadant Q
omegaQ=vDO2/O2D //rad/s
//Calculating the linear speed of the rack
vR=omegaQ*rQ //mm/s
//Calculating the ratio of times of lowering and raising the rack
r=beta/alpha
//Calculating the length of stroke of the rack
L=rQ*angleB1O2B2 //mm
//Results:
printf("\n\n The linear speed of the rack, vR = %.1f mm/s.\n",vR)
printf(" The ratio of times of lowering and raising the rack is %d.\n",r)
printf(" The length of the stroke of the rack is %.2f mm.\n\n",L) |
0c1ee95adf676c33f9988178678c7d07b0408118 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1280/CH8/EX8.10/8_10.sce | 251b118b53870e40c46af3bde551a11797b085ad | [] | 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 | 194 | sce | 8_10.sce | clc
//initialisation of variables
T= 32 //lb-ft
N= 1200 //rpm
P= 2000 //psi
Q= 7.5 //gpm
//CALCULATIONS
eo= T*N*100/(P*Q*3.06)
//RESULTS
printf ('overall efficiency = %.f percent',eo)
|
2be5b69d63ea387504b3710adbdb3d8e8770bba6 | b38cc305aa8a93920fa1c8b049e8fbab7cb5bb56 | /exercicio_1.sce | 51868a4048880b8fcb354d7c044c82c7aa1977e2 | [] | no_license | JoaoPi314/LCE_2_algorythms | 17ab58d0a9304786ac4374574d8acec881f11c56 | b2a5a1bc73be37555da0f7c83cba85b9c5e89a35 | refs/heads/master | 2022-12-19T00:09:39.141230 | 2020-10-10T06:41:58 | 2020-10-10T06:41:58 | 298,599,199 | 0 | 1 | null | 2020-10-10T06:41:59 | 2020-09-25T14:40:06 | Scilab | UTF-8 | Scilab | false | false | 1,334 | sce | exercicio_1.sce | //Exercício 1
//fi1 + fi2+ fi3 = 0
//Valores comuns
f = 1000;
w0 = 2*%pi*f;
t = linspace(0, 2/1000, 100);
//Valores de V1
A1 = 75;
fi1 = 2.361873;
//Valores de V2
A2 = 25;
fi2 = 1.202528;
//Valores de V3
A3 = 45;
fi3 = 0.29925782;
//Tensões
v1 = A1*cos(w0*t + fi1);
v2 = A2*cos(w0*t + fi2);
v3 = A3*cos(w0*t + fi3);
//Fasores
V1 = A1/sqrt(2)*exp(%i*(fi1));
V2 = A2/sqrt(2)*exp(%i*(fi2));
V3 = A3/sqrt(2)*exp(%i*(fi3));
veq = v1 + v2 + v3;
Veq = V1 + V2 + V3;
//Minima tensão
Vsum = V1 + V3;
fi_new = atan(imag(Vsum), real(Vsum));
V2_new = A2/sqrt(2)*exp(%i*(fi_new+%pi)); //Obtenção do ângulo oposto ao fi_new
Veq_new = V1 + V2_new + V3;
//Plot
figure(0);
xtitle('Tensões em série', 'Tempo(s)' ,'Tensão (V)');
plot(t, v1, t, v2, t, v3, t, veq, 'thickness', 3);
legend('v1', 'v2', 'v3', 'veq');
//Plot Fasores
figure(1);
xtitle('Fasores das tensões', 'Real', 'Imag');
plot([0 real(V1)], [0 imag(V1)], [0 real(V2)], [0 imag(V2)], [0 real(V3)], [0 imag(V3)], [0 real(Veq)], [0 imag(Veq)]);
legend('V1', 'V2', 'V3', 'Veq');
figure(2);
xtitle('Fasores das tensões', 'Real', 'Imag');
plot([0 real(V1)], [0 imag(V1)], [0 real(V2_new)], [0 imag(V2_new)], [0 real(V3)], [0 imag(V3)], [0 real(Veq_new)], [0 imag(Veq_new)]);
legend('V1', 'V2_new', 'V3', 'Veq_new');
|
cfab39a8cf3e2a61837206ce92c361d7d3bd6720 | b9c6de66a61d6f9a57edaa44baf92266ccbab3db | /macros/distfun_poissinv.sci | 6cb39798441bf42de710ecd69f9501181aa624e1 | [] | no_license | papriwalprateek/distfun-scilab | 81b3edef0af1d1908e05472dfb15b0a55f61571d | 82fd34521d1e6ebb6513773264b54a0d48f5f3f9 | refs/heads/master | 2016-09-03T07:08:47.605240 | 2013-10-13T05:53:43 | 2013-10-13T05:53:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,021 | sci | distfun_poissinv.sci | // Copyright (C) 2012 - Prateek Papriwal
//
// 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 x = distfun_poissinv(varargin)
// Poisson Inverse CDF
//
// Calling Sequence
// x = distfun_poissinv(p,lambda)
// x = distfun_poissinv(p,lambda,lowertail)
//
// Parameters
// p : a 1x1 or nxm matrix of doubles, the probability .
// lambda : a 1x1 or nxm matrix of doubles, the average rate of occurrence
// lowertail : a 1x1 matrix of booleans, the tail (default lowertail=%t). If lowertail is true (the default), then considers P(X<=x) otherwise P(X>x).
// x : a nxm matrix of doubles, the outcome. x belongs to the set {0,1,2,3,......}
//
// Description
// Computes the Inverse cumulative distribution function of
// the Poisson distribution function.
//
// Any scalar input argument is expanded to a matrix of doubles
// of the same size as the other input arguments.
//
// Examples
// // Test with p scalar, lambda scalar
//x = distfun_poissinv(0.999,5)
//expected = 13;
//x = distfun_poissinv(1-0.999,5,%f)
//expected = 13;
//
// // Test with expanded p , scalar lambda
//x = distfun_poissinv([0.32 0.3],2)
//expected = [1. 1.];
//
// // Test with scalar p, expanded lambda
// x = distfun_poissinv(0.22,[3 2])
// expected = [2. 1.];
//
//
// // Test small values of p
// x = distfun_poissinv(1.e-15,1)
// expected = 0.;
// x = distfun_poissinv(1.e-15,1,%f)
// expected = 17.;
//
// Bibliography
// http://en.wikipedia.org/wiki/Poisson_distribution
//
// Authors
// Copyright (C) 2012 - Prateek Papriwal
//
[lhs,rhs] = argn()
apifun_checkrhs("distfun_poissinv",rhs,2:3)
apifun_checklhs("distfun_poissinv",lhs,0:1)
p = varargin(1)
lambda = varargin(2)
lowertail = apifun_argindefault(varargin,3,%t)
//
// Check type
apifun_checktype("distfun_poissinv",p,"p",1,"constant")
apifun_checktype("distfun_poissinv",lambda,"lambda",2,"constant")
apifun_checktype("distfun_poissinv",lowertail,"lowertail",3,"boolean")
//
// Check dimensions
apifun_checkscalar("distfun_poissinv",lowertail,"lowertail",3)
//
// Check Content
apifun_checkrange("distfun_poissinv",p,"p",1,0,1)
apifun_checkgreq("distfun_poissinv",lambda,"lambda",2,1)
[p,lambda] = apifun_expandvar(p,lambda)
if (p==[]) then
x=[]
return
end
path = distfun_getpath()
internallib = lib(fullfile(path,"macros","internals"))
q = distfun_p2q(p)
if (lowertail) then
x = ceil(distfun_invcdfpoi(lambda,p,q))
else
x = ceil(distfun_invcdfpoi(lambda,q,p))
end
endfunction |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.