blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 214 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2
values | repo_name stringlengths 6 115 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 21
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 141k 586M ⌀ | star_events_count int64 0 30.4k | fork_events_count int64 0 9.67k | gha_license_id stringclasses 8
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 50
values | src_encoding stringclasses 23
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 1
class | length_bytes int64 5 10.4M | extension stringclasses 29
values | filename stringlengths 2 96 | content stringlengths 5 10.4M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d210b55b729dbb961e71ec3c9650a16054ac08e0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1034/CH2/EX2.2/example2.sce | a894a743b2fbab9458fdcdb88a72018e73ead7f4 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 384 | sce | example2.sce | clear;
clc;
printf("\n Example 2.2\n");
// String insertion.
s="auto";...............//1st string or character array.
x="mobile";...............//2nd string or character array.
z=s+x;..........//concatenation of 2 strings.
printf("\tstring s=");
disp(s);
printf("\tstring x=");
disp(x);
printf("\tconcatenated string z=");
disp(z);........//dispalying concatenated string. |
9aeac2bc27a80aa2d251f4699bee5c4cbca4ae74 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3840/CH2/EX2.6/Ex2_6.sce | e97510d41eafe5a96f4620ec6ae6af6fb2dfc007 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | Ex2_6.sce | clear
//
//
//
//Variable declaration
N=6.02*10**26 //Avagadro Number
n=8 //number of atoms
a=5.62*10**-10 //lattice constant(m)
M=72.59 //atomic weight(amu)
//Calculation
rho=n*M/(a**3*N) //density(kg/m**3)
//Result
|
639d01e5ffc6eb7f54db6dfa96050c9b9f47cad0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2216/CH2/EX2.1/ex_2_1.sce | cc514fbbeb2ff78d0462b624eb1656c9a6f8d445 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 636 | sce | ex_2_1.sce | //Example 2.1 // NA ,angles and pulse broadning
clc;
clear;
close;
format('v',9 )
disp("part (a)")
n1=1.5;//core refrative index
n2=1.48;//claddin refractive index
a=100/2;//radius in micro meter
na=1;//air refrative index
NA=sqrt(n1^2-n2^2);//numerical aperture
disp(NA,"numerical aperture is")
disp("part (b)")
am=(asind(NA));//
tm=asind(NA/n1);//
tc=asind(n2/n1);//
disp(am,"angle in degree is (αm)")
disp(tm,"angle in degree is (Om)")
disp(tc,"angle in degree is(Φc)")
disp("part (c)")
c=3*10^8;//speed of light in m/s
dtl=((n1/n2)*(n1-n2)/c);//pulse broadning per unit length
disp(dtl,"pulse broadning per unit length in sm^-1")
|
91358dbf64ec1cdb190aee670eb1d798c49f6c06 | 1b969fbb81566edd3ef2887c98b61d98b380afd4 | /Rez/bivariate-lcmsr-post_mi/bfas_oi_vrt_col_d/~BivLCM-SR-bfas_oi_vrt_col_d-PLin-VLin.tst | 094b52bc5b0ae9870abad99c9c8ca92933694d6a | [] | no_license | psdlab/life-in-time-values-and-personality | 35fbf5bbe4edd54b429a934caf289fbb0edfefee | 7f6f8e9a6c24f29faa02ee9baffbe8ae556e227e | refs/heads/master | 2020-03-24T22:08:27.964205 | 2019-03-04T17:03:26 | 2019-03-04T17:03:26 | 143,070,821 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 11,909 | tst | ~BivLCM-SR-bfas_oi_vrt_col_d-PLin-VLin.tst |
ESTIMATED COVARIANCE MATRIX FOR PARAMETER ESTIMATES
1 2 3 4 5
________ ________ ________ ________ ________
1 0.268492D+00
2 -0.147873D-02 0.211473D-02
3 -0.489459D-02 -0.855111D-03 0.393875D+00
4 -0.151137D-02 -0.618116D-04 -0.192970D-02 0.347601D-02
5 -0.134384D-02 0.368126D-04 0.206304D-02 0.746187D-04 0.352973D-02
6 0.904082D-03 0.247710D-04 -0.103239D-03 -0.122153D-04 -0.211316D-03
7 0.160761D-02 -0.279283D-04 -0.177985D-03 -0.680529D-05 0.235804D-03
8 0.196969D-03 0.945759D-04 -0.108814D-02 0.124828D-03 0.208188D-04
9 -0.425060D+00 0.211415D-01 0.400550D+00 -0.654718D-03 0.569136D-01
10 -0.361370D+00 -0.340545D-03 0.217110D+00 -0.230361D-02 0.165086D+00
11 -0.246230D+00 0.414167D-02 -0.333779D-01 0.654590D-02 -0.477824D-02
12 -0.148318D+00 -0.909303D-03 -0.119636D+01 0.557656D-01 -0.286384D-01
13 0.154384D+00 0.125550D-02 -0.799888D-02 0.410154D-02 0.198343D-01
14 0.133524D+00 -0.774451D-02 -0.454539D+00 0.204597D-01 -0.137601D-01
15 -0.224644D+01 -0.294356D-01 -0.295709D+00 -0.457382D-02 -0.867764D-01
16 -0.201096D-01 -0.733386D-02 0.134365D-01 -0.905398D-03 0.353195D-03
17 0.467435D-02 0.114137D-03 -0.192588D-02 0.116862D-03 -0.362659D-03
18 -0.439713D+00 -0.134231D-01 0.125577D+00 -0.250038D-01 -0.717341D-01
19 -0.793156D-01 -0.316111D-02 -0.122656D-01 0.946993D-02 -0.374516D-02
20 0.453864D+00 -0.142890D-01 -0.313927D+01 -0.302560D-01 0.282843D-01
21 0.684045D-01 0.265608D-02 -0.594019D-02 0.204075D-02 0.694238D-02
22 0.211472D-02 0.635864D-04 0.616929D-02 0.364590D-03 0.116659D-03
23 0.922255D-02 0.383885D-02 -0.419896D-01 -0.132870D-01 -0.442687D-03
24 0.177393D-02 0.283732D-03 0.261974D-02 -0.987364D-03 -0.392662D-04
ESTIMATED COVARIANCE MATRIX FOR PARAMETER ESTIMATES
6 7 8 9 10
________ ________ ________ ________ ________
6 0.529153D-03
7 0.617844D-03 0.426584D-02
8 0.833115D-04 -0.972193D-04 0.169113D-02
9 -0.178143D-01 -0.370705D-01 -0.101939D-01 0.357302D+02
10 -0.126934D-01 0.167045D-01 -0.528494D-02 0.213360D+01 0.163588D+02
11 -0.121162D-01 -0.197887D-01 0.610473D-02 0.231947D+01 0.199876D+00
12 0.301402D-02 -0.945023D-02 0.167409D-01 -0.599606D+00 -0.794965D+00
13 0.391591D-01 0.112174D+00 -0.272362D-03 -0.203517D+01 0.172219D+01
14 0.123668D-01 0.339031D-01 0.142322D+00 -0.139758D+01 0.373901D+00
15 0.134986D-01 -0.193625D-01 0.262556D-01 0.208488D+01 -0.336871D+01
16 -0.920818D-03 -0.242679D-02 -0.685236D-03 0.604478D+00 -0.154059D-01
17 -0.125951D-04 0.739879D-04 -0.162068D-03 -0.120527D+00 -0.359652D-01
18 -0.156549D-01 -0.464231D-01 -0.707592D-01 -0.864052D+01 -0.815880D+00
19 -0.130096D-01 0.386176D-02 -0.127846D-02 -0.901338D+00 -0.711785D+00
20 -0.157115D-01 0.257936D-01 -0.934463D-01 0.584794D+01 0.216127D+01
21 0.109148D-01 -0.884088D-02 0.176745D-02 0.106719D+01 0.901427D+00
22 0.707324D-04 0.237190D-04 0.296884D-03 0.439363D-01 -0.104438D-01
23 0.278950D-03 0.118261D-02 -0.443054D-03 -0.357393D-01 0.843209D-01
24 0.179565D-04 -0.270664D-04 -0.154161D-03 -0.745962D-02 -0.756755D-02
ESTIMATED COVARIANCE MATRIX FOR PARAMETER ESTIMATES
11 12 13 14 15
________ ________ ________ ________ ________
11 0.268766D+02
12 0.770335D+00 0.126117D+03
13 -0.419131D+01 0.255364D+01 0.113132D+02
14 -0.388568D+01 -0.765402D+00 0.260222D+01 0.567741D+02
15 -0.181595D+01 0.149847D+01 -0.260165D+01 0.290990D+01 0.184882D+03
16 0.256140D+00 -0.144409D+00 -0.157841D+00 -0.164911D+00 0.160223D+01
17 0.291818D-01 0.736533D-01 0.162461D-02 0.561427D-02 -0.875724D+00
18 -0.188267D+01 -0.496108D+01 -0.170610D+01 -0.102972D+02 0.205979D+01
19 0.372373D+00 -0.232757D+01 -0.142691D+01 0.150750D+01 -0.203792D+01
20 0.250118D+01 -0.175219D+02 -0.368536D+01 -0.159262D+02 0.107200D+02
21 0.888380D-01 0.248250D+01 0.123160D+01 -0.156997D+01 0.113863D+01
22 -0.339821D-01 0.459320D-01 -0.547410D-03 0.396347D-01 -0.311117D-01
23 0.699723D-02 -0.310708D+00 0.747182D-01 0.191577D+00 0.271250D+00
24 0.229130D-01 -0.123993D+00 -0.141607D-02 -0.911273D-01 -0.223438D-01
ESTIMATED COVARIANCE MATRIX FOR PARAMETER ESTIMATES
16 17 18 19 20
________ ________ ________ ________ ________
16 0.343071D+00
17 -0.211273D-01 0.109376D-01
18 -0.528833D+00 0.895186D-02 0.173067D+03
19 0.391275D-01 0.221636D-01 0.331549D+01 0.460431D+01
20 0.380968D+00 -0.498512D-01 -0.230328D+02 0.349213D+01 0.511738D+03
21 -0.292867D-01 -0.255914D-01 0.440693D-01 -0.428540D+01 -0.340652D+01
22 -0.108291D-02 0.430609D-03 -0.765370D+00 -0.181899D-01 0.125437D+00
23 -0.474043D-02 -0.287322D-02 -0.494688D+00 -0.376275D-01 0.465689D+01
24 -0.119281D-02 -0.480803D-03 0.232847D+00 -0.147718D-01 -0.248747D+01
ESTIMATED COVARIANCE MATRIX FOR PARAMETER ESTIMATES
21 22 23 24
________ ________ ________ ________
21 0.493161D+01
22 -0.180111D-01 0.703809D-02
23 0.294974D-02 -0.509094D-02 0.606194D+00
24 -0.111267D-02 -0.223976D-02 -0.319994D-01 0.249333D-01
ESTIMATED CORRELATION MATRIX FOR PARAMETER ESTIMATES
1 2 3 4 5
________ ________ ________ ________ ________
1 1.000
2 -0.062 1.000
3 -0.015 -0.030 1.000
4 -0.049 -0.023 -0.052 1.000
5 -0.044 0.013 0.055 0.021 1.000
6 0.076 0.023 -0.007 -0.009 -0.155
7 0.048 -0.009 -0.004 -0.002 0.061
8 0.009 0.050 -0.042 0.051 0.009
9 -0.137 0.077 0.107 -0.002 0.160
10 -0.172 -0.002 0.086 -0.010 0.687
11 -0.092 0.017 -0.010 0.021 -0.016
12 -0.025 -0.002 -0.170 0.084 -0.043
13 0.089 0.008 -0.004 0.021 0.099
14 0.034 -0.022 -0.096 0.046 -0.031
15 -0.319 -0.047 -0.035 -0.006 -0.107
16 -0.066 -0.272 0.037 -0.026 0.010
17 0.086 0.024 -0.029 0.019 -0.058
18 -0.065 -0.022 0.015 -0.032 -0.092
19 -0.071 -0.032 -0.009 0.075 -0.029
20 0.039 -0.014 -0.221 -0.023 0.021
21 0.059 0.026 -0.004 0.016 0.053
22 0.049 0.016 0.117 0.074 0.023
23 0.023 0.107 -0.086 -0.289 -0.010
24 0.022 0.039 0.026 -0.106 -0.004
ESTIMATED CORRELATION MATRIX FOR PARAMETER ESTIMATES
6 7 8 9 10
________ ________ ________ ________ ________
6 1.000
7 0.411 1.000
8 0.088 -0.036 1.000
9 -0.130 -0.095 -0.041 1.000
10 -0.136 0.063 -0.032 0.088 1.000
11 -0.102 -0.058 0.029 0.075 0.010
12 0.012 -0.013 0.036 -0.009 -0.018
13 0.506 0.511 -0.002 -0.101 0.127
14 0.071 0.069 0.459 -0.031 0.012
15 0.043 -0.022 0.047 0.026 -0.061
16 -0.068 -0.063 -0.028 0.173 -0.007
17 -0.005 0.011 -0.038 -0.193 -0.085
18 -0.052 -0.054 -0.131 -0.110 -0.015
19 -0.264 0.028 -0.014 -0.070 -0.082
20 -0.030 0.017 -0.100 0.043 0.024
21 0.214 -0.061 0.019 0.080 0.100
22 0.037 0.004 0.086 0.088 -0.031
23 0.016 0.023 -0.014 -0.008 0.027
24 0.005 -0.003 -0.024 -0.008 -0.012
ESTIMATED CORRELATION MATRIX FOR PARAMETER ESTIMATES
11 12 13 14 15
________ ________ ________ ________ ________
11 1.000
12 0.013 1.000
13 -0.240 0.068 1.000
14 -0.099 -0.009 0.103 1.000
15 -0.026 0.010 -0.057 0.028 1.000
16 0.084 -0.022 -0.080 -0.037 0.201
17 0.054 0.063 0.005 0.007 -0.616
18 -0.028 -0.034 -0.039 -0.104 0.012
19 0.033 -0.097 -0.198 0.093 -0.070
20 0.021 -0.069 -0.048 -0.093 0.035
21 0.008 0.100 0.165 -0.094 0.038
22 -0.078 0.049 -0.002 0.063 -0.027
23 0.002 -0.036 0.029 0.033 0.026
24 0.028 -0.070 -0.003 -0.077 -0.010
ESTIMATED CORRELATION MATRIX FOR PARAMETER ESTIMATES
16 17 18 19 20
________ ________ ________ ________ ________
16 1.000
17 -0.345 1.000
18 -0.069 0.007 1.000
19 0.031 0.099 0.117 1.000
20 0.029 -0.021 -0.077 0.072 1.000
21 -0.023 -0.110 0.002 -0.899 -0.068
22 -0.022 0.049 -0.693 -0.101 0.066
23 -0.010 -0.035 -0.048 -0.023 0.264
24 -0.013 -0.029 0.112 -0.044 -0.696
ESTIMATED CORRELATION MATRIX FOR PARAMETER ESTIMATES
21 22 23 24
________ ________ ________ ________
21 1.000
22 -0.097 1.000
23 0.002 -0.078 1.000
24 -0.003 -0.169 -0.260 1.000
|
708739733483e09a58ad9bcabd2829fc0c51acf9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /623/CH27/EX5.5.2/U5_C5_2.sce | 5e712bd2665e81b1e04b2b814be7ed7f0b595a0d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,498 | sce | U5_C5_2.sce | //function for calculating the energy level
function[energy]=F(j)
energy=a*j*(j+1);
endfunction
//variable initialization
m=1.6738*10^-27; //mass of hydrogen atom (kg)
r=0.74*10^-10; //intermolecular distance of hydrogen molecule (meter)
h=1.054*10^-34; //Planck's constant (joule second)
e=1.6*10^-19; //Charge of electron (coulombs)
//calculation of rotational energy levels
mu=m/2; //reduced mass of hydrogen atom (kg)
I=mu*r^2; //moment of inertia of molecule (kg meter^2)
a=h^2/(2*I*e); //constant (eV)
E0=F(0); //energy of level 0 (eV)
E1=F(1); //energy of level 1 (eV)
E2=F(2); //energy of level 2 (eV)
E3=F(3); //energy of level 3 (eV)
printf("\nE0 = %.0f\nE1 = %.2e eV\nE2 = %.2e eV\nE3 = %.2e eV",E0,E1,E2,E3);
|
2406fbe357cad1b074c9236b260c9c54b65ba81d | 449d555969bfd7befe906877abab098c6e63a0e8 | /1646/CH9/EX9.11/Ch09Ex11.sce | d40a165f1a51c6e2aa136f102a240bca25357761 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 513 | sce | Ch09Ex11.sce | // Scilab Code Ex9.11: Page-468 (2011)
clc;clear;
alpha = 3.5;....// Attenuation of the optical fibre, dB/km
Pi = 0.5;....// Input power of optical fibre, mW
L = 4;.... // Distance through the optical wave transmits through the fibre, km
// As alpha = 10/L*log10(Pi/Po), solving for Po
Po = Pi/exp(alpha*L*2.3026/10); // Output power of optical fibre, mW
printf("\nThe output power of optical fibre = %4.1f micro-watt", Po/1e-003);
// Result
// The output power of optical fibre = 19.9 micro-watt
|
54dc3eb4e2f4e3a5e53a0af8a4116e71021a1028 | 449d555969bfd7befe906877abab098c6e63a0e8 | /542/CH11/EX11.19/Example_11_19.sci | a78fb62cc8c84ef837474e112ba9d1bd59e6394b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 785 | sci | Example_11_19.sci | clear all;
clc;
printf("\n Example 11.19");
//Data from fig. 11.42
a = [0 0.02 0.04 0.06 0.08 0.1 0.2 0.4 0.6 0.8 1.0];
b = [0.75 0.62 0.60 0.57 0.55 0.52 0.45 0.30 0.18 0.09 0];
//a = (R-Rm)/(R+1)
//b = [(n+1)-(nm+1)]/(n+2)
R = [0.92 1.08 1.25 1.75 2.5 3.5 5.0 7.0 9.0];
n = [28.6 22.8 16.9 13.5 11.7 10.5 9.8 9.2 8.95];
plot(n,R);
xtitle("Plot of R vs n","n","R");
printf("\n Derivative calculated from the graph");
d = [110.0 34.9 9.8 3.8 1.7 0.6 0.4 0.2 0.05];
i=1;
while i <=9
s = R(i)+1 - (n(i)+7.72)/d(i);
if s <=0.0001 then
Ropt = R(i);
printf("\n Ropt = %.2f",Ropt);
break;
end
i=i+1;
end
printf("\n R is approximately %.1f percent of the minimum reflux condition",1.25/0.866666666*100);
|
308e97f5dfa79778cb07bd758e1c3977228a8084 | eb7eeb04a23a477e06f3c0e3d099889caee468b4 | /src/examples/scilab/scilab_shallowwater/runshallowwater.sce | cc716d1f89f04dbdfe90efd635c5d70fab937b5d | [] | no_license | mikeg64/iome | 55699b7d7b3d5c1b006d9c82efe5136b8c909dfd | cc1c94433133e32776dcf16704ec4ec337b1b4a0 | refs/heads/master | 2020-03-30T15:57:33.056341 | 2016-04-13T09:24:27 | 2016-04-13T09:24:27 | 151,387,236 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,333 | sce | runshallowwater.sce | //Steven McHale
//Tsunami Model
//Shallow-Water Wave Equation
//Crank-Nicholson Discretization
clear;
//clf;
clc;
// Constants
g = 9.81;
u0 = 0;
v0 = 0;
b = 0;
h0 = 5030;
// Define the x domain
//ni = 151;
ni=41;
xmax = 100000;
dx = xmax/(ni-1);
x = [0:dx:xmax];
// Define the y domain
//nj = 151;
nj=41;
ymax = 100000;
dy = ymax/(nj-1);
y = [0:dy:ymax];
tmax = 15;
// Define the wavespeed
wavespeed = u0 + sqrt(g*(h0 - b));
// Define time-domain
dt = 0.68*dx/wavespeed;
//t = [0:dt:tdomain];
t=[1:dt:tmax];
courant = wavespeed*dt/dx;
// Build empty u, v, b matrices
u=zeros(length(x), length(y), length(t));
v=zeros(length(x), length(y), length(t));
b=zeros(length(x), length(y));
// Define h
h=zeros(length(x), length(y), length(t));
h(:,:,1) = 5000;
h((45000/100000*(length(x)-1)+1):floor(55000/100000*(length(x)-1)+1),(45000/100000*(length(y)-1)+1):floor(55000/100000*(length(y)-1)+1),1) = 5030;
//Define b
for i = 1:length(x)
if x(i) > 20001
b(:,i) = 0;
elseif x(i) < 20000
b(:,i) = 5000/20000*(20000-x(i));
end
end
// Employ Lax
for n=1:(length(t)-1)
for i=2:(ni-1)
for j=2:(nj-1)
u(i,j,n+1) = ((u(i+1,j,n) + u(i-1,j,n) + u(i,j+1,n) + u(i,j-1,n))/4)...
- 0.5*(dt/dx)*((u(i+1,j,n)^2)/2 - (u(i-1,j,n)^2)/2)...
- 0.5*(dt/dy)*(v(i,j,n))*(u(i,j+1,n) - u(i,j-1,n)) - 0.5*g*(dt/dx)*(h(i+1,j,n)-h(i-1,j,n));
v(i,j,n+1) = ((v(i+1,j,n) + v(i-1,j,n) + v(i,j+1,n) + v(i,j-1,n))/4)...
- 0.5*(dt/dy)*((v(i,j+1,n)^2)/2 - (v(i,j+1,n)^2)/2)...
- 0.5*(dt/dx)*(u(i,j,n))*(v(i+1,j,n) - v(i-1,j,n)) - 0.5*g*(dt/dy)*(h(i,j+1,n)-h(i,j-1,n));
h(i,j,n+1) = ((h(i+1,j,n) + h(i-1,j,n) + h(i,j+1,n) + h(i,j-1,n))/4)...
- 0.5*(dt/dx)*(u(i,j,n))*((h(i+1,j,n)-b(i+1,j)) - (h(i-1,j,n)-b(i-1,j)))...
- 0.5*(dt/dy)*(v(i,j,n))*((h(i,j+1,n)-b(i,j+1)) - (h(i,j-1,n)-b(i,j-1)))...
- 0.5*(dt/dx)*(h(i,j,n)-b(i,j))*(u(i+1,j,n)- u(i-1,j,n))...
- 0.5*(dt/dy)*(h(i,j,n)-b(i,j))*(v(i,j+1,n) - v(i,j-1,n));
end
end
// Define Boundary Conditions
u(1,:,n+1) = 2.5*u(2,:,n+1) - 2*u(3,:,n+1) + 0.5*u(4,:,n+1);
u(length(x),:,n+1) = 2.5*u(ni-1,:,n+1) - 2*u(ni-2,:,n+1) + 0.5*u(ni-3,:,n+1);
u(:,1,n+1) = 2.5*u(:,2,n+1) - 2*u(:,3,n+1) + 0.5*u(:,4,n+1);
u(:,length(y),n+1) = 2.5*u(:,nj-1,n+1) - 2*u(:,nj-2,n+1) + 0.5*u(:,nj-3,n+1);
v(1,:,n+1) = 2.5*v(2,:,n+1) - 2*v(3,:,n+1) + 0.5*v(4,:,n+1);
v(length(x),:,n+1) = 2.5*v(ni-1,:,n+1) - 2*v(ni-2,:,n+1) + 0.5*v(ni-3,:,n+1);
v(:,1,n+1) = 2.5*v(:,2,n+1) - 2*v(:,3,n+1) + 0.5*v(:,4,n+1);
v(:,length(y),n+1) = 2.5*v(:,nj-1,n+1) - 2*v(:,nj-2,n+1) + 0.5*v(:,nj-3,n+1);
h(1,:,n+1) = 2.5*h(2,:,n+1) - 2*h(3,:,n+1) + 0.5*h(4,:,n+1);
h(length(x),:,n+1) = 2.5*h(ni-1,:,n+1) - 2*h(ni-2,:,n+1) + 0.5*h(ni-3,:,n+1);
h(:,1,n+1) = 2.5*h(:,2,n+1) - 2*h(:,3,n+1) + 0.5*h(:,4,n+1);
h(:,length(y),n+1) = 2.5*h(:,nj-1,n+1) - 2*h(:,nj-2,n+1) + 0.5*h(:,nj-3,n+1);
end
|
269b5525b393a8263d324c67830eae464620f22e | 449d555969bfd7befe906877abab098c6e63a0e8 | /2267/CH12/EX4.15/Ex12_15.sce | e4519b55aec390dff23f8eec26cc0104c6a4009c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 445 | sce | Ex12_15.sce | //Part B Chapter 4 Example 15
clc;
clear;
close;
l=3;//m
d1=85;//mm
d2=65;//mm
A=1*0.5;//m^2
Pw=2200;//N/mm^2
LG=Pw*A//N(Total Wind load at G)
M=LG*(3+0.25)//Nm(Max BM on pipe)
T=LG*(0.5+0.5);//Nm
I=%pi/64*(d1^4-d2^4);//mm^4
Z=I/42.5;//mm^3
Zp=2*Z;//mm^3
sigma_b=M*1000/Z;//N/mm^2
tau_s=T*1000/Zp;//N/mm^2
disp("Maximum bending stress is "+string(sigma_b)+" N/mm^2");
disp("Maximum shear stress is "+string(tau_s)+" N/mm^2");
|
1c79e14394f2dc56858d6cb5dac108ab6c39b9ff | 449d555969bfd7befe906877abab098c6e63a0e8 | /3432/CH3/EX3.4/Ex3_4.sce | dacf05a5f62ef2fac5bdfb39d2dcd40da636a1c7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,756 | sce | Ex3_4.sce | //Example 3.4
//Frequency response
xdel(winsid())//close all graphics Windows
clear;
clc;
//------------------------------------------------------------------
//(a) Frequency response of 1/(s+k)
k=1;
fmin=1e-2;
fmax=1e2;
// Transfer function
s=poly(0,'s');
sysH=syslin('c',1/(s+k))
//Frequency response for k=1
//Note that - magnitude plot semilog plot unlike log-log plot in the book.
bode(sysH,fmin,fmax)
title('Frequency response for k=1','fontsize',3)
//------------------------------------------------------------------
//(b) Response to u=sin(10*t);
t=0:0.02:10;
u=sin(10*t);
y=csim(u,t,sysH);
figure, plot(t,y)
//Title, labels and grid to the figure
exec .\fig_settings.sci; // custom script for setting figure properties
title('Complete transient response','fontsize',3)
xlabel('Time (sec.)','fontsize',2)
ylabel('Output','fontsize',2)
//phase lag
figure, plot(t,y)
plot(t,u,'r')
zoom_rect([9 -1 10 1])
exec .\fig_settings.sci; // custom script for setting figure properties
title('Phase lag between output and input','fontsize',3)
xlabel('Time (sec.)','fontsize',2)
ylabel('Output, Input','fontsize',2)
h=legend('y(t)','u(t)')
h.legend_location = "in_upper_right"
h.fill_mode='off'
// time lag
w=find(t>=9.4 & t<=10);
T=t(w);
Y=y(w);
U=u(w);
wu=find(U==max(U))
wy=find(Y==max(Y))
//Responses
plot2d3(T(wy),Y(wy))
plot2d3(T(wu),U(wu))
delta_t=T(wu)-T(wy); //time lag sec.
xstring(9.64,-0.1,"$\delta t$",0,0)
xarrows([9.58;9.72], [0;0], 0.7, 1)
xarrows([9.72;9.58], [0;0], 0.7, 1)
t=get("hdl")
disp(abs(delta_t), "Time lag of output in sec. is")
disp(abs(delta_t)*10, "Phase lag of output in radians is")
//------------------------------------------------------------------
|
ad1cad0371c261428ecd3dd3638b7d88ab058bdc | 449d555969bfd7befe906877abab098c6e63a0e8 | /773/CH9/EX9.01/9_01.sci | b18a252373077bdcb7a98ab88423fd5f1ad0c3de | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 376 | sci | 9_01.sci | //calculates//
s=%s;
G=syslin('c',20/(s*(s+4)))
H=0.35;
y=G*H;
S=1/(1+y);
disp(S,"1/(1+G(s)*H(s))")
//given w=1.2
w=1.2
s=%i*w
S=horner(S,s) //calculates value of S at s
a=abs(S)
disp(a,"sensitivity of open loop")
F=-y/(1+y)
disp(F,"(-G(s)*H(s))/(1+G(s)*H(s))")
S=horner(F,s) //calculates value of F at s
b=abs(S)
disp(b,"sensitivity of closed loop")
|
d3dba93d8e69b442a8409d7930e43b9d7a2c479d | eb7eeb04a23a477e06f3c0e3d099889caee468b4 | /src/examples/scilab/scilab_shallowwater/paramscollabtest1.sce | 7ec898f57768fb28078bbd3851700a947404ff52 | [] | no_license | mikeg64/iome | 55699b7d7b3d5c1b006d9c82efe5136b8c909dfd | cc1c94433133e32776dcf16704ec4ec337b1b4a0 | refs/heads/master | 2020-03-30T15:57:33.056341 | 2016-04-13T09:24:27 | 2016-04-13T09:24:27 | 151,387,236 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 523 | sce | paramscollabtest1.sce |
// Camera parameters
vfrom = [25 25 21];
vto = [23 25 0];
vup = [0.2 0.8 0.6];
fcamwidth = 47;
istep = 1;
sname='testsim3';
cam=struct('camfrom',vfrom,'camto',vto,'camup',vup,'camwidth',fcamwidth);
settings=struct('step',istep,'name',sname);
metadata.author='MikeG';
metadata.sdate=date();
metadata.platform='felix';
metadata.desc='Collab viewer example';
metadata.name='collabtestsim3';
elist=list(2);
elist(1)='localhost';
//elist(1)='10.0.16.99';
elist(2)=8080;
elist(3)=0;
|
0fb591b8f99700ddddaadfba0db08bf48ac4ac3a | 717ddeb7e700373742c617a95e25a2376565112c | /3044/CH3/EX3.4/Ex3_4.sce | a219aa50989469aec850335b64bee64827ac1d4f | [] | 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 | 293 | sce | Ex3_4.sce | //Variable declaration
n1 = 4 // Total operators
n2 = 3 // Total Machines
n3 = 8 // Test specimens for each pair
//Calculation
Total_pairs = n1*n2
Total_specimens = n1*n2*n3
//Results
printf ( "Total Pairs : %.f ",Total_pairs)
printf ( "Total Test specimens : %.f",Total_specimens)
|
7ad257cfbf0df469e2cf4981407a510e9b3bc5be | 1db0a7f58e484c067efa384b541cecee64d190ab | /macros/isminphase.sci | d86f76f11f0081ee11f1c347911a2ee5e1eb672c | [] | no_license | sonusharma55/Signal-Toolbox | 3eff678d177633ee8aadca7fb9782b8bd7c2f1ce | 89bfeffefc89137fe3c266d3a3e746a749bbc1e9 | refs/heads/master | 2020-03-22T21:37:22.593805 | 2018-07-12T12:35:54 | 2018-07-12T12:35:54 | 140,701,211 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,073 | sci | isminphase.sci | <<<<<<< HEAD
//isminphase Determine whether filter is minimum phase or not
// Description : It determines whether the given system function is minimum phase system or not . Minimum phase system means all zeros of transfer function will be inside the unit circle in z-plane , also poles mustbe within unit circle for stability and causality
//Syntax
//flag = isminphase(b,a)
//flag = isminphase(sos)
//flag = isminphase(...,tol)
// b and a are the vectors containing numerator and denumerator coefficients respectively
//tol, tolerance is used to determine when two numbers are close enough to be considered equal.
//Example : of minimum phase system
//flag = isminphase([1 -0.3 0.02],1)
//Output
// flag =
//
// 1.
=======
>>>>>>> 6bbb00d0f0128381ee95194cf7d008fb6504de7d
//Author: Parthasarathi Panda
//parthasarathipanda314@gmail.com
function ismin=isminphase(varargin)
[nargout,nargin]=argn();
if (nargin==2) then
a=varargin(1);
b=varargin(2);
if type(a)~=1 | type(b)~=1 then
error('check input type');
end
v=size(a);
if length(v)>2 then
error('check input dimension');
end
v=size(b);
if length(v)>2 then
error('check input dimension');
end
[n,k]=size(a);
if k==1 then
a=a';
elseif n~=1 then
error('check input dimension');
end
[n,k]=size(b);
if k==1 then
b=b';
k=n;
elseif n~=1 then
error('check input dimension');
end
elseif (nargin==1) then
sos=varargin(1);
if type(sos)~=1 then
error('check input dimension');
end
v=size(sos);
if length(v)>2 then
error('check input dimension');
end
if v(2)~=6 then
error('no. of columns must be 6');
end
a=1;b=1;
for i=[1:v(1)]
a=convol(a,sos(i,1:3));
b=convol(b,sos(i,4:6));
end
else
error('no. of inputs not matching');
end
poly_a=inv_coeff(a);
poly_b=inv_coeff(b);
z=inv_coeff([1,0]);
gc=gcd([poly_a,poly_b]);
[r,den]=pdiv(poly_b,gc);
[r,num]=pdiv(poly_a,gc);
<<<<<<< HEAD
maxpole=max(abs(roots(den)));
maxzero=max(abs(roots(num)));
if length(b)==1 then
if length(a)==1 then
ismin=1;
elseif maxzero<1 then
ismin=0;
else
ismin=1;
end
elseif maxpole>1 then
if length(a)==1 then
=======
maxpole=min(abs(roots(den)));
maxzero=min(abs(roots(num)));
if length(a)==1 then
if length(b)==1 then
ismin=1;
elseif maxzero>1 then
ismin=1;
else
ismin=0;
end
elseif maxpole>1 then
if length(b)==1 then
>>>>>>> 6bbb00d0f0128381ee95194cf7d008fb6504de7d
ismin=1;
elseif maxzero>1 then
ismin=1;
else
ismin=0;
end
else
ismin=0;
end
endfunction
|
c92f362529f7ff8ab69a398de6f00af7e8dc19cf | 449d555969bfd7befe906877abab098c6e63a0e8 | /1382/CH5/EX5.12/EX_5_12.sce | d03e8601d9ca9f203fd58c95971cd64ce839fc65 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,027 | sce | EX_5_12.sce | // Example 5.12:corner frequency and maximum GAIN
clc;
clear;
close;
Vcc=10;// Colector voltage in volts
Beta= 100;
Rc=1;// Collector resistance in killo ohms
Rs=600;//SERIES RESISTANCE IN OHMS
Re=0.2;// in kilo ohms
R1= 50;// in kilo ohms
R2= 10;// in kilo ohms
Vbe=0.7;// Base to emitter voltage in volts
C1=1;//capacitance in micro farad
Vth=Vcc * (R2/(R1+R2)); // vOLTAGE AT BASE
Rth= (R1*R2)/(R1+R2);
Ib=((Vcc-Vbe)/((Rth+(1+Beta)*Re)*10^3))*10^5;//in micro ampere
Icq= Beta*Ib*10^-3;//in milli ampere
Vt=26;//volate at room termprature in milli volts
gm= (Icq/Vt)*10^3;//transconductance in milli ampere per volts
rpi= (Beta*Vt*10^-3)/(Icq*10^-3);//resistance
Rb=Rth;//base resistance in killo ohms
x=(rpi+(1+Beta)*Re*10^3);//
y=(Rs+Rb*10^3);//
ts=((x*y)/(x+y))*C1*10^-3;//in milli second
fl= (1/(2*%pi*ts*10^-3));//corner frequency in hertz
Ri=(x*Rb*10^-3)/(Rb+x*10^-3);//
Av= ((gm*10^-3*rpi*Rc*10^3)*Rb*10^3)/((Ri+Rs*10^-3)*10^3*(x*10^-3+Rb)*10^3);
disp (fl,"corner frequency in hertz is")
disp(Av,"maximum gain is")
|
a1ed3d1a5ff35caa3937fb029e1225d71ea3bbb3 | a4bbc60bcc82ee6212825ce21fc9e4fa7b04e870 | /Bioinformatics_3k/3uzd/tests/1AXC.tst | df229dd1bbc0d125423d334cc0e6c3af9d7b1879 | [] | no_license | Luksys5/LT_programos | 3a7cabb6c5e8a23a856983c1938d2d492cddf916 | 959ab74029df334767fcad84adc46ae36cf7cdf1 | refs/heads/master | 2021-01-19T19:33:11.505596 | 2017-03-12T18:08:14 | 2017-03-12T18:08:14 | 16,478,166 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 92 | tst | 1AXC.tst | #$Id: pdbboxes 232 2015-05-04 12:44:10Z Lukas_Tutkus $
93.962 97.136 44.179 inputs/1AXC.pdb
|
350d4b496b693118d3b87a002e6bc72487cfcea3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3788/CH6/EX6.2.1/Ex6_2_1.sce | eee07265cac6b9d1b1ec8f1ab310f0f3b932b1b4 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,190 | sce | Ex6_2_1.sce | //example 6.2.1
//calculate power level at op of transponder
//variables
clc
clear
pearth = 500
gain = 105
backoff = 3
outputpower = 40
BWStA = 15
BWStB = 10
BWStC = 5
Pt = 20
EIRPa = 3.0
EIRPb = 4.8
EIRPc = 7.8
PtindB=10*log10(outputpower) - backoff
printf("Power of tansponder is %fdBW \n",PtindB)
BWt = BWStA + BWStB + BWStC
PtA = 10*log10((BWStA/BWt)*Pt)
PtB = 10*log10((BWStB/BWt)*Pt)
PtC = 10*log10((BWStC/BWt)*Pt)
printf("Transponder power output allocated to StA is %f dBW \n",PtA)
printf("Transponder power output allocated to StB is %f dBW\n",PtB)
printf("Transponder power output allocated to StC is %f dBW\n",PtC)
PinA = PtA - gain
PinB = PtB - gain
PinC = PtC - gain
printf("Transponder input power for StA signal is %f dBW\n",PinA)
printf("Transponder input power for StB signal is %f dBW\n",PinB)
printf("Transponder input power for StC signal is %f dBW \n",PinC)
Pte = 10*log10(250)
PStA = Pte - EIRPa
PStB = Pte - EIRPb
PStC = Pte - EIRPc
printf("The Earth Station A transmit power is %f dBW \n",PStA)
printf("The Earth Station B transmit power is %f dBW \n",PStB)
printf("The Earth Station C transmit power is %f dBW\n",PStC)
|
426755f13c5661dcd9bf85b0562a2b407b0f7c4c | 449d555969bfd7befe906877abab098c6e63a0e8 | /3557/CH2/EX2.7/Ex2_7.sce | 517b72418ac847acbe70377872c96a43ebb2325e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 81 | sce | Ex2_7.sce | //Example 2.7//
a=sqrt(3);// Given //By formula
b=1;//Given
r=a-b
disp(r)
|
639134c7603671bc703a40dbf3f74c2f596c96d7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /788/CH3/EX3.8.b/3_8_soln.sce | 48bb04d8ab769c7e82ef4c68bddae30ab02bfe05 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 809 | sce | 3_8_soln.sce | clc;
pathname=get_absolute_file_path('3_8_soln.sce')
filename=pathname+filesep()+'3_8_data.sci'
exec(filename)
// Solution:
// The required piston area,
A=round(F_load/p); //in^2
// The necessary pump flow rate,
Q=((A/144)*S)/t; //ft^3/s
Q_gpm=Q*449; //gpm
// The Hydraulic Horsepower delivered to cylinder,
HHP=(p*Q_gpm)/1714; //HP
// rounding off the above answer
HHP=fix(HHP)+(fix(floor((HHP-fix(HHP))*10))/10); //HP
// The output horsepower delivered by cylinder to load,
OHP=HHP*eta; //HP
// Results:
printf("\n Results: ")
printf("\n The Required piston area is %.0f in^2.",A)
printf("\n The necessary pump flow rate is %.1f gpm.",Q_gpm)
printf("\n The Hydraulic Horsepower delivered to cylinder is %.1f HP.",HHP)
printf("\n The output horsepower delivered by cylinder to load is %.1f HP.",OHP)
|
bbc166241d19268648c5fb9ce01a02190cca35d3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3523/CH16/EX16.7.2/Ex16_2.sce | 8970b928bd5e4365afc7679b6e6b06c74bc4f46d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 619 | sce | Ex16_2.sce |
clear all
clc
close
iload=5*1e-3;//Load current in A
//Capacitances of Cockcroft-Waltobn type voltage tripler in F
C1=0.01*1e-6;
C2=0.05*1e-6;
C3=0.10*1e-6;
f=50;//frequency in Hz
Vs=100*1e3//Supply voltage in V
//Ripple voltage in V
dv=iload/f*(2/C1+1/C3)
printf('Ripple voltage in V %f',dv)
//Voltage drop in V
Vdrop=iload/f*(1/C2+1/C1+1/(2*C3))
printf('Voltage drop in V %f',Vdrop)
//Average output voltage in V
V_av=3*sqrt(2)*Vs-Vdrop
printf('Avarage voltage in V %f',V_av)
//Ripple factor in percentage
RF=Vdrop/(3*Vs*sqrt(2))*100
printf('Ripple voltage in percentage %f',RF)
|
00e7bd32565afc9f38d20b5a1608c340df92c902 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2420/CH2/EX2.11.b/2_11b.sce | df914cde944c3fea0c34e58690e98a92198d3021 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 174 | sce | 2_11b.sce | clc
clear
//Initialization of variables
Co=0.1
Co2=14.1
Cb=0.646
//calculations
Q2=Co/(Co+Co2) *Cb*10160
//results
printf("Heat loss = %d Btu per lb of fuel",Q2)
|
3a637f7d9b91f3af619ea1ebc3ad95f01496fd3b | 449d555969bfd7befe906877abab098c6e63a0e8 | /3733/CH24/EX24.12/Ex24_12.sce | aff2f15651361788d3ddc8c355987683dc57b8cc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,168 | sce | Ex24_12.sce | // Example 24_12
clc;funcprot(0);
//Given data
P=10;// Power plant capacity in MW
T_1=300;// K
T_4=960;// K
e=0.7;// The effectiveness of regenerator
n_c=0.8;// Isentropic efficiency of compressor
n_t=0.90;// Isentropic efficiency of turbine
n_com=0.96;// Combustion efficiency
n_m=0.95;// Mechanical efficiency
n_g=0.95;// Generation efficiency
CV=40000;// kJ/kg
C_pa=1;// kJ/kg.K
r=1.4;// Specific heat ratio
Cf_t=4000;// Cost of fuel in Rs./tonne
Oc=3000;// All other charges in rupees
Q=90;// Heat developed in combustion chamber in %
//Calculation
p_r=(n_c*n_t*(T_4/T_1))^(r/(2*(r-1)));// Pressure ratio
T_2a=T_1*(p_r)^((r-1)/r);// K
T_2=((T_2a-T_1)/n_c)+T_1;// K
T_5a=T_4*(1/p_r)^((r-1)/r);// K
T_5=T_4-(n_t*(T_4-T_5a));// K
m_a=(P*1000)/((C_pa*((T_4-T_5)-(T_2-T_1)))*n_com*n_g);
T_3=T_2+(e*(T_5-T_2));// K
m_f=(m_a*C_pa*(T_4-T_3))/(CV*n_com*(Q/100));// kg/sec
Cf=((m_f*3600)/1000)*Cf_t;// Cost of fuel in Rs./hr
Tc=Cf+Oc;// Total cost in Rs/hr
Ce=Tc/(P*1000);// Cost of energy generated in Rs/kWh
m=m_a/m_f;// Air-fuel ratio
printf('\nThe cost of energy generated=Rs.%0.2f/kWh',Ce);
// The answer vary due to round off error
|
dbe1f7973270529f96057dc96cdddbba2d618cfe | 449d555969bfd7befe906877abab098c6e63a0e8 | /249/CH16/EX16.1/16_01.sce | 5d218f8398c04b5fc8666e687eb24a8b5e4267ce | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 660 | sce | 16_01.sce | clear
clc
Co=1;k=1;t=1;//given
//Scheme A
//For mixed flow reactor
//t=(Co-C1)/KC1^2
C1=(-1+sqrt(1-4*t*(-Co)))/2*t;
//For the plug flow reactor
//t=1/k(1/C2-1/C1)
C2=C1/(1+k*t*C1);
printf("\n Conversion for flow scheme A is %f",C2)
//Scheme B
//For plug flow
C3=Co/(1+k*t*Co);
//For mixed flow reactor
C4=(-1+sqrt(1-4*t*(-C3)))/2*t;
printf("\n Conversion for flow scheme B is %f",C4)
//Scheme C,D,E
//Using exit age distribution fn for 2 equal plug-mixed flow reactor system,using fig 12.1
t_bar=2;
in=1000;
C5=integrate('(2/t_bar)*(exp(1-2*t/t_bar))/(1+Co*k*t)','t',t_bar/2,in);
printf("\n Conversion for flow scheme C,D,E is %f",C5)
|
d30e3c07ccbd4be8888e26938c62f9de90492ae5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /710/CH7/EX7.5/7_5.sci | 454acf80b7471da7d686a6eac3399a54862e09dc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | sci | 7_5.sci | clc();
clear;
//To calculate the pitch of the helix and radius of trajectory
v=2*10^6; //speed in m/s
teta=30; //angle at which proton enters at the origin of coordinate system
B=0.3; //magnetic field in iT
vp=v*sind(teta); //v(perpendicular component)
vpa=v*cosd(teta); //v(parallel component)
m=1.67*10^-27; //mass of proton
q=1.6*10^-19;
p=(vpa*2*%pi*m)/(q*B) //pitch of the helix described by the proton
R=((m*vp)/(q*B))*10^2 //radius of the trajectory
printf("the pitch of the helix is %f m and radius of trajectory is %f cm",p,R) |
043d99c0d36b1d2ec93163f4793fc8af18545aef | 449d555969bfd7befe906877abab098c6e63a0e8 | /1286/CH15/EX15.11/15_11.sce | 833becc7bc6351f369cf71d629facf432cb189e8 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 143 | sce | 15_11.sce | clc
//initialisation
de=5.52*10^-21//j
k=1.38*10^-23
//CALCULATIONS
t=de/(2*k)
//results
printf(' \n temperature of system= % 1f k',t)
|
36353af2381d6b35c3442a25fda037086ba231e1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3411/CH2/EX2.9.u1/Ex2_9_u1.sce | b6346b298cd6f882ef40ddc6c1e4ce7c562d6561 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 431 | sce | Ex2_9_u1.sce | //Example 2_9_u1
clc();
clear;
//To calculate resolving power in second order
//We have e*sin(theta)=k*lamda
//We have e*0.2=k*lamda ->1
//And e*0.3=(k+1)*lamda ->2
//Subtracting one and two 3*0.1=lamda
lamda=5000 //units in armstrongs
lamda=lamda*10^-8 //units in cm
e=lamda/0.1 //units in cm
width=2.5 //units in cm
N=width/e
respower=2*N
printf("Resolving power is %.f",respower)
|
5b7820be262fde3799ea63add2feb2676d29ea2d | 449d555969bfd7befe906877abab098c6e63a0e8 | /3802/CH9/EX9.7/Ex9_7.sce | 2e9cf9898466e1eee578620641e94f8a9a836e55 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 967 | sce | Ex9_7.sce | //Book Name:Fundamentals of Electrical Engineering
//Author:Rajendra Prasad
//Publisher: PHI Learning Private Limited
//Edition:Third ,2014
//Ex9_7.sce.
clc;
clear;
//input data are taken from example 9.5
V=1+%i*0;
Xd=1.0;
Xq=0.6;
pf=0.8;
theta=acosd(pf);
Ia1=pf-%i*sind(acosd(pf));
Ia=1.0; //phase magnitude of Ia
printf("\n (a)")
//lagging power factor
tan_del=(Ia*Xq*cosd(theta))/(V+(Ia*Xq*sind(theta)));
del=atand(real(tan_del));
Ef_dash=((V+(Ia*Xq*sind(theta)))^2+(Ia*Xq*cosd(theta))^2)^(1/2);
Ef=real(Ef_dash)+(Ia*sind(theta+del)*(Xd-Xq));
reg=((Ef-V)/1.0)*100;
printf("\n Voltage Regulation for 0.8 lagging power factor=%d percentage \n",reg)
printf("\n (b)")
tan_del=(Ia*Xq*cosd(theta))/(V-(Ia*Xq*sind(theta)));
del=atand(real(tan_del));
Ef=((V-(Ia*Xq*sind(theta)))^2+(Ia*Xq*cosd(theta))^2)^(1/2);
reg=((Ef-V)/1.0)*100;
printf("\n Voltage Regulation for 0.8 leading power factor=%2.0f percentage",reg)
|
a08bd87abb720a6a257a5d6efc53a31d3188e985 | 449d555969bfd7befe906877abab098c6e63a0e8 | /593/CH15/EX15.7/ex15_7.sce | dbd4a505e27c342c4f9e1b3caebbd37c19aa50fb | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 943 | sce | ex15_7.sce | clear;
//clc();
// Example 15.7
// Page: 405
printf("Example-15.7 Page no.-405\n\n");
//***Data***//
printf(" Our system consists of Au and H2O.\n");
// So
N = 2;// Number of the species
// If there is no chemical reaction, then
Q = 0;
//So
C = N - Q;// Number of the components
printf(" If no compound is formed, then number of the components in the system are \n C = N - Q = 2 - 0 = %0.0f\n\n",C);
// However, if there is also a chemical reaction
// Au + H2O = AuH2O
// so
n = 3;// Number of the species
q = 1;// Number of the reactions
// Thus, we have
c = n - q;// Number of the components
printf(" If there is also a chemical reaction, viz.\n Au + H2O = AuH2O \n");
printf(" the number of the components in the system are\n C = N - Q = %0.0f\n\n",c);
printf(" The number of the components is independent of the existence or nonexistence of such compounds of questionable existence. ");
|
397cc7f1d47d676c9a8935e64b5a2fbeacca94f2 | b29e9715ab76b6f89609c32edd36f81a0dcf6a39 | /ketpicscifiles6/Thetadegree.sci | c6ceff89d0bcbe6e74a681794b95883fb86ebee9 | [] | no_license | ketpic/ketcindy-scilab-support | e1646488aa840f86c198818ea518c24a66b71f81 | 3df21192d25809ce980cd036a5ef9f97b53aa918 | refs/heads/master | 2021-05-11T11:40:49.725978 | 2018-01-16T14:02:21 | 2018-01-16T14:02:21 | 117,643,554 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 90 | sci | Thetadegree.sci | // 08.07.11
function Ang=Thetadegree()
global THETA;
Ang=THETA*180/%pi;
endfunction
|
13a8319c9f8a94ed9868a725d9696356159991ff | a62e0da056102916ac0fe63d8475e3c4114f86b1 | /set10/s_Fluid_Mechanics_R._H._F._Pao_2066.zip/Fluid_Mechanics_R._H._F._Pao_2066/CH8/EX8.2/8_2.sce | b8add2077ba1675bce2c4507a969461dc7f81b00 | [] | no_license | hohiroki/Scilab_TBC | cb11e171e47a6cf15dad6594726c14443b23d512 | 98e421ab71b2e8be0c70d67cca3ecb53eeef1df6 | refs/heads/master | 2021-01-18T02:07:29.200029 | 2016-04-29T07:01:39 | 2016-04-29T07:01:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 192 | sce | 8_2.sce | errcatch(-1,"stop");mode(2);
//Initialization of variables
ratio=0.99
E=3.19e5 //lb/in^2
//calculations
pd=-E*log(ratio)
//ersults
printf("Pressure difference = %d psi",pd)
exit();
|
883807c7d10c81bbe951f1fcd7d64195a00143d0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3472/CH39/EX39.5/Example39_5.sce | 5fc531d9c8674f6af1a3f76997c560394fb8c2fa | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,704 | sce | Example39_5.sce | // A Texbook on POWER SYSTEM ENGINEERING
// A.Chakrabarti, M.L.Soni, P.V.Gupta, U.S.Bhatnagar
// DHANPAT RAI & Co.
// SECOND EDITION
// PART IV : UTILIZATION AND TRACTION
// CHAPTER 1: INDUSTRIAL APPLICATIONS OF ELECTRIC MOTORS
// EXAMPLE : 1.5 :
// Page number 682
clear ; clc ; close ; // Clear the work space and console
// Given data
V = 400.0 // IM voltage(V)
f = 50.0 // Frequency(Hz)
I_s = 5.0 // Full voltage starting current in terms of full load current
T_s = 2.0 // Full voltage starting torque in terms of full load torque
tap = 65.0 // Auto-tranformer tapping(%)
// Calculations
V_ph = V/3**0.5 // Phase voltage(V)
V_ph_motor = tap/100*V_ph // Motor phase voltage when auto-transformer is used(V)
I_ph_motor = tap/100*I_s // Motor phase current in terms of full load current
I_1 = tap/100*I_ph_motor // Line current from supply in terms of full load current
T = (tap/100)**2*T_s // Starting torque in terms of full load current
V_applied = V_ph/2**0.5 // Voltage to be applied to develop full-load torque(V)
I_line = V_applied/V_ph*I_s // Line current in terms of full load current
// Results
disp("PART IV - EXAMPLE : 1.5 : SOLUTION :-")
printf("\nCase(i): Motor current per phase = %.2f*I_fl ", I_ph_motor)
printf("\nCase(ii): Current from the supply, I_1 = %.2f*I_fl ", I_1)
printf("\nCase(iii): Starting torque with auto-transformer starter, T = %.3f*T_fl ", T)
printf("\nVoltage to be applied if motor has to develop full-load torque at starting, V = %.f V", V_applied)
printf("\nLine current from the supply to develop full-load torque at starting = %.2f*I_fl ", I_line)
|
38592b350e1aa4caea3a81fbb9c4a2c145f7a6a5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1319/CH2/EX2.8/2_8.sce | b566d3685322b918fbdee4f46f946a5028e5f710 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 528 | sce | 2_8.sce | // Conversion to current source and nodal analysis
clc;
clear;
// Nodal Equations
// 1.5*Va-0.5*Vb+0*Vc=5
// 0.5*Va-1.5*Vb+0.5*Vc=0
// 0*Va-0.5*Vb+1*Vc=0
Y=[1.5 -0.5 0;0.5 -1.5 0.5; 0 -0.5 1]; // Admittance matrix
I=[5;0;0];
V=inv(Y)*I;
Va=V(1);
Vb=V(2);
Vc=V(3);
Vab=Va-Vb;
disp('V',Va,'Voltage at node A =')
disp('V',Vb,'Voltage at node B =')
disp('V',Vc,'Voltage at node C =')
disp('V',Vab,'The voltage across AB in the circuit =')
disp('A',Vab/2,'The current in branch AB in the circuit =')
|
4893869aa2ec4efe42cf71fb782fdfb2dbf311ff | 449d555969bfd7befe906877abab098c6e63a0e8 | /29/CH12/EX12.23.i/exa12_23_i.sce | a6d124d503937b667a50e5715e65775f92da875b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 795 | sce | exa12_23_i.sce | //caption:stability_using_Nyquist_criterion
//example 12_23_i
//page 535
clf();
s=%s;
s1=-s;
disp("for K=0.1")
g=(0.1*(s+10)*(s+40))/(s*(s+1)*(s+4));
g1=(0.1*(s1+10)*(s1+40))/(s1*(s1+1)*(s1+4));
GH=syslin('c',g);
GH1=syslin('c',g1);
nyquist(GH);
nyquist(GH1);
//mtlb_axis([-1.5 0.2 -0.3 0.3]);
xtitle('Nyquist plot of (0.1*(s+10)*(s+40))/(s*(s+1)*(s+4))')
figure;
show_margins(GH,'nyquist')
disp("since the point(-1+%i0) is not encircled clockwise by Nyquist plot ,so N=0 and P=0")
N=0;//no. of encirclement of -1+%i0 by G(s)H(s) plot anticlockwise
P=0;//no. of poles of G(s)H(s) with positive real part
Z=P-N;//np.of zeros of 1+G(s)H(s)=0 with positive real part
disp(Z,"Z=")
disp("as Z=0,there are no roots of closed loop characterstics eq having positive real part, hence system is stable.") |
1a7f4e2ef95a08ab08b3aab633d58c9170c3a6a5 | 06c050d87b5b6b7e42f2d24889ec60b0f5fdd998 | /secante.sce | 9e1210182b0c8229ffa5338ffa0c910c23044ee8 | [] | no_license | jaimedantas/Numerical-Computation-Scilab | 06958d436ee9724daa7c03f2ea14f195e5fbb596 | 66bf163bdbc0d9453cafff0369bbd5cd2fce78f3 | refs/heads/master | 2021-01-11T15:18:52.809391 | 2017-01-29T03:47:50 | 2017-01-29T03:47:50 | 80,327,110 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 542 | sce | secante.sce | clc
//metodo de newton
//funcao juros compostor
function y = modelo(x)
y=0.04+(x)/(1-x)*sqrt(2*3.5/(2+x));
endfunction
//funcao principal
function x = newton(x0, prec, cont_max)
cont=0;
x=x0;
e=1;//maior erro
x_old=x0;
while (e>=10^(-prec) & cont<=cont_max)
x_antes=x_old;
x_old=x;
x=x_old - (modelo(x_old)*(x_antes-x_old)/(modelo(x_antes)-modelo(x_old)));
e=abs(x-x_old)/x;
cont=cont+1;
end
endfunction
//entrada
x=newton(0.5, 3, 10)//nao entra com o a entrada da funcao secundaria(derivada e funcao)
|
8ef7f61bf1864605ab8e5b28c7773a3bc0386e2d | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/BVA5.prev.tst | cccee87bce3241540ad82de2909a03990d68f6ef | [
"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 | 530 | tst | BVA5.prev.tst | BigVectorArray.parseRecurrence("a(n) +(-2*n+1)*a(n-1) +2*(-n+1)*a(n-2)=0")
vname=a_0, k=0, kmax=0, kmin=0, poly=a_0 + a_1 + 2*a_2 - 2*a_1*n - 2*a_2*n
vname=a_1, k=-1, kmax=0, kmin=-1, poly=a_0 + a_1 + 2*a_2 - 2*a_1*n - 2*a_2*n
vname=a_2, k=-2, kmax=0, kmin=-2, poly=a_0 + a_1 + 2*a_2 - 2*a_1*n - 2*a_2*n
shift by 0
create bva[4]
bva[3]=1, vector=[1], poly=a_1 + 2*a_2 - 2*a_1*n - 2*a_2*n
bva[2]=1 - 2*n, vector=[1,-2], poly=2*a_2 - 2*a_2*n
bva[1]=2 - 2*n, vector=[2,-2], poly=0
bva[0]=0
result= [[0],[2,-2],[1,-2],[1]]
|
cd54801612cbb498c4587be7b27557f471a73f75 | 449d555969bfd7befe906877abab098c6e63a0e8 | /249/CH5/EX5.6/5_06.sce | 2a35eb2ee520bcdef183ccd6e3601b629ae94950 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 76 | sce | 5_06.sce | clear
clc
//This is a theorotical Qn
printf("Its a theorotical Question") |
cd63770ef34e403075dec49c33c1826a60c99ea1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /182/CH1/EX1.1/example1_1.sce | a85c92b90a78ea7c105daccfbe8c284f49d95325 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | example1_1.sce |
// Example 1-1 in page 8
// Given data
clc;
phi=500*10^-8;// one maxwell=10^-8 Wb, phi=total flux
Area=(2.54*10^-2)^2;// area in m^2, cross section is one inch and 1inch=2.54cm
// Calculation
B=phi/Area; //flux density(B) in tesla
printf("total flux density=%.2f mT",B*1000);
// Result
// the toatal flux density is 7.75 mT |
4986a10b5d7b63bf4973cfab4bd7de6729920f87 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3428/CH2/EX1.2.2/Ex1_2_2.sce | 5f0087b0de320dbeac51104c6f5718d12d5ff343 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 290 | sce | Ex1_2_2.sce | //Section-1,Example-2,Page no.-AC.163
//To find the weight of air actually supplied per m^3 of the gas.
clc;
M_w=28.97
V=300*(100/21)*(150/100) //Volume of air reqd. for 1m^3 of gas using 50% excess air(L)
W=V*(1/22.4)*M_w
disp(W,'weight of air actually supplied per m^3 of the gas.(gm)')
|
fd90aadee3411f05d9640de31cdd8d1357e3710d | 449d555969bfd7befe906877abab098c6e63a0e8 | /3517/CH6/EX6.5/Ex6_5.sce | bcf40151760b8864dc65f3678ff103e7863da18d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 513 | sce | Ex6_5.sce | //Caption:Design Schmitt circuit components R1,R2,R3,R4 and R5
//Ex6.5
clc;
clear;
close;
u=3//Upper trigger voltage(in volts)
Ib=500//Max base current(in nA)
Vf=0.7//Forward diode voltage(in volts)
Vk1=-2//Voltage(in volts)
Vcc=15//Collector voltage(in volts)
Vk2=-Vk1
i=Ib*0.1
R2=u*1000/i
I=u/R2
Vo=Vcc-1
Vr1=Vo-u
R1=Vr1/I
I4=100*i
Va1=Vk1+Vf
Vee=-Vcc
V4=Va1-Vee
R4=V4*1000/I4
Va2=Vk2+Vf
V5=Va2-Va1
R5=V5*1000/I4
R3=(Vcc-Va2)*1000/I4
disp(R5,R4,R3,R2,R1,'R1,R2,R3,R4,R5(in kilo ohm)=') |
2e210e99249f58cef1a860b12933aaed531c82fc | 449d555969bfd7befe906877abab098c6e63a0e8 | /323/CH2/EX2.29/ex2_29.sci | a295ba145f73953a39974eab704fc146632e3852 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 198 | sci | ex2_29.sci | //Chapter 2,Ex2.29,Pg 2.33
clc;
disp("Refer to the figure shown in the diagram")
A=[1 0 0;-1 3 -1;-2 -5 10]
B=[60;12;24]
V=A\B
printf("\n Voltage across the 100 ohms resistor=%.2f V\n",V(3))
|
01399f8f0325ded23688c653970cffd7cb9ed380 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1586/CH16/EX16.7/EXP16_7.sce | 8e8f90c945f90bcf7692d9947005d2ff0e4c5767 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 730 | sce | EXP16_7.sce | clc;funcprot(0);//EXAMPLE 16.7
// Initialisation of Variables
M=56;.........//Molecular Weight of Polyethylene
P=0.88;........//Measured density of PolyethyleneInitial
P1=0.915;........//Measured density of Polyethylene Final
Pa=0.87;........//Density of Amorphous Polyethylene
//Caluculations
Pc=M/(7.42*4.95*(2.55*10^-24)*6.02*10^23);...........//Density of complete Crystalline polymer
Cp1= ((Pc/P)*((P-Pa)/(Pc-Pa)))*100;..................//Crystallinity of Polyethylene initial
Cp2= ((Pc/P1)*((P1-Pa)/(Pc-Pa)))*100;................//Crystallinity of Polyethylene final
disp(Pc,"Density of Crystalline polymer:")
disp(Cp1,"Crystall. of Polyethylene initial:")
disp(Cp2,"Crystall. of Polyethylene final:")
|
5b5cc660c61f3d9a398663a7b39576c2149780ce | 0e52518c6fe37e683dc04d785f174ce30408f8e7 | /derivacao.sci | 6b3bcc29ac68d5d899689dc75c5620b8ee40ee98 | [] | no_license | thiago-franco/metodos-numericos | c3a7a10d00376c9b238825e9ff049635cc153a92 | 95ed4e0b1e05b10c7d0ef9cbc23f9c98d2cf8a65 | refs/heads/master | 2021-07-06T00:19:31.512668 | 2017-09-30T01:25:29 | 2017-09-30T01:25:29 | 104,950,926 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 442 | sci | derivacao.sci | function y = f(x)
// Função cuja derivada deseja ser estimada
y = exp(x) + sin(x)
endfunction
// Derivada recuada com dois pontos
function D = recuada(x, h)
D = (f(x)-f(x-h))/h
endfunction
function D = avancada(x,h)
D = (f(x+h)-f(x))/h
endfunction
function D = centrada(x,h)
D = (f(x+h)-f(x-h))/2*h
endfunction
function D = derivadaSegunda(x,h)
D = (f(x+h)-2*f(x)+f(x-h))/(h^2)
endfunction
|
72e99e63755959265e1026b326d55b5988a1c862 | 52bc9d4a4a76ae754ef5ed1e1bfaa3734778e40b | /lab6/lab6.sce | ad88a5be91396b08cc3318242c720245847c279a | [] | no_license | DavidShagabaev/mathmod-labs | 4850686841cac662c49350dad6fd1a3e2a02d4a7 | 8832962a354e40b0860e45c440d962727ad53871 | refs/heads/main | 2023-08-30T19:20:26.965258 | 2021-11-14T17:02:40 | 2021-11-14T17:02:40 | 427,987,455 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 442 | sce | lab6.sce | a=0.01;
b=0.02;
N=8124;
I0=124;
R0=30;
S0=N-I0-R0;
t=0:0.01:200;
x0y0=[S0;I0;R0];
function dxdy=x_der(t,x)
dxdy(1)=0;
dxdy(2)=-b*x(2);
dxdy(3)=b*x(2);
endfunction
x=ode(x0y0, 0, t, x_der);
function dxdy=y_der(t,x)
dxdy(1)=-a*x(1);
dxdy(2)=a*x(1)-b*x(2);
dxdy(3)=b*x(2);
endfunction
y=ode(x0y0, 0, t, y_der);
plot(t,y);
h1=legend(['Возможные больные';'Заболели';'Вылечились']);
|
ed82fbcdae4e55de798127979fb5392ac9e513e6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /278/CH26/EX26.8/ex_26_8.sce | bc9bfb77a73628f307407b8f78b8b4d8f9f414b7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 282 | sce | ex_26_8.sce | //find
clc
//solution
//given
D=150//mm
R=75//mm
d=50//mm
r=25//mm
p=0.8//N/mm^2
N=100//rpm
u=0.015
W=p*%pi*[R^2-r^2]//N
printf("load to be supported is,%f N\n",W)
T=(2/3)*u*W*[(R^3-r^3)/(R^2-r^2)]//N-mm
P=2*%pi*N*T/60000
printf("power loast in friction is,%f W\n",P) |
79960798fbc7d1e02b32722855b08237604ca024 | 3fb2b65e8ef9208e822aad35c618441282e08a30 | /MetodeNumerik/gausspivotingsebagian/egauss.sci | 26d752992d620642174d77b415783d7b51098040 | [] | no_license | Lukmannudin/TugasKuliah | 33031fb4f6ff0ab7a5849cda3ea15330e2527c3f | 19738c858dea539f0a5569f27be68b1a56c2aa89 | refs/heads/master | 2020-03-07T15:49:59.414761 | 2018-06-09T07:41:39 | 2018-06-09T07:41:39 | 127,565,939 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 871 | sci | egauss.sci |
function egauss(A,b)
M=[A b];
[n m]=size(M);
j=2;
for j=1:n
kolom=abs(M(:,j));
[nilai,ind]=max(kolom(j:n));
indeks=ind+j-1;
if kolom(j) < nilai then
M=tukar(M,indeks,j);
end,
for i=j+1:n
M(i,:)=-M(i,j)/M(j,j)*M(j,:)+M(i,:);
end,
end
nA=M(1:n,1:n);
nB=M(:,n+1);
solusix=subbalik(nA,nB);
disp('Matriks M');disp(M);
disp('Solusi X');disp(x);
endfunction
function hasil=tukar(M,indeks,j)
sementara=M(j,:);
M(j,:)=M(indeks,:);
M(indeks,:)=sementara;
hasil=M;
endfunction
function nilai=subbalik(A,b)
[m,n]=size(A);
x(n)=b(n)/A(n,n);
for k=n-1:-1:1
jum=0;
for j=k+1:n
jum=jum+A(k,j)*x(j);
end,
x(k)=(b(k)-jum)/A(k,k);
end
nilai=x;
endfunction
|
320767c3457d1b9a4e75d5bb98451809d5cd4ab8 | 85744a910858b3185731e57d7d39dac2b5b17982 | /PRE & DE Emphasis.sce | d520c9d3ce9e0d81712e5c18c8185eb381b81263 | [] | no_license | shashwat2811/Analog-Digital-Communication | b53aac1ae75d53df90e0b938ef8fdc38caaf3084 | edd1ba5b0abad34aa74bed3441fddb26497f91db | refs/heads/main | 2023-06-05T04:33:21.979126 | 2021-06-12T13:41:56 | 2021-06-12T13:41:56 | 376,288,206 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 469 | sce | PRE & DE Emphasis.sce | clc ;
clear ;
xdel ( winsid () ) ;//xdel(0)//xdel()
R=2000;
r=200;
j=sqrt(-1);
C=0.1*10^-6;
for i=1:100000
k(i)=log10(i)
f=i;
w=2*3.1414*f;
w1=1/(r*C);
pre_emp(i)=(R/r)*20*log10(sqrt(1+(w/w1)^2))
de_emp(i)=-20*log10(sqrt(1+(w/w1)^2))
end
subplot(211)
plot(k,pre_emp);
title("Pre emphasis");
xlabel('log f');
ylabel('Gain (dB)')
subplot(212)
plot(k,de_emp);
title("De emphasis");
xlabel('log f');
ylabel('Gain (dB)')
|
f1d530b8bcb89a7c97b39e3530a247cd5bd474b5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1757/CH9/EX9.7/EX9_7.sce | bae8d8c67106492a7307e5a5e9a532dfb69e00c8 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 958 | sce | EX9_7.sce | //Example9.7 // determine the lock range of the FSK demodulator
clc;
clear;
close;
Vcc = 12 ;
Fvco = 0.25*Vcc ;
f = 200*10^3 ; // KHz
// the total time period of VCO
t = 1/f ;
disp('The total time period of VCO is = '+string(t)+ ' sec ');
// In VCO the capacitor charging and discharging time period are equal ,so the total time period of tringular and square wave forms can be written as 2*t ;
// the charging or discharging time of capacitor
tcap = t/2 ;
disp('The charging or discharging time of capacitor is = '+string(tcap)+ ' sec ');
// the voltage swing of VCO for 12 V supply
Fvco = 0.25*Vcc ;
disp('The voltage swing of VCO for 12 V supply is = '+string(Fvco)+ ' V ');
// The lock range of PLL
//FL = (1/2*%pi*f)*(Fvco/tcap);
FL = (3/(2*%pi*f*tcap));
disp('The lock range of PLL FL is = '+string(FL)+ ' Hz ');
// the capture range
fcap = sqrt(f*FL);
disp('The capture range is = '+string(fcap)+ ' Hz ');
|
404d88d1807706ac0d15c71d3b4d0724d7c07844 | 9224090b07cb3f466fe72819cf90ca0c4dedc901 | /Exercise 1/Exercise 1.sce | d39237b546ce9476d84932bafb8f34826642dbae | [] | no_license | MGYBY/advanced_ocean_modelling | 8c383b09f4077174559bd7964062625012026fa0 | 848f0f4d616d472021c31582b64557f04067ce74 | refs/heads/main | 2023-07-14T14:37:57.714203 | 2021-08-20T20:13:49 | 2021-08-20T20:13:49 | 398,386,684 | 4 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 1,861 | sce | Exercise 1.sce | //======================================
// Exercise 1: the surface Ekman layer
//======================================
//Author: Jochen Kaempf, 2015 (update)
f = gcf(); scf(0); f.figure_size = [400,400];
in = read("uvprof1.dat",-1,3); // read data file
nz = 500; z = in(1:nz,1); u = in(1:nz,2); v = in(1:nz,3);
time = 0.0; dt = 2.0;
x = z; y = z; x(1:nz) = 0; y(1:nz) = 0;
for n = 1:125 // animation loop
time = n*dt;
// predict displacement of virtual floats
for i = 1:nz; x(i) = x(i)+dt*u(i); y(i) = y(i)+dt*v(i); end;
drawlater; clf();
// draw graph frame
plot2d(0,0,-1,"031"," ",[-40,-40,40,40]);
ax = gca(); ax.font_size = 3;
// draw floats
nzz = 100;
for i = 1:nz
r = (nzz-i+1)/nzz*1.5; r = max(r,0.3); d = r/2; // float size changes with depth
xfarc(x(i)-d,y(i)+d,r,r,0,360*64)
p1=gce(); //get handle on current entity
p1.foreground=0; p1.thickness=1; p1.fill_mode = "on"; p1.line_mode = "on";
end;
// draw wind direction
xarrows([0 0],[0 40],100,5);
p2=gce(); p2.mark_foreground=4; p2.thickness=3; p2.arrow_size=30;
// draw flow vectors every 10 m
for i = 1:10:91
xarrows([0 x(i)],[0 y(i)],40,2)
p3=gce(); p3.mark_foreground=1; p3.thickness=1; p3.arrow_size=20;
p3.segs_color = 1 ;
end;
xgrid(1); // draw grid
p4=gce(); p4.mark_foreground=1; p4.thickness=1;
xstring(-5, -39,"x (m)"); // draw x label
txt=gce(); txt.font_size = 3;
xstring(-39, 0,"y (m)"); // draw y label
txt=gce(); txt.font_size = 3;
title("Time = "+string(int(time))+" secs","fontsize",3); // draw title
drawnow;
// save frames as sequential GIF files
//if n < 10 then
// xs2gif(0,'ex100'+string(n)+'.gif')
//else
// if n < 100 then
// xs2gif(0,'ex10'+string(n)+'.gif')
// else
// xs2gif(0,'ex1'+string(n)+'.gif')
// end
//end
end; // end reference for animation loop
|
34250bfb9747d26a042102f33f75573f1ab6ea69 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/LIR10.prev.tst | bf2f040c2b4ef95da2c5c6ce317b095e5ed682bd | [
"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 | 124 | tst | LIR10.prev.tst | # A000000 generated by Sequence
# Table of n, a(n) for n = 0..9
0 1
1 9
2 3
3 15
4 6
5 78
6 24
7 132
8 51
9 699
|
8ec1e06a96fb2ef0d452a92209ed1c8441c781e8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3472/CH12/EX12.5/Example12_5.sce | 71b843d2b4fcc2ab8cd5b0b0c619fa272d9bf561 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,204 | sce | Example12_5.sce | // A Texbook on POWER SYSTEM ENGINEERING
// A.Chakrabarti, M.L.Soni, P.V.Gupta, U.S.Bhatnagar
// DHANPAT RAI & Co.
// SECOND EDITION
// PART II : TRANSMISSION AND DISTRIBUTION
// CHAPTER 5: MECHANICAL DESIGN OF OVERHEAD LINES
// EXAMPLE : 5.5 :
// Page number 199
clear ; clc ; close ; // Clear the work space and console
// Given data
w_w = 1.781 // Wind pressure on conductor(kg/m)
w_i = 1.08 // Weight of ice on conductor(kg/m)
D = 6.0 // Maximum permissible sag(m)
s = 2.0 // Factor of safety
w_c = 0.844 // Weight of conductor(kg/m)
u = 7950.0 // Ultimate strength(kg)
// Calculations
w = ((w_c+w_i)**2+w_w**2)**0.5 // Total force on conductor(kg/m)
T = u/s // Allowable maximum tension(kg)
l = ((D*2*T)/w)**0.5 // Half span(m)
L = 2.0*l // Permissible span between two supports(m)
// Results
disp("PART II - EXAMPLE : 5.5 : SOLUTION :-")
printf("\nPermissible span between two supports = %.f metres \n", L)
printf("\nNOTE: ERROR: Horizontal wind load, w_w = 1.781 kg/m, not 1.78 kg/m as mentioned in problem statement")
|
7c262e7b13b9782e76bc2edc7fb7c3221075999c | 8217f7986187902617ad1bf89cb789618a90dd0a | /source/2.5/macros/m2sci/m2sci.sci | c7fb48c21ef2eb0f50bbb138cb50a683d5035204 | [
"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 | 4,745 | sci | m2sci.sci | function [txt,trad]=m2sci(lst,nam,Imode,Recmode)
// translate matlab syntax to scilab
//%Parameters
// lst : list, represents the interpreted code of the matlab function given by macr2lst
// nam : nam of the scilab function to generate
// txt : character string column vector: the text of resulting scilab function
//!
//%Main variables
// vnms : nx2 matrix of strings, each row contains the matlab and scilab name of
// a refered matlab variable
// vtps : a list, each entry is a list(?,?,?,?)
// Copyright INRIA
[lhs,rhs]=argn(0)
if rhs==1 then nam=lst(1),end
if rhs<=2 then Imode=%t,end
if rhs<=3 then Recmode=%f,end
//sci_min=sci_mini
//sci_max=sci_maxi
lst=mmodlst(lst)
lcount=1;level=[0,0];
quote=''''
//
sciparam()
//stack of named variables
// add input variable in the defined variables
inputs=lst(3)
macrhs=size(inputs,2)
vnms=[],
vtps=list()
for k=1:macrhs
if or(inputs(k)==killed(1)) then
vnms=[vnms;['%'+inputs(k),inputs(k)]],
else
if funptr(inputs(k))<>0 then
vnms=[vnms;['%'+inputs(k),inputs(k)]],
inputs(k)='%'+inputs(k),
else
vnms=[vnms;[inputs(k),inputs(k)]],
end
end
if Imode then
r=askfortype(inputs(k))
if r<>[] then
vtps($+1)=r
else
vtps($+1)=list('?','?','?',0)
end
else
vtps($+1)=list('?','?','?',0)
end
end,
// add predefined variable in the defined variables
if find(vnms(:,2)=='i')==[] then
vnms=[vnms;['%i','i']],
vtps($+1)=list('1','1','1',0)
end
if find(vnms(:,2)=='j')==[] then
vnms=[vnms;['%i','j']],
vtps($+1)=list('1','1','1',0)
end
vnms=[vnms;['%nan','NaN']],
vtps($+1)=list('1','1','1',0)
vnms=[vnms;['%nan','nan']],
vtps($+1)=list('1','1','1',0)
vnms=[vnms;['%inf','Inf']],
vtps($+1)=list('1','1','1',0)
vnms=[vnms;['%inf','inf']],
vtps($+1)=list('1','1','1',0)
if find(vnms(:,2)=='pi')==[] then
vnms=[vnms;['%pi','pi']],
vtps($+1)=list('1','1','1',0)
end
if find(vnms(:,2)=='eps')==[] then
vnms=[vnms;['%eps','eps']],
vtps($+1)=list('1','1','1',0)
end
outputs=lst(2)
maclhs=size(outputs,2)
for k=1:maclhs
if funptr(outputs(k))<>0 then
vnms=[vnms;['%'+outputs(k),outputs(k)]]
vtps($+1)=list('?','?','?',0)
outputs(k)='%'+outputs(k)
end
end
bot=size(vtps)
// translate
sciexp=0
[crp,vnms,vtps]=ins2sci(lst,4,vnms,vtps)
dcl=[]
//add special code
// nargin & nargout
if find(vnms(:,1)=='nargin'|vnms(:,1)=='nargout') then
dcl='[nargout,nargin] = argn(0)'
end
//Initial value of lhs arguments
ini=emptystr()
for k=outputs
if find(inputs==k)==[] then ini=ini+k+'=[];',end
end
if ini==emptystr() then ini=[],end
//info on macros variables
n=size(vtps)
info=[]
for k=1:n
m=string(vtps(k)(2))
n=string(vtps(k)(3))
tp=string(vtps(k)(1))
info=[info;
'// '+part(vnms(k,2),1:24)+' size :'+part(m+' x '+n,1:12)+' type: '+tp];
end
//write(%io(2),info,'(a)')
//add the function header
hdr='function '+lhsargs(outputs)+'='+nam+rhsargs(vnms(1:macrhs,1));
txt=[hdr;ini;dcl;crp(1:$-1)]
// generate associated translation function
//if nam=='script' then
// f=fnam+'.sce'
// trad=[
// 'function [stk,txt,top]=sci_'+fnam+'()'
// 'stk=list(''exec('''+sci2exp(f)+''')'',''0'',''?'',''?'',''?'')']
if batch then
trad=[
'function [stk,txt,top]=sci_'+fnam+'()'
'stk=list(''exec('+fnam+')'',''0'',''?'',''?'',''?'')']
else
trad=[
'function [stk,txt,top]=sci_'+nam+'()'
'RHS=[]'
'for k=1:rhs'
' RHS=[stk(top)(1),RHS]'
' top=top-1'
'end'
'top=top+1']
if maclhs==0 then
trad=[trad;
'stk=list('+sci2exp(nam)+'+rhsargs(RHS),''0'',''?'',''?'',''?'')']
elseif maclhs==1 then
k1=find(outputs(1)==vnms(:,2));
if k1<>[] then
k1=k1(1);
w=strcat([sci2exp(vtps(k1)(2)),sci2exp(vtps(k1)(3)),sci2exp(vtps(k1)(1))],',')
else
w='''?'',''?'',''?'''
end
trad=[trad;
'stk=list('+sci2exp(nam)+'+rhsargs(RHS),''0'','+w+')']
else
w=[]
for k=1:maclhs
k1=find(outputs(k)==vnms(:,2));
if k1<>[] then
k1=k1(1);
w=[w;strcat([sci2exp(vtps(k1)(2)),sci2exp(vtps(k1)(3)),sci2exp(vtps(k1)(1))],',') ] ;
else
w=[w;'''?'',''?'',''?''']
end
end
w(1)='w=['+w(1);w($)=w($)+']';
trad=[trad;
'// w(i,1) is the ith output argument type'
'// w(i,2) is the ith output argument row dimension'
'// w(i,2) is the ith output argument column dimension'
w]
// sci2exp(w,'w')]
trad=[trad;
'if lhs==1 then'
' stk=list('+sci2exp(nam)+'+rhsargs(RHS),''0'',w(1,1),w(1,2),w(1,3))'
'else'
' stk=list()'
' for k=1:lhs'
' stk(k)=list('+sci2exp(nam)+'+rhsargs(RHS),''-1'',w(k,1),w(k,2),w(k,3))'
' end'
'end']
end
end
|
3692cb1023e7d322dd4fe80631e3c1aa68430640 | a62e0da056102916ac0fe63d8475e3c4114f86b1 | /set6/s_Electric_Machines_-_I_M._Verma_And_V._Ahuja_695.zip/Electric_Machines_-_I_M._Verma_And_V._Ahuja_695/CH2/EX2.28/Ex2_28.sce | 0328a8c7076c9a726c9105dfc0be08996dd33894 | [] | no_license | hohiroki/Scilab_TBC | cb11e171e47a6cf15dad6594726c14443b23d512 | 98e421ab71b2e8be0c70d67cca3ecb53eeef1df6 | refs/heads/master | 2021-01-18T02:07:29.200029 | 2016-04-29T07:01:39 | 2016-04-29T07:01:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 324 | sce | Ex2_28.sce | errcatch(-1,"stop");mode(2);//Caption:Determine the value of resistance
//Exa:2.28
;
;
V=220;//in volts
R_a=0.1;//in ohms
N_1=800;//in rpm
N_2=520;//in rpm
I_a1=20;//in ampers
E_1=V-(I_a1*R_a);//in volts
E_2=N_2*E_1/N_1;//in volts
R_A=-(E_2-V+I_a1*R_a)/20;
disp(R_A,'Additional resistance(in ohms)=');
exit();
|
757c027653269ffc0ff6aed8ee1102e4af6f4541 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.5/Unix-Windows/scilab-2.5/tests/examples/trzeros.man.tst | 631317d8d19b8fe852ba959bb57e6b5d2e03b030 | [
"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 | 409 | tst | trzeros.man.tst | clear;lines(0);
W1=ssrand(2,2,5);trzeros(W1) //call trzeros
roots(det(systmat(W1))) //roots of det(system matrix)
s=poly(0,'s');W=[1/(s+1);1/(s-2)];W2=(s-3)*W*W';[nt,dt,rk]=trzeros(W2);
St=systmat(tf2ss(W2));[Q,Z,Qd,Zd,numbeps,numbeta]=kroneck(St);
St1=Q*St*Z;rowf=(Qd(1)+Qd(2)+1):(Qd(1)+Qd(2)+Qd(3));
colf=(Zd(1)+Zd(2)+1):(Zd(1)+Zd(2)+Zd(3));
roots(St1(rowf,colf)), nt./dt //By Kronecker form
|
7569d5da1f6a40f84c543c735ca7d670b86d95b7 | 458def2f7b4bd44cdf75f29a4c0cabed2e6ca516 | /Assignment4_SDL.sce | 44342d13e152ef3a2a96775b5ff138f4f9925241 | [] | no_license | SoanKim/Presentation_Software | 1a03bfc9e22bd2a874c5787ca89faa0947c09e67 | 382c84878496fce1e790386a4ff6c03741eb4974 | refs/heads/master | 2022-12-09T03:50:22.916992 | 2020-09-10T10:55:45 | 2020-09-10T10:55:45 | 294,382,441 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 188 | sce | Assignment4_SDL.sce | #SDL
scenario = "GetInput";
pcl_file = "GetInputPCL.pcl";
begin;
picture {
text {caption = " ";}t_Info1; x=0; y = 100;
text {caption = " ";}t_Info2; x=0; y = 0;
} p_Info;
|
0739536550dc1108c0cc31f07f04377ba3cc9363 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1949/CH2/EX2.10/2_10.sce | 5a636fd2f24c4299624d25b5862b38f1b4e5b65e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 551 | sce | 2_10.sce | //Chapter-2,Example 2_10,Page 2-34
clc()
//Given Data:
lam=6*10^-7 //Wavelength of light
a=0.02*10^-2 //width of slit (a=d)
f=2 //distance between screen and slit
//Calculations:
//We know, a*sin(theta)=m*lam, here m=1
theta=asin(lam/a)*180*60/%pi //angular position in first minima (1 degree=60 minutes)
printf('Total angular width is = %.2f minutes \n \n',2*theta)
x=f*lam/a //separation between central maxima and first minima
printf(' Linear width is = %.6f m \n',2*x)
|
891649afff8f1dc673974e59df5b4fe2a96edd74 | 449d555969bfd7befe906877abab098c6e63a0e8 | /767/CH4/EX4.5.2/Ch04Exa4_5_2.sci | c193c29daf149a5279f0bc6a0b0e8bfc1b86fd26 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 380 | sci | Ch04Exa4_5_2.sci | // Scilab code Exa4.5.2: To calculate Q-value for the reaction : Page 183 (2011)
M_Cf = 252.081621; // Mass of califronium, amu
M_Cm = 248.072343; // Mass of curium, amu
M_He = 4.002603; // Mass of alpha particle, amu
Q = [M_Cf-M_Cm-M_He]*931.49; // Q-value, MeV
printf("\nThe Q-value for the reaction : %4.2f MeV", Q)
// Result
// The Q-value for the reaction : 6.22 MeV |
0084c632732426ae40ff37274704816007299022 | 449d555969bfd7befe906877abab098c6e63a0e8 | /291/CH2/EX2.3f/eg2_3f.sce | c4d597b976320094764ea0dbae83edffda26a06d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 137 | sce | eg2_3f.sce | A = [ 3 4 6 7 10];
B= [-20 5 15 24];
disp(variance(A), "The sample variance of A is")
disp(variance(B), "The sample variance of B is") |
a5ef4d529571746d98b7b964e062735d7ff40eb4 | 91bba043768342a4e23ee3a4ff1aa52fe67f7826 | /cs/142/3/tests/test10.tst | 5488f09740733bfcc58ddce221361a2941327006 | [] | no_license | MaxNanasy/old-homework | 6beecc3881c953c93b847f1d0d93a64ec991d6de | 48b7997a49a8f111344f30787c178e1661db04bd | refs/heads/master | 2016-09-08T04:37:44.932977 | 2010-03-02T00:48:59 | 2010-03-02T00:48:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 139 | tst | test10.tst | const const1 = 11;
type t1 = array 20 of int;
var v2 : t1;
void sym1 () {
const const1 = 33;
PRINT SYMBOL TABLE
}
|
40489985f8a8010bc233efee2015c3debae7cbec | 6813325b126713766d9778d7665c10b5ba67227b | /Chapter6/Ch_6_Eg_6.22.sce | 9d6d195a13002c1f54b9c9070988d07bfc356973 | [] | no_license | arvindrachna/Introduction_to_Scilab | 955b2063b3faa33a855d18ac41ed7e0e3ab6bd1f | 9ca5d6be99e0536ba1c08a7a1bf4ba64620ec140 | refs/heads/master | 2020-03-15T19:26:52.964755 | 2018-05-31T04:49:57 | 2018-05-31T04:49:57 | 132,308,878 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 176 | sce | Ch_6_Eg_6.22.sce | // A program to directly writing and reading a matrix to/from a file.
A = rand (4,3);
fprintfMat ("MatrixA.txt", A, "%lg");
B = fscanfMat ("MatrixA.txt", "%lg");
disp(B);
|
e562fc8cc11b932396b5b2a2e03b45de3ce88b69 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3161/CH13/EX13.15/Ex13_15.sce | 91bffdd711fcf2c44e1fc5970c8290806ab47629 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 494 | sce | Ex13_15.sce | clc;
//page 718
//problem 13.15
//Bit interval T = 1/10^6 = 10^-6 sec
T = 10^-6
//White Noise Power Spectral Density n/2 = 10^-9 W/Hz
n = 2*10^-9
//Power required Ps = Eb/T, where Eb = energy per bit
//For information system feedback system Eb = n
Ps = n/T
disp('power required for information system feedback system is '+string(Ps)+' Watt')
//For optimal system Ps = (0.69 * n)/T
Ps = (0.69 * n)/T;
disp('power required for optimal system is '+string(Ps)+' Watt')
|
1842ad6664e4e47a8a008061321d5589c3f0b8f2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2321/CH7/EX7.10.3/EX7_10_3.sce | ea8b903e3ce968a53e9543ba9e83aab41feb42e8 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 384 | sce | EX7_10_3.sce | //Example No. 7.10.3
clc;
clear;
close;
format('v',6);
N=25;//no. of turns
Vrms=150;//µV(emf induced)
f=500;//kHz(tuned frequency)
A=0.5^2;//m²(Area of loop)
theta=0;//degree(angle)
c=3*10^8;//m/s////Speed of light
lambda=c/(f*10^3);//m(Wavelength)
Erms=lambda/(2*%pi*A*N*cosd(theta))*Vrms*10^-6;//V/m(maximum emf induced)
disp(Erms*10^3,"Field strength in mV/m : ");
|
08212a512b8a85615ca02b6fd916b01e67ade75f | 449d555969bfd7befe906877abab098c6e63a0e8 | /3733/CH34/EX34.31/Ex34_31.sce | 88f296ea68b3ed20d6a9a5de97372fe61a11c25e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 988 | sce | Ex34_31.sce | // Example 34_31
clc;funcprot(0);
//Given data
P=2500;// kW
MD=1600;// Maximum load in kW
F_l=0.48;// Load factor
CC_s=15000;// Initial cost of
Ic=18000;// Installation cost in Rs./kW
I=15/100;// Interest on capital
Mc=200000;// Maintainence cost in Rs./year
Tlo=850000;// Total labour and other consumables in Rs./year
Fc=7;// Fuel cost in Rs./kg
Lc=30;// Lubricating oil cost in Rs./kg
F=0.25;// Fuel consumed in kg/kWh
O=0.025;// Oil consumed in kg/kWh
//Calculation
CC=P*Ic;// Capital cost of the plant in rupees
I=CC*I;// Interest on capital in rupees
E_g=MD*F_l*8760;// Energy generated per year in kWh
Cf=F*E_g*Fc;// Cost of fuel in Rs./year
Cl=O*E_g*Lc;// Cost of Lubricating oil in rupees
Tfc=I+Mc;// Total fixed cost in rupees
Trc=Cf+Cl+Tlo;// Total running cost in rupees
Tc=Tfc+Trc;// Total cost in rupees
Gc=Tc/E_g;// Generation cost in Rs./kWh
printf('\nThe cost of generation=Rs.%0.2f/kWh',Gc);
// The answer provided in the textbook is wrong
|
adcd296b0099c3cd7b237ec9b309fe37cf69c8e7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1052/CH14/EX14.5/145.sce | 1a87f13a32cc53c41aa856e42a9e39860b6c10e2 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,619 | sce | 145.sce | clc;
//Exampkle 14.5
//page no 157
printf("Example 14.5 page no 157\n\n");
//air is transported through a circular conduit
MW=28.9//molecular weight of air
R=10.73//gas constant
T=500//temperature
P=14.75//pressure,psia
//applying ideal gas law for density
rho=P*MW/(R*T)//density
rho=0.08//after round off
meu=3.54e-7//viscosity of air at 40 degF
//assume flow is laminar
q=8.33//flow rate ,ft^3/s
L=800//length of pipe,ft
P_1=.1//pressure at starting point
P_2=.01//pressure at delivery point
D=[(128*meu*L*q)/(%pi*(P_1-P_2)*144)]^(1/4)//diameter
printf("\n pipe diameter D=%f ft",D);
//check the flow type
meu=1.14e-5
R_e1=4*q*rho/(%pi*D*meu)//reynolds no
//printf("\n reynolds no R_e=%f ",R_e);
//from R_e we can conclude that laminar flow is not valid
P_drop=12.96//pressure drop P_1-P2 in psf
f=0.005//fanning friction factor
g_c=32.174
D=(32*rho*f*L*q^2/(g_c*%pi^2*P_drop))^(0.2)//diamter from new assumption
//strat the second iteration with the newly calculated D
k=0.00006/12//roughness factor
K_r=k/D//relative roughness
C_f=1.321224
R_e_n=4*q*rho/(%pi*D*meu)//new reynolds no
//printf("\n new reynolds no R_e=%f ",R_e);
f_n=0.0045//new fanning friction factor
D=[((8*rho*f_n*L*q^2)/(g_c*%pi^2*P_drop))^(0.2)]*C_f//final calculated diameter because last diameter is same with this
printf("\nD=%f ",D);
//iteration may now be terminated
S=%pi*(D^2)/4//cross sectional area of pipe
v=q/S//flow velocity
printf("\n flow velocity v=%f ft/s",v);//printing mistake in book in the value of meu in the formula of D is first time that's why this deviation in answer
|
30c279cad5bc466be4fe30c6557827eaff9e56f5 | 449d555969bfd7befe906877abab098c6e63a0e8 | /260/DEPENDENCIES/insertion_sort.sci | d6b5f5d32212cb49eb75eb1b5f9b8d29e92a5ec0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 214 | sci | insertion_sort.sci | function A = insertion_sort(A)
n = length(A);
for(i = 2:n)
t = A(i);
j = i;
while((j > 1) & (A(j-1) > t))
A(j) = A(j-1);
j = j-1;
end
A(j) = t;
end
endfunction |
e5efdb64de80112bf56bca49098462434a83030f | 449d555969bfd7befe906877abab098c6e63a0e8 | /572/CH4/EX4.3/c4_3.sce | 1783cedd4bda8ae9d45fa6f338b37c8a707fbda5 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,135 | sce | c4_3.sce | // (4.3) Steam enters a converging–diverging nozzle operating at steady state with p1 = 40 bar, T1= 400C, and a velocity of 10 m/s. The steam flows through the nozzle with negligible heat transfer and no significant change in potential energy. At the exit, p2 = 15 bar, and the velocity is 665 m/s. The mass flow rate is 2 kg/s. Determine the exit area of the nozzle, in m2.
//solution
//variable initialization
p1 = 40 //entry pressure in bar
T1 = 400 //entry temperature in degree celcius
V1 = 10 //entry velocity in m/s
P2 = 15 //exit pressure in bar
V2 =665 //exit velocity in m/s
mdot = 2 //mass flow rate in kg/s
//from table A-4
h1 = 3213.6 //specific enthalpy in in kj/kg
h2 = h1+((V1^2-V2^2)/2)/1000
//from table A-4
v2 = .1627 //specific volume at the exit in m^3/kg
A2 = mdot*v2/V2
printf('the exit area of the nozzle in m^2 is \n\t A2 = %e',A2) |
854cffc46440e5ec7e506fa2419989729a9b42bc | d1a2737ec744ffbba1165afa7b05f26a4076f513 | /Lab 4/Q2.sce | abff1b54fdfe7d63024dcb98bd2e498fdf1dc30a | [
"MIT"
] | permissive | ipsitmantri/EE-324-Control-Systems-Lab | 4e37a3de51f4114ba0ea281cbb1da78a6c4815bb | b34c45efc3539005603b2e76c1665d6636f80f88 | refs/heads/master | 2023-04-03T10:42:34.548542 | 2021-04-13T14:11:21 | 2021-04-13T14:11:21 | 357,540,595 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,008 | sce | Q2.sce | clc; clear;
//-----------------
// Question 2
// Part a
s = poly(0, 's');
G = 10 / (s* (s+2) * (s+4));
Gs = syslin('c', G);
K = 10;
Cs = K * Gs /. syslin('c', 1, 1);
disp("Transfer function for K = 10");
disp(Cs);
disp("==================================================");
// Part b
K = 0:0.1:100;
scf();
for i=1:size(K, 2)
k = K(i);
Cs = k * Gs /. syslin('c', 1, 1);
[z, p, _p] = tf2zp(Cs);
plot(real(p), imag(p), 'b*', 'LineWidth', 2);
end
xlabel("Real Axis", 'fontsize', 3);
ylabel("Imaginary Axis", 'fontsize', 3);
title(["Locus of poles of", "$\frac{10K}{10K + 8s + 6s^2 + s^3}$"], "fontsize", 4);
xs2png(gcf(), "Q2b.png");
// ------------------------
// Part c
K_critical = -1;
for i=1:size(K, 2)
k = K(i);
Cs = k * Gs /. syslin('c', 1, 1);
[z, p, _p] = tf2zp(Cs);
rp = real(p);
if rp(1) > 0 || rp(2) > 0 || rp(3) > 0
K_critical = k;
break;
end
end
disp("Estimated Critical Value of K");
disp(K_critical);
// ------------------------
// Part d
|
8f6802714917e4bb68b101f07b0c95163f955809 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3311/CH16/EX16.16/Ex16_16.sce | 2372f6b0bf71f814e18af39f5e2a5afc0b690523 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 562 | sce | Ex16_16.sce | // chapter 16
// example 16.16
// What will be the firing angle and output power available
// page-1051
clear;
clc;
// given
f=50; // in Hz
neta=60; // in %
T=0.24; // in s (repition period)
// calculate
// part (i) can not be solved
// since T=0.24 s represents 12 cycles at 50 Hz or T=24 half cycles, therefore
T=24;
// since Pload/Pmax=N/24, therefore
N1=1, N2=24
Pload1=N1/T;
Pload2=N2/T;
printf("The available power range from %.2f %% of Pmax (N=%.f) to %.f %% of Pmax (N=%.f) varying in steps of %.2f %% of Pmax",Pload1*1E2,N1,Pload2*1E2,N2,Pload1*1E2);
|
ffbb15461fec5ae161712090d43b47f4e1f129f5 | 089894a36ef33cb3d0f697541716c9b6cd8dcc43 | /NLP_Project/test/blog/bow/bow.20_14.tst | 719d901caecd8cc82904717bb23b1dbf9683f07a | [] | no_license | mandar15/NLP_Project | 3142cda82d49ba0ea30b580c46bdd0e0348fe3ec | 1dcb70a199a0f7ab8c72825bfd5b8146e75b7ec2 | refs/heads/master | 2020-05-20T13:36:05.842840 | 2013-07-31T06:53:59 | 2013-07-31T06:53:59 | 6,534,406 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 4,583 | tst | bow.20_14.tst | 20 1:0.03636363636363636 3:0.5 5:1.0 8:0.4 11:0.125 15:0.25 17:0.058823529411764705 20:2.0 36:0.5 37:0.09090909090909091 56:1.0 63:2.0 83:1.0 165:0.5 224:1.0 254:1.0 390:1.0 527:1.0 819:0.5 1126:1.0 1199:1.0
20 5:1.0 8:0.4 17:0.23529411764705882 20:1.0 36:0.5 40:0.16666666666666666 56:2.0 83:2.0 224:2.0 227:0.3333333333333333 765:1.0 876:1.0 1126:3.0 1544:1.0 1766:1.0
20 5:1.0 8:0.2 15:0.25 17:0.058823529411764705 40:0.16666666666666666 71:1.0 165:0.5 192:1.0 234:0.3333333333333333 254:1.0 386:0.5 388:0.5 775:1.0 782:1.0 784:1.0 1360:1.0
20 17:0.058823529411764705 56:1.0 83:1.0 183:1.0 391:1.0 1126:1.0 1249:1.0 1369:1.0
20 1:0.01818181818181818 11:0.125 33:0.2 63:1.0 203:1.0 819:0.5 1693:1.0
20 11:0.125 40:0.16666666666666666 91:0.4 254:1.0 396:1.0 778:1.0
20 13:0.2 58:0.5 133:0.5 437:1.0 871:1.0 891:1.0 1233:0.3333333333333333
20 13:0.2 15:0.25 17:0.058823529411764705 254:1.0
20 1:0.01818181818181818 8:0.2 13:0.2 17:0.058823529411764705 32:0.25 44:0.3333333333333333 86:1.0 91:0.2 256:1.0 396:1.0 492:0.5 622:0.25 626:1.0 763:1.0 1165:0.1111111111111111 1630:1.0 1668:1.0
20 13:0.2 15:0.25 17:0.11764705882352941 18:1.0 19:1.0 20:1.0 32:0.25 39:1.0 144:1.0 173:1.0 464:0.3333333333333333 622:0.5 872:1.0 1216:0.5 1360:1.0 1719:1.0
20 8:0.2 11:0.125 13:0.2 15:0.25 17:0.11764705882352941 20:1.0 40:0.16666666666666666 93:1.0 254:1.0 1062:1.0 1723:1.0 1724:1.0
20 1:0.03636363636363636 33:0.2 73:0.3333333333333333 254:1.0 319:1.0 872:1.0
20 17:0.058823529411764705 418:0.5 432:1.0 622:0.25 819:0.5 1507:0.5 1723:1.0
20 8:0.4 13:0.2 14:1.0 15:1.25 17:0.058823529411764705 111:2.0 173:1.0 576:1.0 622:0.75 757:1.0 872:1.0 1234:1.0 1432:3.0 1766:1.0
20 13:0.4 17:0.11764705882352941 133:0.5 254:1.0 388:0.5 430:1.0 673:1.0 811:1.0 872:1.0
20 8:0.2 15:0.25 32:0.25 350:1.0 1253:1.0
20 1:0.01818181818181818 3:0.5 8:0.2 11:0.125 15:0.5 16:2.0 17:0.058823529411764705 32:0.25 40:0.3333333333333333 73:0.3333333333333333 83:1.0 232:1.0 383:2.0 590:1.0 627:1.0 813:1.0 819:0.5 962:1.0 1048:0.3333333333333333 1079:1.0 1082:1.0 1085:1.0 1177:1.0 1198:0.3333333333333333 1343:1.0 1443:1.0 1614:1.0 1821:1.0
20 1:0.01818181818181818 3:0.5 8:0.2 14:1.0 15:0.25 17:0.058823529411764705 20:1.0 33:0.2 36:0.5 73:0.3333333333333333 83:1.0 203:1.0 525:1.0 980:1.0 1010:2.0 1048:0.3333333333333333 1079:1.0 1082:3.0 1085:1.0 1086:1.0 1316:1.0 1319:1.0 1535:1.0 1675:1.0
20 5:1.0 17:0.058823529411764705 33:0.2 36:0.5 37:0.09090909090909091 73:0.3333333333333333 404:1.0 705:1.0 813:1.0 1048:0.3333333333333333 1049:2.0 1085:1.0 1676:1.0
20 1567:1.0 1657:1.0
20 8:0.2 40:0.16666666666666666 346:1.0 492:0.5 586:1.0 1614:1.0 1731:1.0 1821:1.0
20 17:0.058823529411764705 19:1.0 20:1.0 40:0.16666666666666666 228:1.0 590:1.0
20 15:0.25 778:1.0 982:1.0 1082:1.0 1253:1.0
20 8:0.2 15:0.25 17:0.058823529411764705 20:1.0 37:0.09090909090909091 40:0.16666666666666666 56:2.0 83:2.0 170:1.0 204:0.2 527:1.0 618:1.0 714:1.0 722:1.0 1832:1.0
20 11:0.125 17:0.058823529411764705 20:2.0 36:0.5 37:0.09090909090909091 56:1.0 83:1.0 872:1.0 1319:1.0 1321:1.0 1467:1.0 1530:1.0 1832:1.0
20 15:0.25 37:0.18181818181818182 83:1.0 193:1.0 622:0.25 892:1.0 1155:1.0 1227:1.0 1341:1.0
20 3:0.5 5:1.0 9:1.0 11:0.125 17:0.11764705882352941 36:0.5 37:0.09090909090909091 64:0.2 83:1.0 165:0.5 333:0.5 388:0.5 390:1.0 420:1.0 778:1.0 823:1.0 980:1.0 1275:1.0 1327:1.0 1378:1.0
20 40:0.16666666666666666 56:1.0 66:1.0 83:1.0 136:1.0 187:0.2 212:1.0 234:0.3333333333333333 333:0.5 388:0.5 705:1.0 819:0.5 824:1.0 1136:1.0 1772:1.0 1773:1.0
20 8:0.2 32:0.25 91:0.2 386:0.5 1010:1.0 1082:3.0 1126:1.0 1319:1.0
20 36:0.5 37:0.09090909090909091 199:1.0 353:1.0 527:1.0 566:1.0 1233:0.3333333333333333 1306:1.0 1764:1.0
20 8:0.2 32:0.25 91:0.2 187:0.2 279:1.0 1039:0.5 1113:1.0
20 15:0.25 71:1.0 260:1.0 353:1.0 386:0.5
20 20:1.0 36:0.5 37:0.09090909090909091 91:0.2 135:1.0 199:1.0 404:1.0 1131:1.0 1135:1.0 1319:1.0
20 15:0.25 17:0.058823529411764705 36:1.0 58:0.5 73:0.3333333333333333 91:0.4 614:0.3333333333333333 995:1.0 1010:1.0 1031:1.0 1040:1.0 1066:1.0 1113:1.0 1633:1.0
20 3:0.5 20:1.0 36:0.5 55:0.5 303:0.25 350:1.0 1000:1.0 1001:1.0 1034:1.0 1082:1.0 1128:1.0
20 63:1.0 71:1.0 556:1.0 1364:1.0 1541:1.0
20 15:0.25 17:0.058823529411764705 32:0.25 71:1.0 73:0.3333333333333333 386:0.5 590:1.0 1010:1.0 1084:1.0 1467:1.0
20 15:0.25 17:0.058823529411764705 20:2.0 32:0.25 56:1.0 73:0.3333333333333333 239:1.0 390:2.0 995:1.0 1010:1.0 1050:1.0 1069:1.0 1113:1.0
20 15:0.25 17:0.058823529411764705 91:0.2
20 11:0.125 17:0.058823529411764705 71:1.0 91:0.2 187:0.2 234:0.3333333333333333 386:0.5 1053:3.0 1107:1.0
|
c7523a5baaee57b04b2daadb7d4c936023aea847 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2318/CH2/EX2.21/ex_2_21.sce | db41eb78dacb67bee456bbafc05e798303e4eb16 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 627 | sce | ex_2_21.sce | //Example 2.21://consumer monthly bill ,power factor and average cost per unit
clc;
clear;
close;
format('v',9)
kwh=125000;//
kvarh=100000;//
kvah=sqrt(kwh^2+kvarh^2);//kVAh
kw=180;//
kvar=125;//
mkva=sqrt(kw^2+kvar^2);//kVA
pkva=15;//rupees
pkvah=0.1;//reupees
tmb=pkva*mkva+pkvah*kvah;//in Rs
disp(tmb,"total monthly bill in Rs")
pf=kwh/kvah;//power factor
d=30;//days
t=24;//hours a day
lf=((kwh/(d*t))/kw);//load factor
avcp=tmb/kwh;//in paisa
disp(pf,"power factor is")
disp(lf,"load factor is")
disp(avcp*100,"average cost per unit (kWh) in paisa is")
//total monthly bill and load factor is calculated wrong in the book
|
729f0c09c9bb7cd511769b260652af9b01a008ef | 449d555969bfd7befe906877abab098c6e63a0e8 | /978/CH1/EX1.5/Example1_5.sce | 3dea37215335cfe49e051dbe2f7a437c77e2e90d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 228 | sce | Example1_5.sce | //chapter1,Example1_5,pg 482
//with input voltage exceding 2Vd,diodes conduct and the voltage divider circuit with diodes can allow only a Vi given by Vi=2Vd
printf("\ninput voltage to amplifier\n")
printf("\nVi=2Vd")
|
b86123ce7dc74b6a925f5f21c2cd82025bc67915 | 449d555969bfd7befe906877abab098c6e63a0e8 | /991/CH9/EX9.11/Example9_11.sce | 8c30b517a638cb3019d9b96a1c330a0de8f874d7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 710 | sce | Example9_11.sce | //Example 9.11.refer fig.9.55
clc
format(6)
VCC=10
RB=470*10^3
RE=3.3*10^3
beta=100
RS=1*10^3
RL=50
re=22.4
VBE=0.7
IB = (VCC-VBE) / (RB + ((1+beta)*RE))
x1=IB*10^6
disp(x1,"From fig.9.55, IB(uA) = (VCC-VBE) / (RB + (1+beta)*RE)")
format(5)
IE=(1+beta)*IB
x2=IE*10^3
disp(x2," IE(mA) = (1+beta)*IB =")
rL=(RE*RL)/(RE+RL)
disp(rL,"The load resistance of the emitter follower is rL(ohm) = RE || RL =") // answer in textbook is wrong
x=(1+beta)*(re+rL)
Zi=(RB*x)/(RB+x)
x3=Zi*10^-3
disp(x3," Zi(k-ohm) = RB || (1+beta)(re+rL) =")
y=(50/(22.4+50))*((7.13*10^3)/((1*10^3)+(7.3*10^3))) // answer in textbook is wrong
disp(y," VL / VS = (rL/re+rL)(Zi/Rs+Zi) =") |
f7cb66c0726eab374871153c2e65c413ef4d16c8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1478/CH3/EX3.7.9.A/3_7_9_A.sce | 90f28839e0bc05c20880b60246b6b57703164cda | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 408 | sce | 3_7_9_A.sce | //lubricants//
//example 3.7.9.A//
clc
wt_oil=1.55//weight f oil saponified(gms)//
blank=20//volume blank titration reading(ml)//
back=15//volume back titration reading(ml)//
volume=blank-back//volume of alcoholic KOH consumed(ml)//
normality_KOH=0.5//normality of KOH //
S=volume*normality_KOH*56/wt_oil//formula for saponification value//
printf("\nSaponification value of oil is %.2f mgs KOH",S); |
65da5cdc40a69701be72d52f1737a6e2ced8b173 | 3c31145b7b0914a28b5c5c61d01c47253663df63 | /Kalman 2D/FiltroKalman.sci | cf2498dcfd4c7c511bed60761205924df684c08e | [] | no_license | APFN/INTRODUCAO-A-IDENTIFICA-O-DE-SISTEMAS | 1eb05ddc0debe5381d941715915388f7ca8af22c | d1a7afd8c8f894285aa9d4c282939538cfaa45d4 | refs/heads/master | 2021-07-21T14:50:25.870205 | 2017-10-30T19:31:48 | 2017-10-30T19:31:48 | 108,897,789 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,838 | sci | FiltroKalman.sci | clc
clear
cd='C:\Users\Álvaro\Google Drive\0 mestrado mecatronica\2017.2\INTRODUÇÃO À IDENTIFICAÇÃO DE SISTEMAS\2 unidade trabalho\Kalman 2D';
FILE='dados_sensor_GPS.txt';
data = read(FILE, -1, 3);
total_points = size(data,"r");
t = data(1:total_points,1);
x = data(1:total_points,2);
y = data(1:total_points,3);
tempo = 1
dt= t(tempo)-0; // variacao tempo
//erro esperado de sinal do satelite
Uk= 6;
Ek= 36;
/////////MATRIZES DE COVARIANCIA//////////
Rk = [0.1 0; 0 0.1]; //covariancia
Qk = [0.003 0;0 0.003]; //covariancia
PesoR=1;
PesoQ=1000;
Hk = [cos(32) 0; sin(32) 0]; // modelo de obrservacao
Xkant = [0 ; 0]; //X anterior
Pkant = [0.1 0;0 0.1]; //P anterior
/////////PREDICAO//////////
Phi = [1 dt; 0 1]; // modelo de transicao de estados
Xk = Phi*Xkant; // X predicao
Pk = Phi*Pkant*Phi' + Qk; // predicao covariancia
/////////ATUALIZACAO DE DADOS//////////
yk = [(([x(tempo),y(tempo)]))']; //coleta dados
ykest=[(Hk*Xk)]; // dados estimados
erro_estimacao(:,tempo)=yk(:,tempo)-ykest(:,tempo);
/////////CORRECAO//////////
Kk = Pk*Hk'*inv(Hk*Pk*Hk' + Rk); //ganho de kalman
Xkest = Xk + Kk*erro_estimacao; // X correcao
Pkest = (eye(2,2) - Kk*Hk)*Pk; // P correcao
/////////CALCULO DA VELOCIDADE ESTIMADA//////////
Vkest=[Xkest(1,tempo)/dt;Xkest(2,tempo)/dt] // velocidade
Vreal=[(yk(1,tempo))/dt;(yk(2,tempo))/dt];
vel=[sqrt(((Vkest(1,tempo)))^2 +(Vkest(2,tempo))^2)];
/////////Atualizacao Vars. Auxs.//////////
Pkant=Pkest;
Xkant = Xkest(:,tempo);
for tempo = 2:total_points
dt= t(tempo)- t(tempo-1); // variacao tempo
/////////PREDICAO//////////
Phi = [1 dt; 0 1]; // atualizacao modelo
Xk = Phi*Xkant; // predicao X
Pk = Phi*Pkant*Phi' + Qk; // predicao variancia
/////////ATUALIZACAO DE DADOS//////////
yk = [yk, ([x(tempo),y(tempo)])'];//coleta dados
ykest=[ykest, (Hk*Xk)];
erro_estimacao=[erro_estimacao,yk(:,tempo)-ykest(:,tempo)];
/////////CORRECAO//////////
Kk = Pk*Hk'*inv(Hk*Pk*Hk' + Rk); // ganho de kalman
Xkest = [Xkest ,Xk + Kk*erro_estimacao(:,tempo)]; // correcao X
Pkest= (eye(2,2) - Kk*Hk)*Pk; //(eye(2,2) - Kk*Hk)*Pk;
/////////Atualizacao Vars. Auxs.//////////
Pkant=Pkest;
Xkant = Xkest(:,tempo);
/////////CALCULO DA VELOCIDADE ESTIMADA//////////
Vkest=[Vkest, [(Xkest(1,tempo)-Xkest(1,tempo-1))/dt;(Xkest(2,tempo)-Xkest(2,tempo-1))/dt]];
Vreal=[Vreal, [(yk(1,tempo)-yk(1,tempo-1))/dt;(yk(2,tempo)-yk(2,tempo-1))/dt]];
vel=[vel, sqrt(((Vkest(1,tempo)))^2 +(Vkest(2,tempo))^2)];
/////////MATRIZES DE COVARIANCIA//////////
Qk = [(variance(Vkest(1,:)-Vreal(1,:))) 0; 0 (variance(Vkest(2,:)-Vreal(2,:)))]/PesoQ;
Rk = [(variance(erro_estimacao(1,:))) 0; 0 (variance(erro_estimacao(2,:)))]/PesoR;
end
////Primeira janela////
figure(1)
f=get("current_figure") ;
f.figure_size=[1000,800];
subplot(311)
title('Longitude X');
plot(x,'r');
set(gca(),"auto_clear","off")
plot(ykest(1,:),'g');
set(gca(),"auto_clear","on")
hl=legend(['Longitude';'Longitude Calculada'],[-4]);
subplot(312)
title('Latitude Y');
plot(y,'r');
set(gca(),"auto_clear","off")
plot(ykest(2,:),'g');
set(gca(),"auto_clear","on")
h2=legend(['Latitude';'Latitude Calculada'],[-4]);
subplot(313)
title('Erro de estimação');
plot(erro_estimacao(1,:),'g')
set(gca(),"auto_clear","off")
plot(erro_estimacao(2,:),'r')
set(gca(),"auto_clear","on")
h3=legend(['Erro Longitude';'Erro Latitude'],[-4]);
////Segunda janela////
figure(2)
f2=get("current_figure") ;
f2.figure_size=[1000,800];
subplot(211)
title('Latitude x Longitude');
plot(ykest(1,:),ykest(2,:), 'b');
plot(x,y, 'r');
h1=legend(['Kalman';'Real'],[-4]);
subplot(212)
title('Velocidade estimada');
plot(vel, 'g');
h2=legend(['m/s'],[-4]);
|
b48ba7b21a4bd135a3ac91a3daf156e913a42192 | 3b9a879e67cbab4a5a4a5081e2e9c38b3e27a8cc | /Área 1/Aula 6/Teste2.sce | 6ea3c4cf85434533109ecdba0685b3a77737c479 | [
"MIT"
] | permissive | JPedroSilveira/numerical-calculus-with-scilab | 32e04e9b1234a0a82275f86aa2d6416198fa6c81 | 190bc816dfaa73ec2efe289c34baf21191944a53 | refs/heads/master | 2023-05-10T22:39:02.550321 | 2021-05-11T17:17:09 | 2021-05-11T17:17:09 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 111 | sce | Teste2.sce | x=[1321, 246544, 312134]
y=[1320, 246545, 312100]
disp(norm(x-y, 1))
disp(norm(x-y, 2))
disp(norm(x-y, %inf))
|
d10cc85503db2f6a170951bc170663e8fc93b44a | 449d555969bfd7befe906877abab098c6e63a0e8 | /572/CH14/EX14.6/c14_6.sce | e6ddad0eb356bb56d2d1e3e27f7c0db6f1ed7d30 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,179 | sce | c14_6.sce | //(14.6) Carbon monoxide at 25C, 1 atm enters a well-insulated reactor and reacts with the theoretical amount of air entering at the same temperature and pressure. An equilibrium mixture of CO2, CO, O2, and N2 exits the reactor at a pressure of 1 atm. For steady-state operation and negligible effects of kinetic and potential energy, determine the composition and temperature of the exiting mixture in K.
//solution
//The overall reaction is
//CO + .5O2 + 1.88N2 -------> zCO + (z/2)O2 + (1-z)CO2 + 1.88N2
p =1 //in atm
pref = 1 //in atm
//solving equations K = (z/(1-z))*(z/(5.76+z))^.5 and z*deltahbarCO + (z/2)*deltahbarO2 + (1-z)*deltahbarCO2 + 1.88deltahbarN2 + (1-z)*[hfbarCO2-hfbarCO]= 0
z = .125
T = 2399 //in kelvin
printf('the temperature of the exiting mixture in kelvin is: %f',T)
printf('\ncomposition of the equilibrium mixture, in kmol per kmol of CO entering the reactor, is then 0.125CO, 0.0625O2, 0.875CO2, 1.88N2.') |
5935bba4f24d6b7b1e3870b85f882c34a6f572ec | e0124ace5e8cdd9581e74c4e29f58b56f7f97611 | /3913/CH12/EX12.4/Ex12_4.sce | 05c9413a7075e9ad82680bafefb1637efa2f493c | [] | no_license | psinalkar1988/Scilab-TBC-Uploads-1 | 159b750ddf97aad1119598b124c8ea6508966e40 | ae4c2ff8cbc3acc5033a9904425bc362472e09a3 | refs/heads/master | 2021-09-25T22:44:08.781062 | 2018-10-26T06:57:45 | 2018-10-26T06:57:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 574 | sce | Ex12_4.sce | //Chapter 12 : Solutions to the Exercises
//Scilab 6.0.1
//Windows 10
clear;
clc;
//Solution for 1.5
//6*6 matrix in which aij is given by
//(1) least common multiple of i and j
A=[1 2 3 4 5 6;2 2 6 4 10 6;3 6 3 12 15 6;4 4 12 4 20 12;5 10 15 20 5 30;6 6 6 12 30 6];
mprintf('6*6 matrix in which aij is given by ')
mprintf('\n(1) least common multiple of i and j')
disp(A)
//(2) greatest common divisor of i and j
B=[1 1 1 1 1 1;1 2 1 2 1 2;1 1 3 1 1 3;1 2 1 4 1 2;1 1 1 1 5 1;1 2 3 2 1 6];
mprintf('\n(2) greatest common divisor of i and j')
disp(B)
|
9f0d3ed8164af41c7f0db3cc8e808cc676b54cb6 | e41b69b268c20a65548c08829feabfdd3a404a12 | /3DCosmos/Data/Scripts/_menu.SCI | cfd96b2b84c2c3aeabce0d5cea151d56250f8556 | [
"LicenseRef-scancode-khronos",
"MIT"
] | permissive | pvaut/Z-Flux | 870e254bf340047ed2a52d888bc6f5e09357a8a0 | 096d53d45237fb22f58304b82b1a90659ae7f6af | refs/heads/master | 2023-06-28T08:24:56.526409 | 2023-03-01T12:44:08 | 2023-03-01T12:44:08 | 7,296,248 | 1 | 1 | null | 2023-06-13T13:04:58 | 2012-12-23T15:40:26 | C | UTF-8 | Scilab | false | false | 3,326 | sci | _menu.SCI | codeblock readtextfile(ScriptDir+"\_TOOLS.sci");
codeblock readtextfile(ScriptDir+"\_logo.sci");
createvar(menu);
JoystickUseForNavigation(false);
function startup()
{
sf=T_scene_create;
sf=root.SC.Universe;
sss=T_getscene;
myviewport=T_getviewport;
myviewport.CameraPos=point(0,0,1);
myviewport.CameraDir=vector(0,0,-1);
myviewport.FocalDistance=1;
myviewport.NearClipPlane=0.1;
myviewport.FarClipPlane=20;
screensizey=2*tan(myviewport.aperture/2);
screensizex=screensizey*myviewport.aspectratio;
logoframe=sf.addsubframe("Logoframe");
logoframe.transf.translate(vector(0.2*screensizex,-0.3*screensizey,0));
logoframe.transf.scale(0.06);
logoframe.transf.rotate(vector(0,1,0),deg2rad(-45));
createlogo(logoframe);
menu=T_createmenu;
root.SC.Universe.MenuFrame.color=color(0.75,0.75,0.75);
root.SC.Universe.MenuFrame.BlendType=BlendTransparent;
root.mousedampingfactor=0.25;
root.SC.Universe.MenuFrame.EnabeMouseArrow(point(0.5,0.5),point(0,0),point(1,0.995),0.03);
root.framerate=60;
myviewport.EnableUserStop=false;
root.showcontrols=true;
menu.sizex=0.3;
menu.Color=color(1,1,1,1);
dirstack=list;
dirstack.add(ScriptDir);
while dirstack.size>0 do {
curdir=dirstack(dirstack.size-1);dirstack.del(dirstack.size-1);
curparent=curdir;
if curparent==ScriptDir then curparent="";
if FileIsPresent(curdir+"\menu.txt") then {
content=readtextfile(curdir+"\menu.txt");
while content!="" do {
line=content.split("~n");
id=line.split(";");
name=line;if name=="" then name=id;
found=false;
if id=="-" then {
menu.add(curparent,"-");
found=true;
}
if FileIsPresent(curdir+"\"+id+".SCI") then {
menu.add(curparent,Translate(name),curdir+"\"+id+".SCI");
found=true;
}
if not(found) and ID.Length>0 then {
if FileIsPresent(curdir+"\"+id+"\menu.txt") then {
dirstack.add(curdir+"\"+id);
menu.add(curparent,Translate(name),curdir+"\"+id);
}
}
}
}
if false then {
dirlist=GetFileList(curdir+"\*.*",true);
foreach dir in dirlist do
if (dir!=".") and (dir!="..") and (dir(0)!="_") then {
dirstack.add(curdir+"\"+dir);
name=dir;
if name.find("_")>=0 then name.split("_");
menu.add(curparent,Translate(name),curdir+"\"+dir);
}
filelist=GetFileList(curdir+"\*.SCI",false);
foreach file in filelist do {
if file(0)!="_" then {
name=file;name=name.split(".");
if name.find("_")>=0 then name.split("_");
menu.add(curparent,Translate(name),curdir+"\"+file);
}
}
}
}
}
startup;
while true do {
if menu.WasModified then {
st=menu.SelectID;
menu.visible=false;
root.Viewports.main.FadeColor=Color(0,0,0,1);
render;
if FileIsPresent(st) then {
# try {
ExecuteScript(st,"");
# }
}
startup;
menu.SelectID=st;
output(st);
}
render;
}
|
1b80ef0ab76bbbb310bbf1142d82c3d44763946a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2441/CH5/EX5.23/Ex5_23.sce | 067acca6db09723481705589bca7b83c93c37838 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 279 | sce | Ex5_23.sce | //Example 5.23
clc;clear;close;
format('v',7);
Z=1.5+%i*2.5;//ohm
V=11;//kV
P=20;//MW
pf=0.8;//power factor
theta=acosd(pf);
I=P*1000/sqrt(3)/V/pf;//
I=I*expm(%i*-theta*%pi/180);//A
Vdrop=I*Z;//V
Vboost=Vdrop;//V
disp(Vboost,"Voltage boost needed at station A(V)");
|
f088cef8d8e7d37f3cdd0a41e2f2299139e500d8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1133/CH8/EX8.40/Example8_40.sce | 682f7fae31c312e33af1d89731a46e4dea64aa56 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 931 | sce | Example8_40.sce | //Example 8.40
clc
disp("Excitation table")
disp("Present State Next State Flip-flop Inputs")
disp(" QC QB A+ B+ J_A K_A J_B K_B")
disp(" 0 0 1 1 1 X 1 X")
disp(" 0 1 0 0 0 X X 1")
disp(" 1 0 0 1 X 1 1 X")
disp(" 1 1 1 0 X 0 X 1")
disp("")
disp("K-map Simplification")
disp(" For J_A")
disp(" B'' B")
disp("A'' 1 0")
disp("A X X")
disp("J_A = B''")
disp("")
disp(" For K_A")
disp(" B'' B")
disp("A'' X X")
disp("A 1 0")
disp("K_A = B''")
disp("")
disp(" For J_B")
disp(" B'' B")
disp("A'' 1 X")
disp("A 1 X")
disp("J_B = 1")
disp("")
disp(" For K_B")
disp(" B'' B")
disp("A'' X 1")
disp("A X 1")
disp("K_B = 1")
disp("")
|
54ef5ae22d26d3244d9e8930d49e8395c78321e5 | a7c04c776e8211aa5ddbfcbc697255f346211eb7 | /script.sce | 24e11a83e43773c3acf25d70fa176bb5a1939f9c | [] | no_license | jvmr1/Multiagentes | 67644821261296f12d0f5519057b0ca7b8da14cb | 22f6242427a0d795b42e3d8cf70b580006ee8048 | refs/heads/master | 2021-07-25T12:59:04.734825 | 2020-04-11T00:10:43 | 2020-04-11T00:10:43 | 144,584,612 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 263 | sce | script.sce | figure;
plot2d3(x1)
a=gca() ;//get the current axes
a.box="on";
a.data_bounds=[0,0;720,26];
const=m1*ones(1,720);
plot(const)
figure;
plot2d3(x2)
a=gca() ;//get the current axes
a.box="on";
a.data_bounds=[0,0;720,26];
const=m2*ones(1,720);
plot(const)
|
9eafb6ceabd5201bab842424bb49eca840ea19e3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /534/CH3/EX3.2/3_2_Chip_Operating_Temperature.sce | efa8e416588282363658199f89a4532f85e90293 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 789 | sce | 3_2_Chip_Operating_Temperature.sce | clear;
clc;
printf('FUNDAMENTALS OF HEAT AND MASS TRANSFER \n Incropera / Dewitt / Bergman / Lavine \n EXAMPLE 3.2 Page 107 \n'); //Example 3.2
// Chip Operating Temperature
Tf = 25+273; //[K] - Temperature of Fluid Flow
L=.008; //[m] - Thickness of Aluminium
k=239; // [W/m.K] Effective Thermal Conductivity of Aluminium
Rc=.9*10^-4; //[K.m^2/W] Maximum permeasible Resistane of Epoxy Joint
q=10^4; //[W/m^2] Heat dissipated by Chip
h=100; //[W/m^2.k] - Thermal Convectivity from chip to air
//Temperature of Chip
//q=(Tc-Tf)/(1/h)+(Tc-Tf)/(Rc+(L/k)+(1/h))
Tc = Tf + q*(h+1/(Rc+(L/k)+(1/h)))^-1;
printf("\n\n Temperature of Chip = %.2f degC",Tc-273);
printf("\n Chip will Work well below its maximum allowable Temperature ie 85 degC")
//END |
4ad032c5a11885e0ae0854cd2e72739717b5f33f | 449d555969bfd7befe906877abab098c6e63a0e8 | /2510/CH19/EX19.4/Ex19_4.sce | 0fd234072f74061749cb4fe1ddd5d8d5252859ec | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 553 | sce | Ex19_4.sce | //Variable declaration:
k = 0.022 //Thermal conductivity of glass wool (Btu/h.ft. F)
T1 = 400 //Inside wall temperature ( F)
T2 = 25 //Outside wall temperature ( C)
L = 3/12 //Length of insulation cover (ft)
//Calculation:
T_2 = T2*(9/5)+32 //Outside wall temperature in fahrenheit scale ( F)
QbyA = k*(T1-T_2)/L //Heat flux across the wall (Btu/h.ft^2)
//Result:
printf("The heat flux across the wall is : %.1f Btu/h.ft^2 .",QbyA)
|
bd4c71958544a56d2bc3b44380e4294fc371a34f | 449d555969bfd7befe906877abab098c6e63a0e8 | /98/CH13/EX13.28/example13_28.sce | 8872b7415e0b9530501e2b7bee3b5e0fadae4935 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 474 | sce | example13_28.sce | //Chapter 13
//Example 13_28
//Page 343
clear;clc;
v1=250;
v2=250;
l1=35;
l2=20;
r1=v1^2/l1/1000;
r2=v2^2/l2/1000;
I=(v1+v2)/(r1+r2);
V1=I*r1;
V2=I*r2;
printf("Resistance of load on the +ve side = %.3f ohm \n\n", r1);
printf("Resistance of load on the -ve side = %.3f ohm \n\n", r2);
printf("Circuit current = %.2f A \n\n", I);
printf("Voltage across +ve outer and middle wire = %.1f V \n\n", V1);
printf("Voltage across -ve outer and middle wire = %.1f V \n\n", V2);
|
43e0b94caf360a24ebab87234e921b9482f0911c | 449d555969bfd7befe906877abab098c6e63a0e8 | /249/CH18/EX18.4/18_04.sce | 30b7da7f6a5bf3cfc7ef3c293ab93b9125b63c85 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | 18_04.sce | clear
clc
XA=0.35;
FAo=2000;//mol/hr
eA=3;k=96;
CAo=0.1;
W=((1+eA)*log(1/(1-XA))-eA*XA)*(FAo/(k*CAo));
printf("\n The amount of catalyst(kg) needed in a packed bed reactor is %f",W)
|
7f413f23ff9af8496e2fe7414495daf9728fb6af | 66106821c3fd692db68c20ab2934f0ce400c0890 | /test/disassembler/bset.instr.tst | caae714efd44dd22023514418c94d17322a64369 | [] | no_license | aurelf/avrora | 491023f63005b5b61e0a0d088b2f07e152f3a154 | c270f2598c4a340981ac4a53e7bd6813e6384546 | refs/heads/master | 2021-01-19T05:39:01.927906 | 2008-01-27T22:03:56 | 2008-01-27T22:03:56 | 4,779,104 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 456 | tst | bset.instr.tst | ; @Harness: disassembler
; @Result: PASS
section .text size=0x0000000e vma=0x00000000 lma=0x00000000 offset=0x00000034 ;2**0
section .data size=0x00000000 vma=0x00000000 lma=0x00000000 offset=0x00000042 ;2**0
start .text:
label 0x00000000 ".text":
0x0: 0x78 0x94 sei
0x2: 0x08 0x94 sec
0x4: 0x38 0x94 sev
0x6: 0x18 0x94 sez
0x8: 0x68 0x94 set
0xa: 0x58 0x94 seh
0xc: 0x28 0x94 sen
start .data:
|
205a01bbb04f727efb35cb8f091974b4bf97ce55 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2006/CH7/EX7.9/ex7_9.sce | d7403351c2610f3a094417125db5d5ed4cb1266b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 807 | sce | ex7_9.sce | clc;
p1=1; // Pressure of air at inlet of compressor in bar
T1=30; // Temperature of air at inlet of compressor in degree celcius
p2=12; // Delivery pressure of air in bar
T2=400; // Temperature of air at inlet of compressor in degree celcius
V2=90; // Velocity of air at exit in m/s
w=3740; // Power input to compressor in kW
k=1.4; // Index of reversible adiabatic process
Cpo=1.0035; // Specific heat at constant pressure in kJ/kg K
wa=Cpo*(T2-T1)+V2^2/2000; // Actual specific work input
m=w/wa; // Mass flow rate of air
T2s=(T1+273)*(p2/p1)^((k-1)/k);// Isentropic discharge temperature
ws=Cpo*(T2s-(T1+273))+V2^2/2000; // Isentropic work
eff_com=ws/wa; // Isentrpic efficiency
disp ("%",eff_com*100,"Isentrpic efficiency of compressor =","K",T2s,"Isentropic discharge temperature = ");
|
5aac2f6e1eb83476b622caf648ad74ce49a92c07 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3774/CH8/EX8.2/Ex8_2.sce | fe7f98b25ae811d3236b54701016c4150044bfbd | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 544 | sce | Ex8_2.sce | // exa 8.2 Pg 228
clc;clear;close;
// Given Data
Fmin=60;// N
Fmax=140;// N
d=3;// mm
Dm=18;// mm
Sut=1430;// MPa
C=Dm/d;// spring index
Kw=(4*C-1)/(4*C-4)+0.615/C;// Wahl's correction factor
Ks=1+0.5/C;// Shear Stress factor
Fm=(Fmax+Fmin)/2;// N
Fa=(Fmax-Fmin)/2;// N
tau_m=Ks*(8*Fm*C)/(%pi*d**2);// MPa
tau_a=Kw*(8*Fa*C)/(%pi*d**2);// MPa
Ses_dash=0.22*Sut;// MPa
Sys=0.45*Sut;// MPa
//tau_m/Sys+tua_a/Ses_dash*(2-Ses_dash/Sys)=1/n
n=1/(tau_m/Sys+tau_a/Ses_dash*(2-Ses_dash/Sys));// factor of safety
printf('\n factor of safety = %.2f',n)
|
b668529e829197561b5946952b2d7be8273510b2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3537/CH2/EX2.9/Ex2_9.sce | 39f3a49c85d282fdd50bdcc36ff324a3a7265f0e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 359 | sce | Ex2_9.sce | //Example 2_9
clc();
clear;
//To calculate the resolving power and grating element
sintheta1=0.3
sintheta2=0.2
lamda=5000 //units in A
e=(lamda/(sintheta1-sintheta2))*10^-8 //units in cm
width=2.5 //units in cm
n=width/e //units in cm
resolvingpower=2*n
printf("Grating element is e=%.5f cm\n",e)
printf("Resolving power=%d",resolvingpower)
|
1fcee54879169083eb52b47b4d76d57450d065ce | a7dfe06f9734fdfe218ee36d144ffbba420d82a0 | /modules/unit_test/reports/tst-scheddownasup_service.tst | 015cdb62fac32e68f9151811aeef8ec2f2ff11e5 | [
"BSD-3-Clause"
] | permissive | transitiv/ninja | 1f7e114cedf86ee15c9d4e4876f69c0fec540390 | 3a0f0f37b33fe5e8030bb524499950a811c2c4bc | HEAD | 2016-08-05T05:42:14.097421 | 2011-06-20T15:47:02 | 2011-06-20T15:47:02 | 1,924,342 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,121 | tst | tst-scheddownasup_service.tst | description = count scheduled service downtime as uptime
logfile = scheddownasup_service.log
global_vars {
include_soft_states = 0
}
scheduled service downtime as uptime {
start_time = 1202684400
end_time = 1202770800
host_name = testhost
service_description = PING
scheduled_downtime_as_uptime = 1
correct {
TIME_OK_SCHEDULED = 3600
TIME_OK_UNSCHEDULED = 75600
TIME_WARNING_SCHEDULED = 0
TIME_WARNING_UNSCHEDULED = 7200
}
}
host in scheduled downtime, service as uptime {
start_time = 1202684400
end_time = 1202770800
host_name = testhost2
service_description = PING
scheduled_downtime_as_uptime = 1
correct {
TIME_OK_SCHEDULED = 3600
TIME_OK_UNSCHEDULED = 75600
TIME_WARNING_SCHEDULED = 0
TIME_WARNING_UNSCHEDULED = 7200
}
}
host in scheduled downtime, service as uptime, 2 services {
start_time = 1202684400
end_time = 1202770800
host_name = testhost2
service_description {
testhost;PING
testhost2;PING
}
scheduled_downtime_as_uptime = 1
correct {
TIME_OK_SCHEDULED = 3600
TIME_OK_UNSCHEDULED = 75600
TIME_WARNING_SCHEDULED = 0
TIME_WARNING_UNSCHEDULED = 7200
}
}
|
be5b39c573144e78a669d60032999a9d6641bad1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /323/CH2/EX2.23/ex2_23.sce | 6080ed19c85ae190ef281c316c77a045d9af8eed | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 182 | sce | ex2_23.sce | //Chapter 23,Ex 2.23,Pg2.29
clc;
disp("Refer to the diagram given in the question")
A=[4 -2;-2 3]
B=[5;4]
V=A\B
printf("\n Va=%.2f V\n",V(1))
printf("\n Vb=%.2f V\n",V(2))
|
5a30c4b878081ef8a121c12d38b05263ff9bd8fc | f5bb8d58446077a551e4d9a6461a55255db523fe | /integracao_numerica/questao2.sce | 7f4377a0dd165dfbb21382c788fb21e9083cc2cd | [] | no_license | appositum/numerical-calculus | 6be1a9990a1621c705af6ba5694cf8c7b891d06e | 7759e74ce9ce5c5826f96be7de84a2f7ecb97c91 | refs/heads/master | 2021-07-19T18:19:09.336819 | 2018-11-27T21:52:36 | 2018-11-27T21:52:36 | 143,060,426 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 295 | sce | questao2.sce | function y=v(r)
y = 3.*(1 - r./4).^(1./7)
endfunction
function y=Q(r)
vr = 3.*(1 - r./4).^(1./7)
y = 2.*(%pi).*r.*vr
endfunction
a = 0
b = 4
//h = (b-a)./m
h = 0.025
x1 = a
x2 = x1 + h
x3 = b
//R = (h./3).*(Q(x1) + 4.*Q(x2) + Q(x3))
R = h.*(Q(a) + 4.*Q((a+b)./2) + Q(b))
disp(R)
|
dfd8e6d59b353803538efccde25e5fd97e8f2659 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1946/CH4/EX4.23.a/Ex_4_23_a.sce | bfc7391ba5658f2072b8449be4d92965d9a80227 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 539 | sce | Ex_4_23_a.sce | // Example 4.23.a;//TOTAL RMS Pulse broadning
clc;
clear;
close;
M=250;//dispersion parametr picosecond per nano meter per kilometer
Sa=50;//spectral width in nm
NA=0.3;//nUMERICAL aPERTURE
n1=1.45;// Core refractibve index
C=2.998*10^8;//Speed of light in m/s
L=1;//length in Km
Sm=M*L*Sa*10^-3;//rms pulse broadning due to material dispersion
Ss=(L*10^3*NA^2)/(4*sqrt(3)*C*n1)*10^9;//Pulse broadning due to intermodal dispersion in ns/Km
St=sqrt(Sm^2+Ss^2);// Total broadning
disp(Ss,Sm,St,"Total broadning ns per Km is")
|
59296160072bd97a8ea3b832c4637c3bfdd2a462 | 449d555969bfd7befe906877abab098c6e63a0e8 | /698/CH7/EX7.10/P10_angular_displacement_of_flywheel.sce | 6782edb496ae49688a001d8094a485c230577d5f | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,210 | sce | P10_angular_displacement_of_flywheel.sce | clc
//Example 7.10
//Angular displacement of flywheel
//------------------------------------------------------------------------------
//Given data
//Moment of Inertia
J=0.125 //kg-m^2
//Torsional stiffness
Kt=1.176 // N-m/rad
//Torque
To=0.6 //N-m
//frequency
w=4 //rad/s
//Damping couple
Ct=0.4 //N-m
res10=mopen(TMPDIR+'10_angular_displacement_of_flywheel.txt','wt')
mfprintf(res10,'(a) Torsional amplitude of vibration is given by:\n')
mfprintf(res10,'\ttheta=To/sqrt((Kt-Jw2)^2+(Ct*w^2)^2)\n\n')
//Torsional amplitude:
theta=To/sqrt((Kt-(J* w^2))^2 + (Ct* w)^2 )
mfprintf(res10,'\ttheta=%0.4f rad\n\n',theta)
//Maximum Damping couple
Cmax=Ct*w*theta
mfprintf(res10,'(b) Maximum damping couple= Ct*w*theta = %0.4f N-m\n\n',Cmax)
mfprintf(res10,'(c)Phase angle phi =\n\ttan(phi)=(Ct*w)/(Kt-J*w^2)\n')
//Phase angle
phi=atand((Ct*w)/(Kt- J* w^2))
mfprintf(res10,'phi=%0.3f degrees',180+phi) //Adding 180 to make it positive angle
mclose(res10)
editor(TMPDIR+'10_angular_displacement_of_flywheel.txt')
//------------------------------------------------------------------------------
//-----------------------------End of program----------------------------------- |
fd18fcd886a9335a570bc3c50a855e39ddb25941 | 449d555969bfd7befe906877abab098c6e63a0e8 | /881/CH24/EX24.3/exa24_3.sce | 26691996fb175f035d0b14b63d835de5dbda8be3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 430 | sce | exa24_3.sce | clc;
//Example 24.3
//Page No 988
disp("Given: Noise bandwidth is 10MHz");
//solution
f=10*10^6;
disp("Substituting in equation 24-16 yields, ");
N=-174+(10*log10(f));
disp('dBm',N,"N = ");
disp("If the minimum C/N requirement for a receiver ");
Cmin=24+N;
disp('dBm',Cmin,"N = ");
disp("For a system gain of 113.35dB, it would require a minimum transmit carrier power(Pt) of ")
Pt=113.35+Cmin;
disp('dBm',Pt,"N = ");
|
97431adfa94cceb8766a3d7b874908717bc18158 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2660/CH5/EX5.39/Ex5_39.sce | 6330be210b0b3e8f3ee8922745311dab23faa538 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 302 | sce | Ex5_39.sce | clc
fc = 55000 // fixed cost in Rs
vc = 45 // variable cost per piece in Rs
sp = 100 // selling price per piece in Rs
p = (vc/sp)*100 // percentage of variable cost to
pm = 100 - p // profit margin
bep = ((55000/55)*100)/100 // Break even point
printf("\n Break even point = %d pieces" , bep)
|
f8dd534e72e775e2911b073bdc30a90f180dfa37 | 1d7cb1dbfad2558a4145c06cbe3f5fa3fc6d2c08 | /Scilab/SparamUtilities/SxP_InteViewer/SxP_InteViewer_v1.51.sce | ec2699a06c9bd367f89f617c5af582acc9f26ce3 | [] | no_license | lrayzman/SI-Scripts | 5b5f6a8e4ae19ccff53b8dab7b5773e0acde710d | 9ab161c6deff2a27c9da906e37aa68964fabb036 | refs/heads/master | 2020-09-25T16:23:23.389526 | 2020-02-09T02:13:46 | 2020-02-09T02:13:46 | 66,975,754 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 12,777 | sce | SxP_InteViewer_v1.51.sce | // ====================== S-params Converter ====================
//
// (Semi)Intelligent Differential S-param Viewer
//
// (c)2014 L. Rayzman
//
//
//
//
// GUI interface based on UICONTROL2 GUI demo
//
// Created : 02/25/2014
// Last Update : 03/18/2014 - Added user interaction in case can't guess
// port mapping
// 06/23/2014 - Updates against 5.5.0
// - Broke the code structure into multiple files
// for ease of management
// - Removed unwrapping since it has been
// natively introduced into 5.5.0
// - Renamed port mapping modes
// odd -> odd/even
// even -> sequential
// 07/18/2014 - Corrected issue with plot of miniscule
// values
// Corrected issue of plotting in impedance=50ohm
// after plotting renormilized to another impedance
//
//
// TODO: Debug group-delay calculation to deal with phase discontinuities
// resulting in large GD steps
// ====================================================================
// ====================================================================
clear;
stacksize(200*1024*1024);
exec("SxP_InteViewer_Utilities_v1.01.sci"); // Supporting functions/includes
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
global SxPversion;
SxPversion=1.51; //Main code verision
SxPExecName="SxP_InteViewer_v1.51.sce"; // Top level script file name
//
// THINGS FOR FILES
//
global frefsparam;
frefsparam = emptystr(); // Filename of inputfile
global spreffreqs;
spreffreqs=[]; // Inputfile frequency points vector
sprefdata=[]; // Inputfile S-param matrix data
//
// THINGS FOR SPARAM DATA
//
global spdata;
spdata=[]; // Converted s-param matrix data
global numofports;
global numofreqs;
numofports=0; // Number of ports
numofreqs=0; // Number of frequencies
entries_choice=emptystr(); // Text matrix that describes available entries to view
entry_idx=0; //
//
// THINGS FOR PROCESSING/DISP OF SPARAM DATA
//
global smapmode;
smapmode=0; // SxP mapping mode
// 0 ==> Unable to guess/unknown
//
// 1 ==> 1-------- 2 (Odd/Even Mapping)
// 3-------- 4
//
//
// 2 ==> 1 ------- n/2+1 (Sequential Mapping)
// 2 ------- n/2+2 (Canonical form for mode conversion)
smixmode=0; // Output matrix mode
// 1 => SDD
// 2 => SDC
// 3 => SCD
// 4 => SCC
bDetIl=%t; // Insertion loss detection flag
///////////////////////////////////////////////////////////////////////////////
// THINGS FOR GUI/PLOTS
gui_frame_w = 300; // Frame width
gui_frame_h = 500; // Frame height
gui_margin_x = 15; // Horizontal margin between each element
gui_margin_y = 15; // Vertical margin between each element
gui_padding_x = 10; // Horizontal padding between each element
gui_padding_y = 10; // Vertical padding between each element
gui_button_w = 100; // Button width
gui_button_h = 30; // Button height
gui_defaultfont = "arial"; // Default font
gui_subframe_font_size = 12; // Title font size (rotation angle, colormap,...)
gui_text_font_size = 11; // Text font size
global diff_mode_fig; // Diff mode selector GUI ID
global diff_mode_fig_idx;
global diff_mode_fig_handles;
diff_mode_fig_handles.dummy = 0;
diff_mode_fig_idx=0;
global main_GUI_fig; // Main GUI ID
global main_GUI_fig_idx;
global main_GUI_handles;
main_GUI_handles.dummy = 0;
main_GUI_fig_idx=1;
global plot_fig; // Plot Figure ID
global plot_fig_idx;
plot_fig_idx = 2;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
///////////////////
// Get Scilab Version
///////////////////
version_str=getversion();
version_str=tokens(version_str,'-');
version_str=tokens(version_str(2),'.');
version(1)=msscanf(version_str(1), '%d');
version(2)=msscanf(version_str(2), '%d');
if (version(1)<5) then
error("Invalid Scilab version. Version 5.5 or greater is required");
if getscilabmode()=="NW" then sleep(2000); quit; end;
elseif (version(2) < 5) then
error("Invalid Scilab version. Version 5.5 or greater is required");
if getscilabmode()=="NW" then sleep(2000); quit; end;
end
///////////////////
// Setup files/directories
// Read touchstone files
// Get user input
///////////////////
//
// Read input file
//
//
frefsparam=uigetfile("*.s*p", "", "Please choose S-parameters file");
if frefsparam==emptystr() then
messagebox("Invalid source file selection. Script aborted", "","error","Abort");
if getscilabmode()=="NW" then sleep(2000); quit; else abort end;
end
disp(strcat(["Info: Begin loading touchstone file " frefsparam]));
[spreffreqs,sprefdata] =sptlbx_readtchstn(frefsparam);
disp("Info: Finished loading touchstone file");
numofports=size(sprefdata,1); //Find number of ports
if numofports < 4 then
messagebox("Only 4-port or larger S-parameters are allowed. Script aborted", "","error","Abort");
if getscilabmode()=="NW" then sleep(2000); quit; else abort end;
end
if modulo(numofports,2) <> 0 then
messagebox("Only even port-count S-parameters are allowed. Script aborted", "","error","Abort");
if getscilabmode()=="NW" then sleep(2000); quit; else abort end;
end
if modulo(numofports,4) <> 0 then
messagebox("Only even number of mixed-mode ports are currently allowed. Script aborted", "","error","Abort");
if getscilabmode()=="NW" then sleep(2000); quit; else abort end;
end
numofreqs=size(sprefdata,3); //Find number of frequency points
///////////////////
// Estimate the port mapping
///////////////////
//
// Check Odd/Even mapping
//
//
TempM=[];
for i = 1:numofports/2
// Copy to a temp
for k=1:numofreqs
TempM(k)=sprefdata(2*i-1, 2*i,k);
end
// Check the criteria
// Take derivative and Check that average slope value is positive
if (abs(TempM(1)) < 0.9) then
bDetIl = %f;
break;
end
end
TempM=[];
//
// If not odd/even mapping, check seq
//
//
if ~bDetIl then
bDetIl=%t;
for i = 1:numofports/2
// Copy to a temp
for k=1:numofreqs
TempM(k)=sprefdata(i,i+numofports/2,k);
end
// Check the criteria
// Take derivative and Check that average slope value is positive
if (abs(TempM(1)) < 0.9) then
bDetIl = %f;
break;
end
end
if bDetIl then
smapmode=2; // If got to here, then it is sequential mapping
end
else
smapmode=1; // If found all alreday, then it was odd/even mapping
end
clear TempM;
//
// Report Mapping
//
//
if smapmode==0 then
// Ask user to select mode
// exec("SxP_InteViewer_DiffModeSelGUI_v1.sci", 2); // <==== FANCY VERSION DIDN'T WORK
smapmode=x_choices('',list(list('Port map mode:',1,['Odd/Even','Sequential'])));
end
if smapmode==1 then
disp("Info: Odd/Even differential port mapping found")
disp("Info: Applying port remapping")
elseif smapmode==2 then
disp("Info: Sequential differential port mapping found")
else
messagebox("Unable to determine differential port mapping. Script aborted", "","error","Abort");
if getscilabmode()=="NW" then sleep(2000); quit; else abort end;
end
/////////////////////////////
//
// Perform port remapping
// as necessary
//
/////////////////////////////
spdata=zeros(numofports,numofports, numofreqs);
if smapmode==1 then
R=zeros(numofports,numofports);
k=zeros(1,numofports);
// Create row permuation matrix and index vector
R(1,1)=1;
R(numofports,numofports)=1;
k(1)=1;
k(numofports)=numofports;
for i=2:numofports-1
if i<= numofports/2 then //lower ports -> odd
R(i,2*i-1)=1;
else //upper ports -> even
R(i,(i-numofports/2)*2)=1;
end
k(i)=modulo(i-1,2)*(numofports/2)+ceil(i/2);
end
for i=1:numofreqs
// Set port order to sequential mapping (canonincal) form
// First port
spdata(:,1,i)=R*sprefdata(:,1,i);
// Second through second to last port
for j=2:numofports-1
// Apply row permutation matrix on original column
// and put into new column
spdata(:,k(j),i)=R*sprefdata(:,j,i);
end
// Last port
spdata(:,numofports,i)=R*sprefdata(:,numofports,i);
end
sprefdata = spdata;
clear R;
clear k;
end
/////////////////////////////
//
// Perform Mode conversion
//
/////////////////////////////
disp("Info: Performing mode conversion")
spdata=SE2MM_CONV(sprefdata);
clear sprefdata;
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/////////////////////////////
//
// Evoke GUI controls
//
/////////////////////////////
exec("SxP_InteViewer_MainGUI_v1.1.sci");
sleep(100);
show_window(main_GUI_fig_idx);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
|
1256eb4812f898498279a0a7428e80648062471b | 449d555969bfd7befe906877abab098c6e63a0e8 | /1523/CH3/EX3.41/3_41.sce | 418b14a145726e550ad4174de513217b4fd50fd1 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 741 | sce | 3_41.sce | //Network Theorem 1
//page no-3.47
//example3.41
//calculation of Vth
disp("Removing the variable resistor RL from the network:");
disp("I2-I1=4");....//equation 1
disp("Applying KVL at the outerpath:");
disp("-6*I1-5*I2=2");....//equation 2
A=[-1 1;-6 -5];
B=[4 2]'
X=inv(A)*B;
disp(X);
disp("I1 = -2 A");
disp("I2 = 2 A");
disp("Writing Vth equation,");
a=-2;
v=8-a;
printf("\nVth = %.f V",v);
//calculation of Rth
disp("replacing the voltage source with short circuit and current source by an open circuit ");
x=(v*1)/(v+1);
printf("\nRth = %.2f Ohm",x);
//calculation of RL
disp("For maximum power transfer");
printf("\nRth = RL =%.2f Ohm",x);
//calculation of Pmax
m=(v^2)/(4*x);
printf("\nPmax = %.2f W",m); |
d64996671e023a0ede6e2389c7ff925940000993 | 01ecab2f6eeeff384acae2c4861aa9ad1b3f6861 | /xcos_blocks/hystdiff_c.sci | 18df6c2ea57ca1f8bcae130baba488cf0090e0da | [] | no_license | jhasler/rasp30 | 9a7c2431d56c879a18b50c2d43e487d413ceccb0 | 3612de44eaa10babd7298d2e0a7cddf4a4b761f6 | refs/heads/master | 2023-05-25T08:21:31.003675 | 2023-05-11T16:19:59 | 2023-05-11T16:19:59 | 62,917,238 | 3 | 3 | null | null | null | null | UTF-8 | Scilab | false | false | 362 | sci | hystdiff_c.sci | function block=hystdiff_c(block,flag)
if flag==1
in_out_num = block.ipar(1); //Vectorized
row_vec_io = 1:in_out_num; // Row vector for input & output
block.outptr(1)(row_vec_io)=block.x(row_vec_io); //Output
elseif flag==0
//variables and ODE
block.xd(row_vec_io)= block.inptr(1)(row_vec_io)
end
endfunction
|
9122fc133942417adea5ba9332c0cfc770e5a507 | 449d555969bfd7befe906877abab098c6e63a0e8 | /539/CH5/EX5.4/Example_5_4.sce | 09b563c1f60427337eb51e47bcbc9e94f76838b9 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 386 | sce | Example_5_4.sce | //Diffusion Coefficient Determination
clear;
clc;
printf("\tExample 5.4\n");
T=550+273; //in K
D0=1.2*10^-4; //Temperature independent preexponential in m^2/s
Qd=131000; //Activation energy in J/mol-K
R=8.31; //Universal Gas constt
D=D0*exp(-Qd/(R*T));
printf("\nDiffusion coefficient is %.1f * 10^-13 m^2/s\n",D/10^-13);
//End |
e34f7f0c2944c3e6a3d76e15412cdd33dc7d09ff | 449d555969bfd7befe906877abab098c6e63a0e8 | /3472/CH43/EX43.3/Example43_3.sce | b34a37915f8dfc7074506686a7038047c9ec7872 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,223 | sce | Example43_3.sce | // A Texbook on POWER SYSTEM ENGINEERING
// A.Chakrabarti, M.L.Soni, P.V.Gupta, U.S.Bhatnagar
// DHANPAT RAI & Co.
// SECOND EDITION
// PART IV : UTILIZATION AND TRACTION
// CHAPTER 5: ELECTRIC TRACTION-SPEED TIME CURVES AND MECHANICS OF TRAIN MOVEMENT
// EXAMPLE : 5.3 :
// Page number 778-779
clear ; clc ; close ; // Clear the work space and console
// Given data
speed = 25.0 // Scheduled speed(kmph)
D = 800.0/1000 // Distance between 2 stations(km)
t = 20.0 // Time of stop(sec)
V_m_per = 20.0 // Maximum speed higher than(%)
beta = 3.0 // Retardation(km phps)
// Calculations
t_total = D*3600/speed // Total time of run including stop(sec)
T = t_total-t // Actual time for run(sec)
V_a = D/T*3600 // Average speed(kmph)
V_m = (100+V_m_per)*V_a/100 // Maximum speed(kmph)
alpha = 1/((7200.0*D/V_m**2*((V_m/V_a)-1))-(1/beta)) // Value of acceleration(km phps)
// Results
disp("PART IV - EXAMPLE : 5.3 : SOLUTION :-")
printf("\nRate of acceleration required to operate this service, α = %.2f km phps", alpha)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.