blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 6 214 | content_id stringlengths 40 40 | detected_licenses listlengths 0 50 | license_type stringclasses 2 values | repo_name stringlengths 6 87 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 15 values | visit_date timestamp[us]date 2016-08-04 09:00:04 2023-09-05 17:18:33 | revision_date timestamp[us]date 1998-12-11 00:15:10 2023-09-02 05:42:40 | committer_date timestamp[us]date 2005-04-26 09:58:02 2023-09-02 05:42:40 | github_id int64 436k 586M ⌀ | star_events_count int64 0 12.3k | fork_events_count int64 0 6.3k | gha_license_id stringclasses 7 values | gha_event_created_at timestamp[us]date 2012-11-16 11:45:07 2023-09-14 20:45:37 ⌀ | gha_created_at timestamp[us]date 2010-03-22 23:34:58 2023-01-07 03:47:44 ⌀ | gha_language stringclasses 36 values | src_encoding stringclasses 17 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 1 class | length_bytes int64 5 10.4M | extension stringclasses 15 values | filename stringlengths 2 96 | content stringlengths 5 10.4M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bb4f3326c38297d2839401b7b25c129340cfb53a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2087/CH4/EX4.40/example4_40.sce | 5d2f84db50766ddbbd99d2642bd73365722fd5ea | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 468 | sce | example4_40.sce |
//example 4.40
//calculate precipitation at x
clc;funcprot(0);
//given
pA=75; //precipitation at A
pB=58; //precpitation at B
pC=47; //precipitation at C
nA=826; //normal precipitation at A
nB=618; //normal precipitation at B
nC=482; //normal precipitation at C
nX=757; //normal precipitation at X
pX=(nX*pA/nA+nX*pB/nB+nX*pC/nC)/3;
pX=round(pX*10)/10;
mprintf("precipitation at x=%f cm.",pX);
|
4176ce73a4356167b0164145e05d8dcc2048daac | 449d555969bfd7befe906877abab098c6e63a0e8 | /1322/CH9/EX9.7/69ex1.sce | 083e8051febc62049d5b3692a1252defa85abb8d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 525 | sce | 69ex1.sce |
//find x which satisfies 3*x+2>8 & 5*x-3<27
clear;
clc;
close;
x=poly(0,'x');
for x=1:100
if(3*x+2>8)
mprintf("x>%i\n\nand",x)//solving the first we get
break
end
end
x=1;
while(5*x-3<27) //on solving the second we get
x=x+1;
continue
end
mprintf("x<%i \n",x);
x=string(0:10);
n=string('<'+strcat(x,'---')+'>');//0 to 10 no. line
n1=strsubst(n,'---4---5---','___________');
mprintf('the solid line in the number line \n %s represents 3<x<6 ",n1)
|
1e9191090c27f85c6a5ea72f56fd0c287635d374 | 01ecab2f6eeeff384acae2c4861aa9ad1b3f6861 | /sci2blif/sci2blif_added_blocks/mite2.sce | e02ea6c8fec31f5ffdfd40cbebf4c07a368c4771 | [] | 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 | 384 | sce | mite2.sce | //***************************** MITE2 **********************************
if (blk_name.entries(bl) =='mite2') then
mputl("# MITE2",fd_w);
mputl(".subckt mite2 in[0]=net"+string(blk(blk_objs(bl),2))+ " in[1]=net"+string(blk(blk_objs(bl),3))+ " out[0]=net"+ string(blk(blk_objs(bl),2+numofip))+ " out[1]=net"+ string(blk(blk_objs(bl),3+numofip)),fd_w);
mputl(" ",fd_w);
end
|
a20dec49e7e96402356419a1c9c2f17e2c3b0c2b | 449d555969bfd7befe906877abab098c6e63a0e8 | /3830/CH1/EX1.6/Ex1_6.sce | d18700c55d3f63418bc792e316e1b9fc87dccb69 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 786 | sce | Ex1_6.sce | // Exa 1.6
clc;
clear;
// Given
Imax = 100*10^-6; // Initial range of Ammeter in Amp
Rm = 800; // Meter resistance in Ohms
I1max = 0.1; // Range to be extended in Amp
I2max = 10; // Range to be extended in Amp
// Solution
printf(' Referring Figs. 1.21 and 1.22 :- \n');
n = I1max/Imax;
Rsh = Rm/(n-1);
printf(' Ra + Rb + Rc = Rsh; \n ');
printf(' The value of Rsh by calculations = %.4f Ohms \n',Rsh);
printf(' Referring calculations done in textbook,\n we can get values of Ra,Rb and Rc as follows :- \n');
Rc = Imax*(Rsh+Rm)/I2max;
Rb = (Imax/I1max)*(Rsh+Rm) - Rc;
Ra = Rsh-(Rb+Rc);
printf(' Ra = %.3f Ohms, Rb = %.3f Ohms and Rc = %.3f Ohms \n',Ra,Rb,Rc);
//The answer provided in the textbook is wrong for Rc and not at all given for Ra and Rb
|
38f73239503187916c5ea8af70aaedd52968ba59 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3821/CH11/EX11.21/Example11_21.sce | a94cc819814572abf49cdbbd4aee4e4b5dd6e7d7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,868 | sce | Example11_21.sce | ///Chapter No 11 Steam Boilers
////Example 11.21 Page No 254
///Find Mass of gas fowing throgh the chimney
//Input data
clc;
clear;
mf=8000; //Average coal consumption in m
ma=18; //Fuel gases formed ccoal fired in m
Tg=270+273; //Average temp of the chimney of water in degree celsius
Ta=27+273; //Ambient temp in degree celsius
hw=18; //Theoretical draught produced by the chimney in mm
h1=0.6; //Draught is lost in friction in H1
g=9.81;
pi=3.142;
//Calculation
H=(hw/((353)*((1/Ta)-((1/Tg)*((ma+1)/ma))))); //Theoretical draught produced in water column in m
H1=H*(((Tg/Ta)*(ma/(ma+1))-1)); //Theoretical draught produced in hot gas column in m
gp=0.6*H1; //Draught is lost in friction at the grate and passing in m
hgc=H1-gp; //Actual draught produced in hot gas column in m
V=sqrt(2*g*hgc); //Velocity of the flue gases in the chimney in m/s
rhog=((353*(ma+1))/(ma*Tg)); //Density of flue gases in Kg/m^3
mg=mf/3600*(ma+1); //Mass of gas fowing throgh the chimney in Kg/s
d=sqrt(mg/(rhog*(pi/4)*V)); //Diameter of flue gases in Kg/m^3
///Output
printf('Theoretical draught produced in water column= %f m \n ',H);
printf('Theoretical draught produced in hot gas column= %f m \n',H1);
printf('Draught is lost in friction at the grate and passing= %f m \n',gp);
printf('Actual draught produced in hot gas column= %f \n',hgc);
printf('Velocity of the flue gases in the chimney= %f m/s \n',V);
printf('Density of flue gases= %f Kg/m^3 \n ',rhog);
printf('Mass of gas fowing throgh the chimney= %f Kg/s \n ',mg);
printf('Diameter of flue gases= %f Kg/m^3 \n ',d);
|
b30bdb18c2f41c342d4c9a95b02e0297bc866197 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1523/CH5/EX5.2/5_2.sce | 2a60d2f65b0c591c7a463a27da781f6e2df3801c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 921 | sce | 5_2.sce | //Steady-State AC Analysis
//page no - 5.1
//example 5.1
// A = p2z(R,Theta) - Convert from polar to complex form.
// R is a matrix containing the magnitudes
// Theta is a matrix containing the phase angles (in degrees).
function [A] = p2z(R,Theta)
if argn(2) <> 2 then
error("incorrect number of arguments.");
end
if ~and(size(R) == size(Theta)) then
error("arguments must be of the same dimension.");
end
A = R.*exp(%i*%pi*Theta/180.);
endfunction
A=p2z(10,30);
disp(A); //converting to rectangular form
M=[8-2*%i, -3, 0; -3, 8+5*%i, -5; 0, -5 7-2*%i];
N=[A, 0, 0]'
O=inv(M);
X=O*N;
disp(X);
function [r,th]=rect2pol(x,y)
//rectangle to polar coordinate conversion
//based on "Scilab from a Matlab User's Point of View", Eike Rietsch,
2002
r=sqrt(x^2+y^2);
th = atan(y,x)*180/%pi;
endfunction
[r,th]=rect2pol(1.3340761,- 0.5209699)//converting back to polar form
|
8715eb8167a248b6b2fc433d73b33eb0709e9839 | 05db16b4f57b0182fa452e2c11554c3de6fff271 | /branches/vac4.52_sac_cuda/dev/vac4.52mkg_24_06_2010/scilab/sci_studyfile.sci | 62839dff635f4a1736caf1360445452434ccb10c | [] | no_license | SpungMan/smaug-all | 09b4fcf6fcec2fc7be1fa85c5c7f2d68c79e504b | 01df12e98c734529ff984662badc26eaa3a9138b | refs/heads/master | 2021-11-29T14:09:47.094457 | 2018-06-08T09:48:05 | 2018-06-08T09:48:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 571 | sci | sci_studyfile.sci | function [tree] = sci_studyfile(tree)
// Copyright INRIA (Generated by M2SCI)
// Conversion function for Matlab studyfile()
// Input: tree = Matlab funcall tree
// Ouput: tree = Scilab equivalent for tree
// dims(i,:) is the ith output argument dimensions vector
dims=list(list(1,-1),list(1,-1),list(1,-1),list(1,1))
// dims(i,:) is the ith output argument dimensions vector
vtype=[1;1;1;1]
// prop(i) is the ith output argument property
prop=[0;0;0;0]
for k=1:lhs
tree.lhs(k).dims=dims(k)
tree.lhs(k).vtype=vtype(k)
tree.lhs(k).property=prop(k)
end
endfunction
|
2955b93b34473d3d7e7a109968bcf2b47b616f8e | 449d555969bfd7befe906877abab098c6e63a0e8 | /3012/CH12/EX12.8/Ex12_8.sce | d13665cc17005f360f4bba9f75c9e13190b9ea2b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 2,395 | sce | Ex12_8.sce |
// Given:-
V = 35.0 // volume of the vessel in m^3
p1 = 1.5 // in bar
T1 = 120.0 // in degree celcius
psi1 = 0.1
T2 = 22.0 // in degree celcius
// Part(a)
// The dew point temperature at the initial state is the saturation temperature corresponding to the partial pressure pv1. With the given relative humidity and the saturation pressure at 120C from Table A-2
pg1 = 1.985
// Interpolating in Table A-2 gives the dew point temperature as
T = 60.0 // in degree celcius
// Calculation
pv1 = psi1*pg1 // partial pressure in bar
// Result
printf( 'The dew point temperature corresponding to the initial state, in degee celcius is: %f',T)
// Part(b)
Rbar = 8314.0 // universal gas constant
Mv = 18.0 // molar mass of vapor in kj/kmol
// Interpolation in Table A-2
Tdash = 56.0 // in degrees
vv1 =((Rbar/Mv)*(T1+273))/(pv1*10**5) // the specific volume of the vapor at state 1 in m^3/kg
// Result
printf( 'The temperature at which condensation actually begins in degree celcius is: %f',Tdash)
// Part(c)
// From table
vf2 = 1.0022e-3
vg2 = 51.447
vv2 = vv1 // specific volume at final state
// Calculations
mv1 = V/vv1 // initial amount of water vapor present in kg
x2 = (vv2-vf2)/(vg2-vf2) // quality
mv2 = x2*mv1 // the mass of the water vapor contained in the system at the final state
mw2 = mv1-mv2
// Result
printf( 'The amount of water condense in kg is: %f',mw2)
|
a833a594e19a97439a738f3a65a426dda5d4c90b | 194d4cafa290b2fdf3aa87e18ddadcfff70a70d8 | /ode4.sce | 7c0ba3683acb1322f66ff322bbe97144779ea10e | [] | no_license | KomalT/tryout60 | cc43d4a5d96b5525e691a907c7ad8c7e61004a3c | ef4cc3e641a77c2cea565035cf033536d91e29ea | refs/heads/master | 2016-08-12T19:05:56.548794 | 2016-05-02T06:15:37 | 2016-05-02T06:15:37 | 55,436,025 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 183 | sce | ode4.sce | clc;clear;
t=0.00001:.003:.5;
t0=0.00001;
y0=[.1;0];
function [ydot]=f(t,y)
ydot(1)=y(2);
ydot(2)=4*10^-6*y(1)-2*y(2)/t;
endfunction
[y]=ode(y0,t0,t,f);
disp(y)
|
f5aa5084061691f362f95125538f9a88f7a0fef4 | 20de144f57c866e91361673421260cf7779a5931 | /euler/gui/components/parameters.sci | ff9e742fa408a05f0c024b67e9831b120e0fd7fb | [] | no_license | pablovilas/fisica | 0ae0db3a6c7a5293d78a9101ef21b20942e32384 | 924d96593f4c300a420257bc9ce9041a46835bf8 | refs/heads/master | 2016-08-06T00:19:10.566377 | 2014-10-08T01:50:19 | 2014-10-08T01:50:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 2,523 | sci | parameters.sci | function lstParameters(window)
// Crear la lista de parametros
f_margin_x = margin_x;
f_margin_y = margin_y;
f_width = frame_w;
f_height = frame_h - 190;
frameParameters = uicontrol("parent", window, "relief","groove", ...
"style","frame", "units","pixels", ...
"position",[ f_margin_x f_margin_y f_width f_height], ...
"horizontalalignment","center", "background",[1 1 1], ...
"tag","parameters_control");
t_margin_x = margin_x + ((f_width / 2) - 87.5);
t_margin_y = margin_y + 350;
t_width = 175;
t_height = 20;
frameParametersTitle = uicontrol("parent", window, "style","text", ...
"string","Parametros entrada", "units","pixels", ...
"position",[t_margin_x t_margin_y t_width t_height], ...
"fontname",defaultfont, "fontunits","points", ...
"fontsize",14, "horizontalalignment","center", ...
"background",[1 1 1], "tag","title_parameters_control");
executeBtn(frameParameters);
endfunction
function executeBtn(container)
// Boton de ejecutar
execBtn = uicontrol(container, "style","pushbutton", ...
"position",[100 10 100 20], "String","Ejecutar", ...
"backgroundColor",[.9 .9 .9], "fontsize",14, ...
"tag", "execute_button", ...
"callback","null()");
if length(exercises) > 0 then
execBtn.callback = exercises(1)(2);
end
endfunction
function populateParameters(labels, values)
// -------------------------
// Step : Populate the frame
// -------------------------
// Adding model parameters
frameParameters = findobj('tag','parameters_control');
clf(frameParameters, "clear");
guih1 = 0;
guih1o = 325;
// positioning
l1 = 10; l2 = 80; l3 = 110;
for k=1:size(labels,2)
uicontrol("parent", frameParameters, "style","text",...
"string",labels(k), "position",[l1, guih1-k*20+guih1o,l2,20], ...
"horizontalalignment","left", "fontsize",14, ...
"background",[1 1 1]);
uicontrol("parent", frameParameters, "style","edit", ...
"string",string(values(k)), "position",[l3,guih1-k*20+guih1o,180,20], ...
"horizontalalignment","left", "fontsize",14, ...
"background",[.9 .9 .9], "tag", labels(k));
end
uicontrol(frameParameters, "style","pushbutton", ...
"position",[100 10 100 20], "String","Ejecutar", ...
"backgroundColor",[.9 .9 .9], "fontsize",14, ...
"tag", "execute_button", ...
"callback","null()");
endfunction
|
ff55d8fc6c620b24e4329f50b2e3419c339327a2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1571/CH7/EX7.5/Chapter7_Example5.sce | 69b3af2ba76bc4043995cd521a4c11f11c5f7530 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 225 | sce | Chapter7_Example5.sce | clc
clear
//INPUT
tc=5.26;//critical temperature of the helium in K
//CALCULATIONS
ti=27*tc/4;//inversion temperature of the helium in K
//OUTPUT
mprintf('the inversion temperature of the helium is %3.2f K',ti)
|
a9e8719854a73367af7560fafe98d25b3f554795 | 449d555969bfd7befe906877abab098c6e63a0e8 | /991/CH4/EX4.5/Example4_5.sce | 0fd1b765304b569417e774eaf61785722805e9e0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 757 | sce | Example4_5.sce | //Example 4.5.
clc
disp("In an P-type material, the concentration of acceptor atoms is given by")
disp("NA = NV*e^(-(EF - EV)/k*T)")
disp("Let initially NA = NA0, EF = EF0 and EF0 - EV = 0.4 eV")
disp("Therefore, NA0 = NV*e^(-0.4/0.025) = NV*e^-16")
disp("(a) When NA = 0.5*NA0 and EF = EF1, then")
disp("0.5*NA0 = NV*e^(-(EF1-EV)/0.025) = NV*e^-40(EF1 - EV)")
disp("Therefore, 0.5*NV*e^-16 = NV*e^-40(EF1 - EV)")
disp("Therefore, 0.5 = e^(-40*(EF1 - EV)+16)")
disp("Taking natural logarithm on both sides, we get")
disp("ln (0.5) = -40(EF1 - EV) + 16")
q1=(16-log(0.5))/40
disp(q1,"EF1 - EV(in eV) = ")
disp("(b) When NA=4*NA0 and EF = EF2, then")
disp("ln 4 = -40*(EF2 - EV) + 16")
q2=(16-log(4))/40
disp(q2,"EF2 - EV(in eV) = ") |
49312f1679740735f382e68f0983272a3f133d7f | 449d555969bfd7befe906877abab098c6e63a0e8 | /1529/CH7/EX7.10/7_10.sce | 455872b1b4685f848b039d2855eacaf0dba0e87c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 514 | sce | 7_10.sce | //Chapter 7, Problem 10
clc;
l=150*10^-3; //length
u0=4*%pi*10^-7; //permeability of free space
ur=4000; //relative permeability
A=1800*10^-6; //cross-sectional area
S=l/(u0*ur*A); //Calculating reluctance
u=u0*ur; //Calculating absolute permeability
printf("Reluctance = %f H^-1\n\n\n",S);
printf("Absolute permeability = %f H/m",u*1000);
|
3cce36faafe86eed7ec846e5d484b0cc8ef0e891 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1244/CH8/EX8.1/Example81.sce | 95c580820a44d7707f4270775bc989fc01df38c8 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 2,110 | sce | Example81.sce |
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clc;
disp("Principles of Heat Transfer, 7th Ed. Frank Kreith et. al Chapter - 8 Example # 8.1 ")
//Outer dia in m
d = 0.0254;
//mass flow rate of hot fluid in kg/s
mh = 6.93;
//Specific heat of hot fluid n J/kgK
ch = 3810;
//Inlet temperature of hot fluid in degree C
Thin = 65.6;
//Outlet temperature of hot fluid in degree C
Thout = 39.4;
//mass flow rate of cold fluid in kg/s
mc = 6.3;
//Specific heat of cold fluid n J/kgK
cc = 4187;
//Inlet temperature of cold fluid in degree C
Tcin = 10;
//Overall heat transfer coefficient in W/m2K
U = 568;
//Using energy balance, outlet temp. of cold fluid in degree C
Tcout = Tcin+((mh*ch)*(Thin-Thout))/(mc*cc);
//The rate of heat flow in W
q = (mh*ch)*(Thin-Thout);
disp("Parallel-flow tube and shell")
//From Eq. (8.18) the LMTD for parallel flow
//Temperature difference at inlet in degree K
deltaTa = Thin-Tcin;
//Temperature difference at outlet in degree K
deltaTb = Thout-Tcout;
//LMTD in degree K
LMTD = (deltaTa-deltaTb)/log(deltaTa/deltaTb);
//From Eq. (8.16)
disp("Heat transfer surface area in m2 is")
//Heat transfer surface area in m2
A = q/(U*LMTD)
disp("Counterflow tube and shell")
//LMTD in degree K
LMTD = 29.4;
disp("Heat transfer surface area in m2 is")
//Heat transfer surface area in m2
A = q/(U*LMTD)
A1 = A;//To be used further as a copy of this area
disp("Counterflow exchanger with 2 shell passes and 72 tube passes")
//Correction factor found from Fig. 8.15 to the mean temperature for counterflow
P = (Tcout-Tcin)/(Thin-Tcin);
//Heat capacity ratio
Z = (mh*ch)/(mc*cc);
//From the chart of Fig. 8.15, F= 0.97
F = 0.97; //F-Factor
disp("Heat transfer surface area in m2 is")
//Heat transfer surface area in m2 is
A = A1/F
disp("Cross-flow, with one tube pass and one shell pass, shell-side fluid mixed")
//Using same procedure, we get from charts
F = 0.88; //F-Factor
disp("Heat transfer surface area in m2 is")
//Heat transfer surface area in m2 is
A = A1/F
|
ab32e60db77f7ce8cce580111edfcada9a8927c7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /167/CH15/EX15.6/ex6.sce | 343de4863d54797fcaaba0f054cc233629d30763 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 926 | sce | ex6.sce | //example 6
//First-Law Analysis of Steady-Flow Combustion
clear
clc
mair=7.5*4.76*29 //mass of air in kg
mfuel=3*12+4*2 //mass of fuel in kg
AF=mair/mfuel //air fuel ratio
Mfuel=0.05 //Mass flow rate of fuel in kg/min
Mair=AF*Mfuel //mass flow rate of air in kg/min
qout=1*(-118910)+7.5*(8150-8682)+28.2*(0+8141-8669)-2.7*(-393520+71078 -9364)-0.3*(-110530+47517-8669)-4*(-241820+57999-9904)-2.65*(0+49292-8682)-28.2*(0+47073-8669) //in kJ/kmol C3H8
disp('This heat is transferred from the combustion chamber for each kmol (44kg) of propane.therefore qout = qout/44 kJ/kg')
qout=qout/44 //in kJ/kg propane
M=0.05 //mass flow rate of liquid propane in kg/min
Qout=M*qout //rate of heat transfer in kJ/min
Qout=Qout/60 //rate of heat reansfer in kW
printf("\n Hence, the mass flow rate of air is = %.2f kg/min. \n",Mair);
printf("\n and the rate of heat transfer from combustion chamber is = %.2f kW. \n",Qout); |
60cfd35e18f0c0d10b0dba1b33e076d951e1af17 | 8217f7986187902617ad1bf89cb789618a90dd0a | /source/2.2/macros/percent/%sqr.sci | fb7152a7e5dcc28ce0ba91e5c528e82d5e335851 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | clg55/Scilab-Workbench | 4ebc01d2daea5026ad07fbfc53e16d4b29179502 | 9f8fd29c7f2a98100fa9aed8b58f6768d24a1875 | refs/heads/master | 2023-05-31T04:06:22.931111 | 2022-09-13T14:41:51 | 2022-09-13T14:41:51 | 258,270,193 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 245 | sci | %sqr.sci | //<f>=%sqr(s,f)
// %sqr(s,f) calcule la division a gauche, element par element, d'une
//matrice de fractions rationnelles f par une matrice de scalaires s.
//Cett macro correspond a l'operation s./f
//!
f=tlist('r',f(2)./s,f(3),f(4)),
//end
|
a861fee8f9d2635f4cf597a7bc0f627dcc1dddad | 449d555969bfd7befe906877abab098c6e63a0e8 | /620/CH25/EX25.21/example25_21.sce | ba1397939f4b60baba611136d6f05690f5b6264e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 448 | sce | example25_21.sce | r1=0.6;
x_c=1;
r2=2;
x_l=1.5;
v=10;
rl=1;
vth=v*%i*x_l/(r1-%i*x_c+%i*x_l);
m_vth=v*x_l/sqrt(real(r1-x_c+x_l)^2+imag(r1-x_c+x_l)^2);
deg_vth=90-atan(imag(r1-x_c+x_l)/real(r1-x_c+x_l))*180/%pi;
zth=2+%i*x_l*(r1-%i*x_c)/(r1+%i*x_l-%i*x_c);
i=vth/(zth+rl);
disp("the current (in mA) through the resistor has a magnitude of");disp((sqrt((real(i))^2+(imag(i))^2)));
disp("with a phase angle (in deg) of"); disp(atan(imag(i)/real(i))*180/%pi); |
54c9fb1ba85cc73e92c6084d07779b6318e22acc | 449d555969bfd7befe906877abab098c6e63a0e8 | /3754/CH25/EX25.4/25_4.sce | 603aa716caa26979edf0e86345fba139740971d7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,111 | sce | 25_4.sce | clear//
//Variables
RC = 4.0 * 10**3 //Collector resistance (in ohm)
RB = 40.0 * 10**3 //Base resistance (in ohm)
RS = 10.0 * 10**3 //Source resistance (in ohm)
hie = 1100.0 //hie (in ohm)
hfe = 50.0 //hfe
hre=0;hoe=0;dh=0;
//Calculation
RB2 = RB //Resistance (in kilo-ohm)
rL = RC * RB2 /(RC +RB2) //a.c. load resistance (in ohm)
Ai = -hfe //Current gain
Ri = hie //Input resistance of the amplifier looking into the base (in ohm)
Av = Ai * rL / Ri //Voltage gain
RB1 = RB/(1 - Av) //Resistance (in ohm)
Ris = Ri * RB1 / (Ri + RB1) //Input resistance looking from source terminals (in ohm)
Ro = "infinite" //Output resistance (in ohm)
Ros = rL //Output resistance of the stage (in ohm)
Avs = Av * Ris / (RS + Ris) //Voltage gain of the stage
//Result
printf("\n Voltage gain is %0.1f .\nInput resistance is %0.0f ohm.\nOutput resistance is %0.0f ohm.",Avs,Ris,Ros)
|
d21085b519b4ec0dc10c8199a3fc8fa84d75ee5c | 449d555969bfd7befe906877abab098c6e63a0e8 | /226/CH8/EX8.10/example10_sce.sce | 40c3f9dcc9eca29e592e8e85d3763e7a35292a99 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 230 | sce | example10_sce.sce | //chapter 8
//example 8.10
//page 331
printf("\n")
printf("given")
Ic=30*10^-6;Vce=5;eno=354*10^-6;
NF=10;
F=2.51;//F=antilog(NF/10)
Vn=((sqrt(F))*eno)*10^6;
printf("total noise output volateg for amplifier is %duV\n",Vn) |
60bfde14d6b9087ca0775a64b23d8978d36288a7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1484/CH5/EX5.10/5_10.sce | b3b21f4d6c6fd954de550f9468b10c6ba72b453a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | 5_10.sce | clc
//initialisation of variables
Cd= 0.6
g= 32.2 //ft/sec^2
o= 90 //degrees
H= 2 //ft
A= 15.2 //ft^2
//CALCULATIONS
Q= 8*Cd*sqrt(2*g)*tand(o/2)*H^2.5/15
va= Q/A
ha= va^2/(2*g)
Q1= 8*Cd*sqrt(2*g)*((H+ha)^2.5-ha^2.5)/15
//RESULTS
printf ('Discharge of stream= %.1f cuses',Q1)
|
a72bc8aa9b66b292af10a1e1b54925e4a5bd40c9 | 5198a0ef649efb9d9d219febd774bbd495b1d7e8 | /html/current_projects/code_FFTW3/square_wave_60Hz_50_pct_duty_cycle.sce | da710dcbc81e963606d97da24f78170bc10a9725 | [
"Unlicense"
] | permissive | markkhusid/MKDynamics_website | a76e1dcba299ebb9704cd59e60af948bb796a62d | c8761b41ae487c99644361ecc1cf586b022debac | refs/heads/master | 2023-03-15T13:04:11.582595 | 2023-03-07T12:51:50 | 2023-03-07T12:51:50 | 31,366,974 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,496 | sce | square_wave_60Hz_50_pct_duty_cycle.sce | //Frequency components of a signal
//----------------------------------
// build a square wave signal sampled at 10000hz containing at frequency 60Hz
// and 50% duty cycle, 95% duty cycle, and 99% duty cycle
clear;
sample_rate=10000;
frequency=60;
t = 0:1/sample_rate:1;
N=size(t,'*'); //number of samples
// Generate squarewaves
s_50 = squarewave(2*%pi*frequency*t,50);
s_95 = squarewave(2*%pi*frequency*t,95);
s_99 = squarewave(2*%pi*frequency*t,99);
// Perform FFTs
y_50=fft(s_50);
y_95=fft(s_95);
y_99=fft(s_99);
// Setup plotting vectors
//squarewaves are real so the fft response is conjugate symmetric and we retain only the first N/2 points
f=sample_rate*(0:(N/2))/N; //associated frequency vector
n=size(f,'*')
y_mag_50 = abs(y_50(1:n));
y_mag_95 = abs(y_95(1:n));
y_mag_99 = abs(y_99(1:n));
clf();
// Generate plots
// Time domain plots
a=get("current_axes");
a.data_bounds=[0,0;1,2];
xtitle('f(t)', 'Time [s]', 'Amplitude [Arb Units]');
h=0;
scf(h);
xset('window',h);
plot(t, s_50(1:N), 'g-');
plot(t, s_95(1:N), 'r-');
plot(t, s_99(1:N), 'b-');
hl = legend(['50% Duty Cycle'; '95% Duty Cycle'; '99% Duty Cycle']);
// Frequency domain plots
h=1;
scf(h);
xset('window',h);
a=get('current_axes');
a.data_bounds=[0,0;1000,1000];
xtitle('FFT(f(t))', 'Freq [Hz]', 'Amplitude [Arb Units - Linear]');
plot (f, abs(y_mag_50(1:n)), 'g-');
plot (f, abs(y_mag_95(1:n)), 'r-');
plot (f, abs(y_mag_99(1:n)), 'b-');
hl = legend(['50% Duty Cycle'; '95% Duty Cycle'; '99% Duty Cycle']);
|
753edd0fa216240ec33af4519649bd8f01612021 | b33d893a0a740c9f8d2592792e2aa1d9a88c64e9 | /EV/WLTP_Program.sce | a7c9b92ec6796a7cb2ecf9c09343e85b62557f42 | [] | no_license | sharanrathnakumar/Electric_Vehicle | 791f0d18b750cc6788fa2d86c83fcb5c6c9e662a | f50d3e7488b1bd480017fa98634ad55152475e61 | refs/heads/main | 2023-04-21T20:06:04.200553 | 2021-05-12T13:26:28 | 2021-05-12T13:26:28 | 366,724,231 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 523 | sce | WLTP_Program.sce | clear()
clc()
//Decode ole file, extract and open Excel stream
[fd,SST,Sheetnames,Sheetpos] = xls_open('WLTP-DHC-12-07e.xls');
//Read second data sheet
[Value,TextInd] = xls_read(fd,Sheetpos(2));
//close the spreadsheet stream
mclose(fd);
//load WLTP time and speed values in structure
WLTC.time = Value(8:1808,3);
WLTC.values = Value(8:1808,5);
//plot WLTP speed profile
plot(WLTC.time,WLTC.values)
xgrid()
xlabel("Time [s]")
ylabel("Vehicle speed [kph]")
title("PupilFirst x Mankame Automotive")
|
0ec5c60966a31d39d0fc09db980b69cec74105e9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /62/CH7/EX7.25/ex_7_25.sce | f275b1d6fa2eb80aa9ab32069ff550d1ca29fc78 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 146 | sce | ex_7_25.sce | clc;
syms n;
A=[2 1;0 2];
e=spec(A);//since we get equal eigen values
b1=n*e(1)^(n-1);
b0=e(1)^n-b1*e(1);
An=b0*eye(A)+b1*A;
disp(An,"A^n") |
112ab870f32bc83378cd1f804dc04da70ffbef1e | 449d555969bfd7befe906877abab098c6e63a0e8 | /401/CH9/EX9.3/Example9_3.sce | f2cb81770cb3fc62eea143f65fa83d6da8527a35 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,268 | sce | Example9_3.sce | //Example 9.3
//Program to compare the shot noise generated in the photodetector
//with the thermal noise in the load resistor
clear;
clc ;
close ;
//Given data
Id=3*10^(-9); //A - DARK CURRENT
e=1.602*10^(-19); //Coulumbs - CHARGE OF AN ELECTRON
h= 6.626*10^(-34); //J/K - PLANK's CONSTANT
Lambda=0.9*10^(-6); //metre - OPERATING WAVELENGTH
c=2.998*10^8; //m/s - VELOCITY OF LIGHT IN VACCUM
eeta=0.6; //*100 percent - QUANTUM EFFICIENCY
Po=200*10^(-9); //Watt- INCIDENT OPTICAL POWER
k=1.381*10^(-23); //m^2 kg/s - BOLTZMANN's CONSTANT
T=293; //Kelvin - TEMPERATURE
B=5*10^6; //Hz - BANDWIDTH OF RECEIVER
Rl=4*10^3; //Ohms - LOAD RESISTANCE
//RMS shot noise current
Ip=eeta*Po*e*Lambda/(h*c);
Shot_noise_current=sqrt(2*e*B*(Id+Ip));
//RMS thermal noise current
Thermal_noise_current=sqrt(4*k*T*B/Rl);
//Displaying the Results in Command Window
printf("\n\n RMS shot noise current = %0.3f X 10^(-10) A.",Shot_noise_current/10^(-10));
printf("\n\n RMS thermal noise current = %0.3f X 10^(-9) A.",Thermal_noise_current/10^(-9)); |
749fb6b8ef617588793e5dd47e00664129c906ba | 5887829f5a0a005033807cf7dc4fb7231eb280ec | /Listing/chapter 3/Listing3216.sce | 233a5229b81191f875e0225729f06bd77fad5548 | [] | no_license | joaolrneto/learning_scilab | 78ecc0019f167b57bc35647c4ac785ece01e443e | 9624c9a6736860a8a836b0f801256b6224756585 | refs/heads/main | 2023-03-17T22:17:51.853368 | 2021-03-15T20:58:34 | 2021-03-15T20:58:34 | 344,478,059 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 16 | sce | Listing3216.sce | write(%io(2),a)
|
523f05959016d8199b1c4ad042e897425738ff64 | 9d59fb06cf0644f9c0c84aae7977eeff57116a45 | /0-INTRO/INTRO-5.sce | c53d17d3b31cb451c62c5c92c2eada65c5760cc6 | [] | no_license | aguadix/RQ | f353b8fa0e36828c8cca9af53f5c3275ed476a75 | 43e8a31003bf038b0cd72487868c760829b9797c | refs/heads/master | 2023-03-07T10:50:29.102260 | 2023-03-06T01:35:58 | 2023-03-06T01:35:58 | 53,548,175 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,646 | sce | INTRO-5.sce | clear; clc;
// INTRO-5.sce
// ESTABILIDAD DE UN SISTEMA LINEAL DE ECUACIONES DIFERENCIALES
function dxdt = f(t,x)
// dxdt(1) = A(1,1)*x(1) + A(1,2)*x(2)
// dxdt(2) = A(2,1)*x(1) + A(2,2)*x(2)
dxdt = A*x
endfunction
A = [-2.0 1.0; 1.0 -4.0]; // Nodo estable
// A = [ 5.0 -1.0; 3.0 1.0]; // Nodo inestable
// A = [ 2.0 -1.0; 3.0 -2.0]; // Silla inestable
// A = [ 1.0 -5.0; 1.0 -3.0]; // Espiral estable
// A = [ 2.0 -2.5; 1.8 -1.0]; // Espiral inestable
// A = [ 2.0 -5.0; 1.0 -2.0]; // Centro
// ESTADO ESTACIONARIO
// dxdt = A*x = 0 => xee = [0;0]
// PLANO DE FASES
scf(1);
x1min = -10; x1max = 10; x1interval = x1min:x1max;
x2min = -10; x2max = 10; x2interval = x2min:x2max;
// Líneas de pendiente nula
// dxdt(1) = A(1,1)*x(1) + A(1,2)*x(2) = 0
plot(x1interval,-A(1,1)*x1interval/A(1,2),'r-');
// dxdt(2) = A(2,1)*x(1) + A(2,2)*x(2) = 0
plot(x1interval,-A(2,1)*x1interval/A(2,2),'r--');
// Campo vectorial
fchamp(f, 0, x1interval, x2interval);
a1 = gca;
a1.x_location = 'origin';
a1.y_location = 'origin';
a1.isoview = 'on';
a1.data_bounds = [x1min,x2min ; x1max,x2max];
a1.box = 'off';
// Trayectorias
tfin = 10; dt = 0.1; t = 0:dt:tfin;
xini = [0;0];
x = ode(xini,0,t,f);
x1 = x(1,:); x2 = x(2,:);
plot(x1,x2,'o-');
a1.data_bounds = [x1min,x2min ; x1max,x2max];
// CRITERIO DE ESTABILIDAD
// xini <> [0;0]; t = infinito; x = [0;0]
// SOLUCIÓN ANALÍTICA
// x = v*exp(lambda*t)
// dxdt = A*x
// lambda*v*exp(lambda*t) = A*v*exp(lambda*t)
// lambda*v = A*v
// lambda = valores propios
// v = vectores propios
lambda = spec(A)
Estable = and(real(lambda) < 0)
|
61a11e7c847b03d006a52231ef0adf3dd183b201 | 449d555969bfd7befe906877abab098c6e63a0e8 | /788/CH11/EX11.4.b/11_4_soln.sce | 9067420d423c41b54721c37afaf6a0da232d5a5a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 701 | sce | 11_4_soln.sce | clc;
pathname=get_absolute_file_path('11_4_soln.sce')
filename=pathname+filesep()+'11_4_data.sci'
exec(filename)
// Solution:
// pump power loss,
pump_HP_loss=((1/(eff_overall/100))-1)*((p*Q)/1714); //HP
// PRV average HP loss,
PRV_loss=0.5*((p*Q)/1714); //HP
// line average HP loss,
line_loss=(HP_frict/100)*PRV_loss; //HP
// total average loss,
total_loss=pump_HP_loss+PRV_loss+line_loss; //HP
// heat exchanger rating,
HEx_rating=total_loss*2544; //Btu/hr
// Results:
printf("\n Results: ")
printf("\n The heat exchanger rating is %.0f Btu/hr.",HEx_rating)
printf("\n The answer in the program does not match with that in the textbook due to roundoff error (standard ratings) in textbook")
|
69c8c2c31b2f19b3624ad433e308f3e28a689ffb | b762d5d85061b3dd84ccf900726db6098e257125 | /Trabalho Introdução a Engenharia/Trab/quarta_questao.sce | 1598ec7f1faedc67f074dcdc37a43ca771d062da | [] | no_license | hugosousa111/scilab-studies | 8efdba8849fb49eeae6df35e2d9ffd3018bed313 | 5d1db65577683c8fe60bb81620f2281f04688c98 | refs/heads/master | 2020-12-20T18:14:07.202293 | 2020-01-25T11:35:28 | 2020-01-25T11:35:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 456 | sce | quarta_questao.sce | D = [1 1 1 1;2 -1 1 0;-1 1 -1 -1;2 0 2 1];
DX=[1 1 1 1; 2 -1 1 0; 0 1 -1 -1;-1 0 2 1];
DY = [1 1 1 1;2 2 1 0;-1 0 -1 -1;2 -1 2 1];
DZ = [1 1 1 1;2 -1 2 0;-1 1 0 -1;2 0 -1 1];
DT = [1 1 1 1;2 -1 1 2;-1 1 -1 0;2 0 2 -1];
determinante=det(D);
determinante_x=det(DX);
determinante_y=det(DY);
determinante_z=det(DZ);
determinante_t=det(DT);
X=determinante_x/determinante
Y=determinante_y/determinante
Z=determinante_z/determinante
T=determinante_t/determinante
|
e8454f00ea9003156c1683d75396fcdde9119a20 | 99b4e2e61348ee847a78faf6eee6d345fde36028 | /Toolbox Test/slewrate/slewrate11.sce | 15da168099c4f1f440b8bc85c930842e9715f69e | [] | no_license | deecube/fosseetesting | ce66f691121021fa2f3474497397cded9d57658c | e353f1c03b0c0ef43abf44873e5e477b6adb6c7e | refs/heads/master | 2021-01-20T11:34:43.535019 | 2016-09-27T05:12:48 | 2016-09-27T05:12:48 | 59,456,386 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 246 | sce | slewrate11.sce | //check o/p when i/p is a real valued matrix
x=[1.2, 5, 10,;-20, 12, 23];
t=1:length(x);
s=slewrate(x, t);
disp(s)
//output
// !--error 10000
//Argument X must be vector.
//at line 52 of function slewrate called by :
//s=slewrate(x, t);
|
1406bac8030898477727d7e03e36b2b4889a29bb | 449d555969bfd7befe906877abab098c6e63a0e8 | /3838/CH3/EX3.2.e/EX3_2_E.sce | d42d041edd800f1bb0b3ad82a91eb9d87d7fc0e6 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | EX3_2_E.sce | //EXAMPLE 3.2.E
clc;
Syms s t
w=2;
a=5;
F=exp(-a*t)*cos(w*t)
laplace(F,t,s)
|
e1579047cd1b9412df5a6e5a2fea56e4cf1f0d41 | 7b7be9b58f50415293def4aa99ef5795e6394954 | /sim/cmd/test/storerecall.tst | 7a87666c327bc97ac179979d033149538a887ac4 | [] | no_license | sabualkaz/sim42 | 80d1174e4bc6ae14122f70c65e259a9a2472ad47 | 27b5afe75723c4e5414904710fa6425d5f27e13c | refs/heads/master | 2022-07-30T06:23:20.119353 | 2020-05-23T16:30:01 | 2020-05-23T16:30:01 | 265,842,394 | 0 | 0 | null | 2020-05-21T12:26:00 | 2020-05-21T12:26:00 | null | UTF-8 | Scilab | false | false | 2,342 | tst | storerecall.tst | units = Field
$thermo = VirtualMaterials.RK
/ -> $thermo
thermo + METHANE ETHANE PROPANE n-HEXANE
s = Stream.Stream_Material()
h = Heater.Heater()
s.Out -> h.In
cd /s.In
T = 10 C
P = 101.325 kPa
MoleFlow = 1.0
Fraction = 1.0 1.0 1.0 1.0
cd /
h.DeltaP = 1.0
h.Out.T = 50 C
h.In
h.Out
#lets create a directoy right here with a space in its name
mkdir test directory
#normal store
store test directory\storerecall.s42
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#normal recall
recall test directory\storerecall.s42
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed store
#Needs quotes in name of file as there are more than one parameter
store "test directory\storerecall zip.s42" "z"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed recall
#Doesnt really need quotes.
#No need to specify that it is a zip file
recall "test directory\storerecall zip.s42"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed store with "n' flag. (Useless I think)
store "test directory\storerecall zipn.s42" "n"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed recall with "n' flag
recall "test directory\storerecall zipn.s42"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed store with extra files and "z' flag
store "test directory\storerecall zipwfiles.s42" "storerecalldummy1.txt" "storerecall dir" "storerecalldummy2.txt" "z"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed recall with extra files and put the extra files into a new directory
recall "test directory\storerecall zipwfiles.s42" "storerecall temp dir"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed recall with extra files and let the files be put back into the same place
recall "test directory\storerecall zipwfiles.s42"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed store with extra files and "n' flag
store "test directory\storerecall zipnwfiles.s42" "storerecalldummy1.txt" "storerecalldummy2.txt" "n"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#compressed recall with extra files and put the extra files into a new directory
recall "test directory\storerecall zipnwfiles.s42" "storerecall temp dir"
s.In.T = 11 C
s.In.T = 10 C
h.In
h.Out
#Could delete files from cli but lets leave them for manually looking at sizes
|
ce8a28317dc45b21048dbb81b377d3cb77c3c781 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3856/CH11/EX11.4/Ex11_4.sce | 2ac54d7b1b7acdcfaf9f4a02db7f77d82c6aafff | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 568 | sce | Ex11_4.sce | //Calculate the pH of of a buffer solution what is pH of the buffer solution after the addition of HCl
//Example 11.4
clc;
clear;
C1=0.40; //Concentration of Acetic acid in M
C2=0.55; //Concentration of Sodium Acetate in M
pH1=4.76+log10(C2/C1); //pH of the Buffer solution before addition of HCl
printf("pH of the Buffer solution = %.2f",pH1);
C3=0.10; //Concentration of HCl in M
pH=4.76+log10((C2-C3)/(C1+C3)); // pH of the Buffer solution after addition of HCl
printf("\n pH of the Buffer solution after addition of HCl = %.2f",pH);
|
a9235fd3ad7fb51d2d58833d91b996bff5aedc68 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1427/CH4/EX4.4/4_4.sce | a11c22f12ef5800755257678ebffe3098ff2dae0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 275 | sce | 4_4.sce | //ques-4.4
//Calculating BOD of sample
clc
o1=920;//Initial dissolved oxygen (in ppm)
o2=260;//Final dissolved oxygen (in ppm)
v1=100;//Waste water (in mL)
v2=100;//Distilled water (in mL)
ans=(o1-o2)*((v1+v2)/v1);//BOD
printf("BOD of given sample is %d ppm.",ans);
|
cc4cf3ba97b956c76de0bec89452ff7156938d11 | 297b29fb450286d0f7fa619e58c9f4a86949544a | /ConvolutionaDeinterleaver.sci | 21d7ff3c18fdcd840523c1a4bd28a3c87d39b923 | [] | no_license | harshal93shah/scilabcom | 46dc948c1e0d0b37b0a69dfa203347298cc01e40 | 09c5506089a4283968d963ed3812de9823c5a008 | refs/heads/master | 2020-04-06T07:03:23.954966 | 2016-10-04T11:49:41 | 2016-10-04T11:49:41 | 54,882,787 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 2,156 | sci | ConvolutionaDeinterleaver.sci | function [y,state,index] = ConvolutionalDeinterleaver(in,nrows,slope,inist,stindex)
y=[];
state=[];
index=[];
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
//ConvolutionalDeinterleaver Restore ordering of symbols using specified-delay shift registers.
//[y,state,index] = ConvolutionalDeinterleaver(in,delay,inist)..Restore ordering of
//internal shift registers, each with its own delay value.
//it also returns the current state of shift register as matrix
//and the value of next index from which we would get output
//in:input- can be any scalar vector
//nrows:number of rows- no of shift register present
//slope- The number of additional symbols that fit in each successive shift register,
//where the first register holds zero symbols.
//inist:Initialstate- Initial conditions of shift registers
//Specify the initial values in each shift register as a numeric scalar value or a
//matrix. . When you set this property to a matrix, the size should be equal to
// no of shiftregister * max delay r. This matric contains initial conditions,
//Here the orignal delay elements are for ith element is max(delay)-delay
// where the (i,j)is of jth element of i-th shift register.the irrelevant element
//doesn't matter. for eg nrow=2, slope =2 matrix with (2,1) and (2,2) elements
//irrelevant
//stindex:start index- which shift register will give first ouput. it should be scalar
//less than no of shift register
//Author - Harshal Shah
// checking conditions on no of rows
if (~isreal(nrows) | length(nrows)~=1 | isnan(nrows)|nrows<=0) then
error("ConvolutionalDeinterleaver:improper nrows");
end
// checking conditions on slope
if (~isreal(slope) | length(slope)~=1 | isnan(slope)|slope<0) then
error("ConvolutionalDeinterleaver:improper slope");
end
for i =1:nrows
delay(i)= (i-1)*slope;
end
[y,state,index] = MultiplexedDeinterleaver(in,delay,inist,stindex)
endfunction
|
ebce30bc9d7fe0055ba55a8dd145be56e605abe7 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3428/CH3/EX1.3.9/Ex1_3_9.sce | b808fc11d3f7f704266f2e05ffd8d1ad34a34db9 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 360 | sce | Ex1_3_9.sce | //Section-1,Example-4,Page no.AC-243
//To calculate Total hardness of given sample of water in ppm.
clc;
V_1=30 //Volume of EDTA solution reqd. by 20 ml of standard hard water.
V_2=10 //Volume of water sample that requires 10 ml EDTA.
E_1=30/V_1 //weight of CaCO3 in 1mL of EDTA(mg).
Total_H=(10/V_2)*1000
disp(Total_H,'Total hardness of water(ppm)')
|
56082acadbdd7358f5fd269ea6fc0143ce540a92 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2015/CH8/EX8.6/8_6.sce | ae81af6c60653312b50f7b927cf49d21f318921d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 276 | sce | 8_6.sce | clc
//initialisation of variables
h1=176.48 //under -25 degrees temp in kj/kg
h2=215.17 //kj/kg
h4=74.59 //kj/kg
//CALCULATIONS
re=h1-h4
w=h2-h1
cop=re/w
//RESULTS
printf('the refrigeration effect is %2fkj/kg',re)
printf('\ncoefficient of performance is %2f',cop)
|
d448a148e51171601519fbe350eef125adb25ffb | 449d555969bfd7befe906877abab098c6e63a0e8 | /2252/CH17/EX17.2/Ex17_2.sce | 1f31d217dc26fee65c95941eb7ce78a2d0b2485e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 205 | sce | Ex17_2.sce |
P=4//no. of poles
n=24//no. of slots
c=2//conductors per slot
Z=n*c//total no. of conductors
p=Z/4//pole pitch
Ybp=p+1//back pitch
Yfp=p-1//front pitch
Y=Ybp-Yfp
mprintf("Resultant pitch=%f",Y)
|
d13e9b99053598830f78c5b2f264431d7dd86f00 | ebd4548d44d72b237371e08dd7feffa1739dbd92 | /solve_qp.sci | 5c33106fc4f1aca56567099d98933e1aa1b9b4b2 | [] | no_license | JeroenDM/scilab | 23a44dec9fa47956f0ec64396f82943f4efeac8f | 2b05ae5a05023a1d6e4c6c357fb20b5bc6250156 | refs/heads/master | 2021-01-11T15:44:28.911399 | 2017-01-24T14:31:46 | 2017-01-24T14:31:46 | 79,917,765 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 427 | sci | solve_qp.sci | function [x, mu] = solve_qp(P, q, A, b)
// solve a quadric program with linear equality constraints and P > 0
n = size(A, 2); // number of variables
m = size(A, 1); // number of equality constrains
// construct kkt matrix
KKT = [P A'; A zeros(m, m)];
// Solve KKT system
sol = KKT \ [ -q; b];
// split primal and dual solution
x = sol(1:n);
mu = sol(n+1 : $);
endfunction
|
b2c3678e08d5a19e50b80c0d200e1cb8a4720987 | 717ddeb7e700373742c617a95e25a2376565112c | /3424/CH11/EX11.7/Ex11_7.sce | 0789f406c443b063b0252f2599e29ed00cea6d6e | [] | 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 | 281 | sce | Ex11_7.sce | clc
//Initialization of variables
omega=6 //rev/s
Q=10 //ft^3/s
z=20 //ft
gama=62.4 //lb/ft^3
eta=0.94
omega=omega*60 //rpm
Wsh=gama*Q*z*eta
Wsh=Wsh/550 //converting to hp
h_T=z
N=omega*sqrt(Wsh)/(h_T)^(5/4)
printf("W_shaft = %.1f hp',Wsh)
printf('\n N_sd = %.1f',N)
|
94a95ed46a80f06abce8251fb8a4a2e15574a8c8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /60/CH3/EX3.1/ex_1.sce | 6eebf3bbceec90a66d12fba89915f389597165ca | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 424 | sce | ex_1.sce | // Example(3.1)
// finding roots using bisection method
deff('[y]=f(x)','y=x-0.2*sin(x)-0.5')
bisection(0.5,1.0,f)
//regula falsi method
deff('[y]=f(x)','y=x-0.2*sin(x)-0.5')
regularfalsi(0.5,1.0,f)
//secant method
deff('[y]=f(x)','y=x-0.2*sin(x)-0.5')
secant(0.5,1.0,f)
//newton rapson method
x=(0.5+1)/2
deff('[y]=f(x)','y=x-0.2*sin(x)-0.5')
deff ('[y]=g(x)','y=1-0.2*cos(x)')
x=newton(x,f,g)
|
a4f154ce768b096e3d628f12bdb03adcaaacb9e0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2510/CH19/EX19.5/Ex19_5.sce | 01aa172ff422e35acbaa223447837af0407af41c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,852 | sce | Ex19_5.sce | //Variable declaration:
w = 8 //Width of wall (m)
H = 3 //Height of wall (m)
h = 21 //Convective heat transfer coefficient between the air and the surface (W/m^2.K)
T1 = -18 //Outside surace of wall temperature ( C)
T3 = 26 //Surrounding air temperature ( C)
l1 = 80/100 //Reduction in cooling load
k = 0.0433 //Thermal conductivity of cork board insulation (W/m.K)
T = 12000 //Units Btu/h in 1 ton of refrigeration
//Calculation:
A = w*H //Heat transfer area (m^2) (part 1)
Q1 = h*A*(T1-T3) //Rate of heat flow in the absence of insulation (W)
Q2 = Q1*3.4123/T //Rate of heat flow in the absence of insulation (ton of refrigeration)
l2 = 1-l1 //Reduced cooling load (part 2)
Q3 = l2*Q1 //Heat rate with insulation (W)
Rt = (T1-T3)/Q3 //Total thermal resistance ( C/W)
R2 = 1/(h*A) //Convection thermal resistance ( C/W)
R1 = Rt-R2 //Insulation conduction resistance ( C/W)
L = R1*k*A //Required insulation thickness (m)
//Result:
printf("1. The rate of heat flow through the rectangular wall without insulation is : %.2f kW .",Q1/10**3)
printf("Or, the rate of heat flow through the rectangular wall without insulation in tons of refrigeration is : %.1f ton of refrigeration .",Q2)
if (Q1<0) then
printf("The negative sign indicates heat flow from the surrounding air into the cold room.")
else
printf(" The positive sign indicates heat flow from the surrounding air into the cold room.")
end
printf("2. The required thickness of the insulation board is : %.2f mm .",L*10**3)
|
ded2e7571255da9bb49a513203aa19b7e894c8f6 | 84ea66af72ab1c482a1a03fd2d8bdc74e9ad1668 | /Tutorial02-Plots/Scilab_code/Tutorial2_plot_save_func.sce | c6a2883605864afdaecadeddb5a705c6df27a9ed | [] | no_license | FOSSEE/scilab-tutorials | c4a9464a5b163074566234e42659f99e2012ecc0 | 301609f6ef1653dee4fa2ed74bca3e6f7abc1308 | refs/heads/master | 2020-03-26T23:48:04.178016 | 2018-10-08T00:44:39 | 2018-10-08T00:44:39 | 145,567,949 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 678 | sce | Tutorial2_plot_save_func.sce | //This script demonstrate exporting plots to svg/pdf files
clear
clc
exec change_plot_attribs.sci;
//Import data from file
Data = csvRead('../Data/Tut2_data1.csv');
//Segregate the data into variables
t = Data(:,1);
x = Data(:,2)
//Ploting the figure. Name of the figure is fig1;
//Use the field Linewidth to specify thickness of the plot
fig1 = scf(1);
plot(t,x,'Linewidth',3);
//Call function to change plot attributes
//Arguments (x_label,y_label,title,label_size,title_size,fontsize)
change_plot_attribs('Time','Data','x versus t',7,6,3)
//Export Figure 1 as svg file
xs2svg(fig1,'plot_y_versus_x1');
//Export Figure 2 as pdf file
xs2pdf(fig1,'plot_y_versus_x1');
|
8c9e706f88a519d25d5c76c1822e728955f3478d | 449d555969bfd7befe906877abab098c6e63a0e8 | /226/CH13/EX13.14/example14_sce.sce | 6392302d8ffb82e7dc825489dcb6f00fde584d3d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 274 | sce | example14_sce.sce | //chapter 13
//example 13.14
//page 580
printf("\n")
printf("given")
hfe=100;hie=2*10^3;R4=100;R1=5.6*10^3;R6=2.2*10^3;
Zi=hie+(1+hfe)*R4
disp("open loop current gain")
Ai=(hfe*hfe*R1)/(R1+Zi)
B=R4/(R4+R6)
disp("closed loop gain")
Acl=Ai/(1+Ai*B)
Zi=hie/(1+Ai*B) |
ab7186ec3c302d12a273cc3ff902db72bc7b2b2e | 449d555969bfd7befe906877abab098c6e63a0e8 | /3872/CH2/EX2.4/EX2_4.sce | 083783b44193b1ce8f7d9488888a1eb7c45c22f6 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 2,740 | sce | EX2_4.sce | //Book - Power System: Analysis & Design 5th Edition
//Authors - J. Duncan Glover, Mulukutla S. Sarma, and Thomas J. Overbye
//Chapter - 2 ; Example 2.4
//Scilab Version - 6.0.0 ; OS - Windows
clc;
clear;
Eab=480*(cos(0*%pi/180)+%i*sin(0*%pi/180)); //Line Voltage of the source in Volts
Zdel=30*(cos(40*%pi/180)+%i*sin(40*%pi/180)); //Impedance of the delta load in Ohm
Zlineperphase=1*(cos(85*%pi/180)+%i*sin(85*%pi/180)); //Line Impedance in Ohm
Zstar=Zdel/3; //Impedance of delta load converted to star load in Ohm
[r theta]=polar(Eab);
Ebc=r*(cos(theta-120*%pi/180)+%i*sin(theta-120*%pi/180));
Eca=r*(cos(theta+120*%pi/180)+%i*sin(theta+120*%pi/180));
Ean=r*(cos(theta-30*%pi/180)+%i*sin(theta-30*%pi/180))/sqrt(3); //Phase voltage of the source in Volts
[r theta]=polar(Ean);
Ebn=r*(cos(theta-120*%pi/180)+%i*sin(theta-120*%pi/180));
Ecn=r*(cos(theta+120*%pi/180)+%i*sin(theta+120*%pi/180));
Ia=Ean/(Zlineperphase+Zstar); //Line current in Amperes
Ib=Ebn/(Zlineperphase+Zstar);
Ic=Ecn/(Zlineperphase+Zstar);
[r theta]=polar(Ia);
Iab=r*(cos(theta+30*%pi/180)+%i*sin(theta+30*%pi/180))/sqrt(3); //Phase current in Amperes
[r theta]=polar(Ib);
Ibc=r*(cos(theta+30*%pi/180)+%i*sin(theta+30*%pi/180))/sqrt(3);
[r theta]=polar(Ic);
Ica=r*(cos(theta+30*%pi/180)+%i*sin(theta+30*%pi/180))/sqrt(3);
EAB=Zdel*Iab; //Line voltage across the load in Volts
EBC=Zdel*Ibc;
ECA=Zdel*Ica;
printf('\nThe magnitude of line current IA is %.2f Ampere and its angle is %.2f degrees',abs(Ia),atand(imag(Ia),real(Ia)));
printf('\nThe magnitude of line current IB is %.2f Ampere and its angle is %.2f degrees',abs(Ib),atand(imag(Ib),real(Ib)));
printf('\nThe magnitude of line current IC is %.2f Ampere and its angle is %.2f degrees',abs(Ic),atand(imag(Ic),real(Ic)));
printf('\nThe magnitude of load current IAB is %.2f Ampere and its angle is %.2f degrees',abs(Iab),atand(imag(Iab),real(Iab)));
printf('\nThe magnitude of load current IBC is %.2f Ampere and its angle is %.2f degrees',abs(Ibc),atand(imag(Ibc),real(Ibc)));
printf('\nThe magnitude of load current ICA is %.2f Ampere and its angle is %.2f degrees',abs(Ica),atand(imag(Ica),real(Ica)));
printf('\nThe magnitude of load voltage EAB is %.2f Volts and its angle is %.2f degrees',abs(EAB),atand(imag(EAB),real(EAB)));
printf('\nThe magnitude of load voltage EBC is %.2f Volts and its angle is %.2f degrees',abs(EBC),atand(imag(EBC),real(EBC)));
printf('\nThe magnitude of load voltage ECA is %.2f Volts and its angle is %.2f degrees',abs(ECA),atand(imag(ECA),real(ECA)));
|
5e2d1e5c52502dab90842000add946fb4322ffb4 | 8781912fe931b72e88f06cb03f2a6e1e617f37fe | /scilab/difde/Diff_Evol/DiffEvol.sci | a05df41db7638d5898b1b419b44055d0d28ee2e5 | [] | no_license | mikeg2105/matlab-old | fe216267968984e9fb0a0bdc4b9ab5a7dd6e306e | eac168097f9060b4787ee17e3a97f2099f8182c1 | refs/heads/master | 2021-05-01T07:58:19.274277 | 2018-02-11T22:09:18 | 2018-02-11T22:09:18 | 121,167,118 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 14,533 | sci | DiffEvol.sci | function [optarg,optval,nfeval] = DiffEvol(fct,VTR,D,XVmin,XVmax,USERDATA,NP,...
itermax,F,CR,strategy,report);
// minimization of a user-supplied function with respect to x(1:D),
// using the differential evolution (DE) algorithm of Rainer Storn
// (http://www.icsi.berkeley.edu/~storn/code.html)
//
// Special thanks go to Ken Price (kprice@solano.community.net) and
// Arnold Neumaier (http://solon.cma.univie.ac.at/~neum/) for their
// valuable contributions to improve the code.
//
// Strategies with exponential crossover, further input variable
// tests, and arbitrary function name implemented by Jim Van Zandt
// <jrv@vanzandt.mv.com>, 12/97.
//
// Scilab version by Walter Di Carlo <walter.dicarlo@jrc.it> 03/04/99
// modified by Helmut Jarausch <jarausch@igpm.rwth-aachen.de> 2006/03/01
//
// See also http://www.icsi.berkeley.edu/~storn/deshort1.ps
//
// Output arguments:
// ----------------
// optarg parameter vector with best solution
// optval best objective function value
// nfeval number of function evaluations
//
// Input arguments:
// ---------------
//
// fct cost function fct(x,USERDATA) to minimize
// VTR "Value To Reach". DiffEvol will stop its minimization
// if either the maximum number of iterations "itermax"
// is reached or the best parameter vector "optarg"
// has found a value f(optarg,y) <= VTR.
// D number of parameters of the objective function
// XVmin vector of lower bounds XVmin(1) ... XVmin(D)
// of initial population
// *** note: these are not bound constraints!! ***
// XVmax vector of upper bounds XVmax(1) ... XVmax(D)
// of initial population
// USERDATA problem data vector which is passed transparently to
// the cost function fct
// NP number of population members
// itermax maximum number of iterations (generations)
// F DE-stepsize F from interval [0, 2]
// for strategies 3 and 8 this has 2 components
// CR crossover probability constant from interval [0, 1]
// strategy 1 --> DE/best/1/exp 6 --> DE/best/1/bin
// 2 --> DE/rand/1/exp 7 --> DE/rand/1/bin
// 3 --> DE/rand-to-best/1/exp 8 --> DE/rand-to-best/1/bin
// 4 --> DE/best/2/exp 9 --> DE/best/2/bin
// 5 --> DE/rand/2/exp else DE/rand/2/bin
// Experiments suggest that /bin likes to have a slightly
// larger CR than /exp.
// report intermediate output will be produced after "report"
// iterations. No intermediate output will be produced
// if report is < 1
//
// The first four arguments are essential (though they have
// default values, too). In particular, the algorithm seems to
// work well only if [XVmin,XVmax] covers the region where the
// global minimum is expected. DE is also somewhat sensitive to
// the choice of the stepsize F. A good initial guess is to
// choose F from interval [0.5, 1], e.g. 0.8. CR, the crossover
// probability constant from interval [0, 1] helps to maintain
// the diversity of the population and is rather uncritical. The
// number of population members NP is also not very critical. A
// good initial guess is 10*D. Depending on the difficulty of the
// problem NP can be lower than 10*D or must be higher than 10*D
// to achieve convergence.
// If the parameters are correlated, high values of CR work better.
// The reverse is true for no correlation.
//
// default values in case of missing input arguments:
// VTR = 1.e-6;
// D = 2;
// XVmin = [-2 -2]';
// XVmax = [2 2]';
// y=[];
// NP = 10*D;
// itermax = 200;
// F = [0.8;0.6];
// CR = 0.5;
// strategy = 7;
// report = 10;
//
// Cost function: function result = f(x,y);
// has to be defined by the user and is minimized
// w.r. to x(1:D).
//
// Example to find the minimum of the Rosenbrock saddle:
// ----------------------------------------------------
// Define f.m as:
// function result = f(x,y);
// result = 100*(x(2)-x(1)^2)^2+(1-x(1))^2;
// end
// Then type:
//
// VTR = 1.e-6;
// D = 2;
// XVmin = [-2 -2];
// XVmax = [2 2];
// [optarg,optval,nfeval] = DiffEvol(f,VTR,D,XVmin,XVmax);
//
// The same example with a more complete argument list is handled in
// run1.m
//
// Constraints can be added by an L1 penalty function
//
// About DiffEvol.m
// --------------
// Differential Evolution for MATLAB
// Copyright (C) 1996, 1997 R. Storn
// International Computer Science Institute (ICSI)
// 1947 Center Street, Suite 600
// Berkeley, CA 94704
// E-mail: storn@icsi.berkeley.edu
// WWW: http://http.icsi.berkeley.edu/~storn
//
// devec is a vectorized variant of DE which, however, has a
// propertiy which differs from the original version of DE:
// 1) The random selection of vectors is performed by shuffling the
// population array. Hence a certain vector can't be chosen twice
// in the same term of the perturbation expression.
//
// Due to the vectorized expressions DiffEvol executes fairly fast
// in MATLAB's interpreter environment.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 1, or (at your option)
// any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. A copy of the GNU
// General Public License can be obtained from the
// Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
mode(0);
//Check input variables---------------------------------------------
err=[];
nargin = argn(2);
if nargin<1, error('DiffEvol 1st argument must be function name'); else
if type(fct) ~= 13; err(1,length(err)+1)=1; end; end;
if nargin<2, VTR = 1.e-6; else
if length(VTR)~=1; err(1,length(err)+1)=2; end; end;
if nargin<3, D = 2; else
if length(D)~=1; err(1,length(err)+1)=3; end; end;
if nargin<4, XVmin = [-2 -2]';else
if size(XVmin,1)~=D; err(1,length(err)+1)=4; end; end;
if nargin<5, XVmax = [2 2]'; else
if size(XVmax,1)~=D; err(1,length(err)+1)=5; end; end;
if nargin<6, y=[]; end;
if nargin<7, NP = 10*D; else
if length(NP)~=1; err(1,length(err)+1)=7; end; end;
if nargin<8, itermax = 200; else
if length(itermax)~=1; err(1,length(err)+1)=8; end; end;
if nargin<11, strategy = 7; else
if length(strategy)~=1; err(1,length(err)+1)=11; end; end;
if nargin<9, F = [0.8;0.6]; else
if modulo(strategy,5) == 3
if length(F)~=2; err(1,length(err)+1)=9; end;
Lam= F(2);
else
if length(F)~=1; err(1,length(err)+1)=9; end;
end
end;
F= F(1);
if nargin<10, CR = 0.5; else
if length(CR)~=1; err(1,length(err)+1)=10; end; end;
if nargin<12, report = 10; else
if length(report)~=1; err(1,length(err)+1)=12; end; end;
if length(err)>0
printf('error in parameter %d\n', err);
x_message('DiffEvol (function,scalar,scalar,vector,vector,any,integer,integer,scalar,scalar,integer,integer)');
end;
if (NP < 5)
NP=5;
printf(' NP increased to minimal value 5\n');
end;
if ((CR < 0) | (CR > 1))
CR=0.5;
printf('CR should be from interval [0,1]; set to default value 0.5\n');
end;
if (itermax <= 0)
itermax = 200;
printf('itermax should be > 0; set to default value 200\n');
end;
report = floor(report);
//-----Initialize population and some arrays-------------------------------
pop = zeros(D,NP); //initialize pop to gain speed
//----pop is a matrix of size NPxD. It will be initialized-------------
//----with random values between the min and max values of the---------
//----parameters-------------------------------------------------------
for i=1:NP
pop(:,i) = XVmin + rand(D,1).*(XVmax - XVmin);
end;
popold = zeros(pop); // toggle population
val = zeros(NP,1); // create and reset the "cost array"
optarg = zeros(D,1); // best population member ever
optargit = zeros(D,1); // best population member in iteration
nfeval = 0; // number of function evaluations
//------Evaluate the best member after initialization----------------------
ibest = 1; // start with first population member
val(1) = fct(pop(:,ibest),y);
optval = val(1); // best objective function value so far
nfeval = nfeval + 1;
for i=2:NP // check the remaining members
val(i) = fct(pop(:,i),y);
nfeval = nfeval + 1;
if (val(i) < optval) // if member is better
ibest = i; // save its location
optval = val(i);
end;
end;
optargit = pop(:,ibest); // best member of current iteration
optvalit = optval; // best value of current iteration
optarg = optargit; // best member ever
//------DE-Minimization---------------------------------------------
//------popold is the population which has to compete. It is--------
//------static through one iteration. pop is the newly--------------
//------emerging population.----------------------------------------
pm1 = zeros(D,NP); // initialize population matrix 1
pm2 = zeros(D,NP); // initialize population matrix 2
pm3 = zeros(D,NP); // initialize population matrix 3
pm4 = zeros(D,NP); // initialize population matrix 4
pm5 = zeros(D,NP); // initialize population matrix 5
bm = zeros(D,NP); // initialize optargber matrix
ui = zeros(D,NP); // intermediate population of perturbed vectors
mui = zeros(D,NP); // mask for intermediate population
mpo = zeros(D,NP); // mask for old population
rot = (0:1:NP-1)'; // rotating index array (size NP)
rotd= (0:1:D-1)'; // rotating index array (size D)
rt = zeros(NP,1); // another rotating index array
rtd = zeros(D,1); // rotating index array for exponential crossover
a1 = zeros(NP,1); // index array
a2 = zeros(NP,1); // index array
a3 = zeros(NP,1); // index array
a4 = zeros(NP,1); // index array
a5 = zeros(NP,1); // index array
ind = zeros(4,1);
iter = 1;
while ((iter < itermax) & (optval > VTR))
popold = pop; // save the old population
ind = grand(1,'prm',(1:4)'); // index pointer array
a1 = grand(1,'prm',(1:NP)'); // shuffle locations of vectors
rt = modulo(rot+ind(1),NP); // rotate indices by ind(1) positions
a2 = a1(rt+1); // rotate vector locations
rt = modulo(rot+ind(2),NP);
a3 = a2(rt+1);
rt = modulo(rot+ind(3),NP);
a4 = a3(rt+1);
rt = modulo(rot+ind(4),NP);
a5 = a4(rt+1);
pm1 = popold(:,a1); // shuffled population 1
pm2 = popold(:,a2); // shuffled population 2
pm3 = popold(:,a3); // shuffled population 3
pm4 = popold(:,a4); // shuffled population 4
pm5 = popold(:,a5); // shuffled population 5
// population filled with the best member
bm= optargit*ones(1,NP); // of the last iteration
// for i=1:NP
// bm(:,i) = optargit; // of the last iteration
// end;
mui = (rand(D,NP) < CR) * 1; // all random numbers < CR are 1, 0 otherwise
if (strategy > 5)
st = strategy-5; // binomial crossover
else
st = strategy; // exponential crossover
mui=sort(mui); // transpose, collect 1's in each column
for i=1:NP
n=floor(rand()*D);
if n > 0
rtd = modulo(rotd+n,D);
mui(:,i) = mui(rtd+1,i); //rotate column i by n
end;
end;
end;
mpo = (mui < 0.5) * 1; // inverse mask to mui
select st
case 1 // DE/best/1
ui = bm + F*(pm1 - pm2); // differential variation
ui = popold.*mpo + ui.*mui; // crossover
case 2 // DE/rand/1
ui = pm3 + F*(pm1 - pm2); // differential variation
ui = popold.*mpo + ui.*mui; // crossover
case 3 // DE/rand-to-best/1
ui = popold + Lam*(bm-popold) + F*(pm1 - pm2);
ui = popold.*mpo + ui.*mui; // crossover
case 4 // DE/best/2
ui = bm + F*(pm1 - pm2 + pm3 - pm4); // differential variation
ui = popold.*mpo + ui.*mui; // crossover
else // DE/rand/2
ui = pm5 + F*(pm1 - pm2 + pm3 - pm4); // differential variation
ui = popold.*mpo + ui.*mui; // crossover
end;
//-----Select which vectors are allowed to enter the new population------------
for i=1:NP
tempval = fct(ui(:,i),y); // check cost of competitor
nfeval = nfeval + 1;
if (tempval <= val(i)) // if competitor is better than value in "cost array"
pop(:,i) = ui(:,i); // replace old vector with new one (for new iteration)
val(i) = tempval; // save value in "cost array"
//----we update optval only in case of success to save time-----------
if (tempval < optval) // if competitor better than the best one ever
optval = tempval; // new best value
optarg = ui(:,i); // new best parameter vector ever
end;
end;
end; //---end for imember=1:NP
optargit = optarg; // freeze the best member of this iteration for the coming
// iteration. This is needed for some of the strategies.
//----Output section----------------------------------------------------------
if (report > 0)
if (modulo(iter,report) == 0)
printf('Iteration: %d, Best: %f, F: %f, CR: %f, NP: %d\n',iter,optval,F,CR,NP);
for n=1:D
printf('best(%d) = %f\n',n,optarg(n));
end;
end;
end;
iter = iter + 1;
end; //---end while ((iter < itermax) ...
endfunction
|
53faf7276465e3e85a695905c9788a91b34d2193 | 089894a36ef33cb3d0f697541716c9b6cd8dcc43 | /NLP_Project/test/blog/bow/bow.12_16.tst | 6e6bd55b31b9eeb9546f7de9b8d7ea952b2576b3 | [] | 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,555 | tst | bow.12_16.tst | 12 7:1.0 18:0.4 21:0.3333333333333333 28:0.09090909090909091 43:0.5 46:1.0 190:2.0 246:1.0 493:0.6666666666666666 508:1.0 553:1.0 757:1.0 1426:1.0 1432:1.0
12 5:0.013513513513513514 18:0.2 31:1.0 147:1.0 188:1.0 190:1.0 255:1.0 411:1.0 493:0.3333333333333333 583:1.0 738:1.0 1542:1.0
12 3:0.25 5:0.0945945945945946 12:0.5 13:2.0 21:1.6666666666666667 26:1.0 28:0.09090909090909091 29:4.0 31:4.0 32:1.0 35:0.05263157894736842 38:1.0 40:0.08333333333333333 49:1.0 60:0.14285714285714285 61:1.0 71:1.0 75:0.5 85:1.0 91:1.0 98:0.16666666666666666 119:0.25 147:1.0 149:1.0 155:0.5 161:1.0 165:1.0 167:0.14285714285714285 170:1.0 177:0.25 226:0.5 246:2.0 248:0.25 251:1.0 255:1.0 284:1.0 289:0.25 296:1.0 326:1.0 355:1.0 394:1.0 452:1.0 471:1.0 492:1.0 572:1.0 578:1.0 726:1.0 885:1.0 891:2.0 942:0.5 1024:1.0 1047:1.0 1158:1.0 1426:1.0 1521:1.0
12 5:0.013513513513513514 9:1.0 15:1.0 18:0.2 21:0.3333333333333333 23:1.0 24:1.0 41:1.0 130:0.2 206:1.0 330:1.0 1155:1.0 1510:1.0 1632:1.0
12 5:0.013513513513513514 87:1.0 757:1.0
12 28:0.045454545454545456 61:1.0 206:1.0 306:1.0
12 8:1.0 21:0.6666666666666666 26:1.0 61:2.0 119:0.25 215:1.0 306:1.0 1191:1.0
12 3:0.25 5:0.013513513513513514 9:1.0 17:1.0 28:0.045454545454545456 38:1.0 306:1.0 351:1.0
12 12:0.5 17:1.0 18:0.2 35:0.05263157894736842 41:1.0 351:1.0 714:1.0
12 5:0.013513513513513514 53:1.0 91:1.0 122:1.0 164:1.0 422:1.0 476:1.0
12 8:1.0 21:0.3333333333333333 40:0.08333333333333333 56:0.07142857142857142 61:1.0 178:1.0 306:1.0
12 1:0.5 3:0.25 5:0.013513513513513514 18:0.4 25:1.0 28:0.045454545454545456 32:1.0 35:0.05263157894736842 38:1.0 58:1.0 61:1.0 71:1.0 82:1.0 124:0.5 155:0.5 355:1.0
12 11:1.0 13:1.0 18:0.6 21:0.3333333333333333 28:0.045454545454545456 31:1.0 41:1.0 114:1.0 116:0.2 190:2.0 330:1.0 476:2.0 478:1.0 565:1.0
12 21:0.3333333333333333 23:1.0 28:0.045454545454545456 56:0.07142857142857142 61:1.0 116:0.2 135:1.0 167:0.14285714285714285 170:1.0 289:0.08333333333333333 355:1.0
12 18:0.2 29:1.0 135:1.0
12 5:0.013513513513513514 9:1.0 12:1.0 18:0.2
12 5:0.02702702702702703 8:1.0 12:0.5 21:0.3333333333333333 28:0.045454545454545456 40:0.08333333333333333 49:0.5 61:1.0 167:0.14285714285714285 188:1.0 378:1.0 427:1.0 1150:1.0 1585:1.0
12 5:0.013513513513513514 9:1.0 12:0.5 28:0.045454545454545456 31:1.0 47:0.125 159:1.0 190:1.0 294:1.0 427:1.0 503:1.0 674:1.0 714:1.0
12 5:0.04054054054054054 31:1.0 40:0.08333333333333333 47:0.125 71:1.0 159:1.0 188:1.0 196:1.0 427:1.0 593:1.0 1128:1.0
12 40:0.08333333333333333 61:1.0 186:1.0 668:1.0
12 5:0.02702702702702703 12:0.5 31:1.0 100:0.5 188:1.0 336:1.0 588:1.0
12 12:0.5 25:1.0 40:0.08333333333333333 85:1.0 297:1.0 298:1.0 326:1.0 1461:1.0
12 12:0.5 31:1.0 178:1.0 289:0.08333333333333333 296:1.0 812:1.0 1203:1.0
12 5:0.013513513513513514 18:0.2 28:0.045454545454545456 29:1.0 31:1.0 60:0.14285714285714285 69:0.3333333333333333 91:1.0 116:0.2 134:1.0 135:1.0 143:2.0 185:1.0 289:0.08333333333333333 298:1.0 527:1.0 999:1.0
12 21:0.3333333333333333 23:1.0 25:1.0 82:1.0 215:1.0
12 5:0.013513513513513514 7:1.0 8:1.0 12:0.5 21:0.3333333333333333 23:1.0 28:0.045454545454545456 29:2.0 35:0.05263157894736842 40:0.08333333333333333 47:0.25 118:1.0 168:0.1111111111111111 190:1.0 289:0.08333333333333333 422:1.0 476:1.0 592:1.0 714:1.0
12 12:0.5 23:1.0 28:0.045454545454545456 29:2.0 35:0.05263157894736842 47:0.125 60:0.14285714285714285 91:1.0 134:1.0 168:0.1111111111111111 240:1.0 268:1.0 728:1.0
12 1:0.5 5:0.02702702702702703 28:0.13636363636363635 29:1.0 68:1.0 165:1.0 471:1.0 919:1.0 1095:1.0
12 3:0.25 5:0.013513513513513514 16:1.0 17:1.0 18:0.4
12 25:1.0 31:1.0 69:0.3333333333333333 102:1.0 134:1.0
12 8:1.0 12:0.5 21:0.3333333333333333 28:0.045454545454545456 114:1.0 118:1.0 135:1.0 215:1.0 274:1.0 289:0.08333333333333333 1191:1.0
12 21:0.3333333333333333 70:1.0 167:0.14285714285714285 168:0.2222222222222222 186:1.0 322:1.0 336:1.0
12 12:0.5 21:0.6666666666666666 49:0.5 326:1.0 336:1.0 1446:1.0
12 5:0.02702702702702703 12:0.5 21:1.0 29:2.0 38:1.0 40:0.08333333333333333 82:1.0 85:1.0 123:1.0 152:1.0 167:0.14285714285714285 289:0.08333333333333333 1175:1.0
12 21:0.3333333333333333 23:1.0 31:1.0 215:2.0 299:1.0 1352:2.0
12 21:0.3333333333333333 28:0.045454545454545456 29:1.0 35:0.05263157894736842 38:1.0 72:1.0 105:1.0 999:1.0 1352:1.0
12 5:0.013513513513513514 12:0.5 23:1.0 29:1.0 31:1.0 116:0.2 289:0.08333333333333333 296:1.0 299:1.0 471:1.0 588:1.0 618:1.0
12 9:1.0 12:0.5 18:0.2 23:1.0 31:1.0 229:1.0 306:1.0 330:1.0 498:1.0
12 5:0.02702702702702703 8:1.0 9:1.0 21:0.3333333333333333 116:0.2 118:1.0
|
e0ec9cb8d7b7a1373f930042d37fab3d4e6480d9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1775/CH2/EX2.10/Chapter2_Example10.sce | a3d2400afd4a7dfdc7469ba0a193ffb3b9759ba0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,130 | sce | Chapter2_Example10.sce | //Chapter-2, Illustration 10, Page 66
//Title: Gas Power Cycles
//=============================================================================
clc
clear
//INPUT DATA
rv=20;//Compression ratio
P1=95;//Pressure at point 1 in kPa
T1=293;//Temperature at point 1 in K
T3=2200;//Temperature at point 3 in K
y=1.4;//Ratio of specific heats
R=287;//Universal gas constant in J/kg-K
Cp=1.005;//Specific heat at constant pressure in kJ/kg-K
//CALCULATIONS
P2=P1*(rv^y);//Pressure at point 2 in kPa
T2=T1*(rv^(y-1));//Temperature at point 2 in K
v2=(R*T2)/(P2*1000);//Specific volume at point 2 in (m^3)/kg
v3=v2*(T3/T2);//Specific volume at point 3 in (m^3)/kg
rc=v3/v2;//Cut-off ratio
nth=(1-(((rc^y)-1)/((rv^(y-1))*y*(rc-1))))*100;//Thermal efficiency
q23=Cp*(T3-T2);//Heat flow between points 2 and 3 in kJ/kg
wnet=(nth*q23)/100;//Net workdone in kJ/kg
MEP=wnet/(v2*(rv-1));//Mean effective pressure in kPa
//OUTPUT
mprintf('Thermal efficiency is %3.1f percent \n Mean effective pressure is %3.2f kPa',nth,MEP)
//==============================END OF PROGRAM=================================
|
ea31a7a9b95399930431fdde40ed88668e5d0f3a | 449d555969bfd7befe906877abab098c6e63a0e8 | /476/CH6/EX6.8/Example_6_8.sce | cfdd3b9f94d595dee2f7f50a585bc15e392a7d53 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,885 | sce | Example_6_8.sce | //A Textbook of Chemical Engineering Thermodynamics
//Chapter 6
//Thermodynamic Properties of Pure Fluids
//Example 8
clear;
clc;
//Given:
//Equation of state: P(V-B) = RT + (A*P^2)/T
Cp = 33.6; //mean specific heat at atmosheric pressure (J/mol K)
A = 1*10^-3; //m^3 K/(bar)mol
B = 8.0*10^-5; //m^3/mol
R = 8.314*10^-5; //ideal gas constant (m^3 (bar)/mol K)
//To calculate entropy change and mean heat capacity
//(a). The entropy change when the state of gas is changed from state 1 (4 bar, 300 K) to state 2 (12 bar, 400 K)
//The proposed changed is assumed to take place in 3 steps in series as illustrated in Fig. 6.4 (Page no. 206)
//Step 1: Process AC, isothermal at 300 K
//Step 2: Process CD, isobaric at 1 bar
//Step 3: Process DB, isothermal at 400 K
//(del_V/del_T)p = R/P - AP/T^2
//For step 1:
Po = 4; //pressure at A (bar)
P1 = 1; //pressure at C (bar)
T = 300; //temperature (K)
//del_S1 = intg[(del_V/del_T)pdP]
del_S1 = (R*log(Po/P1) - (A/T^2)*(Po^2-P1^2)/2)*10^5; //(J/mol K)
//For step 2:
T1 = 300; //temperature at C (K)
T2 = 400; //temperature at D (K)
del_S2 = Cp*log(T2/T1); //(J/mol K)
//For step 3:
P2 = 1; //pressure at D (bar)
P3 = 12; //pressure at B (bar)
T = 400; //temperature (K)
del_S3 = (R*log(P2/P3) - (A/T^2)*(P2^2-P3^2)/2)*10^5; //(J/mol K)
S = del_S1+del_S2+del_S3; //total entropy change
mprintf('(a). Total entropy change is %f J/mol K',S);
//(b). The mean heat capacity at 12 bar
//If the change is brouhgt along ACo and CoB
//For ACo
P1 = 4; //pressure at A (bar)
P2 = 12; //pressure at Co (bar)
T = 300; //temperature (K)
del_S1 = R*log(P1/P2) - (A/T^2)*(P1^2-P2^2)/2;
//For CoB
T2 = 400; //temperature at B (K)
T1 = 300; //temperature at Co (K)
del_S2 = S-del_S1;
Cpm = del_S2/(log(T2/T1));
mprintf('\n (b). The mean heat capacity at 12 bar is %f J/mol K',Cpm);
//end |
efb7ce7e1f9bcbc524df9165cf97597a490f23a4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /260/CH6/EX6.14/6_14.sce | 1af8f9ff7464054bcf14f06f2a3a6354d7ab34a7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 347 | sce | 6_14.sce | //Eg-6.14
//pg-304
clear
clc
//mean and standard deviation are given as
x=1.011;
s=.108;
n=500;
a=1;
d=(x-a)/(s/n^.5);
if d<=1.96 & d>=-1.96 then
disp("null hypothesis :Ho:u=1mm is accepted")
else
disp("the value of d lies outside range.Therefore we will reject HO at 0.05 level of significance")
end
|
28e2f5084c771b60170f4e35ef5515cf2bc39e90 | 725517259e3eea555ad0f79d421792c632bc4655 | /scripts/seuillage.sci | bb975b7815988cac47e9f559d85c3254eb86e3df | [] | no_license | Exia-epickiwi/exolife | 58b8a72aa397c5d3df8dc6f61730b3b2b217740e | b1bdb3ec2adb92c0fc8c546c9bd56a654523bd22 | refs/heads/master | 2020-05-25T14:05:45.795829 | 2017-03-20T09:26:15 | 2017-03-20T09:26:15 | 84,937,674 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 737 | sci | seuillage.sci | //A function to apply a "seuillage" filter
//imagesrc : The base matrix of the image
//seuil : The value of the seuil
function render=seuillage(imgsrc,seuil)
//Get the sizes of the image
[wd,he]=size(imgsrc);
//Create an empty render image
render=zeros(wd,he);
//For each line of the image
for i=1:he
//For each colum of the image (each pixel)
for j=1:wd
//Get the value of the pixel
pix = imgsrc(j,i);
//Choose which value to assign
if pix < seuil then
//Set to black
render(j,i) = 0;
else
//Set to white
render(j,i) = 255;
end
end
end
endfunction
|
0c40efa2da1a9c7d7761f8a1de2da223103b0abf | 449d555969bfd7befe906877abab098c6e63a0e8 | /2873/CH3/EX3.4/Ex3_4.sce | 0b78777ae1f5df3462b007c8f6a63245f200c8cd | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 485 | sce | Ex3_4.sce | // Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clear;
clc;
disp("Engineering Thermodynamics by Onkar Singh Chapter 3 Example 4")
v=0.78;//volume of cylinder in m^3
p=101.325;//atmospheric pressure in kPa
disp("total work done by the air at atmospheric pressure of 101.325 kPa")
disp("W=(pdv)cylinder+(pdv)air")
disp("0+p*(delta v)")
disp("work done by air(W)=-p*v in KJ")
W=-p*v
disp("so work done by surrounding on system =79.03 KJ")
|
bf42f1404fab967b5d57d895f43756d6ee628db1 | 4e9df66700bcf9688afe22df0009cdf4a17bc61f | /Scilab_Lab/examples/ex2-6.sci | 1013df87ca096964f29f6f125c13d4b884145988 | [] | no_license | vmebus/workspace | e18947a1f967e6a3a7dfbc5cce6f92380d8637fc | f251b8a8e6cec30a77c7ef7b4103c5ee6e6d1393 | refs/heads/master | 2021-01-09T21:53:45.183564 | 2015-10-03T06:42:23 | 2015-10-03T06:42:23 | 36,120,248 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 899 | sci | ex2-6.sci | exec t2f.sci
exec f2t.sci
L=32;
N=2^13;
M=N/L;
Rb=2;
Ts=1/Rb;
fs=L/Ts;
T=N/fs;
Bs=fs/2;
t=-T/2+[0:N-1]/fs;
f=-Bs+[0:N-1]/T;
EP1=zeros(1,N);
EP2=zeros(1,N);
EP3=zeros(1,N);
EP4=zeros(1,N);
EP5=zeros(1,N);
EP6=zeros(1,N);
EP7=zeros(1,N);
EP8=zeros(1,N);
for loop=1:1000
tmp1=zeros(L,M);
tmp2=zeros(L,M);
tmp3=zeros(L,M);
tmp4=zeros(L,M);
tmp5=zeros(L,M);
tmp6=zeros(L,M);
tmp7=zeros(L,M);
tmp8=zeros(L,M);
a=(rand(1,M)>0.5)+0;
b=sign(a-0.5);
L1=L*0.25;
tmp1([1:L1],:)=ones(L1,1)*a;
s1=tmp1(:)';
S1=t2f(s1,fs);
P1=abs(S1).^2/T;
EP1=EP1*(1-1/loop)+P1/loop;
tmp2([1:L1],:)=ones(L1,1)*b;
s2=tmp2(:)';
S2=t2f(s2,fs);
P2=abs(S2).^2/T;
EP2=EP2*(1-1/loop)+P2/loop;
end
xset("window",0)
plot(t,s1);
mtlb_axis([-6,+6,-1.5,1.5]);
xset("window",1)
plot(f,10*log(EP1+%eps));
xset("window",2)
plot(t,s2);
mtlb_axis([-6,+6,-1.5,1.5]);
xset("window",3)
plot(f,10*log(EP2+%eps)); |
75a63153589397fa7e1228db4679d954c6212e23 | f8bb2d5287f73944d0ae4a8ddb85a18b420ce288 | /Scilab/machine-sliding-mode/seigi/比例到達速(4画面).sce | dcac0df5e4a580e3c118eb346745139d524954bd | [] | no_license | nishizumi-lab/sample | 1a2eb3baf0139e9db99b0c515ac618eb2ed65ad2 | fcdf07eb6d5c9ad9c6f5ea539046c334afffe8d2 | refs/heads/master | 2023-08-22T15:52:04.998574 | 2023-08-20T04:09:08 | 2023-08-20T04:09:08 | 248,222,555 | 8 | 20 | null | 2023-02-02T09:03:50 | 2020-03-18T12:14:34 | C | UTF-8 | Scilab | false | false | 3,251 | sce | 比例到達速(4画面).sce | //------------------------------------------------
//■2013.12.14 秋山殿
// 比例到達則+対称化
//------------------------------------------------
//▼2自由度機械システムの定義
L=[1 0; 0 2]; //アクチュエータに加わる力を表す行列(正則行列)
//L=[1 3; 0 0]; //アクチュエータに加わる力を表す行列(正則でない正方行列)
m1=1; m2=1; //質量
k1=1; k2=2; //ばね定数
d1=1; d2=2; //減衰定数
M=[m1 0; 0 m2]; //
K = [k1 -k1; -k1 k1+k2];
D = [d1 -d1; -d1 d1+d2];
AF = [zeros(2,2) eye(2,2); -M*K -M*D];
BF = [zeros(2,2); L ];
//▼比例到達速のパラメータ
R=[6 0; 0 6];
Q=[0.5 0; 0 0.5];
//▼切換超平面Sの定義(設計済)
//S1=[4 0; 0 3]; //(対称1)
S1=[3 0; 0 4]; //(対称2)
//S1=[1 2; -3 6]; //(非対称1)
//S1=[2 2; -1 5]; //(非対称2)
S2=[eye(2,2)]
S = [S1 S2];
//▼マッチング条件を満たさない不確かさ
//D = [0.2 0.4;0.1 0.2;0.1 0.15;0.3 0.2]; //マッチングを満たさない
D = [zeros(2,2); L ]; //マッチングを満たす
F=[1 1 1 1;1 1 1 1];
dA=D*F
disp(dA)
AF=AF+dA //不確かさをAに加える
// 離散化システムの定義
h = 0.02; // サンプリング時間
cont = syslin('c',AF,BF,S);
disc = dscr(cont,h);
//▼状態変数の初期値
X=[5.5 7.0 8.5 10.0]';
// ▼コンソールでLG_d, LG_vが対称行列になっているか確認
F={L*inv(S*BF)*S*AF};
//F = L*pinv(L)*inv(S2)*(S*AF)
disp(F);
[A,B,Sd] = abcd(disc);
// ▼シミュレーション
lines(0)
for i = 1:250;
// 切換関数
sigma = S*X;
// 等価制御入力(通常)
U = -inv(S*BF)*{(S*AF*X)+Q*sign(sigma)+R*sigma};
// 等価制御入力(擬似逆行列)
//U = -pinv(L)*inv(S2)*{(S*AF*X)+Q*sign(sigma)+R*sigma};
dX =A*X+B*U;
// データの保存
Xh1(:,i) = X;
Uh1(:,i) = U; // 弄った
Sh1(:,i) = sigma;// 弄った
X = dX;
end
clf()
// ▼グラフの描画
tt =0:h:(i-1)*h;
//▼第1象限:制御入力
scf(0);
xset("wdim",850,600)
xset("thickness",2)
xset("font",1,4)
plot(tt,Uh1(1,:),tt,Uh1(2,:)),xgrid(2)
l=legend(["$u_1$";"$u_2$"],4);
l.font_size = 5;
xset("thickness",1)
xlabel('Time','fontsize',5,'fontname','Times')
ylabel('Control Input','fontsize',5,'fontname','Times')
//▼第2象限:状態変数
scf(1);
xset("wdim",850,600)
xset("thickness",2)
xset("font",1,4)
plot(tt,Xh1(1,:),tt,Xh1(2,:),tt,Xh1(3,:),tt,Xh1(4,:)),xgrid(2)
l=legend(["$x_1$";"$x_2$";"$x_3$";"$x_4$"],1);
l.font_size = 5;
xset("thickness",1)
xlabel('Time','fontsize',5,'fontname','Times')
ylabel('State Variable','fontsize',5,'fontname','Times')
//▼第3象限:切換関数
scf(2);
xset("wdim",850,600)
xset("thickness",2)
xset("font",1,4)
plot(tt,Sh1),xgrid(2)
l=legend(["$\sigma_1$";"$\sigma_2$"],1);
l.font_size = 5;
xset("thickness",1)
xlabel('Time','fontsize',5,'fontname','Times')
ylabel('Swiching Function','fontsize',5,'fontname','Times')
//▼第4象限:位相平面
scf(3);
xset("wdim",850,600)
xset("thickness",2)
xset("font",1,4)
plot(Xh1(1,:),Xh1(3,:),Xh1(2,:),Xh1(4,:)),xgrid(2)
l=legend(["$x_1, x_3$";"$x_2, x_4$"],2);
l.font_size = 5;
xset("thickness",1)
xlabel('$x_1, x_2$','fontsize',6,'fontname','Times')
ylabel('$x_3, x_4$','fontsize',6,'fontname','Times')
clear tt Uh1 Xh1 Sh1;
|
c8d687a6a5e8c437b48703db303fd7e948139103 | ebd6f68d47e192da7f81c528312358cfe8052c8d | /swig/Examples/test-suite/scilab/inctest_runme.sci | 5a8df7b8f5f8aaebaff229ce4896b479602ccd9d | [
"LicenseRef-scancode-swig",
"GPL-3.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-3.0-only",
"Apache-2.0"
] | permissive | inishchith/DeepSpeech | 965ad34d69eb4d150ddf996d30d02a1b29c97d25 | dcb7c716bc794d7690d96ed40179ed1996968a41 | refs/heads/master | 2021-01-16T16:16:05.282278 | 2020-05-19T08:00:33 | 2020-05-19T08:00:33 | 243,180,319 | 1 | 0 | Apache-2.0 | 2020-02-26T05:54:51 | 2020-02-26T05:54:50 | null | UTF-8 | Scilab | false | false | 442 | sci | inctest_runme.sci | exec("swigtest.start", -1);
try
a = new_A();
catch
printf("did not find A\ntherefore, I did not include ""testdir/subdir1/hello.i""\n");
swigtesterror();
end
try
b = new_B();
catch
printf("did not find B\ntherefore, I did not include ""testdir/subdir2/hello.i""\n");
swigtesterror();
end
if importtest1(5) <> 15 then swigtesterror(); end
if importtest2("black") <> "white" then swigtesterror(); end
exec("swigtest.quit", -1);
|
e974a951e9aa36e935d37941bac9e13c1f199c55 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3428/CH2/EX1.2.9/Ex1_2_9.sce | aafb94396312af874c90ce382d99755bfac8a76b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 451 | sce | Ex1_2_9.sce | //Section-1,Example-3,Page no.-AC.173
clc;
C=750
C_1=75
H=52
H_1=5.2
O=121
O_1=12.1
S=0
Net_O2=((32/12)*C)+((16/2)*H)-O
W_air=Net_O2*(100/23)*10^-3
disp(W_air,'Weight of air required(kg)')
W_air40=W_air*(140/100)
disp(W_air40,'Weight of air required when 40% excess air is supplied(kg)')
GCV=(1/100)*((8080*C_1)+(34500*(H_1-(O_1/8)))+(2240*S))
disp(GCV,'Gross calorific value(kCal/kg)')
NCV=GCV-(0.09*H_1*587)
disp(NCV,'Net calorific value(kCal/kg)')
|
e869f8f9eb9af26ee42e22aae14e59ddf5e5dfa2 | 9b046504c3b7683d3bfa294fe100408058e75aa3 | /Metodos/Clase3/Ejemplos/03_optimization/scilab/01_basic/02_parabolic_interpolation/prueba.sce | 8992c46448efce042740ecfa8de3dca24018789e | [] | no_license | DavidAlex99/Cursos | f15cb4f4fbb35a6eb62cbae0a9b51ea671f3ea8f | aee547ab09db7e535bea5a6d41ed6e455f8a9a89 | refs/heads/master | 2023-01-08T02:46:07.502656 | 2020-11-14T00:45:57 | 2020-11-14T00:45:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 559 | sce | prueba.sce | //************** Ejecucion metodo interpolacion parabolica **************
clear all; clc;
// Solucion del problema de optimizacion
function fx = funcion(x)
fx = (x^2)/10 - 2*sin(x);
endfunction
x1 = 0, x2 = 1, x3 = 4, niter = 5;
[x1, fx1, x2, fx2, x3, fx3, x4, fx4] = interpolacioncuadratica(funcion, x1, x2, x3, niter)
// Grafico de la solucion
x = 0:0.1:4;
fx=funcion(x)
plot(x,fx)
plot(x4,fx4,'marker','d')
xlabel('$t(independiente)$',"fontsize",5)
ylabel('$fx(dependiente)$',"fontsize",5)
title('$x\ vs\ fx$',"fontsize",5)
set(gca(),"grid",[1 1])
|
3259f67a026db9833e2518e8c0f3bd76db37a8d0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3876/CH13/EX13.10/Ex13_10.sce | dd9d949789bc2e0c6df0d4dd1b11f625125b439d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 288 | sce | Ex13_10.sce | //Chapter 13 Thermodynamics Entropy and Free Energy
clc;
clear;
//Initialisation of Variables
F= 18430 //cal
F1= -31350 //cal
F2= 26224 //cal
R= 1.99 //cal/mole K
T= 25 //C
//CALCULATIONS
F3= F+F1+F2
Ksp= 10**(-F3/(R*(273+T)*2.303))
//RESULTS
mprintf("Solubility product = %.2e",Ksp)
|
53993d7caf569037bcda69d6a1b49e95f2f9c857 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2168/CH25/EX25.2/Chapter25_example2.sce | e134924c9f1f0cf4da33d931e0029e2d30b64bce | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 885 | sce | Chapter25_example2.sce | clc
clear
//Input data
p=4//Pressure ratio
T3=1000//Turbine inlet temperature in K
T1=15+273//Inlet temperature in K
p1=1//Inlet pressure in kg/cm^2
m=11//Mass flow rate of air in kg/s
Cp=0.24//Specific heat at constant pressure in kJ/kg.K
R=29.27//haracteristic gas constant in kg.m/kg.K
g=1.4//Ratio of specific heats
//Calculations
Pc=(m*R*T1*(p^((g-1)/g)-1))/75//Power consumed by the compressor in H.P
Pt=(m*R*T3*(1-(1/p)^((g-1)/g)))/75//Power consumed by the turbine in H.P
N=(Pt-Pc)//Net output of the plant in H.P. In textbook answer is given wrong
T2=(T1*(p)^((g-1)/g))//Temperature at the end of compression in K
q=(Cp*(T3-T2))//Heat supplied in kcal/kg of air
n=(((N*4500)/427)/(q*m*60))*100//Overall efficiency of the plant in percent
//Output
printf('Horse power developed is %3.0f H.P \n The overall efficiency of the plant is %3.2f percent',N,n)
|
aaa0b5732bae3956ebf8046ce413032ad35f1c71 | 8ea401b354e99fe129b2961e8ee6f780dedb12bd | /macros/categorical.sci | c5a850c83c2f65cfd8248ac0aea21b95762e3baa | [
"BSD-2-Clause"
] | permissive | adityadhinavahi/SciPandas | 91340ca30e7b4a0d76102a6622c97733a28923eb | b78b7571652acf527f877d9f1ce18115f327fa18 | refs/heads/master | 2022-12-20T04:04:35.984747 | 2020-08-19T16:10:51 | 2020-08-19T16:10:51 | 288,765,541 | 0 | 1 | null | 2020-08-19T15:35:04 | 2020-08-19T15:14:46 | Python | UTF-8 | Scilab | false | false | 641 | sci | categorical.sci | function [df] = Categorical()
// Calls and initializes Categorical function
//
// Syntax
// df = Categorical()
//
// Parameters
//df: Categorical input
//
// Description
//Categoricals can only take on only a limited, and usually fixed, number of possible values (categories). In contrast to statistical categorical variables, a Categorical might have an order, but numerical operations (additions, divisions, …) are not possible.
// Examples
// //Constructing Categorical from a dictionary.
//df = pd_f.Categorical("+c_str+")
// Authors
// Aditya Dhinavahi
// Sundeep Akella
endfunction |
9403d187be718740059be763d9adc060985654cd | 717ddeb7e700373742c617a95e25a2376565112c | /40/CH8/EX8.9d/Exa_8_9d.sce | 2d5d4b294ed32320b8d28ae03dec5c9c17eb915d | [] | 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 | 354 | sce | Exa_8_9d.sce | //DFT and DFS of sinusoids
n2=0:1/2400:23/240;
xt=1+4*sin(120*%pi*n2')+4*sin(40*%pi*n2');
n=0:1/240:23/240;//F=9/32 hence N=32
xn=1+4*sin(120*%pi*n')+4*sin(40*%pi*n');
XDFT=abs(dft(xn,-1));
n1=0:23;
a=gca();
a.x_location="origin";
plot2d(n2,xt);
plot2d3('gnn',n,xn);
xset('window',1);
b=gca();
b.x_location="origin";
plot2d3('gnn',n1,XDFT); |
3b9b751207ffff850a85f89386e94df8585cc52f | 449d555969bfd7befe906877abab098c6e63a0e8 | /2855/CH2/EX2.7/Ex2_7.sce | 51e4b67ef3819243091d1bc25e65cc99d60b201a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 297 | sce | Ex2_7.sce | //Chapter 2
//page no 56
//given
clc;
clear ;
Is=100; //in nAmp
Ts=100; //in Kelvin
I_s=Is*10^-9*2^(Ts/10); //I_s will be in nm
printf("\n I(100 deg Cel) is %0.2f microA \n",I_s*10^6); //converted to microA from nm
// wrong calculation in the book
|
1d5c463db69cf80b6ce4fa5730a1bcb7fa500df8 | a62e0da056102916ac0fe63d8475e3c4114f86b1 | /set14/s_Material_Science_In_Engineering_Dr._K._M._Gupta_1367.zip/Material_Science_In_Engineering_Dr._K._M._Gupta_1367/CH5/EX5.9/5_9.sce | c796d4c8ef78e7393034db27dd617ca905ef4ef0 | [] | 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 | 368 | sce | 5_9.sce | errcatch(-1,"stop");mode(2);//Find Glancing angle and lattice parameter
//Ex:5.9
;
;
a=17.03;//in degrees
w=0.71;//in angstorm
n=1;
d=n*w/(2*sind(a));//interplanar spacing in angstorm
disp(d,"Interplanar Spacing (in angstorm) = ");
// given that h^2+k^2+l^2=8
a=sqrt(8)*d;//in angstorm
disp(a,"Lattice parameter of the crystal (in Angstorm) = ");
exit();
|
d0fcfadd7a97479d1200d43883619a810536e8eb | 449d555969bfd7befe906877abab098c6e63a0e8 | /45/CH15/EX15.11/example_15_11.sce | 038a563d3630abfdadba4d9025ba7ca9614749a7 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 356 | sce | example_15_11.sce | // example 15.11
clc;
clear;
disp('The full scale count for ADC3511 is 1999 and for the ADC3711 is 3999. So, the largest value possible for the MSD in either case is 3 = 0011. clearly the MSB is not needed for th magnitue of the MSD. It is thus convenient to specif positive number when this bit is a 0 and a negtive number when this bit is a 1 .');
|
975a15ad33f49608381e4ad39ce7c42e70fb1412 | 449d555969bfd7befe906877abab098c6e63a0e8 | /608/CH19/EX19.13/19_13.sce | dc2b38b31a17c3ae11aecceb71c32df33a00aa6b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 955 | sce | 19_13.sce | //Problem 19.13: A 400 V, 3-phase star connected alternator supplies a delta-connected load, each phase of which has a resistance of 30 ohm
and inductive reactance 40
ohm. Calculate (a) the current supplied by the alternator and (b) the output power and the kVA of the alternator, neglecting losses in the line between the alternator and load.
//initializing the variables:
R = 30; // in ohms
XL = 40; // in ohms
VL = 400; // in Volts
//calculation:
Zp = (R*R + XL*XL)^0.5
//a delta-connected load
Vp = VL
//Phase current
Ip = Vp/Zp
IL = Ip*(3^0.5)
//Alternator output power is equal to the power dissipated by the load.
//Power P = VL*IL*(3^0.5)*cos(phi) or P = 3*Ip*Ip*Rp)
pf = R/Zp
P = VL*IL*(3^0.5)*pf
//Alternator output kVA,
S = VL*IL*(3^0.5)
printf("\n\n Result \n\n")
printf("\n (a)the current supplied by the alternator is %.2f A",IL)
printf("\n (b)output power is %.2E W and kVA of the alternator is %.2E kVA",P, S) |
45e9ce67dcfb431c2d6d9971da119744d1cd5290 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3772/CH1/EX1.12/Ex1_12.sce | 594cdc7d393e77855d446e9722212079d3fc9c05 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 353 | sce | Ex1_12.sce | // Problem no 1.12,Page no.16
clc;clear;
close;
//Right Circular Cyclinder
//m_1=(16*%pi*h*rho_1) //gm
//y_1=4+h*2**-1 //cm
//Hemisphere
//m_2=256*%pi*rho_1 //gm
y_2=2.5 //cm
Y_bar=4 //cm
r=4 //cm
//Calculation
//Y_bar=(m_1*y_1+m_2*y_2)*(m_1+m_2)**-1 //cm //Centroid
h=(402.114*25.132**-1)**0.5
//Result
printf("The value of h is %.2f cm",h)
|
046c8fab3d00b47a471e6a4e6fee109a06f0a0e2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3720/CH5/EX5.5/Ex5_5.sce | 0d23a597e0e0e9df56ea5cf5599240d53f668157 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 268 | sce | Ex5_5.sce | // Example 5_5
clc;clear;
// given values
P_gage=400;// kPa
rho=1000;// the density of water in kg/m^3
g=9.81;// the accleration due to gravity in m/s^2
// Calculation
z_2=P_gage*1000/(rho*g);// m
printf('The water jet can rise as high,z_2=%0.1f m\n',z_2);
|
000a8bf303201ba11f3ddc274f80fcb6370f1365 | 3dfff09f17e07f8d7d6d1d2a498d4914da3373d6 | /FuzzyLogic02.sce | 4f24ddce851bdb9f72bda0fc6f268e792912db4b | [
"MIT"
] | permissive | edenlandpl/steps-to-fuzzy-logic | e354e2974366ffcf8a2aefc54c8fb0264d107705 | 9b4d114b53fc38a5989f29cc888ff7ed075ba47e | refs/heads/master | 2022-01-20T00:51:24.230407 | 2019-07-21T10:57:14 | 2019-07-21T10:57:14 | 198,045,289 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 880 | sce | FuzzyLogic02.sce | //step = 0.5;
ZX = zeros(4,101);
ZY = zeros(4,101);
for i = 1: 101
x = (i-1);
ZY(1,i) = x;
//////////////////////////////////////////////////
if x < 50
//ZY(2,i) = 1;
ZY(2,i) = (50- x)/(50-0);
else
ZY(2,i) = 0;
end
///////////////////////////////////////////////
if x >= 20 & x <= 60
ZY(3,i) = (x-20)/(60-20);
elseif x >= 60 & x <= 80
ZY(3,i) = (80-x)/(80-60);
else
ZY(3,i) = 0;
end
///////////////////////////////////////////////
if x >= 60 & x <= 100
ZY(4,i) = (x-60)/(100-60);
else
ZY(4,i) = 0;
end
/////////////////////////////////////////////////
end
// Rysowanie wykresu
subplot(2,2,2);
plot(ZY(1,:),ZY(2,:),'r');
plot(ZY(1,:),ZY(3,:),'b');
plot(ZY(1,:),ZY(4,:),'g');
mtlb_axis([ 100 0 1.2]);
|
738e18d33ff986480f70ed87730182f8cd414f06 | 449d555969bfd7befe906877abab098c6e63a0e8 | /24/CH36/EX36.2/Example36_2.sce | 63cdfe549a3b4bc85378515f7d46fef3507d742d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 239 | sce | Example36_2.sce | //Given that
l = 546*10^-9 //in meter
d = 12*10^-5 //in meter
D = 55*10^-2 //in meter
//Sample Problem 36-2
printf("**Sample Problem 36-2**\n")
beeta = l*D/d
printf("The difference between two adjacent maxima is %1.2em", beeta) |
3ccf81d3f4b192fbb6199e46bc2119684291135e | 449d555969bfd7befe906877abab098c6e63a0e8 | /122/CH8/EX8.a.5/exaA_8_5.sce | 8991af9397c61edcbfe21aea7639a8abb433103f | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 805 | sce | exaA_8_5.sce | // Example A-8-5
// PID design
clear; clc;
xdel(winsid()); //close all windows
mode(0);
// please edit the path
// cd "";
// exec("plotresp.sci");
// exec("stepch.sci");
s = %s;
zeta = 0.5 // dominant pole charecteristics
wn = 4
sigma = zeta*wn;
ts = 4 /(zeta*wn);
disp(ts,'settling time approximate (ts) =');
D = (s + 10) * (s^2 + 2*zeta*wn*s + wn^2);
cf = coeff(D);
K = cf(1)
a_plus_b = (cf(2) - 9) / K
ab = (cf(3) - 3.6) / K
Gc = K * (ab * s^2 + a_plus_b *s+ 1) / s
CbyD = syslin('c',s,D)
CbyR = syslin('c',numer(Gc),D)
t = 0:0.05:5;
u = ones(1,length(t));
plotresp(u,t,CbyD,'Response to step disturbance input');
a = gca(); a.data_bounds = [0 ,-4D-3; 5 ,14D-3];
scf();
[Mp ,tp ,tr ,ts] = stepch(CbyR,0,5,0.05,0.02);
disp(Mp,'Max overshoot =');
disp(ts,'settling time actual (ts) =');
|
a7c932874ee4b5cc3271760ae7fa32dc4d49f2f6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3665/CH6/EX6.5/Ex6_5.sce | 7e141dcc86c97026cd0f13a028653cbd033f4d5e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 289 | sce | Ex6_5.sce | clc//
//
//
//Variable declaration
deltax=0.2*10^-10; //distance(m)
h=6.626*10^-34; //planck's constant
//Calculation
deltap=h/(2*%pi*deltax); //uncertainity in momentum(kg m/s)
//Result
printf("\n uncertainity in momentum is %0.2f *10^-24 kg m/s",deltap*10^24)
|
af2e13fe9afe139a2c3c11d6bf7c9ca8ecf40503 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3511/CH5/EX5.4/Ex5_4.sce | 72a2e5d2636d51c2cb827dbdb242e6d83abd0896 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 868 | sce | Ex5_4.sce | clc;
T1=300; // Inlet air temperature to the compressor in kelvin
p1=1; // pressure at state 1 in bar
T2=475; // Temperature at discharge in kelvin
p2=5;// Pressure at state 2
T5=655; // Temperature after heat exchanger in kelvin
T3=870+273; // Temperature at he turbine inlet in kelvin
T4=450+273; // Temperature after turbine in kelvin
Cp=1.005; // Specific heat at constant pressure in kJ/kg K
r=1.4; // Specific heat ratio
R=287; // Characteristic gas constant in J/kg K
Wc=Cp*(T2-T1); // Work done during compression
WT=Cp*(T3-T4); // Work done during expansion
WN=WT-Wc; // Net work done
q=Cp*(T3-T5); // Heat supplied
eff=WN/q; // Efficiency of a cycle
disp ("kJ/kg",WN,"(i). The output per kg of air = ");
disp ("%",eff*100,"(ii).The efficiency of the cycle = ");
disp ("kJ/kg",Wc,"(iii). The work required to drive the compressor = ");
|
0380445e67ff93007513440186d148470c407aee | 449d555969bfd7befe906877abab098c6e63a0e8 | /2744/CH13/EX13.7/Ex13_7.sce | cc05c2c7aba0fffda20139933dfeb87c30275de5 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 698 | sce | Ex13_7.sce | clear;
clc;
l = 12;//feet
w = 150;// lb per sq.foot
//Live load
LL = w*l;//lb-wt
//Dead Load assuming the slab thickness to be 6 inches
t = 6;//inches
DL = t*l*12;//lb-wt
//total load
W = LL+DL;//lb-wt
M = W*l*12/10;//lb-inches
d = sqrt(M/(12*126));
printf('d = %.3f inches',d);
//With about an inch to cover the slab will be 6 inch thick
A_t = 0.8*l*d/100;// in^2
//using 1/2 inch rods
d1 = 1/2;//inches
A1 = 0.25*%pi*(d1)^2;//in^2
r1 = A1*l/A_t;//inches
printf('\n Per foot width of slab, A_t = %.4f in^2',A_t);
printf('\n Using %.2f inch rods, spacing centre to centre will be %.3f inches',d1,r1);
//there are minute calculation errors in the answer given in textbook.
|
036bd96b795c42923b24310955c64af1acf2ebcb | 449d555969bfd7befe906877abab098c6e63a0e8 | /812/CH12/EX12.05/12_05.sce | 22d125b1b683544a0b489f1b66fbded6b3a2174c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 438 | sce | 12_05.sce | //number and flow//
pathname=get_absolute_file_path('12.05.sce')
filename=pathname+filesep()+'12.05-data.sci'
exec(filename)
//Mach number at the exit:
Me=sqrt(((p0/pe)^((k-1)/k)-1)*2/(k-1))
//Temperature at exit(in K):
Te=T0/(1+(k-1)/2*Me^2)
//Mass flow rate(in kg/s):
m=pe*1000*Me*sqrt(k/R/Te)*Ae
printf("\n\nRESULTS\n\n")
printf("\n\nMach number at the exit: %.3f \n\n",Me)
printf("\n\nMass flow rate: %.3f kg/sec\n\n",m)
|
85b22360c4936a3a97c2210108fabf3cd62e6f55 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3472/CH14/EX14.10/Example14_10.sce | c16e707c4ddbde03898719a1c6a84b8738cdd88e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,138 | sce | Example14_10.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 7: UNDERGROUND CABLES
// EXAMPLE : 7.10 :
// Page number 215-216
clear ; clc ; close ; // Clear the work space and console
// Given data
e_1 = 3.6 // Inner relative permittivity
e_2 = 2.5 // Outer relative permittivity
d = 1.0 // Conductor diameter(cm)
d_1 = 3.0 // Sheath diameter(cm)
D = 5.0 // Overall diameter(cm)
V_l = 66.0 // Line Voltage(kV)
// Calculations
V = V_l/3**0.5*2**0.5 // Peak voltage on core(kV)
g1_max = 2*V/(d*(log(d_1/d)+e_1/e_2*log(D/d_1))) // Maximum stress in first dielectric(kV/km)
g_max = 2*V/(d_1*(e_2/e_1*log(d_1/d)+log(D/d_1))) // Maximum stress in second dielectric(kV/km)
// Results
disp("PART II - EXAMPLE : 7.10 : SOLUTION :-")
printf("\nMaximum stress in first dielectric, g_1_max = %.2f kV/cm", g1_max)
printf("\nMaximum stress in second dielectric, g_max = %.2f kV/cm", g_max)
|
83ca93d8b6d88bdf09d025efce409dcba91048d1 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.4/Unix-Windows/scilab-2.4/macros/util/x_choices.sci | babeef92ecad2f64538f8607f0ca34ff8716e5ba | [
"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 | 1,664 | sci | x_choices.sci | function [rep]=x_choices(title,choices_l)
// Copyright INRIA
[lhs,rhs]=argn(0)
if rhs<=0 then s_mat=['l1=list(''choice 1'',1,[''toggle c1'',''toggle c2'',''toggle c3'']);';
'l2=list(''choice 2'',2,[''toggle d1'',''toggle d2'',''toggle d3'']);';
'l3=list(''choice 3'',3,[''toggle e1'',''toggle e2'']);';
'rep=x_choices(''Toggle Menu'',list(l1,l2,l3));'];
write(%io(2),s_mat);execstr(s_mat);
return;end;
if typeof(title)<>'string' then
write(%io(2),'x_choices first argument is not character string')
return
end
if typeof(choices_l)<>'list' then
write(%io(2),'x_choices argument is not a list')
return
end
n=size(choices_l)
items=['void']
defv=[]
for i=1:n, l_ch=choices_l(i);
if typeof(l_ch)<>'list' then
write(%io(2),'x_choices(t,x): x('+string(i)+') is not a list');
return
end
if typeof(l_ch(1))<>'string' then
write(%io(2),'x_choices(t,x): x('+string(i)+')(1) is not a string');
return
end
items= [items, l_ch(1)];
if typeof(l_ch(3))<>'string' then
write(%io(2),'x_choices(t,x): x('+string(i)+')(3) is not vector of strings');
return
end
[xxxl,xxxc]=size(l_ch(3));
if xxxl<>1 then
write(%io(2),'x_choices(t,x): x('+string(i)+')(3) must be a row vector of strings');
return
end
items= [items, l_ch(3)];
if typeof(l_ch(2))<>'constant' then
write(%io(2),'x_choices(t,x): x('+string(i)+')(2) is not of type int');
return
end
if prod(size(l_ch(2)))<>1 then
write(%io(2),'x_choices(t,x): x('+string(i)+')(2) must be an integer');
return
end
defv=[defv,l_ch(2)];
if n<>i then items=[items,"[--sep--]"];end
end
items=items(2:prod(size(items)))
rep=xchoicesi(defv,title,items)
|
ff7b6a36f3196fe52440e86c1159eeb8ed68af1c | 449d555969bfd7befe906877abab098c6e63a0e8 | /2939/CH5/EX5.15/Ex5_15.sce | ebda9ae5e87351d778d6e2fab2b1e8b80d7886fe | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 458 | sce | Ex5_15.sce |
// Ex5_15
clc;
// Given:
r0=1.4*10^-15;// in m
A1=88;
A2=87;
A3=136;
A4=135;
// Solution:
rSr1=(3.14*(r0*(A1)^(0.33333))^2)/10^-28;// in barns
rSr2=(3.14*(r0*(A2)^(0.33333))^2)/10^-28;// in barns
rXe1=(3.14*(r0*(A3)^(0.33333))^2)/10^-28;// in barns
rXe2=(3.14*(r0*(A4)^(0.33333))^2)/10^-28;// in barns
printf("The geometric cross-section area are %f, %f, %f & %f for Sr(88), Sr(87), Xe(136) & Xe(135) respectively",rSr1,rSr2,rXe1,rXe2)
|
20726ad13a1d9ac635b2a661b1d19cfd325cf7e4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3281/CH1/EX1.18/ex1_18.sce | 15c03ba5573c54383998b52014ea2bb3c8793536 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 287 | sce | ex1_18.sce | //Page Number: 43
//Example 1.18
clc;
//Given
er=2.2;
n0=377;//ohm
n2=n0/sqrt(er);//ohm
n1=377;//ohm
//Reflection coefficient
t=(n2-n1)/(n2+n1);
disp(t,'Reflection coefficient:');
//Vswr
//Taking mod of reflection coefficient
t1=-t;
p=(1+t1)/(1-t1);
disp(p,'VSWR:');
|
f07ab2db25e3eb83937a7606bd59f534938a889a | 449d555969bfd7befe906877abab098c6e63a0e8 | /243/CH10/EX10.1/10_01.sce | 671b565679c680a75d79a9f26587ca628b297287 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 285 | sce | 10_01.sce | //Example No. 10_01
//Fitting a Straight Line
//Pg No. 326
clear ;close ;clc ;
x = poly(0,'x')
X = 1:5
Y = [ 3 4 5 6 8 ];
n = length(X);
b = ( n*sum(X.*Y) - sum(X)*sum(Y) )/( n*sum(X.*X) - (sum(X))^2 )
a = sum(Y)/n - b*sum(X)/n
disp(b,'b = ')
disp(a,'a = ')
y = a + b*x
|
3b23c247c6752cd4741eab01e6b66a755798ee81 | 891e9f4e3fce67f553f07f24cef2e802423770b9 | /fminimax/fminimaxDemo/fminimaxCheckvector.dem.sce | 932955694b8031744aa67f0103e7a7d3d12ee147 | [] | no_license | animeshbaranawal/FOSSEE | ae6b6c1a39803ad0fb26780b7f960a62431c71d2 | 75b1b18dcfd935f7ebbe89b44573c8076dae4267 | refs/heads/master | 2022-06-24T14:20:49.508846 | 2022-05-30T17:13:09 | 2022-05-30T17:13:09 | 50,281,099 | 1 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 594 | sce | fminimaxCheckvector.dem.sce | mode(1)
//
// Demo of fminimaxCheckvector.sci
//
// The function takes a vector of 3 doubles.
function y = myfunction ( x )
fminimaxCheckvector ( "myfunction" , x , "x" , 1 , 3 )
y = x
endfunction
// Calling sequences which work
y = myfunction ( ones(1,3) )
y = myfunction ( zeros(3,1) )
// Calling sequences which generate an error
// The following are not vectors
y = myfunction ( ones(2,3) )
y = myfunction ( zeros(3,2) )
// The following have the wrong number of entries
y = myfunction ( ones(1,3) )
halt() // Press return to continue
//========= E N D === O F === D E M O =========//
|
6c7d8da80044f3d00d0558b98db1f876326669c9 | 99b4e2e61348ee847a78faf6eee6d345fde36028 | /Toolbox Test/gaussdesign/gaussedesign9.sce | 5f4357c4a4e0225211263ce4b26692dc997ac1ff | [] | no_license | deecube/fosseetesting | ce66f691121021fa2f3474497397cded9d57658c | e353f1c03b0c0ef43abf44873e5e477b6adb6c7e | refs/heads/master | 2021-01-20T11:34:43.535019 | 2016-09-27T05:12:48 | 2016-09-27T05:12:48 | 59,456,386 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 240 | sce | gaussedesign9.sce | bt =- 0.3;
span = 4;
sps = 'a';
h = gaussdesign();
//output
//!--error 10000
//Not enough input arguments
//at line 3 of function checkNArgin called by :
//at line 16 of function gaussdesign called by :
//h = gaussdesign();
|
342eb027e5368b2d518b937c65f4fb548c613031 | 491f29501fa7d484a5860f64aef3fa89fb18ca3d | /.sandbox/robotics/HuMAns_pa10/RobotSim/pa10Test.sce | 1f210a28215cb456623d18eeb46df5505f8d34ac | [
"Apache-2.0"
] | permissive | siconos/siconos-tutorials | e7e6ffbaaea49add49eddd317c46760393e3ef9a | 0472c74e27090c76361d0b59283625ea88f80f4b | refs/heads/master | 2023-06-10T16:43:13.060120 | 2023-06-01T07:21:25 | 2023-06-01T07:21:25 | 152,255,663 | 7 | 2 | Apache-2.0 | 2021-04-08T12:00:39 | 2018-10-09T13:26:39 | Jupyter Notebook | ISO-8859-1 | Scilab | false | false | 781 | sce | pa10Test.sce | global GLOBAL_U;
global GLOBAL_DT;
global GLOBAL_HIST;
getf 'lib/modules.sci'
getf 'lib/simulation.sci'
getf 'lib/plot.sci'
getf 'lib/pa10/modele.sci'
getf 'pa10Control.sci'
getf 'pa10Jac.sci'
getf 'pa10Plot.sci'
pa10ModelInit();
// Test du modèle cinématique
function []= kinTest(q,i)
M1=pa10Kin(q);
M2 = pa10Tags(q);
printf("%f , %f \n",M1(i)(1,4),M2(i));
printf("%f , %f \n",M1(i)(2,4),M2(i+8));
printf("%f , %f \n",M1(i)(3,4),M2(i+16));
endfunction
q0=[0,0,0,0,0,0,0];
kinTest(q0,7);
q0=[%pi/2,0,0,0,0,0,0];
kinTest(q0,7);
q0=[0,%pi/2,0,0,0,0,0];
kinTest(q0,7);
q0=[0,0,%pi/2,0,0,0,0];
kinTest(q0,7);
q0=[0,0,0,%pi/2,0,0,0];
kinTest(q0,7);
q0=[0,0,0,0,%pi/2,0,0];
kinTest(q0,7);
q0=[0,0,0,0,0,%pi/2,0];
kinTest(q0,7);
q0=[0,0,0,0,0,0,%pi/2];
kinTest(q0,7);
|
65708dd984c35ed27973ea9f9b23ebecf8306def | 449d555969bfd7befe906877abab098c6e63a0e8 | /1499/CH3/EX3.26/q26.sce | 1e83aa4b246719b46bbeb93a3686dd00dc9f891b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 102 | sce | q26.sce | s=%s;
syms k;
num=k*(s+0.5);
den=(s^2)*(s+4.5);
t=syslin('c',num,den);
clf;
evans(t)
xgrid;
|
2019d976a3ab7abaeabd3005046965f7ed3daebb | 449d555969bfd7befe906877abab098c6e63a0e8 | /662/CH4/EX4.21/ex4_21.sce | 05ae3e6c91eb537d9e6c2ed25e27a978b06e4bcc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 234 | sce | ex4_21.sce | //Example 4.21
//use of the minimum field width feature using g-type conversion
i = 12345;
x = 345.678;
printf("%3d %5d %8d\n\n", i, i, i);
printf("%3g %10g %13g\n\n", x, x, x);
printf("%3g %13g %16g", x, x, x); |
175848dde7197e4b5ff06fc1439eb397be21029b | 3daf46b810f462d6c8e936bef696ade9bd2e41a8 | /AulaPratica3/Potencia_deslocada_inversa_Ray.sce | c71177611cf2c83ae311d9de31ac9d3ae36fb3f9 | [] | no_license | JPMarciano/Algebra-Linear-Numerica | 4575a2bd95a4b056100a7d8adaaeb2a0a0fee2d4 | 6d2c8555650b5f8a156f3d1c207c77f6986b8fcd | refs/heads/master | 2021-03-12T14:27:28.360160 | 2020-05-11T14:59:05 | 2020-05-11T14:59:05 | 246,628,921 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 434 | sce | Potencia_deslocada_inversa_Ray.sce | function [lambda,x1,k,n_erro] = Potencia_deslocada_inversa_Ray(A,x0,epsilon,alfa,M)
k=1;
x0=x0/norm(x0, 2);
[n,m] = size(A);
while(k<=M)
[x1, C] = Gaussian_Elimination_4( A - lambda*eye((n,n)), x0);
x1 = x1/norm(x1, 2);
lambda = (x1')*A*x1; // Quociente de Rayleigh; x1 é unitário
n_erro = norm(abs(x1) - abs(x0), 2);
if (n_erro < epsilon)
break;
end
x0 = x1;
k = k + 1;
end
endfunction
|
bbc6c43a813355bbcfa12155e078fa0764620c6b | 449d555969bfd7befe906877abab098c6e63a0e8 | /413/CH2/EX2.5/LU_Decomposition.sce | 11afb1bc633f28931239f18baf61ca8d516332ce | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 209 | sce | LU_Decomposition.sce | //LU Decomposition
clearglobal()
clc;
A=[0 2 0 1 0; 2 2 3 2 -2; 4 -3 0 1 -7; 6 1 -6 -5 6]
[L, U, P]=lu(A)
printf('Matrix is')
disp(A)
printf('L=')
disp(L)
printf('U=')
disp(U)
printf('P=')
disp(P) |
e5dac3804d7b1fa5afaab56be97b0ef74f4d78de | 449d555969bfd7befe906877abab098c6e63a0e8 | /3014/CH1/EX1.18/Ex1_18.sce | e51069e67d172f63f7e7c221b90f27c66969cda9 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 340 | sce | Ex1_18.sce |
clc
//Given that
E = 1 // Energy of neutron in eV
m = 1.67e-27 // Mass of neutron in Kg
h = 6.62e-34 // Plank constant
printf("Example 1.18")
lambda = h/sqrt(2*m*E*1.6e-19) // Calculation of velocity of moving electron
printf("\n Wavelength of electron is %f angstrom.\n\n\n",lambda*1e10)
// Answer in book is 6.62e-22 angstrom
|
b2bc774549ddab4bcbce0dbbe4361126372511e2 | cd3baacb9aa523e8ac4f10406c5fb62c9c60998a | /gate/MyMux.tst | b8bfb0539b30270598302df45c75b7906a5d60d5 | [] | no_license | wangkekekexili/cuddly-octo-pancake | f8bbebc043417af9662712de610b390f062545f8 | 67b3d4c3d15c5877644221b6d987dd911101d013 | refs/heads/master | 2023-03-06T12:49:54.668374 | 2021-02-14T14:53:07 | 2021-02-14T14:53:07 | 338,038,595 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 436 | tst | MyMux.tst | load MyMux.hdl,
output-file MyMux.out,
output-list a%B3.1.3 b%B3.1.3 sel%B3.1.3 out%B3.1.3;
set a 0, set b 0, set sel 0, eval, output;
set a 1, set b 0, set sel 0, eval, output;
set a 1, set b 1, set sel 0, eval, output;
set a 0, set b 1, set sel 0, eval, output;
set a 0, set b 0, set sel 1, eval, output;
set a 1, set b 0, set sel 1, eval, output;
set a 1, set b 1, set sel 1, eval, output;
set a 0, set b 1, set sel 1, eval, output;
|
5885dba4505e29cb8c19b3eb79816fd8c7d973ba | 449d555969bfd7befe906877abab098c6e63a0e8 | /3828/CH9/EX9.1/Ex9_1.sce | 98df923035bde0802785fe41a31facd929d5ab17 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 294 | sce | Ex9_1.sce | //Chapter 9 : Electromagnetic Theory
clear;
//Variable declaration
P=60 //Power
r=2 //distance from source
epsilon0=8.85*10**-12
C=3*10**2
//Calculations
E0=sqrt((P*2)/(4*%pi*r**2*C*epsilon0))/1000
//Result
mprintf("Amplitude of field E= %.0f V/m",E0)
|
9569e300842a498eb32a81548a31b1b50df1ef13 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3830/CH7/EX7.14/Ex7_14.sce | 5c065b80160223e54c0e1be2544d2972ce65846c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 300 | sce | Ex7_14.sce | // Exa 7.14
clc;
clear;
// Given
// An LVDT
vo = 2.6; // Output voltage(volts) of LVDT
d = 0.4; // displacement in mm
// Solution
printf(' The sensitivity s = RMS value of output voltage/Displacement \n');
S = vo/d; // sensitivity
printf(' Therefore, s = %.1f V/mm \n',S);
|
9c6c43bf43be07cd88c579153cc473ee6cf673c0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1871/CH7/EX7.4/Ch07Ex4.sce | c8e138f27a7b4e51065aa6941adf3e19b38ebbc3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | Ch07Ex4.sce | // Scilab code Ex7.4: Pg:288 (2008)
clc;clear;
f0 = 8e+06; // Cyclotron frequency, c/s
c = 3e+010; // Speed of light, cm/s
m = 1.67e-024; // Mass of proton, gm
q = 4.8e-010/c; // Charge on a proton, esu
// Since the cyclotron frequency is given by fo = q*B/2*%pi*m. On solving it for B, we have
B = 2*%pi*m*f0/q; // Magnetic field, Weber per meter square
printf("\nThe magnetic field to accelerate protons = %5.3f Wb per Sq. m", B/1e+04);
// Result
// The magnetic field to accelerate protons = 0.525 Wb per Sq. m |
c5590e35f018329f632c45d148c8690bceb9c100 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1859/CH7/EX7.13/exa_7_13.sce | 2a2189b685c3307892b508083b0a2df18ca35e79 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 267 | sce | exa_7_13.sce | // Exa 7.13
clc;
clear;
close;
// Given data
L= 47.8;// in mH
R= 1.36;// in ohm
R2= 100;// in ohm
R3= 32.7;//in ohm
R4= 100;//in ohm
R1= R2*R3/R4-R;// in ohm
disp(R1,"Resistance of coil in ohm");
L1= R2/R4*L;// in mH
disp(L1,"Inductance of coil in mH")
|
6cff80e3d157860432f0434caf364fbc231fd602 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1655/CH5/EX5.2.1/Example_5_2_1.sce | 7957f39b5df05c8c3ee7625783de57b6c867637c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 487 | sce | Example_5_2_1.sce | // Example 5.2.1 page 5.2
clc;
clear;
n1=1.47; //refractive index of fiber
n=1; //refractive index of air
r=((n1-n)/(n1+n))^2; //computing fraction of light reflected
loss=-10*log10(1-r); //loss
total_loss=2*loss;
printf("r = %.3f, which means %.1f percent of the transimitted light is reflected at one interface",r,r*100);
printf("\nTotal loss is %.3f dB",total_loss);
//answer in the book for total loss of fiber is 0.318 dB, deviation of 0.002
|
465da7a6924d7d93f1bda73d92ed4bf60fdce34c | 449d555969bfd7befe906877abab098c6e63a0e8 | /2102/CH2/EX2.28/exa_2_28.sce | 5a7d0ceca23bfd88b79cc95bc704e2cfa5c68043 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 258 | sce | exa_2_28.sce | // Exa 2.28
clc;
clear;
close;
// Given data
format('v',13)
Eg= 0.72;// in eV
Ef= Eg/2;//in eV
K= 8.61*10^-5;// in eV/K
T=300;//in K
nc= 1;
n= 1+%e^((Eg-Ef)/(K*T));
ncBYn= nc/n;
disp(ncBYn,"The fraction of the total number or electrons is : ")
|
0fc879974eaa0284f99a323d73e94cb2a917c9e6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3020/CH1/EX1.7/ex1_7.sce | dc95cc2e01aaba5019899c4d4d1b1b62bf7831dc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 285 | sce | ex1_7.sce | clc;
clear all;
l=1; // Length of wire in meters
d=1e-3; // Diameter of wire in meters
r=d/2;//radius of wire in meters
n=2.8e10; // Rigidity modulus in newton per square meters
ang=%pi/2; // angle in radian
c=ang*%pi*n*r^4/(2*l);
disp('N m',c,'The couple to be applied is')
|
a36109fcfd043c91dd1f23a078354dbaf19447ba | 449d555969bfd7befe906877abab098c6e63a0e8 | /2417/CH5/EX5.1/Ex5_1.sce | 3ef10e17b53ca6bd3e586a89e18c493f4d61060c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 608 | sce | Ex5_1.sce | //scilab 5.4.1
clear;
clc;
printf("\t\t\tProblem Number 5.1\n\n\n");
// Chapter 5 : Properties Of Liquids And Gases
// Problem 5.1 (page no. 182)
// Solution
p=0.6988; //Unit:psia //absolute pressure
vg=467.7; //Unit:ft^3/lbm //Saturated vapour specific volume
ug=1040.2; //Unit:Btu/lbm //Saturated vapour internal energy
J=778; //J=Conversion factor
// 1 Btu = 778 ft*LBf
//h=u+(p*v)/J
hg=ug+((p*vg*144)/J); //The enthalpy of saturated steam //1 ft^2=144 in^2 //Btu/lbm
printf("The enthalpy of saturated steam at 90 F is %f Btu/lbm",hg); //The value is matched with the value in table 1
|
88158a6b90fceed26fec693ed2c7b370761c1af2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2438/CH10/EX10.7/Ex10_7.sce | b4c64099346be22430f0122f6e6c679908b98119 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 640 | sce | Ex10_7.sce | //============================================================================================================
// chapter 10 example 7
clc
clear
// Variable declaration
n1 = 1.33; //refractive index of water
n2 = 1; // refractive index of air
// Calculations
theta_c = asin((n2/n1))
theta_c_deg = theta_c*(180/%pi); // radian to degree conversion
// Result
mprintf('For angles above %3.2f degrees , there will be total internal reflection in water',theta_c_deg );
//================================================================================================================
|
5ec9127d6c25ab3bbc530047477141b05495f5ea | b29e9715ab76b6f89609c32edd36f81a0dcf6a39 | /ketpicscifiles6/Dataindex.sci | 82e9ac4831c33448d8d20645efed35afe51ded05 | [] | 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 | 330 | sci | Dataindex.sci | //
// 08.05.31
function Ndm=Dataindex(P)
// %inf;%inf -> end
Ndm=[];
if P==[] return; end
N1=1;
Flg=0;
for J=1:size(P,1)
if P(J,1)==%inf
Ndm=[Ndm;N1,J-1];
N1=J+1;
if P(N1,1)==%inf
Flg=1;
break;
end
end
end
if Flg==0
Ndm=[Ndm;N1,size(P,1)];
end
endfunction
|
7858e1817b8ba80467953d0f7ecc2ae50ed96c35 | 449d555969bfd7befe906877abab098c6e63a0e8 | /964/CH18/EX18.4/18_4.sce | cac5142430bfabfafefb168f3da1f9e52d9fe940 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 391 | sce | 18_4.sce | //clc()
x = 2;
x0 = 1;
m = 0;
x1 = 4;
n = 1.386294;
x3 = 5;
p = 1.609438;
x2 = 6;
o = 1.791759;
f01 = (m - n)/(x0 - x1);
f12 = (n - o)/(x1 - x2);
f23 = (p - o)/(x3 - x2);
f210 = (f12 - f01)/(x2 - x0);
f321 = (f23 - f12)/(x3 - x1);
f0123 = (f321 - f210) / (x3 - x0);
b0 = m;
b1 = f01;
b2 = f210;
b3 = f0123;
R2 = b3 * (x - x0) * (x - x1)*(x-x2);
disp(R2,"error R2 = ")
|
ce1a333c6a1d441707df7bba01203fcc47a29282 | 8217f7986187902617ad1bf89cb789618a90dd0a | /source/2.3/macros/percent/%spfs.sci | ba5c787e9c300ddfc26dd9e6446ced5da730d45f | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-public-domain"
] | permissive | clg55/Scilab-Workbench | 4ebc01d2daea5026ad07fbfc53e16d4b29179502 | 9f8fd29c7f2a98100fa9aed8b58f6768d24a1875 | refs/heads/master | 2023-05-31T04:06:22.931111 | 2022-09-13T14:41:51 | 2022-09-13T14:41:51 | 258,270,193 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 63 | sci | %spfs.sci | function a=%spfs(a,b)
// [a;b] a sparse b full
a=[a;sparse(b)]
|
358be2e8f078a388c4bdc982aad12a56ab17aaf3 | 449d555969bfd7befe906877abab098c6e63a0e8 | /551/CH5/EX5.14/14.sce | 8ad676512891ba6757ec44c39427833b4f1f4c23 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | 14.sce | clc
T_e1=493; //K
T_e2=298; //K
T_p1=298; //K
T_p2=273; //K
Amt=15; //tonnes produced per day
h=334.5; //kJ/kg
Q_abs=44500; //kJ/kg
Q_p2=Amt*10^3*h/24/60;
COP_hp=T_p2/(T_p1-T_p2);
W=Q_p2/COP_hp/60;
disp("(i)Power developed by the engine = ")
disp(W)
disp("kW")
disp("(ii) Fuel consumed per hour")
n_carnot=1-(T_e2/T_e1);
Q_e1=W/n_carnot*3600; //kJ/h
fuel_consumed=Q_e1/Q_abs;
disp("Quantity of fuel consumed/hour = ")
disp(fuel_consumed)
disp("kg/h") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.