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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9c6f29837f8c6dc9f9869fa1c9a929e2c450d20b | 449d555969bfd7befe906877abab098c6e63a0e8 | /413/CH9/EX9.3/Example_9_3.sce | 0137d961b3b654e5d4d3157e960c7b4a87d44a87 | [] | 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 | 438 | sce | Example_9_3.sce | clc
clear
printf('Solve the equation y''+y=3X^2, with boundary points (0,0) and (2, 3.5)')
printf('\nCompare computed value form The Galerkin Method vs Analytic result')
P=0
X(1,1)=0
for i=1:20
X(1,i+1)=0.1+P
P=X(1,i+1)
end
for i=1:21
A(1,i)=(101/152).*X(1,i).*X(1,i).*X(1,i)-(103/228)*X(1,i).*X(1,i)+(1/228)*X(1,i)
B(1,i)=6*cos(X(1,i))+3*(X(1,i).*X(1,i)-2)
T=[X(1,i), B(1,i), A(1,i), B(1,i)-A(1,i)]
disp(T)
end |
b3892976f7f220f6ed77a8645b669710b857e684 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3673/CH16/EX16.a.9/Example_a_16_9.sce | 54b12fd2a2e748ef783f279c9379d38e3758cca9 | [] | 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 | Example_a_16_9.sce | //Example_a_16_9 page no:787
clc;
Y11=6;
Y22=6;
Y21=4;
Y12=4;
Ys=1;
driv_pt_admt=((Y22*Ys)+(Y22*Y11)-(Y21*Y12))/(Ys+Y11);
disp(driv_pt_admt,"the driving point admittance is (in mho)");
|
f620ec9b66ef601054d4d115c7d960a64830c0e2 | 993d195bcd2d0c410983954f13fe34356f73cfe8 | /plots/plotter.sce | 3a9385c6d1ce518765e29f29339420942cd3d211 | [] | no_license | celebro/diploma | e4da6f0f1447e3b27c31474164f55718b744fdf7 | a96df9a188ac3cf035f372839cbd6c372aeeeae1 | refs/heads/master | 2021-03-12T21:42:39.337604 | 2013-03-28T08:43:52 | 2013-03-28T08:43:52 | 8,127,151 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 2,040 | sce | plotter.sce | function []=process_result(filename)
M = csvRead(filename, ";")
fontS = 4;
disp(filename);
M1 = M;
M1(isnan(M1)) = 60000;
disp("total times:");
disp(sum(M1, 1)/1000/60/60);
disp(sum(M1)/1000/60/60);
f=gcf();
f.figure_size=[1100, 650]
f.background=-2;
T=5000
N=6000;
fact=T/N
for j=1:1:size(M,2)
x1 = [1:N];
for i=1:1:N
x1(i) = sum(M(:,j) < i*fact);
end
if j == 1 then
x = x1;
else
x = [x; x1];
end
end
clf;
subplot(1,2,1)
plot([1:N]/N*60,x);
//xtitle(filename, 'čas [s]', 'št. rešenih primerov');
xtitle("", 'čas [s]', 'št. rešenih primerov');
a=gca();
a.font_size = fontS;
a.x_label.font_size=fontS;
a.y_label.font_size=fontS;
a.margins = [0.15, 0.05, 0.125, 0.125]
subplot(1,2,2)
plot("ln",[1:N]/N*60,x);
//xtitle(filename, 'čas [s]', 'št. rešenih primerov');
xtitle("", 'čas [s]', 'št. rešenih primerov');
a=gca();
a.font_size = fontS;
a.x_label.font_size=fontS;
a.y_label.font_size=fontS;
a.margins = [0.15, 0.05, 0.125, 0.125]
a.log_flags="ln";// (l=) log scale on y axis
legend(['ullmann', 'vf2+subsea', 'vf2'], 4);
xs2png(f,strsubst(filename,".txt",""));
xs2svg(f,strsubst(filename,".txt",""));
xs2pdf(f,strsubst(filename,".txt",""));
endfunction
figure(1)
process_result("diploma/data/results_si2_r001.txt")
figure(2)
process_result("diploma/data/results_si2_r005.txt")
figure(3)
process_result("diploma/data/results_si2_r01.txt")
figure(4)
process_result("diploma/data/results_si4_r001.txt")
figure(5)
process_result("diploma/data/results_si4_r005.txt")
figure(6)
process_result("diploma/data/results_si4_r01.txt")
figure(7)
process_result("diploma/data/results_si6_r001.txt")
figure(8)
process_result("diploma/data/results_si6_r005.txt")
figure(9)
process_result("diploma/data/results_si6_r01.txt")
//M = csvRead()
//subplot(3,3,1);
|
cf1380af26412214a0e7471f2dc6dd4affa69a83 | 449d555969bfd7befe906877abab098c6e63a0e8 | /995/CH2/EX2.17/Ex2_17.sce | 1a3e85bd9d8720c526a21a5db2fdc7d04b7496a4 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 219 | sce | Ex2_17.sce | //Ex:2.17
clc;
clear;
close;
r_o=40;//resis at 0 degree
r_t=44;//at 100 degree
t=100;//temperature diff.
temp_coeff=(1/t)*((r_t/r_o)-1);
printf("Temperature Coefficient = %f per degree centigrade",temp_coeff);
|
f8ede74bda734e2bdc142ace10db3ebb96045fcc | 5f48beee3dc825617c83ba20a7c82c544061af65 | /tests/s/92.tst | c29b1ec8f30b05e13337a4c247701fb42556bc6f | [] | no_license | grenkin/compiler | bed06cd6dac49c1ca89d2723174210cd3dc8efea | 30634ec46fba10333cf284399f577be7fb8e5b61 | refs/heads/master | 2020-06-20T12:44:17.903582 | 2016-11-27T03:08:20 | 2016-11-27T03:08:20 | 74,863,612 | 3 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 36 | tst | 92.tst | int main(void)
{
float x;
x++;
} |
3cede8a2abe2b9d4e06df5dcc65f51d6db30046c | 449d555969bfd7befe906877abab098c6e63a0e8 | /2006/CH7/EX7.2/ex7_2.sce | e91e8996eae7d4b13f06995254c04370f1418397 | [] | 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,589 | sce | ex7_2.sce | clc;
p1=1.0021; // Initial pressure of the fluid in MPa
T1=180; // Initial temperature of the fluid in degree celcius
m=0.5; // Mass of the fluid in kg
p2=p1; // Constant pressure process
// (a).Steam
x1=0.8; // Quality of the steam at state 1
// Following are the values taken from steam table
vf1=0.001127; vfg1=0.1929; // specific volume of the steam in m^3/kg
hf1=763.2; hfg1=2015; // specific enthalpy in kJ/kg
sf1=2.1396; sfg1=4.4460; // specific entropy in kJ/kg K
v1=vf1+x1*vfg1; // specific volume in m^3/kg
h1=hf1+x1*hfg1; // specific enthalpy in kJ/kg
s1=sf1+x1*sfg1; // specific entropy in kJ/kg K
v2=2*v1; // Final volume of the fluid
t2=410.5; // Final temperature of steam in degree celcius (from superheated steam table)
h2=3286.4; // specific enthalpy in kJ/kg
s2=7.525; // specific entropy in kJ/kg K
S21=m*(s2-s1); // Change in entropy
W=m*p1*10^3*(v2-v1); // Work done
Q=m*(h2-h1); // Heat transferred
disp ("kJ",Q,"Heat transferred = ","kJ",W,"Work done = ","kJ/K",S21,"Change in entropy = ","K",t2+273,"Final Temperature = ","(a).Steam");
// (b).Air
Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K
R=0.287; // characteristic gas constant of air in kJ/kg K
V1=m*R*(T1+273)/(p1*10^3); // Initil volume
V2=2*V1; // Final volume
T2=(T1+273)*V2/V1; // Final temperature
S21=m*Cpo*log (V2/V1); // Change in entropy
W=p1*10^3*(V2-V1); // Work done
Q=m*Cpo*(T2-(T1+273));// Heat transferred
disp ("kJ",Q,"Heat transferred = ","kJ",W,"Work done = ","kJ/K",S21,"Change in entropy = ","K",T2,"Final Temperature = ","(b).Air");
|
1ea42528e9e9d5c74b9e491468b04b10dabe7b65 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1997/CH11/EX11.35/example35.sce | 210df3351f3dff7a9e6bd21e9ba1873061508ff3 | [] | 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 | 863 | sce | example35.sce | //Chapter-11 example 35
//=============================================================================
clc;
clear;
//input data
lamda = 0.03; //wavelength in m
RCS = 5; // Radar cross section in m^2
D = 1; // antenna diameter in m
F = 5; // noise figure in dB
Rmax = 10*10^3 // Radar range
BW = 500*10^3; // bandwidth
//Calculation
F1 = 10^(F/10) // antilog calculation
//Rmax = 48*((Pt*D^4*RCS)/(BW*lamda*lamda(F-1)))^0.25
Pt = ((Rmax/48)^4)*((BW*lamda*lamda*(F1-1))/(D^4*RCS))
//Output
mprintf('Peak Transmitted Power is %e',Pt);
mprintf('\n Note: Antilog Calculation error in textbook at F')
//=============================================================================
|
961620381da1aa9a8fe9b02698f4e60a52c26366 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/PB9.prev.tst | 56445cd3655c62f51e71625764d14a38c1f95ede | [
"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 | 303 | tst | PB9.prev.tst | y^2 = x^3 + c with x = 24*w + 3, y = 54*v + 5, c = - 2
x -> (2976*w + 31104*w^2 + 165888*w^3 + 331776*w^4 + 129) /
(2160*v + 11664*v^2 + 100),
y -> ( - 9072*w - 492480*w^2 - 6912000*w^3 - 44789760*w^4 - 143327232*w^5 - 191102976*w^6 + 383) /
(32400*v + 349920*v^2 + 1259712*v^3 + 1000)
|
a78bbbf2a335036e04b77ce7b8249af1bb49f886 | 18df283fb5101e31bf18ec6b27f48fa7ecb3f4e4 | /src/assign6/scilab/Prob7.sci | 4855973ffd551cc53da19cd6b74454458d6191d3 | [] | no_license | Assimilater/ENGR2450 | ada8988b883aef5e8bfb2990c8e7dff0d923e46c | 49280b9ce8309b2b5cb9cc664eba448e7af45ed6 | refs/heads/master | 2021-01-01T18:47:54.820828 | 2015-04-17T04:43:33 | 2015-04-17T04:43:33 | 30,390,731 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 502 | sci | Prob7.sci | //Script to solve dY/dx=F(x,Y), Y(x0)=Y0
function [Z] = F(x, Y)
Z(1) = Y(2);
Z(2) = (2.5 * sin(.5 * x) - 5 * abs(Y(2)) * Y(2) - 6 * Y(1)) / 2;
endfunction;
x = [0.0:0.25:15];
x0 = 0;
Y0 = [1;0];
Y = ode("rk", Y0, x0, x, F); //solve ODE
disp("t Displacement Velocity")
disp([x' Y']);
y1 = Y(1,:); y2 = Y(2,:); //extract y1, y2C
scf();
plot(x, y1, 'b-', x, y2, 'r-');
legend('Disp.', 'Velo.', 1);
xtitle('signal plots', 't', 'y');
scf();
plot(y1, y2);
xtitle('phase portrait', 'x', 'dx/dt');
|
7738daa99c263fc326cbeec795960c649d974295 | 449d555969bfd7befe906877abab098c6e63a0e8 | /632/CH11/EX11.17/example11_17.sce | 507247a0998e8c01880d7660c2acd7c1d7373da1 | [] | 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 | 729 | sce | example11_17.sce | //clc()
T1 = 250;//K
T = 273.15;//K
T2 = 400;//K
Cice = 2.037;//kJ/kgK
T3 = 373.15;//K
Cliq = 75.726;//kJ/kmolK
//Cp = 30.475 + 9.652*10^-3*T + 1.189*10^-6*T^2
Hfusion = 6012;//kJ/kmol
Hvap = 40608;//kJ/kmol
//1 - Heat for raising the temperature of ice, H1
H1 = Cice * (T - T1);
//2 - Latent heat of fusion of ice, Hf
Hf = Hfusion / 18.016;//kJ
//3 - Sensible heat of raising the temperature of water, H2
H2 = Cliq * ( T3 - T)/18.016;
//4 - Latent heat of vaporization of water, Hv
Hv = Hvap / 18.016;
//5 - Sensible heat of raising the temperature of water vapou, H3
H3 = (integrate('30.475 + 9.652*10^-3*T + 1.189*10^-6*T^2','T',T3,T2))/18.016;
Q = H1 + H2 + H3 + Hf + Hv;
disp("kJ",Q,"Heat required = ") |
5ef790a64a572442deb7b62f2c65850149b86e49 | 449d555969bfd7befe906877abab098c6e63a0e8 | /620/CH19/EX19.3/example19_3.sce | 3521be9d05c9cc3a3e95ca2cd49369bc45122c27 | [] | 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 | 409 | sce | example19_3.sce | l=8;
r=400;
v=20;
disp("Part a");
t=l/r;
disp("the time constant (in ms) of the circuit is"); disp(t*10^3);
disp("Part b");
i=v/r;
disp("final value of the current (in mA) is"); disp(i*10^3);
disp("Part c");
rate=v/l;
disp("the initial rate of rise of current (in A/s) is"); disp(rate);
disp("Part d");
t1=i/rate;
disp("time taken (in ms) to reach the final value of current is"); disp(t1*10^3); |
30c7d115afd0b7f826ff4931f4ce068cad8bd2f8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /72/CH6/EX6.4.1/6_4_1.sce | 3fcc22f4560d76b04705f1a0e42b295904c453d5 | [] | 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 | 620 | sce | 6_4_1.sce | //chapter_no.-6, page_no.-260
//Example_no.6-4-1
clc;
//(a) Calculate_the_strong_potential_w(inv)_for_strong_inversion
kt=26*(10^-3);
Na=3*(10^17);
Ni=1.5*(10^10);
wsinv=2*kt*log(Na/Ni);
disp(wsinv,'the_strong_potential_w(inv)_for_strong_inversion(volts)');
//(b)Calculate_the_insulator_Capacitance
eir=4;
ei=8.854*(10^-12)*eir;
d=.01*(10^-6);
Ci=ei/d;
Ci=Ci*(1000);
disp(Ci,'the_insulator_Capacitance(mF/m^2)=');
//(c) Calculate_the_threshold_voltage
q=1.6*(10^-19);
Na=3*(10^23);
er=11.8;
e=8.854*er*(10^-12);
Vth=wsinv+((2/(Ci*(10^-3)))*((e*q*Na*.437)^(1/2)))
disp(Vth,'the_threshold_voltageis ()Volts=');
|
e18e51e937c421e4ea28652f96db4370698c1fc8 | fdc5047b7bf8122bad1e621df236b0481226c36e | /exemplos/xls-link-0.5.0-src/tests/unit_tests/xls_ShowGrid.tst | 27186eebdd11327a597cdbec4866318e26c1ebb7 | [] | no_license | jpbevila/virtualHartSci | aea3c6ba23d054670eb193f441ea7de982b531cc | a3f5be6041d230bd9f0fd67e5d7efa71f41cfca5 | refs/heads/main | 2023-07-26T23:05:28.044194 | 2021-09-09T11:50:59 | 2021-09-09T11:50:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 771 | tst | xls_ShowGrid.tst | // ====================================================================
// Allan CORNET
// DIGITEO 2008 - 2010
// ====================================================================
// <-- CLI SHELL MODE -->
// ====================================================================
r = xls_NewExcel();
assert_checktrue(r);
r = xls_SetVisible(%t);
assert_checktrue(r);
r = xls_AddWorkbook();
assert_checktrue(r);
r = xls_SetWorksheet(1);
assert_checktrue(r);
for i=1:5
r = xls_ShowGrid(%t);
assert_checktrue(r);
sleep(200);
r = xls_ShowGrid(%f);
assert_checktrue(r);
sleep(200);
end
r = xls_SetVisible(%f);
assert_checktrue(r);
r = xls_SetSave(%t);
assert_checktrue(r);
r = xls_Close();
assert_checktrue(r);
r = xls_Quit();
assert_checktrue(r);
|
18c7aeecf922560d25e5d62b03235ed680414122 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3864/CH5/EX5.18/Ex5_18.sce | 26a9324a64f850bf58c2d4611431df22c1dd92a9 | [] | 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,598 | sce | Ex5_18.sce | clear
//
//
//Initilization of Variables
L_ED=2 //m //Length of DB & AC
L_AC=2
L_DB=2
L_CD=4 //m //Length of CD
L_CE=2 //m //Length of CE
F_A=40 //KN //Force at C
F_B=20 //KN //Force at A
E=200*10**6 //KN/mm**2 //Modulus of Elasticity
I=50*10**-6 //m**4 //M.I
//Calculations
//LEt V_C & V_D be the reactions at C & D respectively
//V_C+V_D=60
//Taking Moment At D,M_D
V_C=-(-F_A*(L_AC+L_CE+L_ED)+F_B*L_DB)*L_CD**-1
V_D=60-V_C
//Now Taking Moment at Distance x from A,
//M_x=-40*x+50*(x-2)+10*(x-6)
//EI*(d**2*y/dx**2)=-40*x+50*(x-2)+10*(x-6)
//Now Integrating above Equation we get
//EI*(dy/dx)=C1+20*x**2-25*(x-2)+5*(x-6)**2
//Again Integrating above Equation we get
//EI*y=C2+C1*x-20*3**-1*x**3+25*3**-1*(x-2)**3+5*3**-1*(x-6)**3
//At
x=0
y=0
//C2+2*C1=-53.33 ...............(1)
//At
x=6
y=0
//C2+6*C1=906.667 ...............(2)
//Subtracting Equation 1 from 2 we get
C1=853.333*4**-1
C2=53.333-2*C1
x=0
y_A=(C2+C1*x-20*3**-1*x**3+25*3**-1*(x-2)**3+5*3**-1*(x-6)**3)*(E*I)**-1
//Answer For y_A is incorrect in textbook
//At Mid-span
C1=853.333*4**-1
C2=53.333-2*C1
x=4
y_E=(C2+C1*x-20*3**-1*x**3+25*3**-1*(x-2)**3+5*3**-1*(x-6)**3)*(E*I)**-1
//Answer For y_E is incorrect in textbook
//At B
C1=853.333*4**-1
C2=53.333-2*C1
x=8
y_B=(C2+C1*x-20*3**-1*x**3+25*3**-1*(x-2)**3+5*3**-1*(x-6)**3)*(E*I)**-1
//Result
printf("\n Deflection relative to the level of the supports:at End A %0.4f mm",y_A)
printf("\n :at End B %0.4f mm",y_B)
printf("\n :at Centre of CD %0.4f mm",y_E)
|
eeeb63bf87e3830652150767eac64c0001fd290a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2417/CH7/EX7.1/Ex7_1.sce | 0091801636b0420834ff264591e06d259935dae0 | [] | 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,937 | sce | Ex7_1.sce | //scilab 5.4.1
clear;
clc;
printf("\t\t\tProblem Number 7.1\n\n\n");
// Chapter 7 : Mixtures Of Ideal Gases
// Problem 7.1 (page no. 322)
// Solution
//As the basis of the calculation,assume that we have 1 lbm of mixture.Also,take the molecular weight of oxygen to be 32.00 and nitrogen to be 28.02.(from table7.1)
printf("Solution for (a)\n");
nO2=0.2315/32; //no of moles of oxygen=ratio of mass and molecular weight //0.2315 lb of oxygen per pound
printf("The moles of oxygen is %f mole/lbm of mixture\n",nO2);
nN2=0.7685/28.02; //no of moles of nitrogen=ratio of mass and molecular weight //0.7685 lb of nitrogen per pound
printf("The moles of nitrogen is %f mole/lbm of mixture\n",nN2);
nm=nO2+nN2; //Unit:Mole/lbm //number of moles of gas mixture is sum of the moles of its constituent gases
printf("The total number of moles is %f mole/lbm\n",nm);
xO2=nO2/nm; //mole fraction of oxygen=ratio of no of moles of oxygen and total moles in mixture
xN2=nN2/nm; //mole fraction of nitrogen=ratio of no of moles of oxygen and total moles in mixture
printf("The mole fraction of oxygen is %f and the mole fraction of nitrogen is %f\n",xO2,xN2);
//(Check:xO2+xN2=1)
printf("xO2+xN2=%f\n\n",xO2+xN2);
printf("Solution for (b)\n");
// the air is at 14.7 psia
pO2=xO2*14.7; //the partial pressure of oxygen=pressure of air * the mole fraction of oxygen //psia
printf("The partial pressure of oxygen is %f psia\n",pO2);
pN2=xN2*14.7; //the partial pressure of nitrogen=pressure of air * the mole fraction of nitrogen //psia
printf("The partial pressure of nitrogen is %f psia\n\n",pN2);
printf("Solution for (c)\n");
MWm=(xO2*32) + (xN2*28.02); //the molecular weight of air=sum of products of mole fraction of each gas component
printf("The molecular weight of air is %f\n\n",MWm);
printf("Solution for (d)\n");
Rm=1545/MWm; //the gas constant of air
printf("The gas constant of air is %f\n\n",Rm);
|
6dd0e705e4aadbad42301307e454ca610bbb9f99 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1733/CH4/EX4.17/4_17.sce | 34cacea82333b133513142cdd8c9b26d137dbf54 | [] | 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 | 117 | sce | 4_17.sce | //4.16
clc;
Vav=250;
V=150;
Toff=1*10^-3;
Ton=(Vav/V)*Toff-Toff;
printf("Period of conduction = %.6f sec", Ton) |
4f1f7c0bd26b6fbd048e3ecc0b64359663e645c4 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.4.1/Unix-Windows/scilab-2.4.1/macros/util/%p_simp.sci | b56b2c67575cd09e21519e0cb183a36eea9bfc15 | [
"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 | 81 | sci | %p_simp.sci | function [num,den]=%p_simp(num,den)
// implement complex case
// Copyright INRIA
|
403f550e79b10b18710120af5703927bcaf7a1f4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2672/CH1/EX1.27/Ex1_27.sce | 0d58cdf74c1280afa0daa7f92ddabd67e683285d | [] | 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 | 565 | sce | Ex1_27.sce | //Example 1_27
clc;
clear;
close;
format('v',4);
//given data :
V1=20;//V
V2=4;//V
R1=500;//ohm
R2=1000;//ohm
R3=100;//ohm
R4=800;//ohm
RL=1000;//ohm
//solution
VCB=-R2/(R4+R2)*V1;//V
//writing KVL equation for the loop
I=poly(0,'I');
eqn=V1-R1*I-V2-R3*I;//KVL equation
I=roots(eqn);//A
VCA=-I*R1;//V
//Potential at point B with respect to A
VBA=VCB-VCA;//V
VOC=VBA;//V
Vth=VOC;//V
Req=R1*R3/(R1+R3)+R2*R4/(R2+R4);//ohm
//Thevenin equivalent current
IL=Vth/(Req+RL);//A
IL=IL*1000;//mA
disp(IL,"Current through 1000 ohm resistor(mA)");
|
b40deabae6174533f467589783cc75af5d86d4fe | 449d555969bfd7befe906877abab098c6e63a0e8 | /2048/DEPENDENCIES/cra.sci | be0d6e2f211833877dab1bfb5a77187f601060d9 | [] | 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,143 | sci | cra.sci |
// [ir,r,cl] = cra(z,M,n)
// M: No. of lags
// n: Order of pre whitening filter
// z is of the form:
// z = [y u]
// y and u are column matrices
function [ir,r,cl] = cra(z,varargin)
len = length(varargin);
if len==0,M = 20;n = 10;
elseif len==1,M = varargin(1);n=10;
else M = varargin(1);n = varargin(2);
end;
[ro,co] = size(z);
a1 = armax1(n,-1,0,z(:,2)',zeros(1,ro));
[A,B,D] = arma2p(a1);
a11 = coeff(A);
z22(1,:) = filt(a11,1,z(:,1)');
z22(2,:) = filt(a11,1,z(:,2)');
Covr = covf(z22',M+1);
scir=Covr(4,1);
sccf=sqrt(Covr(1,1)*Covr(4,1));
ir = Covr(2,:)'/scir;
r(:,1) = -M:M;
r(:,2) = [Covr(1,M+1:-1:1) Covr(1,2:M+1)]'
r(:,3) = [Covr(4,M+1:-1:1) Covr(4,2:M+1)]'
rhoyu = Covr(3,:)'/sccf;
rhouy = Covr(2,:)'/sccf;
r(:,4) = [rhoyu(M+1:-1:1); rhouy(2:M+1)];
sdreu=2.58*sqrt(r(:,3)'*r(:,2))/scir/sqrt(ro)*ones(2*M+1,1);
cl=sdreu(1);
timeax=[0:length(ir)-1];
plot(timeax,ir,'bo');
plot2d3(timeax,ir,style = 2);
plot(timeax,cl*ones(1,length(ir)),'b-.');
plot(timeax,-cl*ones(1,length(ir)),'b-.');
xtitle('Impulse response estimate','Lags');
xgrid();
endfunction;
|
07856ec970720dd522852e30718fce104aa53021 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1286/CH1/EX1.3/1_3.sce | c576fd5f1688dedbeb32d3a0a8e1b82519475140 | [] | 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 | 187 | sce | 1_3.sce | clc
//initialisation of variables
p=1.0//metres
p0=0.8//metres
p100=1.093//metres
//CALCULATIONS
t=((p-p0)*100/(p100-p0))
//RESULTS
printf(' temperature of hot water= % 1f C',t)
|
92c9fbe10887f3ca4c5897fe0519501c1ed98f8c | be07c1e346737e6e38bb958d9a66f52f6da2180a | /Regression/VCAST_TIME/VCAST_TIME_W.tst | e578af63fcae6c2a21b8773eeb31f5179c6a75e9 | [] | no_license | dpreisser/Training | 1bc8840d646306d861f4c7610a28bb23667f06e5 | 97eb58c7963e4725d6a2ad9e8200ca9367c84061 | refs/heads/master | 2021-01-10T13:03:12.508795 | 2016-04-11T12:49:06 | 2016-04-11T12:49:06 | 54,963,561 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,644 | tst | VCAST_TIME_W.tst | -- VectorCAST 6.4d (02/29/16)
-- Test Case Script
--
-- Environment : VCAST_TIME_W
-- Unit(s) Under Test: vcast_time
--
-- Script Features
TEST.SCRIPT_FEATURE:C_DIRECT_ARRAY_INDEXING
TEST.SCRIPT_FEATURE:CPP_CLASS_OBJECT_REVISION
TEST.SCRIPT_FEATURE:MULTIPLE_UUT_SUPPORT
TEST.SCRIPT_FEATURE:MIXED_CASE_NAMES
TEST.SCRIPT_FEATURE:STANDARD_SPACING_R2
TEST.SCRIPT_FEATURE:OVERLOADED_CONST_SUPPORT
TEST.SCRIPT_FEATURE:UNDERSCORE_NULLPTR
TEST.SCRIPT_FEATURE:FULL_PARAMETER_TYPES
TEST.SCRIPT_FEATURE:STATIC_HEADER_FUNCS_IN_UUTS
--
-- Test Case: time_add_seconds.001
TEST.UNIT:vcast_time
TEST.SUBPROGRAM:time_add_seconds
TEST.NEW
TEST.NAME:time_add_seconds.001
TEST.NOTES:
Author:
Date:
Version:
Requirement:
TEST.END_NOTES:
TEST.VALUE:vcast_time.time_add_seconds.start.mins:(2)59
TEST.VALUE:vcast_time.time_add_seconds.start.secs:(2)59
TEST.VALUE:vcast_time.time_add_seconds.seconds:1,61
TEST.EXPECTED:vcast_time.time_add_seconds.return.mins:(2)60
TEST.EXPECTED:vcast_time.time_add_seconds.return.secs:0,60
TEST.END
-- Test Case: time_add_seconds.002
TEST.UNIT:vcast_time
TEST.SUBPROGRAM:time_add_seconds
TEST.NEW
TEST.NAME:time_add_seconds.002
TEST.NOTES:
Author:
Date:
Version:
Requirement:
TEST.END_NOTES:
TEST.VALUE:vcast_time.time_add_seconds.seconds:1
TEST.VALUE_USER_CODE:vcast_time.time_add_seconds.start
<<vcast_time.time_add_seconds.start>>.mins = 59;
<<vcast_time.time_add_seconds.start>>.secs = 59;
TEST.END_VALUE_USER_CODE:
TEST.EXPECTED_USER_CODE:vcast_time.time_add_seconds.return
{{ <<vcast_time.time_add_seconds.return>>.mins == 60 }}
{{ <<vcast_time.time_add_seconds.return>>.secs == 0 }}
TEST.END_EXPECTED_USER_CODE:
TEST.END
|
b3acafad4b1efc4778295609009455b510a8ad5e | e04f3a1f9e98fd043a65910a1d4e52bdfff0d6e4 | /New LSTMAttn Model/.data/form-split/GOLD-TEST/kjh.tst | 4eb23b1f8b1a03dbf3b28271076302723980969c | [] | no_license | davidgu13/Lemma-vs-Form-Splits | c154f1c0c7b84ba5b325b17507012d41b9ad5cfe | 3cce087f756420523f5a14234d02482452a7bfa5 | refs/heads/master | 2023-08-01T16:15:52.417307 | 2021-09-14T20:19:28 | 2021-09-14T20:19:28 | 395,023,433 | 3 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 9,020 | tst | kjh.tst | пуғдай пуғдайзар N;ALL;SG
кӱскӱ кӱскӱнің N;GEN;SG
алтын алтын N;NOM;SG
чайғы чайғылар N;NOM;PL
хар харның N;GEN;SG
ағас ағастар N;NOM;PL
хуча хучаларнаң N;INS;PL
кӱскӱ кӱскӱлерзер N;ALL;PL
хара хурт хара хурт N;NOM;SG
тарбаған тарбағаннарда N;AT;PL
иир иирзер N;ALL;SG
алтынзарых алтынзарыхтарзар N;ALL;PL
інек інектерні N;ACC;PL
хысхы хысхыларның N;GEN;PL
аба абаларнаң N;INS;PL
тигір тигірлерні N;ACC;PL
кӱзен кӱзеннер N;NOM;PL
хысхы хысхы N;NOM;SG
тағ тағның N;GEN;SG
пулут пулуттардаң N;ABL;PL
хымысха хымысханың N;GEN;SG
тиин тииннің N;GEN;SG
алтынзарых алтынзарыхтарнаң N;INS;PL
часхы часхыларнаң N;INS;PL
чылтыс чылтыстарнаң N;INS;PL
кӧл кӧллердең N;ABL;PL
хамнос хамностарға N;DAT;PL
хозан хозаннар N;NOM;PL
хамнос хамностар N;NOM;PL
пӧрік пӧрік N;NOM;SG
ӱстінзарых ӱстінзарыхтарны N;ACC;PL
чар чарларзар N;ALL;PL
хозан хозанны N;ACC;SG
тирек тирек N;NOM;SG
ӧрке ӧркелерге N;DAT;PL
сабын сабыннарда N;AT;PL
суғ суғны N;ACC;SG
киндір киндірні N;ACC;SG
кӱскӱ кӱскӱлернең N;INS;PL
пуғдай пуғдайны N;ACC;SG
чар чарзар N;ALL;SG
тағ таға N;DAT;SG
пуға пуғазар N;ALL;SG
тиин тииннер N;NOM;PL
пус пуснаң N;INS;SG
пуға пуғалар N;NOM;PL
іскер іскердең N;ABL;SG
часхы часхыларны N;ACC;PL
порсых порсых N;NOM;SG
тас тассар N;ALL;SG
кӱн кӱннернең N;INS;PL
палых палыхтарнаң N;INS;PL
кӧрік кӧріктернең N;INS;PL
іскер іскерге N;DAT;SG
тағ тағнаң N;INS;SG
пуға пуғаларда N;AT;PL
пулут пулуттарның N;GEN;PL
тимір тимірнің N;GEN;SG
тарбаған тарбағанның N;GEN;SG
тас тастаң N;ABL;SG
часхы часхыда N;AT;SG
інек інектернің N;GEN;PL
мылтых мылтыхтаң N;ABL;SG
парыс парыстың N;GEN;SG
хысхы хысхылар N;NOM;PL
кӱн кӱннең N;ABL;SG
мылтых мылтыхтар N;NOM;PL
азах азах N;NOM;SG
палых палыхтардаң N;ABL;PL
тіл тілде N;AT;SG
аба абаларны N;ACC;PL
тайға тайғаларнаң N;INS;PL
кӱскӱ кӱскӱзер N;ALL;SG
хозан хозаннарнаң N;INS;PL
порсых порсыхтарға N;DAT;PL
оо ооларнаң N;INS;PL
суғ суғларзар N;ALL;PL
тайға тайға N;NOM;SG
пуға пуғалардаң N;ABL;PL
сабын сабыннарның N;GEN;PL
кӧл кӧллерде N;AT;PL
пӧрік пӧріктерні N;ACC;PL
чис чиске N;DAT;SG
кӱскӱ кӱскӱлерде N;AT;PL
парыс парыстарда N;AT;PL
хоосха хоосханаң N;INS;SG
тиин тиинзер N;ALL;SG
алабарыс алабарыстарны N;ACC;PL
чылан чыланнар N;NOM;PL
тиин тииннернең N;INS;PL
кӧл кӧллернең N;INS;PL
хымысха хымысхадаң N;ABL;SG
хоосха хоосхаларнаң N;INS;PL
тӱлгӱ тӱлгӱзер N;ALL;SG
порсых порсыхтарның N;GEN;PL
чылтыс чылтыстың N;GEN;SG
часхы часхынаң N;INS;SG
ағас ағастарның N;GEN;PL
азах азахтардаң N;ABL;PL
сыын сыыннарда N;AT;PL
кӧл кӧллерзер N;ALL;PL
порсых порсыхнаң N;INS;SG
чис чистердең N;ABL;PL
кӱмӱс кӱмӱстернің N;GEN;PL
молат молатнаң N;INS;SG
ағас ағастарны N;ACC;PL
пӧрік пӧріктең N;ABL;SG
адай адайның N;GEN;SG
чазы чазылардаң N;ABL;PL
харағай харағайның N;GEN;SG
кӱмӱс кӱмӱстерге N;DAT;PL
кидер кидернең N;INS;SG
кӧрік кӧріктең N;ABL;SG
чылан чылан N;NOM;SG
адай адайға N;DAT;SG
азах азахха N;DAT;SG
чил чиллер N;NOM;PL
пулут пулуттарзар N;ALL;PL
пуға пуғадаң N;ABL;SG
тамыр тамыр N;NOM;SG
чылан чыланнаң N;ABL;SG
тибе тибелерзер N;ALL;PL
адай адайларны N;ACC;PL
тирек тиректерге N;DAT;PL
тайға тайғазар N;ALL;SG
хысхы хысхыларны N;ACC;PL
тамыр тамырларзар N;ALL;PL
алабарыс алабарыстарға N;DAT;PL
тіл тілге N;DAT;SG
киндір киндірлерзер N;ALL;PL
ағас ағасты N;ACC;SG
хоосха хоосхаларның N;GEN;PL
парыс парыста N;AT;SG
хозан хозаннарда N;AT;PL
кӱн кӱннерге N;DAT;PL
кидер кидерлер N;NOM;PL
хамнос хамностарнаң N;INS;PL
кӱскӱ кӱскӱлернің N;GEN;PL
інек інексер N;ALL;SG
тигір тигірлерде N;AT;PL
сыын сыынға N;DAT;SG
тибе тибезер N;ALL;SG
алтынзарых алтынзарыхтарның N;GEN;PL
хозан хозанда N;AT;SG
ӱстінзарых ӱстінзарыхтарзар N;ALL;PL
чон чонны N;ACC;SG
тимір тимірлернің N;GEN;PL
сосха сосхазар N;ALL;SG
тас тастарнаң N;INS;PL
часхы часхы N;NOM;SG
тас тастарзар N;ALL;PL
чазы чазызар N;ALL;SG
хуча хучаларға N;DAT;PL
хузурух хузурухтың N;GEN;SG
наңмыр наңмырзар N;ALL;SG
тӱн тӱнзер N;ALL;SG
пуғдай пуғдайларда N;AT;PL
талай талайларны N;ACC;PL
чар чарның N;GEN;SG
іскер іскерлернең N;INS;PL
хуча хучалар N;NOM;PL
чар чарларны N;ACC;PL
хысхы хысхының N;GEN;SG
харағай харағайзар N;ALL;SG
ағас ағастарда N;AT;PL
сыын сыынның N;GEN;SG
тирек тирекнең N;INS;SG
тигір тигірзер N;ALL;SG
кӱзен кӱзеннернең N;INS;PL
кӱзен кӱзеннең N;ABL;SG
оо ооның N;GEN;SG
тас таста N;AT;SG
пуғдай пуғдайнаң N;INS;SG
тибе тибенең N;INS;SG
сосха сосхалардаң N;ABL;PL
тағ тағда N;AT;SG
тибе тибені N;ACC;SG
чон чонның N;GEN;SG
тамыр тамырға N;DAT;SG
хум хумнар N;NOM;PL
тарбаған тарбағаннар N;NOM;PL
хамнос хамностаң N;ABL;SG
тарбаған тарбағаннаң N;ABL;SG
иир иирлерні N;ACC;PL
чил чиллерні N;ACC;PL
тайға тайғадаң N;ABL;SG
парыс парыстарзар N;ALL;PL
алтынзарых алтынзарыхтарны N;ACC;PL
суғ суғларнаң N;INS;PL
хул хулда N;AT;SG
чылан чыланнардаң N;ABL;PL
молат молаттарнаң N;INS;PL
тас тас N;NOM;SG
кӱзен кӱзеннерні N;ACC;PL
чазы чазыны N;ACC;SG
порсых порсыхха N;DAT;SG
молат молаттарның N;GEN;PL
чазы чазыларны N;ACC;PL
табах табахтарны N;ACC;PL
аба абаларға N;DAT;PL
тӱлгӱ тӱлгее N;DAT;SG
хуча хуча N;NOM;SG
пӧрік пӧріктерзер N;ALL;PL
хара хурт хара хурттарда N;AT;PL
адай адайлар N;NOM;PL
тарбаған тарбағаннарзар N;ALL;PL
хум хумда N;AT;SG
наңмыр наңмырлар N;NOM;PL
чайғы чайғызар N;ALL;SG
сӧс сӧс N;NOM;SG
чылтыс чылтыста N;AT;SG
чил чил N;NOM;SG
тиин тииннерні N;ACC;PL
сосха сосханы N;ACC;SG
иир иирдең N;ABL;SG
сӧс сӧсте N;AT;SG
хамнос хамностарда N;AT;PL
чил чиллернең N;INS;PL
харағай харағайларны N;ACC;PL
парыс парысты N;ACC;SG
чил чиллердең N;ABL;PL
хуча хучаны N;ACC;SG
іскер іскерлернің N;GEN;PL
чис чистерде N;AT;PL
мылтых мылтыхтың N;GEN;SG
тимір тимірні N;ACC;SG
хузурух хузурухтарға N;DAT;PL
оо оо N;NOM;SG
талай талайның N;GEN;SG
чис чистің N;GEN;SG
тигір тигірдең N;ABL;SG
табах табахтың N;GEN;SG
парыс парыстардаң N;ABL;PL
хум хумға N;DAT;SG
сабын сабынзар N;ALL;SG
тамыр тамырзар N;ALL;SG
наңмыр наңмырларда N;AT;PL
сосха сосхаа N;DAT;SG
хузурух хузурухтарны N;ACC;PL
чайғы чайғыларда N;AT;PL
|
5b801a6f0fae9b9e9f5da2aadd70836d88cb77d5 | a439c420539294c6e178cc89c43c4231246f9cbe | /Scripts/Code/Lagrange.sci | e64058f277b9e5ba08aede0863ee8a048937a7cd | [] | no_license | PirateKing19902016/Scilab-Spoken-Tutorials | b7927e196acbefa47abdbdeb326d37385d5cbc34 | a110fc425c123f7041cb9ee8eca42ce08619ae60 | refs/heads/master | 2021-05-02T06:14:37.089440 | 2018-02-09T16:23:27 | 2018-02-09T16:23:27 | 120,855,481 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 850 | sci | Lagrange.sci |
// *******************************************************************
// Lagrange Interpolation for the given data: ****
// (x1, f1), (x2, f2), (x3, f3), ......(xn, fn) ****
// NPDE-TCA UG-Level workshop at IMA Bhubaneshwar ****
// By Manas,FOSSEE,IITB ****
//********************************************************************
function y = Lagrange(x0, x,f, n)
m = n + 1;
N = ones(1,m);
D = N;
C = N;
y = 0.0;
for j = 1:m
for k = 1:m
if (k<>j) then
N(j) = N(j)*(x0 - x(k))
D(j) = D(j)*(x(j) - x(k))
end
end
L(j) = N(j)/D(j);
y = y + L(j)*f(j);
end
disp(L','L')
disp(f,'f(x)')
endfunction
|
a7c288588a12be8c76b5e16e794f5006d75f1be2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1754/CH1/EX1.12/Exa1_12.sce | 76e5ef4ea45112b1a4fd9514ef1f692b2efa8bea | [] | 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 | 271 | sce | Exa1_12.sce | //Exa 1.12
clc;
clear;
close;
//Given data
format('v',6);
C1=21;//in pF
V1=4;//in volt
V2=9;//in volt
disp("C is proportional to 1/sqrt(V)");
disp("So, C2/C1=sqrt(V1/V2)");
C2=sqrt(V1/V2)*C1;//in pF
disp(C2,"At reverse bias 9V, Diode capacitance in pF : ");
|
db3ee8cc1b1e2f6b4793a050ebdb129adf3eb5b3 | 92074377d2c131cb9b55fc3babf541cab2c3c38b | /Statistika/FungsiPeluang.sce | ff01c484f77306c8006e0ae0c4310d67e9d26859 | [] | no_license | LinggaWahyu/BelajarScilab | 05f6173e0cad24d3d13bb324c6470bd87a4269cf | ea45563c3048f4f4f229ad1306245591fcb83e52 | refs/heads/master | 2020-07-31T10:41:28.629143 | 2019-10-24T23:12:17 | 2019-10-24T23:12:17 | 210,577,295 | 3 | 3 | null | 2019-10-24T23:12:18 | 2019-09-24T10:38:10 | Scilab | UTF-8 | Scilab | false | false | 124 | sce | FungsiPeluang.sce | function [fx] = FungsiD(x)
M = sum(x);
[m, n] = size(x);
for i = 1 : n
fx(i) = (x(i)) / M
end
endfunction
|
d7b1bbdb6abcda6db21edbb8b7db4c5954035b11 | 449d555969bfd7befe906877abab098c6e63a0e8 | /40/CH9/EX9.8b/Exa_9_8b.sce | fc27bc3d65e1399d91a5c6a4a1491a842dee44b7 | [] | 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 | 518 | sce | Exa_9_8b.sce | //Bilinear transformation
//To convert twin-T notch analog filter to digital filter
s=%s;
z=%z;
HS=(s^2+1)/(s^2+4*s+1);
Wo=1;
S=240;f=60;//sampling and analog frequencies
W=0.5*%pi;//digital frequency
C=Wo/tan(0.5*W)
HZ=horner(HS,C*(z-1)/(z+1))
f=0:120;
HZ1=abs(horner(HZ,exp(-%i*%pi*f'/120)));
HS1=abs(horner(HS,(%i*f'/60)));
a=gca();
a.x_location="origin";
plot2d(f,HZ1);
plot2d(f,HS1);
xlabel('Analog Frequency f[kHZ]');
ylabel('Magnitude');
xtitle('Notch filter H(S) and digital filter H(z)');
|
e54c74f49eccfbe3ff523a26a74d4a927515f359 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3831/CH8/EX8.2/Ex8_2.sce | 1cdd31febf92df60705076c22f8ffd5966448f1e | [] | 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 | 344 | sce | Ex8_2.sce | // Example 8_2
clc;funcprot(0);
// Given data
Q_solar=100*10^3;// Btu/h
T_river=40+459.67;// R
T_collector=200+459.67;// R
// Calculation
W_e_rev=(Q_solar*(1-(T_river/T_collector)))/3412;// kW
printf("\nThe maximum steady state electrical power (in kW) that can be produced by this power plant,(W_electrical)_rev=%1.2f kW",W_e_rev);
|
a0f119fe9d2ebf3c701ba7a3b87a281e222ae69b | 953cef8e16ff989ca373ddfc0f3f91d56fa4a5ef | /delta_mod.sce | e597c1fa0f6ba2245bf6646cbef8c0ba74f5a700 | [] | no_license | anarutesc/STD_P2 | ceda2571ae8713ffc701447881fe9f3cb55c6416 | 100ec1213a9dbc71c64cb638db3d1432eb5fb0e4 | refs/heads/master | 2020-04-10T11:18:30.524541 | 2018-12-20T00:12:53 | 2018-12-20T00:12:53 | 160,989,402 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 307 | sce | delta_mod.sce | function [x_q, s_q] = delta_mod(sinal,delta)
e(1) = 0;
e_q(1) = delta*sign(e(1));
x_q(1) = 0;
for k=1:length(sinal)
e(k+1) = sinal(k) - x_q(k);
e_q(k+1) = delta*sign(e(k));
x_q(k+1) = x_q(k) + e_q(k);
end
s_q = e_q./delta;
endfunction
|
a741cfd64c6b36bbc86834976957b9e2b172f083 | 449d555969bfd7befe906877abab098c6e63a0e8 | /557/CH24/EX24.1/1.sce | 122b7e51d518de09efbbc47fbdd0bb07eae73da7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 2,005 | sce | 1.sce | clc; funcprot(0);
//Example 24.1
//Initializing the variables
H_at = 10.3;
Hs = 1.5;
Hd = 4.5;
Ls = 2;
Ld = 15;
g = 9.81;
Ds = 0.4; // Diameter of stroke
Db = 0.15; // Diameter of bore
Dd = 0.05; // Diameter of discharge and suction pipe
nu = 0.2;
f = 0.01;
abs_pump_pressure = 2.4;
//Calculations
A = %pi*(Db)^2/4;
a = %pi*(Dd)^2/4;
r = Ds/2;
W = 2*%pi*nu;
Hsf = 0;
function[y] = H_suck(n) // n for checking the sign of Hsi = 4fl/2dg *(vA/a)^2
y = H_at - Hs +(-1)^n*(L/g)*(A/a)*W^2*r;
endfunction
function[y] = H(n,DischargeOrSuction)// n for checking the sign of Hsi = 4fl/2dg *(vA/a)^2, for suction 1 and for discharge2
if(DischargeOrSuction == 1) then
y = H_at - Hs +(-1)^n*(Ls/g)*(A/a)*W^2*r;
elseif(DischargeOrSuction == 2) then
y = H_at + Hd +(-1)^n*(Ld/g)*(A/a)*W^2*r;
else disp("There is something wrong :")
end
endfunction
function[y] = H_mid(DischargeOrSuction,uA)// n for checking the sign of Hsi = 4fl/2dg *(vA/a)^2, for discharge 1 and for suction 2
if(DischargeOrSuction == 1) then
Hsf = 4*f*Ls/(2*Dd*g)*(uA/a)^2;
y = H_at - Hs - Hsf;
elseif(DischargeOrSuction == 2) then
Hsf = 4*f*Ld/(2*Dd*g)*(uA/a)^2;
y = H_at + Hd + Hsf;
else disp("There is something wrong :")
end
endfunction
Hs_start = H(1,1); // Inertia head negative hence n = 1
Hs_end = H(2,1); // Inertia head positive hence n = 2
Hd_start = H(1,2);
Hd_end = H(2,2);
u = W*r;
Hs_mid = H_mid(1,u*A);
slip = 0.04;
Hd_mid = H_mid(2,u*A);
suction = [Hs_start Hs_end Hs_mid];
discharge = [Hd_start Hd_end Hd_mid];
header = [" Start(m)"," End(m)"," Mid(m)"];
W_max = sqrt((abs_pump_pressure - H_at + Hs)*(g/Ls)*(a/A)*(1/r));
W_max_rev = W_max/(2*%pi)*60; // maximum rotation speed in rev/min
disp(W_max_rev,"Drive speed for s eperation (rev/min) :","!----Part(c)----1",discharge,header,"!----Part(b)----! Head at",suction,header,"!----Part(a)----! Head at"); |
3e0dda2bfdc04104bb2abf875053710d0eda4ec5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1553/CH21/EX21.1/21Ex1.sce | 629325463fc1d9e61d212e9dc6310e52df5d5f18 | [] | 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 | 145 | sce | 21Ex1.sce | //chapter 21 Ex 1
clc;
clear;
close;
p=68000; r=50/3; t=9/12;
sInterest=(p*r*t)/100;
printf("The simple interest is Rs. %d",sInterest);
|
02a7761b18943e77ee83d5cd81b37d51b4145581 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1026/CH6/EX6.19/Example6_19.sce | a25c278aa30f10f29b03f7b4c50f34d792dff308 | [] | 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 | 145 | sce | Example6_19.sce | //chapter6,Example6_19,pg 148
Ie=1*10^-3
Ib=0.04*10^-3
Ic=Ie-Ib
alpha=Ic/Ie
printf("current gain\n")
printf("alpha=%.2f",alpha) |
9ad6cddcbabab24ef8f1d880d703f40c9bc30cc4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2288/CH2/EX2.16.5/ex2_16_5.sce | a9a1fb1cd80ea01b48a14605aa887c8ca425649b | [] | 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 | 309 | sce | ex2_16_5.sce | // Exa 2.16.5
clc;
clear;
close;
format('e',8)
// Given data
At = 63.5;// atomic weight
d = 8.96;// in gm/cc
Miu_e = 43.28;// in cm^2/V.sec
N_A = 6.02*10^23;// in /gm mole
e = 1.6*10^-19;// in C
n = (N_A/At)*d;// in /cc
Rho = 1/(n*e*Miu_e);// in ohm-cm
disp(Rho,"The resistivity in ohm-cm is");
|
9549027ad4b5b29d45eebf921bd965bbc23f6d0a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2777/CH6/EX6.28/Ex6_28.sce | 264cf0587c81b48171a1bbd7149fa15f857678b8 | [] | 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,295 | sce | Ex6_28.sce |
// ELECTRICAL MACHINES
// R.K.Srivastava
// First Impression 2011
// CENGAGE LEARNING INDIA PVT. LTD
// CHAPTER : 6 : SYNCHRONOUS MACHINES
// EXAMPLE : 6.28
clear ; clc ; close ; // Clear the work space and console
// GIVEN DATA
V = 400; // Operating voltage of the Synchronous generator in Volts
f = 50; // Operating Frequency of the Synchronous generator in Hertz
xd = 12; // Direct axis reactances in Ohms
xq = 5; // Quadrature axis reactances in Ohms
delta = 15; // Power(Torque) angle in degree
p = 2; // Number of the poles
m = 3; // Number of the phase
// CALCULATIONS
v = V/sqrt(3); // Rated Phase Votage in Volts
Ns = (120*f)/p; // Operating speed in RPM
Ws = (2*%pi*f)/(p/2); // Synchronous speed in radians/s
T = (3*v^2*sind(2*delta)/(2*Ws))*((1/xq)-(1/xd)); // Developed Torque in Newton-meter
// DISPLAY RESULTS
disp("EXAMPLE : 6.28: SOLUTION :-");
printf("\n (a) Operating speed, Ns = %.f RPM \n",Ns)
printf("\n (b) Developed Torque , T = %.2f N-m \n",T)
|
c06e97093aded53634bc13813fcaef12f098bb10 | 0812f3bb6f3cc038b570df68ccee4275da04b11f | /models/complexity_1000/Applied_Thermodynamics_and_Engineering/CH5/EX5.4/5_4.sce | 36b8326a192115f4b497be4067d7a2a0b243ba02 | [] | no_license | apelttom/20-semester_PhD_thesis | edc0b55580bae9d364599932cd73cf32509f4b7a | ff28b115fcf5e121525e08021fa0c02b54a8e143 | refs/heads/master | 2018-12-26T22:03:38.510422 | 2018-12-14T20:04:11 | 2018-12-14T20:04:11 | 106,552,276 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 148 | sce | 5_4.sce | clc;
bore=5;//cm
stroke=7.5;//cm
V=(%pi/4)*5^2*7.5
V0=21.3;
tV=V+V0;
rv=tV/V0;
y=1.4;
eta=1-[rv^(1-y)];
disp("efficiency is:");
disp("%",eta*100)
|
d570d683987c660e954b5bab8794cbe68f898120 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3669/CH3/EX3.6/6.sce | 330997620f0fbb4ee92a01db6aec87c3a7a10bfa | [] | 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 | 6.sce | //Variable declaration
theta=90; //angle(degrees)
lamda=1.5; //wavelength(angstrom)
d=1.6; //spacing(angstrom)
//Calculation
theta=theta*%pi/180; //angle(radian)
n=2*d*sin(theta)/lamda; //order of diffraction
//Result
printf('order of diffraction is %0.3f \n',int(n)) |
0bf41967c29535101280e104fec03431e1964b88 | 1573c4954e822b3538692bce853eb35e55f1bb3b | /DSP Functions/allpasslp2bs/allpasslp2bs.sci | b225c7c2ae94a357da232bf63da47542974174b2 | [] | 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 | 2,859 | sci | allpasslp2bs.sci | function [AllpassNum,AllpassDen]= allpasslp2bs (Wo,Wt)
// Allpass filter for lowpass to bandstop transformation
//
//Calling Sequence:
//[AllpassNum,AllpassDen] = allpasslp2bs(Wo,Wt): returns the numerator, AllpassNum, and the denominator, AllpassDen, of the second-order allpass mapping filter for performing a real lowpass to real bandstop frequency transformation. This transformation effectively places one feature of an original filter, located at frequency -Wo, at the required target frequency location, Wt1, and the second feature, originally at +Wo, at the new location, Wt2. It is assumed that Wt2 is greater than Wt1. This transformation implements the "Nyquist Mobility," which means that the DC feature stays at DC, but the Nyquist feature moves to a location dependent on the selection of Wo and Wt.
//
//Input Parameters:
// Wo: Frequency value of the prototype filter
// Wt: Desired Frequencies for the target filter
//
//Output Parameters:
// AllpassNum: Numerator of mapping filer
// AllpassDen: Denominator of mapping filter
//Example: Design the allpass mapping filter changing the lowpass filter with cutoff frequency at Wo=0.65 to the real–valued bandstop filter with cutoff frequencies at Wt1=0.23 and Wt2=0.45.
//
// Wo = 0.65; Wt = [0.23 0.45];
// [AllpassNum, AllpassDen] = allpasslp2bs(Wo, Wt);
// [h, f] = freqz(AllpassNum, AllpassDen);
// plot(f/%pi,-angle(h)/%pi);
//
//Author: Shrenik Nambiar
//
//References: 1. Constantinides, A.G., "Spectral transformations for digital filters," IEEE® Proceedings, vol. 117, no. 8, pp. 1585-1590, August 1970.
// 2. Constantinides, A.G., "Design of bandpass digital filters," IEEE Proceedings, vol. 1, pp. 1129-1231, June 1969.
//
// Input Validation Statements
if argn(2) ~=2 then
error("Number of input arguments should be 2");
end
if argn(1)<1| argn(1)>2 then
error("Number of output arguments should be either 1 or 2");
end
if ~isscalar(Wo) | ~isreal(Wo) then
error("Wo must be real ,numeric and scalar");
end
if Wo<=0 | Wo>=1 then
error("Wo must lie between 0 and 1");
end
if length(Wt)~=2 | ~isreal(Wt) then
error("Wt must be real and numeric and must contain only 2 elements");
end
if Wt(1)<=0 | Wt(1)>=1 | Wt(2)<=0 | Wt(2)>=1 then
error("Wt must lie between 0 and 1");
end
//Calculating the numerator and denominator for the mapping filter
Wc = sum(Wt) / 2;
bw = max(Wt) - min(Wt);
al = cos(%pi*(Wo+bw)/2) / cos(%pi*(Wo-bw)/2);
be = cos(%pi*Wc) / cos(%pi*bw/2);
AllpassDen = [1 -be*(1+al) al];
AllpassNum = flipdim(AllpassDen,2);
endfunction
|
4dde1efa2118013ad334345fb59680d75fce8d3a | cb8badb7b62f46da3dd1b582c4186b5b2829d5af | /macros/Sources/CURVE_c.sci | d5c87f61dc1e891246573810ffee5d5ad16b691d | [
"MIT"
] | permissive | FOSSEE/xcos_on_cloud | e3cf7ff202a1628a875484774c87936fbd8696cf | e981d77e0c96ab5db0e01755a2531d878864266f | refs/heads/master | 2023-05-12T12:12:08.955522 | 2023-02-16T10:25:15 | 2023-02-16T10:25:15 | 99,215,141 | 12 | 31 | MIT | 2023-05-02T00:18:57 | 2017-08-03T09:24:23 | JavaScript | UTF-8 | Scilab | false | false | 39,684 | sci | CURVE_c.sci | // Scicos
//
// Copyright (C) INRIA - Masoud Najafi <masoud.najafi@inria.fr>
// Serge Steer <serge.steer@inria.fr> 1993
// Habib Jreij 1993
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// See the file ../license.txt
//
function [x,y,typ]=CURVE_c(job,arg1,arg2)
//** 07/01/2008 : Adapted fot Scilab 5.0 by Simone Mannori
x=[];
y=[];
typ=[];
select job
case "set" then
x = arg1;
model = arg1.model;
graphics = arg1.graphics;
exprs = graphics.exprs;
ok = %f;
SaveExit = %f;
while %t do
Ask_again = %f;
[ok,Method,xx,yy,PeriodicOption,graf,exprs] = scicos_getvalue("Spline data",["Spline"+...
" Method (0..7)";"x";"y";"Periodic signal(y/n)?";"Launch"+...
" graphic window(y/n)?"],list("vec",1,"vec",-1, ...
"vec",-1,"str",1,"str",1),exprs)
if ~ok then
break;
end
if PeriodicOption=="y" | PeriodicOption=="Y" then
PO=1;
else
exprs(4)="n";
PO=0;
end
mtd=int(Method);
if mtd<0 then
mtd=0
end;
if mtd>7 then
mtd=7;
end
METHOD = getmethod(mtd);
if ~Ask_again then
xx=xx(:);
yy=yy(:);
[nx,mx] = size(xx);
[ny,my]=size(yy);
if ~((nx==ny)&(mx==my)) then
messagebox("Incompatible size of [x] and [y]","modal","error");
Ask_again = %t;
end
end
if ~Ask_again then //+++++++++++++++++++++++++++++++++++++++
xy = [xx,yy];
[xy] = cleandata(xy); // just for sorting to be able to compare data before and after poke_point(.)
N= size(xy,"r");
exprs(5)="n";// exprs.graf='n'
if graf=="y" | graf=="Y" then //_______Graphic editor___________
ipar=[N;mtd;PO];
rpar=[];
if (winsid() == []) then
curwin = 0;
else
curwin = max(winsid())+1; //** prepare a brand new win
end
//** see below in this file; "poke_point" is very similar to "edit_curv"
[orpar,oipar,ok] = poke_point(xy,ipar,rpar); //** HERE WE ARE +++++++++++++++++++++++++++++++++++
if ~ok then
break;
end;// exit without save
// verifying the data change
N2=oipar(1);
xy2=[orpar(1:N2),orpar(N2+1:2*N2)];
New_methhod=oipar(2);
DChange=%f;
METHOD=getmethod(New_methhod);
if or(xy(:,1)<>xy2(:,1)) then,
DChange=%t;
end
if or(xy(1:N-1,2)<>xy2(1:N2-1,2)) then,
DChange=%t;
end
if (xy(N,2)<>xy2(N2,2) & (METHOD<>"periodic")) then,
DChange=%t;
end
if DChange then
exprs(2)=strcat(sci2exp(xy2(:,1)))
exprs(3)=strcat(sci2exp(xy2(:,2)))
end
exprs(1)=sci2exp(New_methhod);
if oipar(3)==1 then,
perop="y";
else,
perop="n";
end
exprs(4)=perop;
SaveExit=%t
else//_____________________No graphics__________________________
[Xdummy,Ydummy,orpar]=Do_Spline(N,mtd,xy(:,1),xy(:,2));
if (METHOD=="periodic") then // periodic spline
xy(N,2)=xy(1,2);
end
if (METHOD=="order 2" | METHOD=="not_a_knot"|METHOD=="periodic" | METHOD=="monotone"| METHOD=="fast" | METHOD=="clamped") then
orpar=[xy(:,1);xy(:,2);orpar];
else
if (METHOD=="zero order"|METHOD=="linear")
orpar=[xy(:,1);xy(:,2);]
end
end
exprs(1)=sci2exp(mtd);// pour le cas methode>7 | method<0
oipar=[N;mtd;PO]
SaveExit=%t
end //___________________________________________________________
end //++++++++++++++++++++++++++++++++++++++++++++++++++++++
if (SaveExit) then
xp=find(orpar(1:oipar(1))>=0);
if (xp<>[]) then
model.firing=orpar(xp(1)); //first positive event
else
model.firing=-1;
end
model.rpar=orpar
model.ipar=oipar
graphics.exprs=exprs;
x.model=model
x.graphics=graphics
break
end
end
case "define" then
model=scicos_model()
xx=[0, 1, 2];
yy=[10, 20, -30];
N=3;
Method=3;
PeriodicOption="y";
Graf="n"
model.sim=list("curve_c",4)
model.in=[]
model.out=1
model.rpar=[xx(:);yy(:)]
model.ipar=[N;Method;1]
model.blocktype="c"
model.dep_ut=[%f %t]
model.evtin=1
model.evtout=1
model.firing=0
exprs=[sci2exp(Method);sci2exp(xx);sci2exp(yy);PeriodicOption;Graf]
gr_i=[]
x=standard_define([2 2],model,exprs,gr_i)
end
endfunction
function [rpar,ipar,ok] = poke_point(ixy,iparin,rparin)
[lhs,rhs]=argn(0)
//** get_click is already defined in "editi_curv"
//in line definition of get_click
deff("[btn,xc,yc,win,Cmenu]=get_click(flag)",[
"if ~or(winsid() == curwin) then Cmenu = ''Quit'';return,end,";
"if argn(2) == 1 then";
" [btn, xc, yc, win, str] = xclick(flag);";
"else";
" [btn, xc, yc, win, str] = xclick();";
"end;";
"if btn == -1000 then";
" if win == curwin then";
" Cmenu = ''Quit'';";
" else";
" Cmenu = ''Open/Set'';";
" end,";
" return,";
"end";
"if btn == -2 then";
" xc = 0;yc = 0;";
" try " // added to handle unwanted menu actions in french version
" execstr(''Cmenu='' + part(str, 9:length(str) - 1));";
" execstr(''Cmenu='' + Cmenu);";
" catch"
" Cmenu=[]"
" end "
" return,";
"end";
"Cmenu=[]"])
ok = %f
if rhs==0 then
ixy=[];
end;
if size(xy,"c")<2 then
xinfo(" No [y] is provided");
return
end
[xy] = cleandata(ixy)
N = size(xy,"r");
if rhs<=1 then
NOrder = 1;
PeridicOption = 0;
ipar = [N;NOrder;PeridicOption]
rpar = []
else
if rhs==2 then
NOrder = iparin(2);
PeridicOption = iparin(3);
ipar = iparin;
rpar = [];
else
if rhs==3 then
NOrder = iparin(2);
PeridicOption = iparin(3);
ipar = iparin;
rpar = rparin
end
end //** ???
end //** ???
Amp=[];
wp=[];
phase=[];
offset=[];
np1=[];
Sin_exprs = list(string(Amp),string(wp), string(phase),string(offset),string(np1));
sAmp=[];
sTp=[];
sdelay=[];
Sawt1_exprs = list(string(sAmp),string(sTp),string(sdelay));
sAmp2=[];
sTp2 = [];
Sawt2_exprs = list(string(sAmp2),string(sTp2));
Amp3=[];
Tp3=[];
Pw3=[];
Pd3=[];
Bias3=[];
Pulse_exprs=list(string(Amp3), string(Tp3),string(Pw3),string(Pd3),string(Bias3))
mean4=[];
var4=[];
seed4=[];
sample4=[];
np4=[];
random_n_exprs=list(string(mean4),string(var4), string(seed4),string(sample4),string(np4))
min5=[];
max5=[];
seed5=[];
sample5=[];
np5=[];
random_u_exprs=list(string(min5), string(max5), string(seed5),string(sample5),string(np5))
// bornes initiales du graphique
xmx = max(xy(:,1));
xmn=min(xy(:,1)),
xmn=max(xmn,0);
ymx = max(xy(:,2));
ymn=min(xy(:,2));
dx = xmx-xmn;
dy = ymx-ymn
if dx==0 then
dx=max(xmx/2,1),
end;
xmx = xmx+dx/50;
if dy==0 then
dy=max(ymx/2,1),
end;
ymn = ymn-dy/50;
ymx = ymx+dy/50;
rect = [xmn,ymn;xmx,ymx];
// initial draw
f = scf(curwin);
menu_r = [];
menu_s = [];
menu_o = ["zero order","linear","order 2","not_a_knot","periodic","monotone","fast","clamped"]
menu_d = ["Clear","Data Bounds","Load from text file","Save to text file","Load from Excel","Periodic signal"]
menu_t=["sine","sawtooth1","sawtooth2","pulse","random normal","random uniform"]
menu_e=["Help","Exit without save","Save/Exit"]
MENU=["Autoscale","Spline","Data","Standards","Exit"];
menus = list(MENU,menu_s,menu_o,menu_d,menu_t,menu_e);
scam="menus(1)(1)"
w="menus(3)(";
r=")";
Orderm=w(ones(menu_o))+string(1:size(menu_o,"*"))+r(ones(menu_o))
w="menus(4)(";
r=")";
Datam=w(ones(menu_d))+string(1:size(menu_d,"*"))+r(ones(menu_d))
w="menus(5)(";
r=")";
Standm=w(ones(menu_t))+string(1:size(menu_t,"*"))+r(ones(menu_t))
w="menus(6)(";
r=")";
Exitm=w(ones(menu_e))+string(1:size(menu_e,"*"))+r(ones(menu_e))
execstr("Autoscale_"+string(curwin)+"=scam")
execstr("Spline_"+string(curwin)+"=Orderm")
execstr("Data_"+string(curwin)+"=Datam")
execstr("Standards_"+string(curwin)+"=Standm")
execstr("Exit_"+string(curwin)+"=Exitm")
addmenu(curwin,MENU(1))
addmenu(curwin,MENU(2),menu_o)
addmenu(curwin,MENU(3),menu_d)
addmenu(curwin,MENU(4),menu_t)
addmenu(curwin,MENU(5),menu_e)
//===================================================================
drawlater();
a = gca();
a.data_bounds = rect;
a.axes_visible = "on";
a.clip_state = "on";
xtitle( "", "time", "Output" ) ;
a.title.font_size=2;
a.title.font_style=4;
a.title.foreground=2;
a.grid=[2 2];
xpolys(xy(:,1),xy(:,2),[-1]); //children(2)
xpolys(xy(:,1),xy(:,2),[5]); //children(1)
splines = a.children(1).children
points = a.children(2).children
//---------------------------------------
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
drawnow();
// -- boucle principale
lines(0);
while %t then //=================================================
N = size(xy,"r");
[btn,xc,yc,win,Cmenu] = get_click(); //** see
if ((win>0) & (win<>curwin)) then
Cmenu="Mouse click is Offside!";
end
if Cmenu==[] then
Cmenu="edit",
end
if (Cmenu=="Exit") |(Cmenu=="Quit" ) then,
ipar=[];
rpar=[];
ok=%f;
return;
end
//-------------------------------------------------------------------
if ((Cmenu=="zero order") | (Cmenu=="linear") | (Cmenu=="order 2")| ...
(Cmenu=="not_a_knot")| (Cmenu=="periodic")| (Cmenu=="monotone")| ...
(Cmenu=="fast")| (Cmenu=="clamped")) then
select Cmenu
case "zero order" then
NOrder=0;
case "linear" then
NOrder=1;
case "order 2" then
NOrder=2;
case "not_a_knot" then
NOrder=3;
case "periodic" then
NOrder=4;
case "monotone" then
NOrder=5;
case "fast" then
NOrder=6;
case "clamped" then
NOrder=7;
end
ipar(2)=NOrder;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
end
//-------------------------------------------------------------------
select Cmenu
case "Data Bounds" then
rectx=findrect(a);
[mok, xmn1, xmx1, ymn1, ymx1] = scicos_getvalue("Enter new bounds",["xmin";"xmax"; "ymin";"ymax"], ..
list("vec", 1,"vec", 1,"vec", 1,"vec", 1), string(rectx(:)))
//drawlater();
if mok then
if (xmn1 > xmx1 | ymn1 > ymx1) then
xinfo("Incorrect bounds")
mok=%f;
end
if xmn1<0 then
xinfo("X should be positive")
mok=%f;
end
if mok then
a.data_bounds=[xmn1, ymn1; xmx1, ymx1];
end
end
//drawnow();
//-------------------------------------------------------------------
case "Autoscale" then
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
//-------------------------------------------------------------------
case "Periodic signal" then
if PeridicOption==1 then,
ans0="y",
else,
ans0="n",
end;
[mok,myans]=scicos_getvalue("Generating periodic signal",["y/n"],list("str",1),list(ans0));
if ((myans=="y")|(myans=="Y")) then,
PeridicOption=1,
else,
PeridicOption=0;
end;
ipar(3)=PeridicOption;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
//-------------------------------------------------------------------
case "sine" then
[mok,Amp,wp,phase,offset,np1,Sin_exprs2]=scicos_getvalue(" Sine parameters", ...
["Amplitude";"Frequency(rad/sec)"; ...
"Phase(rad)";"Bias";"number of points"],list("vec",1,"vec",1,"vec",1, ...
"vec",1,"vec",1),Sin_exprs)
if np1< 2 then
np1=2;
end
if mok & wp>0 then
NOrder=3;
ipar(2)=NOrder;
phase=atan(tan(phase));
xt=linspace(0,%pi*2/wp,np1)';
yt=Amp*sin(wp*xt+phase)+offset;
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
Sin_exprs=Sin_exprs2
end
//-------------------------------------------------------------------
case "sawtooth1" then
[mok,sAmp,sTp,sdelay,Sawt1_exprs2]=scicos_getvalue("Sawtooth signal parameters", ...
["Amplitude";"Period";"delay"], ...
list("vec",1,"vec",1,"vec",1),Sawt1_exprs)
if mok & sTp>0 then
NOrder=1;
ipar(2)=NOrder;
if sdelay<sTp then
xt=[0;sdelay;sTp];
yt=[0;0;sAmp];
else
xt=[0];
yt=[0];
end
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar);
Sawt1_exprs=Sawt1_exprs2
end
//-------------------------------------------------------------------
case "sawtooth2" then
[mok,sAmp2,sTp2,Sawt2_exprs2]=scicos_getvalue("Sawtooth signal parameters", ...
["Amplitude";"Period"],list("vec",1,"vec",1),Sawt2_exprs)
if mok & sTp2>0 then
NOrder=1;
ipar(2)=NOrder;
xt=[0;sTp2];
yt=[sAmp2;-sAmp2];
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar);
Sawt2_exprs=Sawt2_exprs2
end
//-------------------------------------------------------------------
case "pulse" then
[mok,Amp3,Tp3,Pw3,Pd3,Bias3,Pulse_exprs2] = scicos_getvalue("Square wave pulse signal", ...
["Amplitude";"Period (sec)";"Pulse width(% o"+...
"f period)";"Phase delay (sec)";"Bias"],list("vec",1, ...
"vec",1,"vec",1,"vec",1,"vec",1),Pulse_exprs);
if mok & Tp3>0 then
NOrder=0;
ipar(2)=NOrder;
if (Pd3>0) then
xt=0;
yt=Bias3;
else
xt=[];
yt=[];
end
//otherwise there would be double points at 0
if Pd3<Tp3 then
if Pw3>0 then
xt=[xt;Pd3; Pw3*Tp3/100+Pd3;Tp3];
yt=[yt;Amp3+Bias3;Bias3;Bias3];
else
xt=[0;Tp3];yt=[Bias3;Bias3];
end
else
xt=[0;Tp3];yt=[Bias3;Bias3];
end
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar);
Pulse_exprs=Pulse_exprs2;
end
//-------------------------------------------------------------------
case "random normal" then
[mok,mean4,var4,seed4,sample4,np4,random_n_exprs2]=scicos_getvalue("Normal (Gaussian) random signal", ...
["Mean";"Variance";"Initial seed";"Sample time";"Number of points"],list("vec",1, ...
"vec",1,"vec",1,"vec", ...
1,"vec",1),random_n_exprs)
if mok & sample4>0 then
NOrder=0;
ipar(2)=NOrder;
rand("normal");
rand("seed",seed4);
xt=0:sample4:sample4*(np4-1);
xt=xt(:);
yt=mean4+sqrt(var4)*rand(np4,1);
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar);
random_n_exprs2=random_n_exprs;
end
//-------------------------------------------------------------------
case "random uniform" then
[mok,min5,max5,seed5,sample5,np5,random_u_exprs2]=scicos_getvalue("Uniform random signal", ...
["Minimum";"Maximum";"Initial seed";"Sample time";"Number of points"],list("vec",1, ...
"vec",1,"vec",1,"vec", ...
1,"vec",1),random_u_exprs)
if mok & sample5>0 then
NOrder=0;
ipar(2)=NOrder;
rand("uniform");
rand("seed",seed5);
xt=0:sample5:sample5*(np5-1);
xt=xt(:);
yt=min5+(max5-min5)*rand(np5,1);
xy=[xt,yt];
[rpar,ipar]=AutoScale(a,xy,ipar,rpar);
random_u_exprs2=random_u_exprs;
end
//-------------------------------------------------------------------
case "Save/Exit" then
NOrder=ipar(2);
PeridicOption=ipar(3);
METHOD=getmethod(NOrder);
if (METHOD=="periodic") then // periodic spline
xy(N,2)=xy(1,2);
end
if (METHOD=="order 2" | METHOD=="not_a_knot"|METHOD=="periodic" | METHOD=="monotone"| METHOD=="fast" | METHOD=="clamped") then
rpar=[xy(:,1);xy(:,2);rpar];
else
if (METHOD=="zero order"|METHOD=="linear")
rpar=[xy(:,1);xy(:,2);]
end
end
ok=%t
delete(f);
return
//-------------------------------------------------------------------
case "Exit without save" then
ipar=[];
rpar=[];
ok=%f
delete(f);
return
//-------------------------------------------------------------------
case "Clear" then
xy=[0,0];
NOrder=0;
ipar(2)=NOrder;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
//----------------------------------------------------------------
case "Edit text data NOT IN USE" then
// editvar xy;
[mok,xt,yt]=scicos_getvalue("Enter x and y data",["x";"y"],list("vec",-1,"vec",-1),list(strcat(sci2exp(xy(:,1))),strcat(sci2exp(xy(:,2)))));
if mok then,
xy=[xt,yt];
[xy]=cleandata(xy),
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
end
//---------------------------------------------------------------
case "Help" then
t1="Mouse-left click: adding a new point"
t2="Mouse-right click: remove a point"
t3="Mouse-left double click: edit a point''s coordinates"
t4="Mouse-left button press/drag/release: move a point"
t5="Change the window size: ''Data'' menu -> ''Databounds''"
messagebox([t1;t2;t3;t4;t5],"modal","info");
//---------------------------------------------------------------
case "Load from Excel" then
[tok,xytt]=ReadExcel()
if tok then
xy=xytt;
NOrder=1
ipar(2)=NOrder;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
end
//---------------------------------------------------------------
case "Load from text file" then
[tok,xytt]=ReadFromFile()
if tok then
xy=xytt;
NOrder=1
ipar(2)=NOrder;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
end
//---------------------------------------------------------------
case "Save to text file" then
[sok]=SaveToFile(xy)
//---------------------------------------------------------------
case "Replot" then
if xy<>[] then
drawlater();
points.data=xy;
[rpar,ipar]=drawSplin(a,xy,ipar,rpar);
drawnow()
end
//----------------------------------------------------------
case "edit" then
HIT=%f
if N<>0 then
xt=xy(:,1);
yt=xy(:,2);
dist=((xt-ones(N,1)*xc))^2+((yt-ones(N,1)*yc))^2
[dca,k]=min(dist);
rectx=a.data_bounds;
ex=abs(rectx(2,1)-rectx(1,1))/80;
ey=abs(rectx(2,2)-rectx(1,2))/80;
if (abs(xc-xt(k))<ex & abs(yc-yt(k))<ey) then
HIT=%t
end
end
//_________________________
// if ~((NOrder==-1|NOrder==-2|NOrder==-3|NOrder==-4)) then
if (~HIT)&(btn==0 | btn==3) then // add point
if (xc>=0) then
if (xc==0) then
zz=find(x==0);
xy(zz,:)=[];
end
xy=[xy;xc,yc];
[xtt,k2]=gsort(xy(:,1),"r","i");xy=xy(k2,:)
drawlater();
points.data=xy;
[rpar,ipar]=drawSplin(a,xy,ipar,rpar);
drawnow();
end
end
if (HIT)&(btn==2 | btn==5) then // remove point
if (xy(k,1)>0) |( xy(k,1)==0 & (size(find(xy(:,1)==0),"*")>1)) then
xy(k,:)=[];
end
drawlater();
points.data = xy;
[rpar,ipar] = drawSplin(a,xy,ipar,rpar);
drawnow();
end
if (HIT)&(btn==0) then // move point
[xy,rpar,ipar] = movept(a,xy,ipar,rpar,k)
end
if (HIT)&(btn==10) then // change data:: double click
[mok,xt,yt]=scicos_getvalue("Enter new x and y",["x";"y"],...
list("vec",1,"vec",1),list(sci2exp(xy(k,1)),sci2exp(xy(k,2))));
if mok then
xy(k,:) = [xt,yt];
[xy] = cleandata(xy)
drawlater();
points.data=xy;
[rpar,ipar]=AutoScale(a,xy,ipar,rpar)
drawnow()
end
end
// end
//_________________________________
end
//----------------------------------------------------------
end
endfunction
//========================================================================
function [orpar,oipar] = drawSplin(a,xy,iipar,irpar)
N=size(xy,"r");// new size of xy
x=xy(:,1);
y=xy(:,2);
points=a.children(2).children
splines=a.children(1).children
order=iipar(2);
periodicoption=iipar(3);
orpar=irpar;
METHOD=getmethod(order);
if periodicoption==1 then
PERIODIC="periodic, T="+string(x(N)-x(1));
else
PERIODIC="aperiodic";
end
a.title.text=[string(N)+" points, "+"Method: "+METHOD+", "+PERIODIC];
if (N==0) then,
return;
end
if (N==1) then,
order=0;
end
// NP=50;// number of intermediate points between two data points
[X,Y,orpar]=Do_Spline(N,order,x,y);
if (periodicoption==1) then
X=[X;X($)];
Y=[Y;Y(1)];
else
xmx=max(points.data(:,1)); xmn=min(points.data(:,1));
XMX=max(0,xmx);
XMN=max(0,xmn);
xmx1=max(a.x_ticks.locations)
XMX=max(XMX,xmx1);
X=[X;XMX];
Y=[Y;Y($)];
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
splines.data=[X,Y];
oipar=[N;iipar(2);periodicoption]
endfunction
//=============================================================
function [xyt,orpar,oipar]=movept(a,xy,iipar,irpar,k)
//on bouge un point existant
points=a.children(2).children
splines=a.children(1).children
oipar=iipar
orpar=irpar
order=iipar(2);
x=xy(:,1);
y=xy(:,2);
if (x(k)==0) then
zz=find(x==0);
x(zz)=[];
y(zz)=[];
ZERO_POINT=%t
else
x(k)=[];
y(k)=[];
ZERO_POINT=%f
end
btn=-1
while ~(btn==3 | btn==0| btn==10| btn==-5)
rep=xgetmouse([%t %t]); xc=rep(1);yc=rep(2);btn=rep(3);
if (ZERO_POINT) then
xc=0;
else
if (xc<=0) then
zz=find(x==0);
x(zz)=[];
y(zz)=[];
ZERO_POINT=%t;
xc=0;
end
end
xt=[x;xc];
yt=[y;yc];
[xt,k2]=gsort(xt,"r","i");yt=yt(k2)
xyt=[xt,yt];
drawlater();
points.data=xyt;
[orpar,oipar]=drawSplin(a,xyt,oipar,orpar);
drawnow()
end
endfunction
//==========================================================
function rectx = findrect(a)
splines=a.children(1).children
points=a.children(2).children
if (points.data==[]) then
rectx=a.data_bounds;
return;
end
ymx1=max(splines.data(:,2));
ymn1=min(splines.data(:,2))
xmx=max(points.data(:,1));
xmn=min(points.data(:,1));
ymx=max(points.data(:,2));
ymn=min(points.data(:,2));
XMX=max(0,xmx);
XMN=max(0,xmn);
YMX=max(ymx,ymx1);
YMN=min(ymn,ymn1);
dx=XMX-XMN;
dy=YMX-YMN
if dx==0 then
dx=max(XMX/2,1),
end;
XMX=XMX+dx/50
if dy==0 then
dy=max(YMX/2,1),
end;
YMN=YMN-dy/50;
YMX=YMX+dy/50;
rectx=[XMN,YMN;XMX,YMX];
endfunction
//============================================================
function [tok,xyo]=ReadExcel()
TA=["A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P"; ...
"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z";"a";"b";"c";"d";"e";"f"; ...
"g";"h";"i";"j";"k";"l";"m";"n";"o";"p";"q";"r";"s";"t";"u";"v"; ...
"w";"x";"y";"z"];
TN=["0","1","2","3","4","5","6","7","8","9"];
xyo=[];
tok=%f;
while %t
[zok,filen,sheetN,xa,ya]=scicos_getvalue("Excel data file ",["Filename";"Sheet #"+...
" ";"X[start:Stop]";"Y[start:stop]"],list("str",1, ...
"vec",1,"str",1, ...
"str",1), ...
list(["Classeur1.xls"],["1"],["C5:C25"],["D5:D25"]));
if ~zok then
break,
end
try
[fd,SST,Sheetnames,Sheetpos] = xls_open(filen);
catch
xinfo("Scicos cannot find the excel file:"+filen);
break;
end
try
N=size(Sheetnames,"*");
if ((sheetN<=N) &(sheetN>0)) then
[Value,TextInd] = xls_read(fd,Sheetpos(sheetN))
mclose(fd)
end
xa=strsubst(xa," ","");
px=strindex(xa,":");
ya=strsubst(ya," ","");
py=strindex(ya,":");
x1=part(xa,1:px-1);
x2=part(xa,px+1:length(xa));
y1=part(ya,1:py-1);
y2=part(ya,py+1:length(ya));
x1p=min(strindex(x1,TN));
if x1p==[] then,
xinfo("Bad address in X:"+x1);
break,
end
x11=part(x1,1:x1p-1);
x12=part(x1,x1p:length(x1));
x2p=min(strindex(x2,TN));
if x2p==[] then,
xinfo("Bad address in X:"+x2);
break, end
x21=par
t(x2,1:x2p-1);
x22=part(x2,x2p:length(x2));
y1p=min(strindex(y1,TN));
if y1p==[] then,
xinfo("Bad address in Y:"+y1);
break,
end
y11=part(y1,1:y1p-1);
y12=part(y1,y1p:length(y1));
y2p=min(strindex(y2,TN));
if y2p==[] then,
xinfo("Bad address in Y:"+y2);
break,
end
y21=part(y2,1:y2p-1);
y22=part(y2,y2p:length(y2));
// x11 x12: x21 x22
lx11=length(x11);
lx21=length(x21);
ly11=length(y11);
ly21=length(y21)
xstC=0;
for i=1:lx11,
xstC=xstC+modulo(find(TA==part(x11,lx11-i+1)),26)*26^(i-1);
end
xenC=0;
for i=1:lx21,
xenC=xenC+modulo(find(TA==part(x21,lx21-i+1)),26)*26^(i-1);
end
ystC=0;
for i=1:ly11,
ystC=ystC+modulo(find(TA==part(y11,ly11-i+1)),26)*26^(i-1);
end
yenC=0;
for i=1:ly11,
yenC=yenC+modulo(find(TA==part(y21,ly21-i+1)),26)*26^(i-1);
end
xstR=evstr(x12);
xenR=evstr(x22);
ystR=evstr(y12);
yenR=evstr(y22);
[mv,nv]=size(Value)
if ~(xstR<=mv & xstR>0 & xenR<=mv & xenR>0&ystR<=mv & ystR>0¥R<=mv¥R>0 ) then
xinfo("error in Row data addresses");
break
end
if ~(xstC<=nv & xstC>0 & xenC<=nv & xenC>0&ystC<=nv & ystC>0¥C<=nv¥C>0 ) then
xinfo("error in Column data addresses");
break
end
xo=Value(min(xstR,xenR):max(xstR,xenR),min(xstC,xenC):max(xstC,xenC));
yo=Value(min(ystR,yenR):max(ystR,yenR),min(ystC,yenC):max(ystC,yenC));
[nx,mx]=size(xo);// adjusting the x and y size
[ny,my]=size(yo);
N=min(nx,ny);
xo=xo(1:N,:);
yo=yo(1:N,:);
xyo=[xo,yo];
[xyo]=cleandata(xyo)
tok=%t;
break,
catch
xinfo(" Scicos cannot read your Excel file, please verify"+...
" the parameters ");
break
end
end
endfunction
//---------------------------------------------------------------
function [xyo]=cleandata(xye)
xe=xye(:,1)
ye=xye(:,2)
[nx,mx]=size(xe);// adjusting the x and y size
[ny,my]=size(ye);
N=min(nx,ny);
xe=xe(1:N,:);
ye=ye(1:N,:);
// checking for NULL data
for i=1:N
if (xe(i)<>xe(i)) then
xinfo("x contains no data:x("+string(i)+")");
return;
end
if (ye(i)<>ye(i)) then
xinfo("Y contains no data:y("+string(i)+")");
return;
end
end
zz=find(xe<0);
xe(zz)=[];
ye(zz)=[]
if (find(xe==0)==[]) then // add zero point
xe($+1)=0;
ye($+1)=0;
end
[xo,k2]=gsort(xe,"r","i");
yo=ye(k2)
xyo=[xo,yo];
endfunction
//---------------------------------------------------------------
function [orpar,oipar] = AutoScale(a,xy,inipar,inrpar)
drawlater();
oipar = inipar
orpar = inrpar
points = a.children(2).children
splines = a.children(1).children
points.data = xy;
splines.data = xy;
[orpar,oipar] = drawSplin(a,xy,oipar,orpar);
rectx=findrect(a);
a.data_bounds = rectx;
drawnow()
endfunction
//============================
function METHOD = getmethod(order)
select order
case 0 then,
METHOD="zero order"
case 1 then,
METHOD="linear"
case 2 then,
METHOD="order 2"
case 3 then,
METHOD="not_a_knot"
case 4 then,
METHOD="periodic"
case 5 then,
METHOD="monotone"
case 6 then,
METHOD="fast"
case 7 then,
METHOD="clamped"
end
endfunction
//=======================================
function [sok,xye] = ReadFromFile()
xye=[];sok=%f;
while %t
[sok,filen,Cformat,Cx,Cy]=scicos_getvalue("Text data file ",["Filename";"Reading [C] f"+...
"ormat";"Abscissa column";"Output"+...
" column"],list("str",1,"str",1,"vec",1,"vec",1), ...
list(["mydatafile.dat"],["%g %g"],["1"],["2"]));
if ~sok then
break,
end
px=strindex(Cformat,"%");
NC=size(px,"*");
if NC==[] then,
xinfo("Bad format in reading data file");
sok=%f;
break;
end
Lx=[];
try
fd=mopen(filen,"r");
Lx=mfscanf(-1,fd,Cformat);
mclose(fd);
catch
xinfo("Scicos cannot open the data file: " + filen);
break;
end
[nD,mD] = size(Lx);
if ((mD==0) | (nD==0)) then,
xinfo("No data read");
sok=%f;
break;
end
if (mD<>NC) then,
xinfo("Bad format");
sok=%f;
break;
end
xe=Lx(:,Cx);
ye=Lx(:,Cy);
xye=[xe,ye];
[xye]=cleandata(xye)
sok=%t;
break,
end
endfunction
//=======================================
function [sok]=SaveToFile(xye)
xe=xye(:,1)
ye=xye(:,2)
sok=%f;
while %t
[sok,filen,Cformat]=scicos_getvalue("Text data file ",["Filename";"Writing [C] f"+...
"ormat"],list("str",1,"str",1), ...
list(["mydatafile.dat"],["%g %g"]));
if ~sok then
break,
end
px=strindex(Cformat,"%");
NC=size(px,"*");
if NC<>2 then,
xinfo("Bad format in writing data file");
sok=%f;
break;
end
Cformat=Cformat+"\n";
try
fd=mopen(filen,"w");
mfprintf(fd,Cformat,xe,ye);
mclose(fd);
catch
xinfo("Scicos cannot open the data file:"+filen);
break;
end
sok=%t;
break,
end
endfunction
//=========================================================
function [X,Y,orpar]=Do_Spline(N,order,x,y)
X=[];
Y=[];
orpar=[];
METHOD=getmethod(order);
if (METHOD=="zero order") then
X=x(1);
Y=y(1);
for i=1:N-1
X=[X;x(i);x(i+1);x(i+1)];
Y=[Y;y(i);y(i);y(i+1)];
end
return
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="linear") then
X=[];
for i=1:N
X=[X;x(i)];
Y=[Y;y(i)];
end
return
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (N<25) then
NP=10;
else
if (N<50) then
NP=5;
else
if (N<100) then
NP=2;
else
if (N<200) then
NP=1;
else
NP=0;
end;
end;
end;
end
for i=1:N-1
X=[X;linspace(x(i),x(i+1),NP+2)']; // pour tous sauf "linear" et "zero order"
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (N>2) & (METHOD=="order 2") then
Z=ORDER2(x,y);
A=Z(1:N-1);
B=Z(N:2*N-2);
C=Z(2*N-1:3*N-3);
for j=1:size(X,"*")
for i=N-1:-1:1
if X(j)>=x(i) then,
break;
end
end
Y(j)=A(i)*(X(j)-x(i))^2+B(i)*(X(j)-x(i))+C(i);
end
orpar=matrix(Z,-1,1)
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="not_a_knot") then
try
d = splin(x, y, METHOD);
Y = interp(X, x, y, d);
orpar=d(:);
catch
xinfo("ERROR in SPLINE: "+METHOD)
end
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="periodic") then
if y(1)<>y(N) then
y(N)=y(1)
end
try
d = splin(x, y,METHOD);
Y = interp(X, x, y, d);
orpar=d(:);
catch
xinfo("ERROR in SPLINE: "+METHOD)
end
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="monotone" ) then
try
d = splin(x, y, METHOD);
Y = interp(X, x, y, d);
orpar=d(:);
catch
xinfo("ERROR in SPLINE: "+METHOD)
end
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="fast") then
try
d = splin(x, y, METHOD);
Y = interp(X, x, y, d);
orpar=d(:);
catch
xinfo("ERROR in SPLINE: "+METHOD)
end
end
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
if (METHOD=="clamped") then
try
d = splin(x, y, METHOD,[0;0]);
Y = interp(X, x, y, d);
orpar=d(:);
catch
xinfo("ERROR in SPLINE: "+METHOD)
end
end
endfunction
//=================================================
function [Z]=ORDER2(x,y)
N=size(x,"*")-1;
A=zeros(3*N-1,N*3);
B=zeros(3*N-1,1);
for i=1:N
j=3*(i-1)+1;
A(j,i+2*N)=1;
B(j)=y(i);
A(j+1,i)=(x(i+1)-x(i))^2;
A(j+1,i+N)=x(i+1)-x(i);
A(j+1,i+2*N)=1;
B(j+1)=y(i+1);
end
for i=1:N-1
j=3*(i-1)+1;
A(j+2,i)=2*(x(i+1)-x(i));
A(j+2,i+N)=1;
A(j+2,i+N+1)=-1;
end
Q=zeros(3*N,3*N);
for i=1:N
Q(i,i)=4*(x(i+1)-x(i))^2
Q(i,i+N)=2*(x(i+1)-x(i))
Q(i+N,i)=2*(x(i+1)-x(i))
Q(i+N,i+N)=1;
end
At=[Q,A';A,zeros(3*N-1,3*N-1)]
Bt=[zeros(3*N,1);B]
Zt=At\Bt;
Z=Zt(1:3*N,1)
endfunction
//===================================================
|
3f003663ed346a4ee56d7f96f4501c6dfccd5c81 | 449d555969bfd7befe906877abab098c6e63a0e8 | /620/CH24/EX24.8/example24_8.sce | c380f382bfb661900017c3f2eeae1757451df0bf | [] | 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 | example24_8.sce | i=0.2;
v1=120;
f=60;
v2=95;
disp("Part a");
z1=v1/i;
x_l=sqrt(z1^2-r^2);
z2=v2/i;
x_c=x_l-sqrt(z2^2-r^2);
c=1/(2*%pi*f*x_c);
disp("the size of capacitance (in μF) needed is"); disp(c*10^6);
disp("Part b");
vc=i*x_c;
disp("voltage (in V) across capacitor is");disp(vc);
disp("Part c");
v=i*z1;
disp("voltage (in V) across solenoid is"); disp(v); |
337221528bfc5e99ee0a554c356fe2124919b4d3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1850/CH5/EX5.10/exa_5_10.sce | 6f418eee40fa0da4ccc5c424f40bb3c0df29b7fc | [] | 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 | 391 | sce | exa_5_10.sce | // Exa 5.10
clc;
clear;
close;
// Given data
Vin= 10;// in volt
R=2.2;// in k ohm
R=R*10^3;//in ohm
Ad=10^5;// voltage gain
T= 1;// in ms
T=T*10^-3;// in second
C=1;// in micro F
C=C*10^-6;// in F
I= Vin/R;// in volt
V= I*T/C;// in V
disp(V,"The output voltage at the end of the pulse in volt");
RC_desh= R*C*Ad;
disp(RC_desh,"The closed-loop time constant in second is");
|
2631f61e6acb9895e81aea486c7b793b9d14a783 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1472/CH25/EX25.4/25_4.sce | 6cfb670a5c3836b4e2365066916160f1a9d66683 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 517 | sce | 25_4.sce | clc
//initialization of varaibles
disp("From psychrometric charts,")
e=0.7
phi=0.5
g1=0.0131 //lb water/lb dry air
h1=32.36 //B/lb of dry air
g3=0.0073
h3=24.26
pg=0.3390
T3=528 //R
V3=1000
Rw=85.8
//calculations
pw3=phi*pg
ww3=pw3*144*V3/(Rw*T3)
wa3=ww3/g3
wa1=phi*wa3
wa2=phi*wa3
ww1=g1*wa1
ww2=ww3-ww1
g2=ww2/wa2
h2=(wa3*h3-wa1*h1)/wa2
tdb=61 //F
//results
printf("Air supplied = %.3f lb/min",ww2)
printf("\n temperature = %d F",tdb)
printf("\n Humidity = %.5f lb water/lb dry air",g2)
|
bcb5b71cdbdd8cfbbb74735d31b12a569f61225c | 449d555969bfd7befe906877abab098c6e63a0e8 | /767/CH4/EX4.5.8/Ch04Exa4_5_8.sci | 933e199f4011198390a12b7b5416a99259c95307 | [] | 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 | 462 | sci | Ch04Exa4_5_8.sci | // Scilab code Exa4.5.8: To determine the threshold energy for given reaction : P.no. 185 (2011)
// Na(11,23)+ n > F(9,20)+ He(2,4) is the reaction
M_Na_23 = 22.99097; // Mass of Na-23, amu
M_n_1 =1.00866 ; // Mass of n-1, amu
Q = -5.4; // Q-value, MeV
E_th = -Q*(M_Na_23+M_n_1)/M_Na_23; // Threshold energy, MeV
printf("\nThe threshold energy for the reaction : %4.2f MeV ", E_th)
// Result
// The threshold energy for the reaction : 5.64 MeV |
a77ac490415003753db4a33c8f4bc8301661ac1b | 449d555969bfd7befe906877abab098c6e63a0e8 | /2087/CH14/EX14.34/example14_34.sce | 00ea0eabf4d2817d7f341976b6de0c7bd4d2adb5 | [] | 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 | 358 | sce | example14_34.sce |
//example 14.34
//calculate concentration at point 10 cm above the bed
clc;funcprot(0);
//given
D=2.8; //depth of flow
c_=700; //concentration at 30 cm below water surface
y=0.1;
a=D-0.3;
e=0.4; //exponent in rouse equation;
c=c_*(a*(D-y)/(y*(D-a)))^e;
mprintf("concentration at point 10 cm above the bed=%i ppm.",c);
|
38a7e43565e9d8275f011063d5ec59016d7060ba | 6e257f133dd8984b578f3c9fd3f269eabc0750be | /ScilabFromTheoryToPractice/CreatingPlots/testplotf.sce | 92eec0d7b4c9e9bf899aa680b84fc871b10b54f0 | [] | 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 | 87 | sce | testplotf.sce | function y=f(x)
y=-sin(x^2)/x
endfunction
x=[0.001:0.02:2*%pi];
clf;
plot(x,f,"r")
|
f93edefff7ae249e68b9ea9a30fbd02546b915fa | efba0810ec7227f4fe228c95563e792b0b9eee9c | /demos/scatterly_sin.dem.sce | 859dfb4f32c8997fe6f189255db471ff6148dd82 | [] | no_license | mstroehle/Plotly | 99d626c68ddb65f388034fa4e24b276d04a7cfec | e360ffcae3639471e72e4ee742878443e9072737 | refs/heads/master | 2023-03-23T09:13:19.890260 | 2020-04-21T16:34:29 | 2020-04-21T16:34:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 147 | sce | scatterly_sin.dem.sce | function demo_scatterly_sin()
x=[0:0.1:2*%pi];
y=2*sin(x);
scatterly(x,y)
endfunction
demo_scatterly_sin();
clear demo_scatterly_sin;
|
811d59e90d4437898a33a723c873b52d860ebdda | 449d555969bfd7befe906877abab098c6e63a0e8 | /3760/CH4/EX4.85/Ex4_85.sce | f8a4ca7d2dad9303308cb35fd9b8098f9d149db8 | [] | 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 | 557 | sce | Ex4_85.sce | clc;
g1=1.5; // gain factor of amplifier
g2=80; // gain factor of generator
vo=250; // output voltage at no load
s=0.2; // feedback potentiometer setting
// for generated voltage= 80V field current is 1 A
ifl=vo/g2; // field current for generated voltage= 250V
vi=ifl/g1; // amplifier input voltage for field current corresponding to generated voltage= 250V
vfb=s*vo; // feedback voltage
vr=vfb+vi;
printf('Reference voltage for given potentiometer setting is %f V\n',vr);
printf('When feedback setting is zero, reference voltage is %f V',vi);
|
edc54c3e3ec29a267edf04f943cf103c08b3892c | 449d555969bfd7befe906877abab098c6e63a0e8 | /569/CH4/EX4.5/4_5.sci | ec3685f0d869b032c26131eb427be12da637d422 | [] | 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 | 165 | sci | 4_5.sci | // Calculate the value of resistance after 15s
clc;
R0=29.44;
Rs=100;
t=15;
tc=5.5;
R_15=Rs+R0*[1-exp(-t/tc)];
disp(R_15,'value of resistance after 15s(ohm)') |
bb2cab249e0a52ace62e49bfcbbd59676d9d79e6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1967/CH4/EX4.2/4_2.sce | 2acbad8b94df60d764c241092c9d49d8083546a5 | [] | 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 | 186 | sce | 4_2.sce | clc
//initialisation of variables
clear
p1= 10 //atm
p2= 1 //atm
T1= 25 //C
n= 2/5
//CALCULATIONS
T2= (p1/p2)^n*(273+T1)-273
//RESULTS
printf ('Final temperature = %.f C',T2)
|
fad0895230cc455cfc9e474fe721c1ecc6f34d2b | 449d555969bfd7befe906877abab098c6e63a0e8 | /257/CH4/EX4.6/example_4_6.sce | 79a65b3d3b890ad52902fdd3dae96b2446b181a5 | [] | 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 | 78 | sce | example_4_6.sce | syms I R C s
V1=I*(R+1/(s*C))
V2=I*(1/(s*C))
disp(V2/V1,"V2/V1 = ")
|
760512abf51fbdd830b28f9461c065e0a09300f7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2417/CH11/EX11.26/Ex11_26.sce | 56f359ab616790d866e203fcbce7525c8304d12a | [] | 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,085 | sce | Ex11_26.sce | //scilab 5.4.1
clear;
clc;
printf("\t\t\tProblem Number 11.26\n\n\n");
// Chapter 11 : Heat Transfer
// Problem 11.26 (page no. 603)
// Solution
//From the table 11.7,
//For the oil side,a resistance(fouling factor) of 0.005 (hr*F*ft^2)/Btu can be used
//and for the water side,a fouling factor of 0.001 (hr*F*ft^2)/Btu can be used
//From problem 11.25,
U=40;//The coefficient of heat transfer of the unit //Unit:Btu/(hr*ft^2*F)
//therefore,
Roil=0.005; //unit:(hr*ft^2*F)/Btu //resistance at oil side
Rwater=0.001; //unit:(hr*ft^2*F)/Btu //resistance for water side
Rcleanunit=inv(U); //unit:(hr*ft^2*F)/Btu //resistance at clean unit
Roverall=Roil+Rwater+Rcleanunit; //unit:(hr*ft^2*F)/Btu //overall resistance
Uoverall=inv(Roverall); //Unit:Btu/(hr*ft^2*F) //The overall coefficient of heat transfer of the unit
//Because all the parameters are the same,the surface area required will vary inversely as U
A=569*(U/Uoverall); //A=569 ft^2 in the problem 11.25 //unit:ft^2 //The outside surface area
printf("The outside surface area required is %f ft^2",A);
|
144556a1bdf0757793af88adde8755c7821952b8 | 707d28b087c840493d2dedc9605e6efe3b12b238 | /load_data_from_file.sce | dc5d2e8412e140aa0363b2ff9309417b3727544a | [] | no_license | jahufford/scilab_scripts | c6403d3b37e7d26a988747577512f7d4e6eba748 | 2da481b39317e92e03dc3fe1de7bbefe59bc2526 | refs/heads/master | 2020-03-22T14:41:32.600224 | 2018-07-08T19:48:56 | 2018-07-08T19:48:56 | 140,197,889 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 76 | sce | load_data_from_file.sce | r = fscanfMat("/home/joe/programming/ruby/discrete_math/tickets_sold.dat");
|
24dc4f14a162e6cb4a11d713cae6b38db097f112 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/TECD.prev.tst | e6b99f2fb386696dd09a9cbeab7122feaf1a0aff | [
"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 | 7,520 | tst | TECD.prev.tst | Expanding for base=2, level=6, reasons+features=base,same,similiar invall,norm
Refined variables=x,y
[0+1x,0+1y]: unknown -> [1] [0,0] x²-y³+3
---------------- level 0
expanding queue[0]^-1,meter=[2,2]: x²-y³+3
[1+2x,0+2y]: unknown -> [1] [1,0] x+x²-2y³+1
[0+2x,1+2y]: unknown -> [2] [0,1] 2x²-3y-6y²-4y³+1
endexp[0]
---------------- level 1
expanding queue[1]^0,meter=[2,2]: x+x²-2y³+1
endexp[1]
expanding queue[2]^0,meter=[2,2]: 2x²-3y-6y²-4y³+1
[0+4x,3+4y]: unknown -> [3] [0,1] 4x²-27y-36y²-16y³-6
[2+4x,3+4y]: unknown -> [4] [1,1] 4x+4x²-27y-36y²-16y³-5
endexp[2]
---------------- level 2
expanding queue[3]^2,meter=[2,2]: 4x²-27y-36y²-16y³-6
[0+8x,3+8y]: unknown -> [5] [0,0] 8x²-27y-72y²-64y³-3
[4+8x,3+8y]: unknown -> [6] [1,0] 8x+8x²-27y-72y²-64y³-1
endexp[3]
expanding queue[4]^2,meter=[2,2]: 4x+4x²-27y-36y²-16y³-5
[2+8x,7+8y]: unknown -> [7] [0,1] 4x+8x²-147y-168y²-64y³-42
[6+8x,7+8y]: unknown -> [8] [1,1] 12x+8x²-147y-168y²-64y³-38
endexp[4]
---------------- level 3
expanding queue[5]^3,meter=[2,2]: 8x²-27y-72y²-64y³-3
[0+16x,11+16y]: unknown -> [9] [0,1] 16x²-363y-528y²-256y³-83
[8+16x,11+16y]: unknown -> [10] [1,1] 16x+16x²-363y-528y²-256y³-79
endexp[5]
expanding queue[6]^3,meter=[2,2]: 8x+8x²-27y-72y²-64y³-1
[4+16x,11+16y]: unknown -> [11] [0,1] 8x+16x²-363y-528y²-256y³-82
[12+16x,11+16y]: unknown -> [12] [1,1] 24x+16x²-363y-528y²-256y³-74
endexp[6]
expanding queue[7]^4,meter=[2,2]: 4x+8x²-147y-168y²-64y³-42
[2+16x,7+16y]: unknown -> [13] [0,0] 4x+16x²-147y-336y²-256y³-21
[10+16x,7+16y]: unknown -> [14] [1,0] 20x+16x²-147y-336y²-256y³-15
endexp[7]
expanding queue[8]^4,meter=[2,2]: 12x+8x²-147y-168y²-64y³-38
[6+16x,7+16y]: unknown -> [15] [0,0] 12x+16x²-147y-336y²-256y³-19
[14+16x,7+16y]: unknown -> [16] [1,0] 28x+16x²-147y-336y²-256y³-9
endexp[8]
---------------- level 4
expanding queue[9]^5,meter=[2,2]: 16x²-363y-528y²-256y³-83
[0+32x,27+32y]: unknown -> [17] [0,1] 32x²-2187y-2592y²-1024y³-615
[16+32x,27+32y]: unknown -> [18] [1,1] 32x+32x²-2187y-2592y²-1024y³-607
endexp[9]
expanding queue[10]^5,meter=[2,2]: 16x+16x²-363y-528y²-256y³-79
[8+32x,27+32y]: unknown -> [19] [0,1] 16x+32x²-2187y-2592y²-1024y³-613
[24+32x,27+32y]: unknown -> [20] [1,1] 48x+32x²-2187y-2592y²-1024y³-597
endexp[10]
expanding queue[11]^6,meter=[2,2]: 8x+16x²-363y-528y²-256y³-82
[4+32x,11+32y]: unknown -> [21] [0,0] 8x+32x²-363y-1056y²-1024y³-41
[20+32x,11+32y]: unknown -> [22] [1,0] 40x+32x²-363y-1056y²-1024y³-29
endexp[11]
expanding queue[12]^6,meter=[2,2]: 24x+16x²-363y-528y²-256y³-74
[12+32x,11+32y]: unknown -> [23] [0,0] 24x+32x²-363y-1056y²-1024y³-37
[28+32x,11+32y]: unknown -> [24] [1,0] 56x+32x²-363y-1056y²-1024y³-17
endexp[12]
expanding queue[13]^7,meter=[2,2]: 4x+16x²-147y-336y²-256y³-21
[2+32x,23+32y]: unknown -> [25] [0,1] 4x+32x²-1587y-2208y²-1024y³-380
[18+32x,23+32y]: unknown -> [26] [1,1] 36x+32x²-1587y-2208y²-1024y³-370
endexp[13]
expanding queue[14]^7,meter=[2,2]: 20x+16x²-147y-336y²-256y³-15
[10+32x,23+32y]: unknown -> [27] [0,1] 20x+32x²-1587y-2208y²-1024y³-377
[26+32x,23+32y]: unknown -> [28] [1,1] 52x+32x²-1587y-2208y²-1024y³-359
endexp[14]
expanding queue[15]^8,meter=[2,2]: 12x+16x²-147y-336y²-256y³-19
[6+32x,23+32y]: unknown -> [29] [0,1] 12x+32x²-1587y-2208y²-1024y³-379
[22+32x,23+32y]: unknown -> [30] [1,1] 44x+32x²-1587y-2208y²-1024y³-365
endexp[15]
expanding queue[16]^8,meter=[2,2]: 28x+16x²-147y-336y²-256y³-9
[14+32x,23+32y]: unknown -> [31] [0,1] 28x+32x²-1587y-2208y²-1024y³-374
[30+32x,23+32y]: unknown -> [32] [1,1] 60x+32x²-1587y-2208y²-1024y³-352
endexp[16]
---------------- level 5
expanding queue[17]^9,meter=[2,2]: 32x²-2187y-2592y²-1024y³-615
[0+64x,59+64y]: unknown -> [33] [0,1] 64x²-10443y-11328y²-4096y³-3209
[32+64x,59+64y]: unknown -> [34] [1,1] 64x+64x²-10443y-11328y²-4096y³-3193
endexp[17]
expanding queue[18]^9,meter=[2,2]: 32x+32x²-2187y-2592y²-1024y³-607
[16+64x,59+64y]: unknown -> [35] [0,1] 32x+64x²-10443y-11328y²-4096y³-3205
[48+64x,59+64y]: unknown -> [36] [1,1] 96x+64x²-10443y-11328y²-4096y³-3173
endexp[18]
expanding queue[19]^10,meter=[2,2]: 16x+32x²-2187y-2592y²-1024y³-613
[8+64x,59+64y]: unknown -> [37] [0,1] 16x+64x²-10443y-11328y²-4096y³-3208
[40+64x,59+64y]: unknown -> [38] [1,1] 80x+64x²-10443y-11328y²-4096y³-3184
endexp[19]
expanding queue[20]^10,meter=[2,2]: 48x+32x²-2187y-2592y²-1024y³-597
[24+64x,59+64y]: unknown -> [39] [0,1] 48x+64x²-10443y-11328y²-4096y³-3200
[56+64x,59+64y]: unknown -> [40] [1,1] 112x+64x²-10443y-11328y²-4096y³-3160
endexp[20]
expanding queue[21]^11,meter=[2,2]: 8x+32x²-363y-1056y²-1024y³-41
[4+64x,43+64y]: unknown -> [41] [0,1] 8x+64x²-5547y-8256y²-4096y³-1242
[36+64x,43+64y]: unknown -> [42] [1,1] 72x+64x²-5547y-8256y²-4096y³-1222
endexp[21]
expanding queue[22]^11,meter=[2,2]: 40x+32x²-363y-1056y²-1024y³-29
[20+64x,43+64y]: unknown -> [43] [0,1] 40x+64x²-5547y-8256y²-4096y³-1236
[52+64x,43+64y]: unknown -> [44] [1,1] 104x+64x²-5547y-8256y²-4096y³-1200
endexp[22]
expanding queue[23]^12,meter=[2,2]: 24x+32x²-363y-1056y²-1024y³-37
[12+64x,43+64y]: unknown -> [45] [0,1] 24x+64x²-5547y-8256y²-4096y³-1240
[44+64x,43+64y]: unknown -> [46] [1,1] 88x+64x²-5547y-8256y²-4096y³-1212
endexp[23]
expanding queue[24]^12,meter=[2,2]: 56x+32x²-363y-1056y²-1024y³-17
[28+64x,43+64y]: unknown -> [47] [0,1] 56x+64x²-5547y-8256y²-4096y³-1230
[60+64x,43+64y]: unknown -> [48] [1,1] 120x+64x²-5547y-8256y²-4096y³-1186
endexp[24]
expanding queue[25]^13,meter=[2,2]: 4x+32x²-1587y-2208y²-1024y³-380
[2+64x,23+64y]: unknown -> [49] [0,0] 4x+64x²-1587y-4416y²-4096y³-190
[34+64x,23+64y]: unknown -> [50] [1,0] 68x+64x²-1587y-4416y²-4096y³-172
endexp[25]
expanding queue[26]^13,meter=[2,2]: 36x+32x²-1587y-2208y²-1024y³-370
[18+64x,23+64y]: unknown -> [51] [0,0] 36x+64x²-1587y-4416y²-4096y³-185
[50+64x,23+64y]: unknown -> [52] [1,0] 100x+64x²-1587y-4416y²-4096y³-151
endexp[26]
expanding queue[27]^14,meter=[2,2]: 20x+32x²-1587y-2208y²-1024y³-377
[10+64x,55+64y]: unknown -> [53] [0,1] 20x+64x²-9075y-10560y²-4096y³-2598
[42+64x,55+64y]: unknown -> [54] [1,1] 84x+64x²-9075y-10560y²-4096y³-2572
endexp[27]
expanding queue[28]^14,meter=[2,2]: 52x+32x²-1587y-2208y²-1024y³-359
[26+64x,55+64y]: unknown -> [55] [0,1] 52x+64x²-9075y-10560y²-4096y³-2589
[58+64x,55+64y]: unknown -> [56] [1,1] 116x+64x²-9075y-10560y²-4096y³-2547
endexp[28]
expanding queue[29]^15,meter=[2,2]: 12x+32x²-1587y-2208y²-1024y³-379
[6+64x,55+64y]: unknown -> [57] [0,1] 12x+64x²-9075y-10560y²-4096y³-2599
[38+64x,55+64y]: unknown -> [58] [1,1] 76x+64x²-9075y-10560y²-4096y³-2577
endexp[29]
expanding queue[30]^15,meter=[2,2]: 44x+32x²-1587y-2208y²-1024y³-365
[22+64x,55+64y]: unknown -> [59] [0,1] 44x+64x²-9075y-10560y²-4096y³-2592
[54+64x,55+64y]: unknown -> [60] [1,1] 108x+64x²-9075y-10560y²-4096y³-2554
endexp[30]
expanding queue[31]^16,meter=[2,2]: 28x+32x²-1587y-2208y²-1024y³-374
[14+64x,23+64y]: unknown -> [61] [0,0] 28x+64x²-1587y-4416y²-4096y³-187
[46+64x,23+64y]: unknown -> [62] [1,0] 92x+64x²-1587y-4416y²-4096y³-157
endexp[31]
expanding queue[32]^16,meter=[2,2]: 60x+32x²-1587y-2208y²-1024y³-352
[30+64x,23+64y]: unknown -> [63] [0,0] 60x+64x²-1587y-4416y²-4096y³-176
[62+64x,23+64y]: unknown -> [64] [1,0] 124x+64x²-1587y-4416y²-4096y³-130
endexp[32]
---------------- level 6
Maximum level 6 [65] mod 2: x²-y³+3
|
c93ba6bab4561c0d6c1ba4733d6e640f9978d729 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/RS2.prev.tst | 161391bddefe21da682e95d96de12ff442ae58df | [
"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 | 75 | tst | RS2.prev.tst | 1*a^1 + 1*b^1 > 0; 1*a^1 - 1*b^1 > 0; 1*a^1 > 0
evaluate: failure biased
|
1c8e6cae25aa1d2ca3748c6ce27306e5e3c8016a | 449d555969bfd7befe906877abab098c6e63a0e8 | /3862/CH4/EX4.2/Ex4_2.sce | fa6b88563de932c966714c9f6c781eaee239b375 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 674 | sce | Ex4_2.sce | clear
//
//The composite figure is divided into three simple figures and taking A as origin coordinates of their centroids
//variable declaration
L1=400.0 //length of wire AB,mm
L2=150.0*%pi //length of wire BC,mm
L3=250.0 //length of wire CD,mm
theta=30*%pi/180
//The wire is divided into three segments AB, BC and CD. Taking A as origin the coordinates of the centroids of AB, BC and CD are (X1,Y1),(X2,Y2),(X3,Y3)
X1=200.0
X2=475.0
X3=400+300.0+250*cos(theta)/2
Y1=0
Y2=2*150/%pi
Y3=125*sin(theta)
L=L1+L2+L3 //Total length,mm
xc=(L1*X1+L2*X2+L3*X3)/L
printf("\n xc= %0.2f mm",xc)
yc=(L1*Y1+L2*Y2+L3*Y3)/L
printf("\n yc= %0.2f mm",yc)
|
6b81bcee6e01397912b107e91d0a4a221edc7009 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/PG30IE.prev.tst | 6ca8c3004d530d838cf649f9acf30bf2b299a340 | [
"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 | 2,022 | tst | PG30IE.prev.tst | [[-1,2,-1,0,0],[1,2,-1,1,0],[2,-2,1,-1,0],[2,-1,2,0,0]] [0,1,0,1]*3 [-2,15,9,16]*2 [-12,43,38,51]*3 [-12,31,33,40]*12 [-80,171,204,235]*5 [-150,283,365,408]*6 [-84,145,198,217]*21
[[-1,2,1,1,0],[1,2,1,0,0],[2,1,2,0,0],[2,2,1,1,0]] [3,4,5,6] [1,6,8,9]*6 [-5,48,69,76]*3 [-27,100,152,165]*4 [-23,60,95,102]*15 [-137,294,480,511]*6 [-237,448,749,792]*7
[[0,-1,2,-1,0],[0,1,2,-1,1],[0,2,-2,1,-1],[0,2,-1,2,0]] [0,1,0,1]*3 [-2,15,9,16] [-12,43,38,51] [-12,31,33,40]*3 [-80,171,204,235] [-150,283,365,408] [-84,145,198,217]*3
[[0,-1,2,1,1],[0,1,2,1,0],[0,2,1,2,0],[0,2,2,1,1]] [3,4,5,6] [1,6,8,9]*3 [-5,48,69,76] [-27,100,152,165] [-23,60,95,102]*3 [-137,294,480,511] [-237,448,749,792]
[[0,0,1,-2,1],[0,0,2,-1,2],[0,1,-1,2,-2],[0,1,-1,2,1]] [0,1,0,1]*3 [1,8,6,9] [4,17,22,25] [3,10,18,19]*3 [16,47,108,111] [25,68,190,193] [12,31,102,103]*3
[[0,0,1,2,1],[0,0,2,1,2],[0,1,1,2,-1],[0,1,1,2,2]] [4,5,3,6] [3,4,5,6]*3 [16,23,41,44] [25,38,87,90] [12,19,53,54]*3 [49,80,263,266] [64,107,405,408]
[[0,1,-2,-1,-1],[0,2,2,1,1],[1,1,2,-1,0],[1,1,2,2,0]] [-1,2,1,2]*3 [-1,9,10,12]*3 [5,76,123,132] [9,55,116,120]*3 [23,102,265,270]*3 [137,511,1578,1596] [79,264,945,952]*3
[[0,1,0,0,-1],[0,2,0,0,1],[1,0,0,-1,0],[1,0,0,2,0]] [0,1,0,1]*3 [7,17,14,20] [26,55,78,87] [21,43,84,88]*3 [124,251,620,635] [215,433,1290,1308] [114,229,798,805]*3
[[0,1,-2,1,0],[0,2,-1,2,0],[1,-1,2,-2,0],[1,-1,2,1,0]] [0,1,0,1]*3 [1,8,6,9]*2 [4,17,22,25]*3 [3,10,18,19]*12 [16,47,108,111]*5 [25,68,190,193]*6 [12,31,102,103]*21
[[0,1,2,1,0],[0,2,1,2,0],[1,1,2,-1,0],[1,1,2,2,0]] [4,5,3,6] [3,4,5,6]*6 [16,23,41,44]*3 [25,38,87,90]*4 [12,19,53,54]*15 [49,80,263,266]*6 [64,107,405,408]*7
[[0,1,2,-1,1],[0,2,-2,1,-1],[1,-1,2,-2,0],[1,-1,2,1,0]] [1,0,0,1]*3 [5,3,4,6]*3 [43,38,66,75] [31,33,72,76]*3 [57,68,180,185]*3 [283,365,1140,1158] [145,198,714,721]*3
[[0,1,0,0,1],[0,2,0,0,-1],[1,0,0,-2,0],[1,0,0,1,0]] [2,1,-1,2] [3,5,4,6]*3 [28,53,75,84] [65,127,248,260] [42,83,205,210]*3 [217,431,1284,1302] [344,685,2387,2408]
#---> reslines=12
|
f7091ec9784d1191e673be8c10e261991a93faed | 449d555969bfd7befe906877abab098c6e63a0e8 | /2219/CH7/EX7.5/Ex7_5.sce | 8c042dcddb4ca1b5e08ee80e8ed0e5779f2ec74a | [] | 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 | 483 | sce | Ex7_5.sce | // chapter 7 example 5
//-----------------------------------------------------------------------------
clc;
clear;
// given data
Ptot = 100; // certain antenna radiating power
Ptot_iso = 10*10^3; // isotropic antenna radiating power
// Calculations
D = 10*log10(Ptot_iso/Ptot); // Directivity of antenna
// Output
mprintf('Directivity of antenna = %d dB',D);
//------------------------------------------------------------------------------
|
e6a53a77838b141d78d78a3a5f1e586d69099255 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3769/CH9/EX9.27/Ex9_27.sce | becc30d26f89aedf24adcc18efb6a25e7c67323f | [] | 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 | 470 | sce | Ex9_27.sce | clear
//Given
A=10**-3 //m**
n=10
I=2 //A
B=0.1 //T
//Calculation
//
t=n*I*A*B*cos(0)
t1=n*I*A*B*cos(60*3.14/180.0)
//Result
printf("\n (i) Torque when magnetic field is parallel to the field %0.0f *10**-3 Nm",t*10**3)
printf("\n (ii) Torque when magnetic field is perpendicular to the field is zero")
printf("\n (iii) Torque when magnetic field is 60 degree to the field is %0.1f *10**-3 Nm",t1*10**3)
|
7dcb08a772dfebf1db9376adba75ac5675ff697a | 449d555969bfd7befe906877abab098c6e63a0e8 | /3866/CH2/EX2.11/Ex2_11.sce | a148567eeba0824801e9afeb3201b31480a72485 | [] | 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 | 575 | sce | Ex2_11.sce | clear; clc; close;
w=0.4;//in micrometer
l=100;//in nanometer
Cg=1.6;//in fF/micrometer
Ct=Cg*w;
Cgs1=0;Cgd1=0;Cgb1=Ct/2;//cutoff
Cgs2=Ct/2;Cgd2=Ct/2;Cgb2=0;//linear
Cgs3=(2*Ct)/3;Cgb3=0;Cgd3=0;//saturation
disp(Cgs1,'Cgs for cutoff region');//units in fF
disp(Cgd1,'Cgd for cutoff region');
disp(Cgb1,'Cgb for cutoff region');
disp(Cgs2,'Cgs for linear region');
disp(Cgd2,'Cgd for linear region');
disp(Cgb2,'Cgb for linear region');
disp(Cgs3,'Cgs for saturation region');
disp(Cgd3,'Cgs for saturation region');
disp(Cgb3,'Cgs for saturation region');
|
6b7be69214ffb6133e9105d104506fccdca05a8a | 449d555969bfd7befe906877abab098c6e63a0e8 | /1271/CH14/EX14.5/example14_5.sce | bd40cb1651d1a80162fb2c7f7865fb2347b73121 | [] | 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 | 442 | sce | example14_5.sce | clc
// Given that
E = 5e-19 // energy of photon in J
h = 6.62e-34 // Planck constant in J-sec
c = 3e8 // speed of light in m/sec
e = 1.6e-19 // charge on an electron in C
// Sample Problem 5 on page no. 14.21
printf("\n # PROBLEM 5 # \n")
printf("Standard formula used \n")
printf(" E = h*c/lambda \n")
lambda = c * h / E
printf("\n Wavelength is %f Angstrom.",lambda * 10^10)
|
9b724de1d9a42a82d5d6a5a7d96485a2d23806b3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /416/CH8/EX8.6/exp8_6c.sce | b2c405027ab8bed88f5411f31eef99beab176b91 | [] | 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 | 770 | sce | exp8_6c.sce | clear
clc
disp("example 8.6")
mh=205//mean height
a=1000*10^6//in miters
r=1.25//annual rain fall
er=0.8//efficiency
lf=0.75//load factor
hl=5//head loss
et=0.9//efficiency of turbine
eg=0.95//efficiency of generator
wu=a*r*er/(365*24*3600)
printf("\nwater used is \t\t%fm^3/sec",wu)
eh=mh-hl
printf("\neffective head is \t%dm",eh)
p=(735.5/75)*(wu*eh*et*eg)
printf("\npower generated is \t%fkW =\t%fMW",p,p/1000)
pl=p/lf
printf("\npeak load is \t\t%fMw \ntherefore the MW rating of station is \t%fMW",pl/1000,pl/1000)
if eh<=200 then
printf("\nfor a head above 200m pelton turbine is suitable,\nfrancis turbine is suitable in the range of 30m-200m.,\nhowever pelton is most suitable")
else
printf("only pelton turbine is most suitable")
end
|
e65211bd38ca7409c400c97cbaa47b96841354c9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /671/CH2/EX2.24/2_24.sce | 8fd5d8f86b0ee81e9e25e93c1ae9a3aa5bbf731c | [] | 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 | 207 | sce | 2_24.sce | V=32
I=1
R1=20
R2=8
R3=2
Voc1=V/(R1+R2+R3)*(R2+R3) ///a,b open
Isc1=V/R1 ///a,b short
Voc2=I*R2/(R1+R2+R3)*R1
Isc2=I*R2/(R2+R3)
////by superposition
Voc=Voc1+Voc2
Isc=Isc1+Isc2
disp(Voc)
disp(Isc)
|
4db4e8acc1f28f7c1e35a46ea06c1ff8fba296af | 449d555969bfd7befe906877abab098c6e63a0e8 | /2414/CH5/EX5.6/Ex5_6.sce | 69697627fb410c8db102ae36f3c0f770ac6ead8f | [] | 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 | 600 | sce | Ex5_6.sce | clc;
clear all;
//page no 157
//prob no. 5.6
fLO=110; //MHz
//for V2(f)
f=[0:.01:231+.01]; //x axis
function V=pulse()
V=[]
for i=1:.005:1.5
V=[V i]
end
endfunction
V2=[zeros(0:.01:120-fLO-.01) pulse() zeros(121-fLO+.01:.01:120+fLO-.01) pulse() 0]; //y axis
clf;
subplot(211);
plot2d(f,V2,[5],rect=[0,0,240,2])
xtitle('Spectral diagram','f,MHz','V2(f)');
//for V3(f)
f=[0:.01:11+.01]; //x axis
V3=[zeros(0:.01:120-fLO-.01) pulse() 0]; //y axis
subplot(212);
plot2d(f,V3,[5],rect=[0,0,20,2])
xtitle('Spectral Diagram','f,MHz','V3(f)');
|
877bc03687fd2867e2b2960bb1f416dc9ca30006 | 9aa95a74bbb2cde53d49cfbeb529fe858781b85c | /newton.sce | 3de855f3f32463f13d5a98106d4174d113afc4c4 | [] | no_license | Killer2499/Scilab | 020807deb4ea75743af080761b65be086d05d491 | 322a592dcccad58dab48bcf52411aa5b26fcb8ff | refs/heads/master | 2020-03-10T09:08:15.979283 | 2018-04-12T19:57:09 | 2018-04-12T19:57:09 | 129,303,189 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 262 | sce | newton.sce | function[e,xn,a,b,c]=newton(x)
a=(x^3)-(0.165*(x^2))+(3.993*(10^-4));
b=(3*x^2)-(0.33*x);
xn=x-(a/b);
e=abs((xn-x)/xn)*100;
if(e>0)
then newton(xn);
else
disp(xn);
disp(e);
end
endfunction
|
7e1938918e29ebe6a655b863d07971cc9d8ab73b | 449d555969bfd7befe906877abab098c6e63a0e8 | /3523/CH12/EX12.17.5/Ex12_5.sce | 766f5b59263a4d193ca471eceed08b773e276585 | [] | 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 | 457 | sce | Ex12_5.sce | //Example 5// Ch 12
clc;
clear;
close;
// given data
C2 = 0.75/3;//capacitance between 3 core bunched together and lead sheath in uF/km
C3=0.56//in uf/km
V=33*10^3;
f=50;//in Hz
C4=0.5*(C2+C3)*10;//capacitance per km b/w any two cores
printf("capacitance per km b/w any two cores %f uF",C4)
ChargKVAr=V^2*2*%pi*f*C4/10^9;
printf("Charging KVAr %f KVAr",ChargKVAr)
//given ans in book is wrong the capacitance of 10km b/w 2 cores is 4.05uF
|
cf9d747fc6e7fce4d2b8d38f11ece431577822e3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /28/CH3/EX3.3.f/ex3_3_5.sce | d33114f39eb25eaffe1f9ccaaf0ac492a7473a6b | [] | 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 | ex3_3_5.sce | // for open loop system
// given speed=60km/hr
syms R K1 K;
(R*K1*K)=60
K1=50;
K=1.5;
R=60/(K1*K)
disp(R,"Input open=")
// for closed loop
R=60(1+(K1*K))/(K1*K)
disp(R,"Input closed=") |
0ac138479c7dc81d7689f310244905c4cd9f375d | 449d555969bfd7befe906877abab098c6e63a0e8 | /2072/CH26/EX26.4/EX26_4.sce | a965bf8c912ff2a75c8e8c24bf88d35b03a88a03 | [] | 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 | 440 | sce | EX26_4.sce | //Chapter 26
clc
//Example4
//given
c=3*10^8 //velocity of light in m/sec
//when the spaceship is at rest
x=52 // diatance in x direction in meters
y=25 //measurement in y direction
v=0.95*c
//when the spaceship moves to an observer at rest only x dimension looks contracted
gamma=1/sqrt(1-(v^2/c^2))
L=x/gamma
disp(L,"The observer sees the horizontal dimension of the spaceship gets contracted to a length in meters of")
|
e4107ceab18e13008cc3f4cc1eab4f698d69e86f | 449d555969bfd7befe906877abab098c6e63a0e8 | /2087/CH5/EX5.7/example5_7.sce | d0f465b2cebadd1c548647a88d7aacd98a55e517 | [] | 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 | 545 | sce | example5_7.sce |
//example 5.7
//calculate discharge and percent increase in discharge
clc;
//given
k=0.005; //coefficient of permeability
r=0.1; //well radius
s=4; //drawdown
b=10; //thickness
R=300; //radius of circle of influence
//Part(a)
Q1=2.72*b*k*s/log10(R/r);
Q1=round(Q1*10000)/10000;
mprintf("Discharge=%f cumec",Q1);
//Part (b)
r=0.2;
Q2=2.72*b*k*s/log10(R/r);
I=(Q2-Q1)*100/Q1;
I=round(I*10)/10;
mprintf("\npercent increase in discharge=%f percent.",I);
|
e36a7d1859486c8003c349f1cd59456395c0d37c | 449d555969bfd7befe906877abab098c6e63a0e8 | /2705/CH4/EX4.2/Ex4_2.sce | d3c8e64ddebe801fecaa6ff00d756c62d6b3aae8 | [] | 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,661 | sce | Ex4_2.sce | clear;
clc;
disp('Example 4.2');
// aim : To determine
// saturation temperature and enthalpy
// Given values
P = 2.04;// pressure, [MN/m^2]
// solution
// since in the steam table values of enthalpy and saturation temperature at 2 and 2.1 MN?m^2 are given, so for knowing required values at given pressure,there is need to do interpolation
// calculation of saturation temperature
// from steam table
Table_P_tf = [[2.1,2.0];[214.9,212.4]]; // P in [MN/m^2] and tf in [C]
// using interpolation
tf = interpln(Table_P_tf,2.04);// saturation temperature at given condition
mprintf('\n The Saturation temperature is = %f C \n',tf);
// calculation of specific liquid enthalpy
// from steam table
Table_P_hf = [[2.1,2.0];[920.0,908.6]];// P in [MN/m^2] and hf in [kJ/kg]
// using interpolation
hf = interpln(Table_P_hf,2.04); // enthalpy at given condition, [kJ/kg]
mprintf('\n The Specific liquid enthalpy is = %f kJ/kg \n',hf);
// calculation of specific enthalpy of evaporation
// from steam table
Table_P_hfg = [[2.1,2.0];[1878.2,1888.6]];// P in [MN/m^2] and hfg in [kJ/kg]
// using interpolation
hfg = interpln(Table_P_hfg,2.04); // enthalpy at given condition, [kJ/kg]
mprintf('\n The Specific enthalpy of evaporation is = %f kJ/kg \n',hfg);
// calculation of specific enthalpy of dry saturated steam
// from steam table
Table_P_hg = [[2.1,2.0];[2798.2,2797.2]];//P in [MN/m^2] and hg in [kJ/kg]
// using interpolation
hg = interpln(Table_P_hg,2.04); // enthalpy at given condition, [kJ/kg]
mprintf('\n The Specific enthalpy of dry saturated steam is = %f kJ/kg \n',hg);
// End
|
32f4501bd737ee6ece2ecf48a69e7feb0c467eaa | 449d555969bfd7befe906877abab098c6e63a0e8 | /2660/CH4/EX4.14/Ex4_14.sce | 4b38f533a054e69b79df7a8932136975b4ccb5f0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 280 | sce | Ex4_14.sce | clc
D = 12.7 // diameter in mm
d = 50 // depth in mm
v = 75 // cutting speed in m/min.
f = 0.175 // feed in mm/rev
l = d + 2*0.29*D // lemgth of drill travel in mm
N = (1000*v)/(%pi*D) // r.p.m.
tm = l/(f*N) // min
printf("\n Time taken to drill hole = %0.3f min." , tm)
|
299b597a7d8e14560e35add83101323ec7067b16 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2882/CH10/EX10.3/Ex10_3.sce | 8c2e238b1d4b0a9079ed0ffc765b3f732616b873 | [] | 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 | 378 | sce | Ex10_3.sce | //Tested on Windows 7 Ultimate 32-bit
//Chapter 10 Feedback in Amplifiers Pg no. 330 and 331
clear;
clc;
//Given
A=500;//open loop gain
B=0.1;//feedback factor beta
dA_to_A=10/100;//variation in open loop gain
//Solution
dAfb_to_Afb=dA_to_A*1/(A*B);//variation in closed loop gain
printf("Percentage variation in closed loop gain = %.1f %%",dAfb_to_Afb*100);
|
d7aeaaab07cc4b14a1ff567fcedba65f0a869aac | 449d555969bfd7befe906877abab098c6e63a0e8 | /1445/CH2/EX2.51/Ex2_51.sce | 90e9c52737f56dcc30f4014474547bc345f9103d | [] | 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 | 808 | sce | Ex2_51.sce | //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT
//Example 51
clc;
disp("CHAPTER 2");
disp("EXAMPLE 51");
//VARIABLE INITIALIZATION
Y1=0.4+(%i*0.6); //admittance of 1st branch in Siemens
Y2=0.1+(%i*0.4); //admittance of 2nd branch in Siemens
Y3=0.06+(%i*0.23); //admittance of 3rd branch in Siemens
//SOLUTION
Y=Y1+Y2+Y3;
//function to convert from rectangular form to polar form
function [Y,angle]=rect2pol(x,y);
Y=sqrt((x^2)+(y^2));
angle=atan(y/x)*(180/%pi); //to convert the angle from radians to degrees
endfunction;
[Y1,angle]=rect2pol(real(Y),imag(Y));
disp(sprintf("The total admittance of the circuit is %f S, %f degrees",Y1,angle));
z=1/Y1;
disp(sprintf("The impedance of the circuit is %f Ω, %f degrees",z,-angle));
//END
|
d33b253dcd845069d63e3de95599e6dd9abeb48b | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/PMP3.prev.tst | be6ba95a349d39b84b9da33f3cd493d7c1e8d902 | [
"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 | 82 | tst | PMP3.prev.tst | ("16*x^4 - 16*y^4 - z^2").isMappableTo("x^4 - y^4 - z^2") = {x=>2*x,y=>2*y,z=>z}
|
4c2549f86bec8d99860949a12094180f8bb00efc | 449d555969bfd7befe906877abab098c6e63a0e8 | /374/CH9/EX9.4.a/94a.sci | 67b4728df8f52d6480cbe02e5327cc5d1f4a3f72 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 417 | sci | 94a.sci | //chapter 9 example 4a//
clc
clear
//angular velocity=A,llength at which rotating mirror from the photo detector=L,shadow pulse of width=We,shadow velocity=V,outer diametetr=do//
L=0.1;//in mts//
A=4;//in rad sec-1//
V=L*A;//in mts/sec//
printf("\n shadow velocity=%f m/sec\n",V)
We=250;//in micro seconds//
do=We*V;//outer diameter of the fibre//
printf("\n outer diamter of the fibre=%f micro meter\n",do) |
9060cdbf4c66800c05df6ec7c12bca0a852343a9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3768/CH7/EX7.5/Ex7_5.sce | dd6f1b5de7de6bc99be7a7cbadd726ec49cce176 | [] | 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 | 334 | sce | Ex7_5.sce | //Example number 7.5, Page number 147
clc;clear;
close;
//Variable declaration
A=650*10**-4; //area(m**2)
epsilon0=8.85*10**-12;
d=4*10**-2; //seperation(m)
Q=2*10**-10; //charge(C)
epsilonr=3.5; //dielectric constant
//Calculation
C=A*epsilon0/d;
V=Q/C; //voltage(V)
//Result
printf("voltage is %.1f V",V)
|
fde271fef9634e14dd9218ea487149ba686fc7eb | 449d555969bfd7befe906877abab098c6e63a0e8 | /896/CH8/EX8.7/7.sce | 9facf8d16d0f134062b9bed12e66ee1844459d46 | [] | 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 | 847 | sce | 7.sce | clc
//Example 8.7
//Calculate the cross sectional area, pressure, temperature and mach number at a pt in duct where air velocity is 1400ft/s
P1=30//psia
T1=660//R (Rankine temperature scale)
ratio_T=0.83333//dimentionless
m=10//lbm/s mass flow rate
v1=1400//ft/s
R=4.98*10^4//(ft^2/s^2)*(lbm/lbmol.R)^0.5
k=1.4//dimentionless
M=29//lbm/lbmol
T2=T1*ratio_T//R (Rankine temperature scale)
printf("The temperature at the pt in the duct where air velocity is 1400 ft/s is %f R\n",T2);
c=223*(k*T2/M)^0.5//ft/s
Ma=v1/c//dimentionless (Mach number)
printf("The mach number at the pt in the duct where air velocity is 1400 ft/s is %f\n",Ma);
ratio_t=0.7528//dimentionless
ratio_P=0.3701//dimentionless
ratio_A=1.0587//dimentionless
T=T1*ratio_t//R (Rankine temperature scale)
printf("T=%f\n",T);
P=P1*ratio_P//psia
printf("P=%f",P); |
2829e600d999375961773b2aee0446c88c958144 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2195/CH3/EX3.15.2/ex_3_15_2.sce | a85b4a7d9ac9c6a4cb5867bb30a11f540565f1e6 | [] | 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 | 190 | sce | ex_3_15_2.sce | //Example 3.15.2: shunt resistance
clc;
clear;
close;
//given data :
Im=1;// in mA
Rm=100;// in ohm
I=100;// in mA
Rsh=(Im*10^-3*Rm)/((I-Im)*10^-3);
disp(Rsh,"shunt resistance,Rsh(ohm) = ")
|
8158f9589ed26e5608cada01d7ad109bc76f065b | 449d555969bfd7befe906877abab098c6e63a0e8 | /2183/CH5/EX5.4/Ex_5_4.sce | e6f78298e6094c3bee28baa7fb36b2a2d8d6ffd2 | [] | 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 | 144 | sce | Ex_5_4.sce | // Example 5.4 //slope efficiency
clc;
clear;
close;
eg=1242;//
e=1300;//in nm
n=0.1;//efficiency
s=((eg/e)*n);//
disp(s,"slope efficiency is")
|
2a404e753b905d23fe2ae4cd85c2c28c490a29ae | 449d555969bfd7befe906877abab098c6e63a0e8 | /1271/CH15/EX15.16/example15_16.sce | f53857a6db72bb2ac9e3db9d27419d3d1acae234 | [] | 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 | sce | example15_16.sce | clc
// Given that
l = 3e-10 // width of box in m
e = 1.6e-19 // charge on an electron in C
m = 9.1e-31 // mass of electron in kg
c = 3e8 // speed of light in m/sec
h = 6.62e-34 // Planck constant in J-sec
// Sample Problem 16 on page no. 15.30
printf("\n # PROBLEM 16 # \n")
printf("Standard Formula used \n")
printf(" E = (n^2 * h^2) / (8 * m * L^2)) \n")
n = 1 // For n=1
E = (n^2 * h^2) / (8 * m * l^2)
n = 2 // For n=2
E_ = (n^2 * h^2) / (8 * m * l^2)
n = 3 // For n=3
E__ = (n^2 * h^2) / (8 * m * l^2)
printf("\n Energy of electron -\n For (n=1) is %e J.\n For (n=2) is %e J.\n For (n=3) is %e J.",E,E_,E__)
|
2d43f296fc5ce401a63a933d7ec45c5b0004ff2e | 449d555969bfd7befe906877abab098c6e63a0e8 | /998/CH29/EX29.67/Ex67.sce | 5d7f646d94cc6e082164868c40404875c3dda27b | [] | 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 | 261 | sce | Ex67.sce | //Ex:67
clc;
clear;
close;
R_e=6378;// in km
H=35786;// in km
E_min=5;// min elevation angle in degree
x=cos(E_min*3.14/180);
R=R_e/(R_e+H);
P=2*asin(R*x);// in radian
a_max=(P)*180/3.14;// in degree
printf("The max coverage angle=%f degree", a_max); |
8890a42dc33034b5ee8f7407cad9700c6c7fce8e | b68ae1fc3cd37c85031f69e42d92903b7f1a90ab | /projects/07/MemoryAccess/BasicTest/BasicTestVME.tst | 9936246a634f8f351ffcd4921f6d81ee7f948d08 | [] | no_license | bricef/The-Elements-of-Computing-Systems | fb3aa100c18176ccfc876e9d30319c0b8a5c7635 | 6be81eacaa30ad57b06f018c0aecbcf7e04841bc | refs/heads/master | 2021-01-18T13:43:02.653913 | 2011-04-06T19:23:52 | 2011-04-06T19:23:52 | 1,578,790 | 5 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 608 | tst | BasicTestVME.tst | // This file is part of the materials accompanying the book
// "The Elements of Computing Systems" by Nisan and Schocken,
// MIT Press. Book site: www.idc.ac.il/tecs
// File name: projects/07/MemoryAccess/BasicTest/BasicTestVME.tst
load BasicTest.vm,
output-file BasicTest.out,
compare-to BasicTest.cmp,
output-list RAM[256]%D1.6.1 RAM[300]%D1.6.1 RAM[401]%D1.6.1
RAM[402]%D1.6.1 RAM[3006]%D1.6.1 RAM[3012]%D1.6.1
RAM[3015]%D1.6.1 RAM[11]%D1.6.1;
set sp 256,
set local 300,
set argument 400,
set this 3000,
set that 3010,
repeat 25 {
vmstep;
}
output;
|
90f791bb9c5968cb8b11b69fb7f341204031fb92 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2024/CH11/EX11.23/11_23.sce | 2bae2ef2c38f4a6535fc655fed35ae3102782b96 | [] | 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 | 245 | sce | 11_23.sce | clc
//Initialization of variables
H=-169182 //Btu/mole
s1=1.3609 //Btu/mole R
s2=49.003 //Btu/mole R
s3=51.061 //Btu/mole R
T=537 //R
//calculations
dG=H-T*(s3-s2-s1)
//results
printf("Change in Gibbs energy = %d Btu/mole carbon",dG)
|
9a55f01da7d127a446e54d484066f22ded19ddf6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /770/CH15/EX15.16/15_16.sce | 1b52ba022ca3ce0e0e48375d840b65a67397cebe | [] | 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,166 | sce | 15_16.sce | clear;
clc;
funcprot(0);
//Example - 15.16
//Page number - 534
printf("Example - 15.16 and Page number - 534\n\n");
//Given
T = 78.15;//[C]
P_1_sat = 755;//[mm Hg]
P_2_sat = 329;//[mm Hg]
z_1 = 0.3;
V = 0.5;
// log(Y1) = 0.845/(1 + 0.845*(x_1/x_2))^(2)
// log(Y2) = 1/(1 + 1.183*(x_2/x_1))^(2)
// A value of x_1 is to determined for which V = 0.5
// Let us assume a value of x_1, say x_1 = 0.150
x_1 = 0.150;
error = 10;
while(error>0.001)
x_2 = 1 - x_1;
Y1 = exp(0.845/(1 + 0.845*(x_1/x_2))^(2));
Y2 = exp(1/(1 + 1.183*(x_2/x_1))^(2));
P = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;
y_1 = (x_1*Y1*P_1_sat)/P;
V_prime = (z_1 - x_1)/(y_1 - x_1);
error=abs(V_prime - V);
x_1 = x_1 + 0.00001;
end
P_prime = x_1*Y1*P_1_sat + x_2*Y2*P_2_sat;//[mm hg]
// At x_1 , V = 0.5,
// Therefore when the mixture is 50 % vaporized at 78.15 C the mole fraction of component 1 in the liquid phase is x_1 and the system pressure is P_prime
printf(" The required pressure is %f mm Hg\n\n",P_prime);
printf(" and the mole fraction of component 1 in the liquid phase for this pressure is x_1 = %f\n\n",x_1);
|
52a2f943530769264941c1ad23f93cd0d50c287a | 449d555969bfd7befe906877abab098c6e63a0e8 | /69/CH8/EX8.10/8_10.sce | d731832aec599eeff6b7d09ee5d9e9fc964f10af | [] | 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 | 718 | sce | 8_10.sce | clear; clc; close;
yos = 50*10^(-6);
Idss = 10*10^(-3);
Vp = -4;
Vgsq = -2.2;
Idq = 2.03*10^(-3);
Rd = 3.6*10^(3);
Rs = 1.1*10^(3);
Vi = 40*10^(-3);
gmo = 2*Idss/abs(Vp);
gm = gmo*(1-(Vgsq/Vp));
rd = 1/yos;
Zi = Rs*((rd+Rd)/(1+gm*rd))/(Rs+((rd+Rd)/(1+gm*rd)));
Zi2 = Rs*gm^(-1)/(Rs+gm^(-1));
Zo = Rd*rd/(Rd+rd);
Zo2 = Rd;
Av = (gm*Rd+(Rd/rd))/(1+Rd/rd);
Vo = Av*Vi;
Av2 = gm*Rd;
Vo2 = Av2*Vi;
disp(gm,'gm(S) = ');
disp(rd,'rd(ohms) = ');
disp(Zi,'Zi(ohms) = ');
disp(Zi2,'Zi(ohms) without rd = ');
disp(Zo,'Zo(ohms) = ');
disp(Zo2,'Zo(ohms) without rd = ')
disp(Av,'Voltage gain Av = ');
disp(Vo,'Vo = ');
disp(Av2,'Volatge gain Av(ignoring rd) = ');
disp(Vo2,'Vo2 witout rd = ');
|
d9875fc6e17511ee648f9c0a5e8f08b21d6a0525 | 178822612bcd418dc12ba7a649304a24ab618d60 | /Numerical Analysis/descente.sci | b157f4576ab7c8796ca4bdba13940d1849e71201 | [] | no_license | engom/Math_Problem_Solving | b56c6cbfbff6c416c519795b9ab8f0c0bbba5ea3 | 6538c476681ae4ee803ea9b3a8944c5f370e1961 | refs/heads/master | 2022-05-25T01:13:16.123161 | 2016-02-13T11:32:28 | 2016-02-13T11:32:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 219 | sci | descente.sci | function[x]= descente(A,b)
n=size(A)
i=1:n
j=1:n
A=A(i,j)
x(1)=b(1)/A(1,1)
for k=2:n
s=0
for j=1:k-1
s=s+A(k,j)*x(j)
end
x(k)=(b(k)-s)/A(k,k)
end
endfunction
|
12eacc5fbd96266b44ba9d5b64e0adf10654e6a3 | 6be22cc470807d3b2d9a8042a18ccd96070d00ae | /propulsion/turbojet_engine/hw7_p1.sce | 0fa1cf9a0848f4f29b3bd12b00e111c51a4de5a0 | [] | no_license | ordinatorix/scilab_projects | a8e5096ddd0c343559bb06c1c05c0926e4f13fdc | 1f227a2bdf8e2ae7a7f1fa42788e9a346710fa40 | refs/heads/master | 2022-02-27T14:52:47.802082 | 2016-05-06T21:09:07 | 2016-05-06T21:09:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 5,645 | sce | hw7_p1.sce | // HW_7 Problem 1
// clear and close everything!!!
clear; clc; close; close; close; close;
// Independent Parameters ------------------------------------------------
gamma_a = 1.4;
gamma_e = 1.3;
R = 287; // (j/(kg*K))
M = 1.8;
P_a = 12112; // (Pa)
T_a = 216.650; // (K)
T_max = 1500; // (K)
h_c = 43124000; // (j/kg)
FA_st = 0.06;
P_e = P_a; // (Pa)
eff_dif = 0.9;
eff_comp = 0.9;
eff_burn = 0.98;
eff_turb = 0.92;
eff_nozz = 0.98;
r_b = 0.97;
r_c = [2:2:60];
// Dependent Parameters --------------------------------------------------
Po_3 = zeros(1,30); // (Pa)
To_3_i = zeros(1,30); // (K)
To_3_r = zeros(1,30); // (K)
W_c_in = zeros(1,30); //(W)
FA = zeros(1,30);
eq_ratio = zeros(1,30);
W_t_out = zeros(1,30); // (W)
Po_4 = zeros(1,30); // (Pa)
To_5_i = zeros(1,30); // (K)
To_5_r = zeros(1,30); // (K)
Po_5 = zeros(1,30); // (Pa)
To_7_r = zeros(1,30); // (K)
T_7_i = zeros(1,30); // (K)
T_7_r = zeros(1,30); // (K)
u_e = zeros(1,30); // (m/s)
M_e = zeros(1,30);
A_ratio = zeros(1,30);
TSFC = zeros(1,30); // (kg/(N*s))
I = zeros(1,30); // (N*s/kg)
eff_therm = zeros(1,30);
eff_propul = zeros(1,30);
eff_overall = zeros(1,30);
// Calculate specific heat at constant pressure---------------------------
cp_a = (gamma_a/(gamma_a-1))*R;
cp_e = (gamma_e/(gamma_e-1))*R;
// Ambient conditions-----------------------------------------------------
Po_a = P_a*(1+(gamma_a-1)/2*M^2)^(gamma_a/(gamma_a-1));
To_a = T_a*(1+(gamma_a-1)/2*M^2);
u = M*sqrt(gamma_a*R*T_a);
// Diffuser Stage (a-2)---------------------------------------------------
To_2_r = To_a;
To_2_i = eff_dif*(To_2_r-T_a)+T_a;
Po_2 = P_a*(To_2_i/T_a)^(gamma_a/(gamma_a-1));
// Compressor Stage-(2-3)-------------------------------------------------
Po_3 = r_c.*Po_2;
To_3_i = r_c.^((gamma_a-1)/gamma_a).*To_2_r;
To_3_r = ((To_3_i-To_2_r)./eff_comp)+To_2_r;
W_c_in = cp_a.*(To_3_r-To_2_r);
// Burner Stage-(3-4)-----------------------------------------------------
// Verify that FA <= FA_st
FA = ((T_max./To_3_r)-1)./(((eff_burn.*h_c)./(cp_e.*To_3_r))-(T_max./To_3_r));
eq_ratio = FA./FA_st;
for i = 1:30,
if eq_ratio <= 1 then
To_4_r = T_max;
else
To_4_r(i) = 1.0./(1+FA_st).*((eff_burn.*h_c./cp_e)+To_3_r(i));
end,
end
Po_4 = r_b.*Po_3;
// Turbine Stage-(4-5)----------------------------------------------------
W_t_out = W_c_in;
To_5_r = To_4_r-(W_t_out./((1+FA).*cp_e));
To_5_i = To_4_r-((To_4_r-To_5_r)./eff_turb);
Po_5 = Po_4.*(To_5_i/To_4_r).^(gamma_e./(gamma_e-1));
// Nozzle Stage -(5-7)----------------------------------------------------
To_7_r = To_5_r;
Po_7 = Po_5;
P_7 = P_e;
T_7_i = To_5_r.*(P_7./Po_5).^((gamma_e-1)./gamma_e);
T_7_r = To_5_r-(eff_nozz.*(To_5_r-T_7_i));
u_e = sqrt(2.*eff_nozz.*(gamma_e./(gamma_e-1)).*R.*To_5_r.*(1-(P_a./Po_5).^((gamma_e-1)./gamma_e)));
M_e = u_e./sqrt(gamma_e.*R.*T_7_r);
A_ratio = 1.0./M_e.*((2/(gamma_e+1)).*(1+((gamma_e-1)./2.0).*M_e.^2)).^((gamma_e+1)./(2.0.*(gamma_e-1)));
// Calculate Specific Thrust; TSFC; and Efficiencies;---------------------
I = ((1+FA).*u_e-u);
TSFC = FA./I;
eff_therm = ((1+FA).*u_e.^2-u.^2)./(2.0.*FA.*h_c);
eff_propul = (I.*u)./((1+FA).*(u_e.^2.0./2)-(u.^2.0./2));
eff_overall = eff_therm.*eff_propul;
// Plot Graphs------------------------------------------------------------
f0 = scf(0); //creates figure with id==0 and make it the current one
f1 = scf(1); //creates figure with id==1 and make it the current one
f2 = scf(2);
f3 = scf(3);
f4 = scf(4);
// Plot Specific Thrust---------------------------------------------------
scf(f0);
subplot(311);
plot(r_c,I, 'r');
xtitle("Specific Thurst VS Compressor Pressure Ratio","r_c","Specific Thurst(N*s/Kg)");
//a=get("current_axes")
//a.data_bounds=[1,500;6,1220];
// plot TSFC--------------------------------------------------------------
subplot(312);
plot(r_c,TSFC, 'g');
xtitle("TSFC VS Compressor Pressure Ratio","r_c","TSFC(Kg/N*s)");
// plot area ratio
subplot(313);
plot(r_c,A_ratio, 'r');
xtitle("Area Ratio VS Compressor Pressure Ratio","r_c","Area Ratio");
// Plot Temperature Across TurboJet---------------------------------------
scf(f1);
subplot(111);
plot(r_c,To_3_r, 'b');
plot(r_c,To_5_r, 'c');
plot(r_c,T_7_r, 'm');
xtitle("Stagnation Temperature VS Compressor Pressure Ratio","r_c","Temperature (K)");
leg=legend(['To_3_r';'To_5_r';'T_7_r'],[4]);
//a=get("current_axes")
//a.data_bounds=[1,2300;6,2800];
// Plot Temperature Across TurboJet---------------------------------------
scf(f2);
subplot(111);
plot(r_c,Po_3, 'b');
plot(r_c,Po_4, 'c');
plot(r_c,Po_5, 'm');
xtitle("Stagnation Pressure VS Compressor Pressure Ratio","r_c","Pressure (Pa)");
leg=legend(['Po_3';'Po_4';'Po_5'],[4]);
//a=get("current_axes")
//a.data_bounds=[1,2300;6,2800];
// plot efficiencies------------------------------------------------------
scf(f3);
subplot(111);
plot(r_c,eff_therm, 'r');
plot(r_c,eff_propul, 'b');
plot(r_c,eff_overall, 'g');
xtitle("Efficiencies VS Compressor Pressure Ratio","r_c","Effeciency");
leg=legend(['Thermal Efficiency';'Propulsive Efficiency';'Overall Efficiency'],[4]);
// Plot Exit Mach Number--------------------------------------------------
scf(f4);
subplot(111);
plot(r_c,M_e, 'r');
xtitle("Exit Mach Number VS Compressor Pressure Ratio","r_c","M");
|
7e7f339bde5c183d428138953fa16dcbd14795a4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /55/CH1/EX1.8/1ex8.sci | 0967ccbc199fcadf728ad4c8273772ccb759d607 | [] | 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 | 668 | sci | 1ex8.sci | disp('To find:number of mathematics students taking atleast one of the languages French(F),German(G) and Russian(R)')
F=65; //number of students studying French
G=45; // number of students studying German
R=42; //number of students studying Russian
FandG=20; //number of students studying French and German
FandR=25; //number of students studying French and Russian
GandR=15; //number of students studying German and Russian
FandGandR=8; //number of students studying French,German and Russian
//By inclusion-exclusion principle
ForGorR=F+G+R-FandG-FandR-GandR+FandGandR;
disp(ForGorR,'the number of students studying atleast one of the languages :') |
aab68d7b4456ef4189e1f48c8ae08ebb2671a44f | 717ddeb7e700373742c617a95e25a2376565112c | /1445/CH2/EX2.45/Ex2_45.sce | 9122b5be23bf6d06281dba01d842420b77a2c867 | [] | 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 | 908 | sce | Ex2_45.sce | //CHAPTER 2- STEADY-STATE ANALYSIS OF SINGLE-PHASE A.C. CIRCUIT
//Example 45
disp("CHAPTER 2");
disp("EXAMPLE 45");
//VARIABLE INITIALIZATION
L=1.405; //inductance in Henry
r=40; //resistance in Ohms
C=20/(10^6); //capacitance in Farad
v=100; //voltage in Volts
//SOLUTION
//resonant frequency f=1/2.pi.sqrt (L.C)
f0=1/(2*%pi*sqrt(L*C));
disp(sprintf("The frequency at which the circuit resonates is %d Hz",f0));
I0=v/r;
disp(sprintf("The current drawn from the supply is %.1f A",I0));
xl0=2*%pi*f0*L;
z0=sqrt((r^2)+(xl0^2));
vl0=I0*z0;
disp(sprintf("The voltage across the coil is %.1f V",vl0));
xc0=1/(2*%pi*f0*C);
disp(sprintf("The capcitative reactance is %.1f Ω",xc0));
Q0=(2*%pi*f0*L)/r;
disp(sprintf("The quality factor is %.3f", Q0));
bw=r/L;
disp(sprintf("The bandwidth is %.3f Hz",bw));
//END
|
eefa46f12250336b128d52a0aa830c586a6fff76 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2066/CH7/EX7.9/7_9.sce | f9988e2d402a3903b6ae27722d357035e05b6397 | [] | 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 | 288 | sce | 7_9.sce | clc
clear
//Initialization of variables
d=8 //in
V=3.65 //ft/s
u1=4.75 //ft/s
r0=4 //in
//calculations
f=0.0449
Q=V*%pi/4 *(d/12)^2
Vs=(u1-V)/3.75
r0e=10^((u1/Vs - 8.5)/5.75)
e=r0/r0e
//results
printf("Flow rate = %.2f ft^3/s",Q)
printf("\n roughness factor = %.3f in",e)
|
66640f542ee13a8ace689ee33bfd974354e7d1be | 449d555969bfd7befe906877abab098c6e63a0e8 | /3669/CH6/EX6.7/7.sce | 7a90e9de7d24dd04877a00cfdcce6d35cb9cb8b1 | [] | 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 | 402 | sce | 7.sce |
//Variable declaration
N=1.6*10**20; //number of molecules(/m**3)
T=300; //temperature(K)
E=5*10**5; //electric field(V/m)
x=0.25*10**-9; //separation(m)
Kb=1.381*10**-23; //boltzmann constant
e=1.6*10**-19;
//Calculation
Pd=N*e**2*x**2*E/(3*Kb*T); //orientational polarization
//Result
printf('orientational polarization is %0.3f *10**-11 C m \n',(Pd*10**11)) |
6ef6fe37b46607295e4b9d96659e0fa9905d5f81 | 4a37bfef0f5bd1f6a904e802680e22b2662d2a17 | /nektar/nektar++-5.0.0/solvers/IncNavierStokesSolver/Tests/Tet_Kovasnay_SVV_DGKer.tst | dfb46df8cba73ff33833ec32b1b1e5a688853b66 | [
"MIT"
] | permissive | mapengfei-nwpu/DG-program | 5a47d531f5f8118547b194aa250b546a03f700c3 | e7d9b98f0241d7f4af941d801de3f0b12bb0ed3a | refs/heads/master | 2022-10-04T22:21:42.409887 | 2020-05-04T12:49:45 | 2020-05-04T12:49:45 | 261,162,778 | 5 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,032 | tst | Tet_Kovasnay_SVV_DGKer.tst | <?xml version="1.0" encoding="utf-8"?>
<test>
<description>3D Tet Kovasnay solution using DG SVV Kerneal and dealiasing</description>
<executable>IncNavierStokesSolver</executable>
<parameters>Tet_Kovasnay_SVV_DGKer.xml</parameters>
<files>
<file description="Session File">Tet_Kovasnay_SVV_DGKer.xml</file>
</files>
<metrics>
<metric type="L2" id="1">
<value variable="u" tolerance="1e-6">0.00476409</value>
<value variable="v" tolerance="1e-6">0.000908482</value>
<value variable="w" tolerance="1e-6">0.000616045</value>
<value variable="p" tolerance="1e-6">0.00422569</value>
</metric>
<metric type="Linf" id="2">
<value variable="u" tolerance="1e-6">0.0418501</value>
<value variable="v" tolerance="1e-6">0.00387299</value>
<value variable="w" tolerance="1e-6">0.00349122</value>
<value variable="p" tolerance="1e-6">0.0254931</value>
</metric>
</metrics>
</test>
|
84ec24762658581f1d7865cecb4630965103736d | 449d555969bfd7befe906877abab098c6e63a0e8 | /1970/CH3/EX3.7/Ch03Exa7.sce | 72dc750c92248c56e73b1f9e21084e50f8ffa965 | [] | 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 | 596 | sce | Ch03Exa7.sce | // Scilab code Exa3.7: : Page 125(2011)
clc; clear;
Z = 82; // Atomic number
E = 1; // Energy of the beta paricle, MeV
I_l = 800; // Ionisation loss, MeV
R = Z*E/I_l; // Ratio of radiation loss to ionisation loss
E_1 = I_l/Z; // Energy of the beta particle when radiation radiation loss is equal to ionisation loss, MeV
printf("\nThe ratio of radiation loss to ionisation loss = %5.3e \nThe energy of the beta particle = %4.2f MeV ", R, E_1);
// Result
// The ratio of radiation loss to ionisation loss = 1.025e-01
// The energy of the beta particle = 9.76 MeV
|
4fc5aebc0f8fcb6915930df4efc61b3c75897ba5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2705/CH4/EX4.19/Ex4_19.sce | edc6f9d4452f57482e9ecc64addd26debb75e7cf | [] | 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,412 | sce | Ex4_19.sce | clear;
clc;
disp('Example 4.19');
// aim : To determine the condition of the steam after
// (a) isothermal compression to half its initial volume,heat rejected
// (b) hyperbolic compression to half its initial volume
// Given values
V1 = .3951;// initial volume,[m^3]
P1 = 1.5;// initial pressure,[MN/m^2]
// solution
// (a)
// from steam table, at 1.5 MN/m^2
hf1 = 844.7;// [kJ/kg]
hfg1 = 1945.2;// [kJ/kg]
hg1 = 2789.9;// [kJ/kg]
vg1 = .1317;// [m^3/kg]
// calculation
m = V1/vg1;// mass of steam,[kg]
vg2b = vg1/2;// given,[m^3/kg](vg2b is actual specific volume before compression)
x1 = vg2b/vg1;// dryness fraction
h1 = m*(hf1+x1*hfg1);// [kJ]
Q = m*x1*hfg1;// heat loss,[kJ]
mprintf('\n (a) The Quantity of steam present is = %f kg \n',m);
mprintf('\n Dryness fraction is = %f \n',x1);
mprintf('\n The enthalpy is = %f kJ \n',h1);
mprintf('\n The heat loss is = %f kJ \n',Q);
// (b)
V2 = V1/2;
// Given compression is according to the law PV=Constant,so
P2 = P1*V1/V2;// [MN/m^2]
// from steam table at P2
hf2 = 1008.4;// [kJ/kg]
hfg2 = 1793.9;// [kJ/kg]
hg2 = 2802.3;// [kJ/kg]
vg2 = .0666;// [m^3/kg]
// calculation
x2 = vg2b/vg2;// dryness fraction
h2 = m*(hf2+x2*hfg2);// [kJ]
mprintf('\n (b) The dryness fraction is = %f \n',x2);
mprintf('\n The enthalpy is = %f kJ\n',h2);
// End
|
297da8e504f75461f5c442a65237a7f7dcbdcd51 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1658/CH28/EX28.10/Ex28_10.sce | 3f1c1d9a2e164d0fdb10dc2732bdac0d7fdd8877 | [] | 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 | 138 | sce | Ex28_10.sce | clc;
//e.g 28.10
C1=0.1*10**-6;
C2=1*10**-6;
L=470*10**-6;
C=(C1*C2)/(C1+C2)
fo=1/(2*%pi*sqrt(L*C));
disp('kHZ',fo*10**-3,"fo=");
|
ad6662688718e51d14049c26839226c84395c478 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1574/CH15/EX15.1/BIT_Ex_15_1.sce | 9a60b6e5506b32e99b1158ebe622519e32cface8 | [] | 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 | BIT_Ex_15_1.sce | clc
//Chapter15
//Example15.1, page no 533
//Given
P_A=0.5// probability of producing symbol 'A'
P_B=0.25// probability of producing symbol 'B'
P_C=0.25// probability of producing symbol 'C'
H=P_A*log2(1/P_A)+P_B*log2(1/P_B)+P_C*log2(1/P_C)// the source entropy
mprintf('The source entropy is: %f bits/symbol',H)
|
64c8d7ee9389c00966d8738837bd92f384e9bd9f | 449d555969bfd7befe906877abab098c6e63a0e8 | /3751/CH2/EX2.6/Ex2_6.sce | 3c9ad5fcb4303e9bef4012bdab60c63cba6b7022 | [] | 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,104 | sce | Ex2_6.sce | //Fluid system - By - Shiv Kumar
//Chapter 2 - Impact of Jet
//Example 2.6
clc
clear
//Given Data:-
M=13.5; //Mass of plate, kg
d=16; //Diameter of the Jet, mm
V=20; //Velocity of the Jet, m/s
L=300; //Length of Edge of plate, mm
//Data Used:-
rho=1000; //Density of water, kg/m^3
g=9.81; //Acceleration due to gravity, m/s^2
//Computations:-
d=d/1000; //m
L=L/1000; //m
W=M*g; //Weight of Plate, N
a=(%pi/4)*d^2; //cross sectional area of Jet, m^2
//(a)
Fx=rho*a*V^2; //Force exerted by Jet normal to plate, N
//Taking Moment at 'A',
P=Fx*(L/2)/L; //N
//(b)
theta=asind(rho*a*V^2/W); //Angle of Swing, degrees
//Results:-
printf("(a)Horizontal force applied at Lower edge of plate to keep it vertical, P=%.3f N \n", P) //The answer vary due to round off error
printf("(b)Angle of swing, theta=%.2f degrees", theta) //The answer vary due to round off error
|
4fd04402055987593ee00a9e01263a554228dc0b | 491f29501fa7d484a5860f64aef3fa89fb18ca3d | /.sandbox/robotics/HuMAns_Bip/Visu/Visu.sci | ce6e3a8ff57e161919e1cdb8f330993d92fe9fa9 | [
"Apache-2.0"
] | permissive | siconos/siconos-tutorials | e7e6ffbaaea49add49eddd317c46760393e3ef9a | 0472c74e27090c76361d0b59283625ea88f80f4b | refs/heads/master | 2023-06-10T16:43:13.060120 | 2023-06-01T07:21:25 | 2023-06-01T07:21:25 | 152,255,663 | 7 | 2 | Apache-2.0 | 2021-04-08T12:00:39 | 2018-10-09T13:26:39 | Jupyter Notebook | UTF-8 | Scilab | false | false | 6,912 | sci | Visu.sci | // Copyright (C) INRIA 1999-2005
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License version 2 as published
// by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
// Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this program; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//%
// @file LagrangianDynamics/Complete/Visu.scilab
// @author Pierre-Brice Wieber
//
// Affiliation(s): INRIA, team BIPOP
//
// Email(s): Pierre-Brice.Wieber@inria.fr
//
// @brief Draw the visualisation 3D
//
// Description:
//
// Modifications:
// $Log$
// Revision 1.6 2005/10/28 08:14:14 billet
// Moving from old to new graphic style and removing of windows scilab visualization bug
//
// Revision 1.5 2005/05/04 13:13:15 billet
// Correction and changes for doxygen documentation
//
// Revision 1.4 2005/05/03 11:45:17 billet
// Comments for doxygen documentation
//
// Revision 1.3 2005/05/02 12:03:13 wieber
// Added the possibility to print a Message above the figure and prepared the new figure_style mode, still not active because buggy in Scilab 3.0.
//
// Revision 1.2 2005/04/07 15:37:29 wieber
// Drawing contact forces on different solids through the use of the variable ContactSolids.
//
// Revision 1.1.1.1 2005/02/08 13:08:22 rpissard
// version start HuMAnS
//
//
function [] = VisuPlay(flag, gwin)
///////////////////////////////////////////
// Draws a 3D stick figure of the system following the trajectory Q1.
// If LAMBDA is available, also draws the contact forces with a
// ratio of 1000N for 1m.
///////////////////////////////////////////
global QVISU;
global LAMBDAVISU;
///////////////////////////////////////////
// Compute the bounding box.
///////////////////////////////////////////
mmin = [%inf, %inf, %inf];
mmax = -mmin;
for k = 1:size(QVISU, 2),
tag = Tags(QVISU(:, k));
mmin = min([mmin; tag], 'r');
mmax = max([mmax; tag], 'r');
end;
mmin(2) = 0;
delta_iso = max(mmax-mmin);
mmin = (mmin+mmax)/2-0.55*delta_iso;
mmin(2) = 0;
mmax = mmin+1.1*delta_iso;
f = scf(gwin);
f.figure_name = "3D Stick Figure (HuMAnS)";
ha = f.children;
ha.axes_visible = "on";
ha.box = "on";
ha.view = "3d";
f.pixmap = "on";
ha.data_bounds = [mmin(3), mmin(1), mmin(2); mmax(3), mmax(1), mmax(2)];
if flag~=0 then
delete(ha.children);
else
f.figure_size=[600,600];
ha.rotation_angles = [80, 30];
end;
for k = 1:size(QVISU, 2),
tag = Tags(QVISU(:, k));
if k>1 then
delete(ha.children);
end;
///////////////////////////////////////////
// Draw the center of mass of the system,
///////////////////////////////////////////
param3d1([tag($,3)-0.02;tag($,3)+0.02;tag($,3)+0.02;tag($,3)-0.02;tag($,3)-0.02],...
[tag($,1)-0.02;tag($,1)+0.02;tag($,1)-0.02;tag($,1)+0.02;tag($,1)-0.02],...
list([tag($,2);tag($,2);tag($,2);tag($,2);tag($,2)],21), ...
ha.rotation_angles(2), ha.rotation_angles(1),"Z@X@Y", [1,4]);
if exists('LAMBDAVISU', 'all')&(size(LAMBDAVISU, 2)==size(QVISU, 2)) then
contact = Contact(QVISU(:, k));
contact = [contact(1:$/3), contact($/3+1:2*$/3), contact(2*$/3+1:$)];
lambda = [LAMBDAVISU(1:$/3, k), LAMBDAVISU($/3+1:2*$/3, k), LAMBDAVISU(2*$/3+1:$, k)];
/////////////////////////////////////////////
// draw the sum of the contact forces acting on each contacting solid
// at the corresponding center of pressure,
/////////////////////////////////////////////
for i = 1:size(ContactSolids, 1),
ContactPoints = ContactSolids(i, 1):ContactSolids(i, 2);
Force = lambda(ContactPoints, :);
if sum(Force(:, 2))>sqrt(%eps) then
COP = sum(diag(Force(:, 2))*contact(ContactPoints, :), 'r')/sum(Force(:, 2));
Force = COP+sum(Force/1000, 'r');
param3d1([COP(3)-0.02;COP(3)+0.02;COP(3)+0.02;COP(3)-0.02;COP(3)-0.02;COP(3);Force(3)],...
[COP(1)-0.02;COP(1)+0.02;COP(1)-0.02;COP(1)+0.02;COP(1)-0.02;COP(1);Force(1)],...
list([COP(2);COP(2);COP(2);COP(2);COP(2);COP(2);Force(2)],24),...
ha.rotation_angles(2), ha.rotation_angles(1), "Z@X@Y", [0,0]);
end;
end;
///////////////////////////////////////////
// draw the sum of all the contact forces acting on the system at the
// global center of pressure on the ground (aka the zero moment point),
///////////////////////////////////////////
if sum(lambda(:, 2))>sqrt(%eps) then
contact = contact(lambda(:, 2)>sqrt(%eps), :);
lambda = lambda(lambda(:, 2)>sqrt(%eps), :);
contact = contact-diag(contact(:, 2)./lambda(:, 2))*lambda;
COP = sum(diag(lambda(:, 2))*contact, 'r')/sum(lambda(:, 2));
lambda = COP+sum(lambda/1000, 'r');
param3d1([COP(3)-0.02;COP(3)+0.02;COP(3)+0.02;COP(3)-0.02;COP(3)-0.02;COP(3);lambda(3)],...
[COP(1)-0.02;COP(1)+0.02;COP(1)-0.02;COP(1)+0.02;COP(1)-0.02;COP(1);lambda(1)],...
list([COP(2);COP(2);COP(2);COP(2);COP(2);COP(2);lambda(2)],11),...
ha.rotation_angles(2), ha.rotation_angles(1), "Z@X@Y", [0,0]);
end;
end;
///////////////////////////////////////////
// and finally draw the 3D stick figure of the system.
///////////////////////////////////////////
param3d1([tag(StickFigure(:,1),3)'; tag(StickFigure(:,2),3)'], ...
[tag(StickFigure(:,1),1)'; tag(StickFigure(:,2),1)'], ...
[tag(StickFigure(:,1),2)'; tag(StickFigure(:,2),2)'], ...
ha.rotation_angles(2), ha.rotation_angles(1), "Z@X@Y", [0,0]);
if exists('Message') then
xtitle(Message);
end;
show_pixmap();
end;
endfunction
//%
// Draw the visualisation 3D of a position or a trajectory with contact
// forces if they exist.
// @param Q (float matrix, size = NDOF x NSAMPLES) trajectory or position
// @param LAMBDA (float matrix) contact forces
// @param Message (string, optionnal) Message to print above the figure
// @param DuringSimulationFlag (boolean, optionnal) Flag to know if we draw
// the figure during the simulation or not.
//
function [] = Visu(Q, LAMBDA, Message, DuringSimulationFlag)
global QVISU;
global LAMBDAVISU;
QVISU = Q;
if exists('LAMBDA', 'local')|(~exists('LAMBDA', 'local')&exists('LAMBDA', 'all')) then
LAMBDAVISU = LAMBDA;
end;
if ~exists('DuringSimulationFlag', 'local') then
DuringSimulationFlag = %F;
end;
if DuringSimulationFlag then
scf(2005);
clf();
end
VisuPlay(0, 2005);
if (~DuringSimulationFlag) then
addmenu(2005, "Replay", list(2, 'VisuPlay'));
end;
endfunction
|
7591d95a3e3a92174147db1900e484a0680cf20d | ae04c56a04befaa02df7b98f8c38159cc1ca6ca4 | /auto corelation.sce | 221923832513e47706dba35f87f77f3df9a47bfe | [] | no_license | suryaputra59/lorentz-_attractor | 14aed583a0d564a61af7785e20fc7af90dd2f7ba | ec6f3b6dd5f7b45e27022a3dbfb1394835ee3da5 | refs/heads/main | 2023-09-01T20:43:23.929652 | 2021-10-08T18:23:43 | 2021-10-08T18:23:43 | 415,085,164 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 748 | sce | auto corelation.sce | function ldot = f(t,l)
ldot = [sigma*(l(2,1)-l(1,1));
(r-l(3,1))*l(1,1)-l(2,1);
l(1,1)*l(2,1)-b*l(3,1)];
endfunction
/*x = l(1,1);
y = l(2,1);
z = l(3,1);*/
sigma = 10;
r = 28;
b = 2.66;
t = [0:0.01:90];
t0 = 0;
l0 = [0;1;1];
ls = ode(l0,t0,t,f);
title('Auto correlation for lorenz attractor')
[c, ind] = xcorr(ls(2,:), "coeff");
plot(ind, c)
a=get("current_axes")//get the handle of the newly created axes
a.axes_visible="on"; // makes the axes visible
a.font_size=3; //set the tics label font size
//a.x_location="top"; //set the x axis position
a.data_bounds=[0,0,-1;400,1,1]; //set the boundary values for the x, y and z coordinates.
a.sub_tics=[5,0];
a.labels_font_color=5;
//a.grid=[2,2];
a.box="off";
|
6086a70e37701377b976154a46f4c0afda981720 | 449d555969bfd7befe906877abab098c6e63a0e8 | /884/CH3/EX3.10/Example3_10.sce | b9def8f7cb9db6d1cc55684bf90af2d365040fbf | [] | 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 | 410 | sce | Example3_10.sce | //mass of an element in a given compound
clear;
clc;
printf("\t Example 3.10\n");
massCuFeS2=3.71*10^3;//given mass of CuFeS2, kg
CuFeS2=183.5;//mol. mass of CuFeS2, g
Cu=63.55;//mol. mass of Cu, g
percentCu=Cu/CuFeS2*100;//percent Cu in CuFeS2
massCu=percentCu*massCuFeS2/100;//mass of Cu in given CuFeS2, kg
printf("\t the mass of Cu in CuFeS2 is : %1.2f*10^3 kg\n",massCu*10^-3);
//End
|
e76a7158edc9c43dd9ef84c47bb4cfe9bdbadfeb | 449d555969bfd7befe906877abab098c6e63a0e8 | /1332/CH14/EX14.10/14_10.sce | e8c41ccb8c1a5092250572038f37701ad1e97f4a | [] | 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 | 222 | sce | 14_10.sce | //Example 14.10
//Spline Integration Method
//Page no. 478
clc;close;clear;
deff('y=f(x)','y=sind(%pi*x)')
deff('y=f1(x,h)','y=(f(x+h)-f(x))/h')
h=0.01;
n=2;h=0.5;a=0;b=1;
disp(integrate('f(x)','x',0,1),'I = ')
|
1f8ba9d67dffce20cc29755711606f2bcf2e613a | 449d555969bfd7befe906877abab098c6e63a0e8 | /1967/CH1/EX1.4/1_4.sce | e5b1add60d0be65a1df4c71df73b14c58ff3d589 | [] | 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 | 422 | sce | 1_4.sce | clc
//initialisation of variables
clear
v= 1 //lit
p= 1 //atm
h= 76 //cm
d= 13.595 //kg/cm^3
g= 980.66 //dunes cm^-2
j= 4.18 //joules
//CALCULATIONS
W= v*p
W1= h*d*g
W2= W1*10^-4
W3= W2/j
//RESULTS
printf ('Work done in lit-atm = %.f lit-atm',W)
printf ('\n Work done in dynes = %.2e dynes cm^-2',W1)
printf ('\n Work done in ergs = %.2e ergs',W2)
printf ('\n Work done in calories = %.2f calories',W3)
|
c0283335bf321d7971aae1cc71aabe758ad42f14 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1163/CH10/EX10.16/example_10_16.sce | 89c384a8b5c587aead841289e65c510b16f402bf | [] | 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,110 | sce | example_10_16.sce | clear;
clc;
disp("--------------Example 10.16---------------");
x=poly(0,"x");
// a) x+1
g=x^1+1;
t=0;
// compute t
while(%T)
q=(x^t+1)/g;
if(q == 1)
break;
end
t=t+1;
end
printf("a. t = %d . This is a very poor choice for a generator. Any two errors next to each other cannot be detected.\n\n",t); // display result
// b) x^4+1
g=x^4+1;
t=0;
// compute t
while(%T)
q=(x^t+1)/g;
if(q == 1)
break;
end
t=t+1;
end
printf("b. t = %d .This generator cannot detect two errors that are four positions apart. The two errors can be anywhere, but if their\ndistance is %d, they remain undetected.\n\n",t,t); // display result
// c) x^7+x^6+1
g=x^7+x^6+1;
printf("c. This is a good choice for this purpose.\n\n"); // display result
// d) x^15+x^14+1
t=32768; // very large to compute
printf("d. This polynomial cannot divide any error of type x^t + 1 if t is less than %d. This means that a codeword with two isolated\nerrors that are next to each other or up to %d bits apart can be detected by this generator.",t,t); // display result
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.