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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f16e15c3b47a161691a6bfba9a355c4fe518312 | f78a758dc17a311b355e12366d1315f7a9c2b763 | /GM/GMW3172 2012/9.2.18 Switched Battery Lines 20.tst | 6786d81e9ee61b3a7e431f8dbce57b3a04cb9b5c | [] | no_license | CZPFOX/Standards | 9dbf036f7e3e5767c23872c884ae7da83e66f81c | af34157e6e447d1a2b39136b9f3734feb663d9bb | refs/heads/master | 2020-06-18T12:58:06.033918 | 2019-07-11T02:55:42 | 2019-07-11T02:55:42 | 196,309,147 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 2,317 | tst | 9.2.18 Switched Battery Lines 20.tst | <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AutoTestC version="2.0.0">
<Pulse>CUSTOM WAVE</Pulse>
<Title>125us 500us/50kHz 80%</Title>
<Organization>GM</Organization>
<Standard>GMW3172 2012</Standard>
<Item>9.2.18 Switched Battery Lines</Item>
<voltage>13.5</voltage>
<count>180</count>
<wave id="0">
<type>0</type>
<dspin id="0">5</dspin>
<time>0.1</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="1">
<type>4</type>
<dspin id="0">5</dspin>
<dspin id="1">0</dspin>
<dspin id="2">50</dspin>
<spin id="0">80</spin>
<spin id="1">180</spin>
<comboindex id="0">1</comboindex>
<time>0.5</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="2">
<type>4</type>
<dspin id="0">5</dspin>
<dspin id="1">0</dspin>
<dspin id="2">50</dspin>
<spin id="0">80</spin>
<spin id="1">180</spin>
<comboindex id="0">1</comboindex>
<time>0.5</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="3">
<type>4</type>
<dspin id="0">5</dspin>
<dspin id="1">0</dspin>
<dspin id="2">50</dspin>
<spin id="0">80</spin>
<spin id="1">180</spin>
<comboindex id="0">1</comboindex>
<time>0.5</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="4">
<type>4</type>
<dspin id="0">5</dspin>
<dspin id="1">0</dspin>
<dspin id="2">50</dspin>
<spin id="0">80</spin>
<spin id="1">180</spin>
<comboindex id="0">1</comboindex>
<time>0.5</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="5">
<type>4</type>
<dspin id="0">5</dspin>
<dspin id="1">0</dspin>
<dspin id="2">50</dspin>
<spin id="0">80</spin>
<spin id="1">180</spin>
<comboindex id="0">1</comboindex>
<time>0.5</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="6">
<type>0</type>
<dspin id="0">5</dspin>
<time>100</time>
<timeUnit>1</timeUnit>
</wave>
<wave id="7">
<type>0</type>
<dspin id="0">0</dspin>
<time>5</time>
<timeUnit>0</timeUnit>
</wave>
</AutoTestC>
|
8d5865c5bf712c87c985207ce1bb97c2972f4f60 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1862/CH2/EX2.2/C2P2.sce | 5d6c6aee272510438af991a9ce10d5cb9269802b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 938 | sce | C2P2.sce |
clear
clc
//to find magnitude and direction of vector indicating location of car
// GIVEN::
//distance travelled due east on a level of road
//s is represented as ax+by.since b has no x component and a has no y componebt we can write
Sx = 32// in km
//distance travelled before stopping after taking turn due north
Sy = 47// in km
// SOLUTION:
//magnitude of distance travelled
x = sqrt(Sx^2 + Sy^2)//in meters
//direction of travelling
fi = atand(Sy/Sx)//in degrees
g = Sy/Sx
x = round(x)
fi = round(fi)
printf ("\n\n Distance travelled due east on a level of road Sx =\n\n %2i km",Sx);
printf ("\n\n Distance travelled before stopping after taking turn due north Sy =\n\n %2i km",Sy);
printf ("\n\n Magnitude ofdistance travelled by automobile x =\n\n %2i km",x);
printf ("\n\n Value of tanfi =\n\n %.2f ",g);
printf ("\n\n Direction of automobile travelling fi =\n\n %2i degrees north of east",fi);
|
4c9fb28db3386d7318753ae7fb8ff39cc3811cbe | 449d555969bfd7befe906877abab098c6e63a0e8 | /3651/CH5/EX5.7/7.sce | 9f016dc5e85ec4c56a71303d9375dade83594ee8 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 396 | sce | 7.sce | //Variable declaration
chi=0.5*10**-5; //magnetic susceptibility
H=10**6; //field strength(ampere/m)
mew0=4*%pi*10**-7;
//Calculation
I=chi*H; //intensity of magnetisation(ampere/m)
B=mew0*(I+H); //flux density in material(weber/m**2)
//Result
printf('intensity of magnetisation is %0.3f ampere/m \n',I)
printf('flux density in material is %0.3f weber/m**2 \n',(B)) |
603305d529746df46deaff37f55bdfa927fa4897 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1895/CH6/EX6.9/EXAMPLE6_9.SCE | c723d2e5ff15bb084bddfdb9086b8883763e7480 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 532 | sce | EXAMPLE6_9.SCE | //ANALOG AND DIGITAL COMMUNICATION
//BY Dr.SANJAY SHARMA
//CHAPTER 6
//NOISE
clear all;
clc;
printf("EXAMPLE 6.9(PAGENO 302)");
//given
R_eq = 2518//equivalent resistance in ohms
R_t = 600//input impedence in ohms
R_a= 50//output impedencre in ohms
//calculations
R_eq1 = R_eq - R_t;
F = 1 + (R_eq1/R_a) //noise figure
F_dB = 10*log10(F)//noise figure in dB
//results
printf("\n\nNoise figure in dB = %.2f dB",F_dB);
printf("\n\nNote:Calculation mistake is their in text book in finding noise figure in dB")
|
7a3e777f26e067f4b1fdcfc696be46c8d33f9f42 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2210/CH5/EX5.13/5_13.sce | 52b74525b3491fc5e13b1d65fe2e908f13599ed1 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 322 | sce | 5_13.sce | //Chapter 5, Problem 13
clc
n1=16 //no of turns on primary
n2=8 //no of turns on secondary
zs=16 //terminating resistance
//calculation of effective resistance
zp=zs*(n1/n2)^2
printf("Effective resistance at the primary = %d ohm",zp)
|
58343e74dc53d795d3c84356142ef805b79ccb6f | 449d555969bfd7befe906877abab098c6e63a0e8 | /2837/CH17/EX17.2/Ex17_2.sce | f1f07dd5ca1c4eb3b854ffad79b97e344c840608 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 341 | sce | Ex17_2.sce | clc
clear
//Initalization of variables
J=778
o2=12.5
theo=0.95
N=56.5
R0=1545
T=540 //R
p=14 //psia
LHV=2368089 //Btu/lb
ther=39.4
iep=0.78
ve=0.8
//calculations
Ar=o2/0.21 *theo
vol=N*R0*T/(144*p)
hv=(LHV -17730)/LHV
ithep=iep*ther
pd=ithep/100 *ve *100.5
mep=J*pd
//results
printf("Indicated mep = %d lb/sq ft",mep)
|
2d2fb705cf9b7cdc61b16a683b2eb4072db6d92b | 449d555969bfd7befe906877abab098c6e63a0e8 | /3793/CH15/EX15.2/exp_15_2.sce | 2b4cdccadf3f4b65334d4c7973cce001d758e138 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 491 | sce | exp_15_2.sce | clear;
clc;
E_ll=110;
U=12;
V_o=(3*sqrt(2)*E_ll)/%pi;
X=0;
V_d1=(V_o*(cosd(X)+cosd(U+X)))/2;
printf("\nthe dc output voltage when (X=0) = %.3f kV",V_d1);
X1=25;
V_d2=(V_o*(cosd(X1)+cosd(U+X1)))/2;
printf("\nthe dc output voltage when (X1=25) = %.3f kV",V_d2);
X2=90;
V_d3=(V_o*(cosd(X2)+cosd(U+X2)))/2;
printf("\nthe dc output voltage when (X2=90) = %.3f kV",V_d3);
X3=120;
V_d4=(V_o*(cosd(X3)+cosd(U+X3)))/2;
printf("\nthe dc output voltage when (X3=120) = %.3f kV",V_d4);
|
1aad1ea275ecf291e0c8bb876a56ad1da7b9db99 | 449d555969bfd7befe906877abab098c6e63a0e8 | /680/CH6/EX6.06/6_06.sce | aa9047c3dd780cea52f7b8f7ba0d3691a740703e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 390 | sce | 6_06.sce | //Problem 6.06:
//initializing the variables:
n = 5; // in lbmol
T1 = 100; // in degrees F
P1 = 1; // in atm
T2 = 400; // in degrees F
P2 = 10; // in atm
Cpg = 5; // Btu/lb.degF
R = 1.987;
//calculation:
T1 = T1 + 460
T2 = T2 + 460
dS = n*R*log(P1/P2) + n*Cpg*log(T2/T1)
printf("\n\nResult\n\n")
printf("\n the entropy for the irreversible process is %.2f Btu/deg R",dS) |
fa711f5e1c937f8360f18797fb7dd36612a1c9b2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2384/CH9/EX9.9/ex9_9.sce | dad32b421dbf25a31833b9994274b960f5208261 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 651 | sce | ex9_9.sce | // Exa 9.9
clc;
clear;
close;
format('v',7)
// Given data
Rating = 250*10^3;// in VA
Pi = 1.8;// in kW
Pi = Pi * 10^3;// in W
Pcu_f1 = 2000;// in W
phi= acosd(0.8);// in °
Eta = ((Rating*cosd(phi))/((Rating*cosd(phi))+Pi+Pcu_f1))*100;// %Eta in %
disp(Eta,"The efficiency at full load in % is");
// The maximum efficiency
Eta_max = Rating * sqrt(Pi/Pcu_f1 );// in VA
Eta_max = Eta_max *10^-3;// in kVA
disp(Eta_max,"The maximum efficiency in kVA is");
Eta_max = Eta_max *10^3;// in VA
Pcu = Pi;// in W
Eta_max1 = ((Eta_max*cosd(phi))/((Eta_max*cosd(phi)) + Pi+Pcu ))*100;// in %
disp(Eta_max1,"The maximum efficiency in % is");
|
072a86396a1e5cccc5cbb7f9cf30c9fadd0d4791 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3768/CH4/EX4.10/Ex4_10.sce | 32e1a87bae1bf411f87dd48fd932d2fc72c9f04c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | Ex4_10.sce | //Example number 4.10, Page number 70
clc;clear;
close;
//Variable declaration
n=1; //order
h=1;
k=1;
l=1;
e=1.6*10**-19; //charge(c)
V=5000; //voltage(V)
m=9.1*10**-31; //mass(kg)
H=6.625*10**-34; //plank constant
d=0.204*10**-9; //interplanar spacing(m)
//Calculation
lamda=H/sqrt(2*m*e*V); //wavelength(m)
theta=asin(n*lamda/(2*d)); //bragg's angle(radian)
theta=theta*180/%pi; //bragg's angle(degree)
//Result
printf("bragg''s angle is %.4f degree",theta)
|
e1b298974aabdff29abaa84c1f23939952c8e752 | 449d555969bfd7befe906877abab098c6e63a0e8 | /446/CH2/EX2.8/2_8.sce | 33e3a67b369df5b4b6913623e19dd1b0397cecb1 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 262 | sce | 2_8.sce | clear
clc
disp('Exa-2.8');
w1=600;w2=434; // w1=recorded wavelength;w2=actual wavelength
// c/w1 = c/w2 *(sqrt(1-u/c)/(1+u/c))
k=w2/w1;
x=(1-k^2)/(1+k^2); //solving for u/c
printf('The speed of galaxy wrt earth is %.2f c',x);
|
76372a8a155e3416ba47cf474132bd3e11d4199b | 449d555969bfd7befe906877abab098c6e63a0e8 | /2276/CH10/EX10.2/chapter10_ex2.sce | f7f06a6bb3ef66af56c7709a2cf52886a9beb8a2 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 597 | sce | chapter10_ex2.sce | clc
clear
//input
p=4;//number of poles
n=48;//number of slots
b=0.02;//fulx per pole in weber
w=50*(%pi);//angular velocity in rad/sec
//calcultions
f=(w*(p/2))/(2*%pi);//frequency in hertz
phim=360/n;//mechanical angle in degrees
phie=phim*(p/2);//electrical angle in degrees
phiE=phie*(%pi/180);//electrical angle in radians
kd=(sin(2*(phiE/2)))/(2*sin(phiE/2));//distribution factor and 2 is taken as we are calculating for 2 coils
e=(p/2)*kd*4.44;//total e.m.f. for two coils in series in volts
//output
mprintf('the total e.m.f. for two coils in series is %3.1f V',e)
|
a47a2315f5f343d4299eb4bc652387ea54c2279d | 449d555969bfd7befe906877abab098c6e63a0e8 | /3886/CH4/EX4.7/Ex4_7.sce | 3d38484614996847c2b3a813f833b14647a8c0f6 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 717 | sce | Ex4_7.sce | //finding magnitude and nature of forces
//refer fig. 4.14(a)
//considering equilibrium if entire truss
//taking moment about L0
R2=(200*6+200*12+150*18+100*24+100*30)/36 //kN
R1=200+200+150+100+100-R2 //kN
//consider equilibrium of right hand side of section (1)-(1)
theta1=atand(1/6) //degree
theta2=atand(6/8) //degree
//taking moment about U4
FL3L4=(-100*6+325*12)/8 //kN (tension)
//taking moment about L3
FU3U4=456.2 //kN (compression)
FU4L3=(456.2*cosd(9.46)-412.5)/sind(36.87) //kN (tension)
printf("The required forces are:-\nMember Force\nU3U4= %.2d kN (Compression)\nL3L4= %.2d kN (Tension)\nU4L3= %.2d kN (Tension)",FU3U4,FL3L4,FU4L3)
|
63e2e57cf43f21963244725d9d9fc50c4f3beb14 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.5/Unix-Windows/scilab-2.5/macros/util/g_round.sci | 2dbe3753cf297c3c85203552d903744e01bdd1e5 | [
"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 | 87 | sci | g_round.sci | function sp=g_round(a)
// Copyright INRIA
[ij,v,mn]=spget(a)
sp=sparse(ij,round(v),mn)
|
e9aa04c9f7bee1471bb8188f5d81f7957638d73d | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.5/Unix-Windows/scilab-2.5/macros/mtlb/mtlb_fprintf.sci | 0c02ac82b7b76800869dbf3536ab1089085d5343 | [
"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,423 | sci | mtlb_fprintf.sci | function count = mtlb_fprintf(varargin)
[lhs,rhs]=argn()
count=0
if type(varargin(1))==10 then //mtlb_fprintf(fmt,...)
fmt=varargin(1)
nfmt=size(strindex(fmt,'%'),'*')
nv=size(varargin)-1
if nv==1 then
a=varargin(2)
na=size(a,'*')
mult=max(na/nfmt,1)
fmt=strcat(fmt(ones(1,mult))) // duplicate format
l=list()
A=a
for k=1:size(a,'*'),l($+1)=A(k); end
mprintf(fmt,l(:))
elseif nv==0 then
mprintf(fmt)
else
sz=[]
for k=1:nv
sz=[sz size(varargin(k+1),1)]
end
if and(sz==1) then
mult=max(nv/nfmt,1)
fmt=strcat(fmt(ones(1,mult))) // duplicate format
mprintf(fmt,varargin(2:$))
else
error('mtlb_fprintf this particular case is not implemented')
end
end
else //mtlb_fprintf(fid,fmt,...)
fid=varargin(1)
fmt=varargin(2)
//count % in fmt
nfmt=size(strindex(fmt,'%'),'*')
nv=size(varargin)-2
if nv==1 then
a=varargin(3)
na=size(a,'*')
mult=max(na/nfmt,1)
fmt=strcat(fmt(ones(1,mult))) // duplicate format
l=list()
for k=1:size(a,'*'),l(k)=a(k); end
mfprintf(fid,fmt,l(:))
else
sz=[]
for k=1:nv
sz=[sz size(varargin(k+2),1)]
end
if and(sz==1) then
mult=max(nv/nfmt,1)
fmt=strcat(fmt(ones(1,mult))) // duplicate format
mfprintf(fid,fmt,varargin(3:$))
else
error('mtlb_fprintf this particular case is not implemented')
end
end
end
|
fdddda4a8554b33134324f9e5d0393530f608546 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2075/CH5/EX5.7/pe5_7.sce | 07c36f13c5606531eeef28f3437931953c9156dc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 219 | sce | pe5_7.sce | //example 5.7
clc; funcprot(0);
// Initialization of Variable
Vi=350;//voltage
f=100;//frequency
Rf=10000;//resistance
Ri=520;
//calculation
Vp=(1+(Rf/Ri))*Vi*2^.5;
disp(Vp/1000,"load voltage in V:")
clear()
|
cb5227aac83b56e225310acd6b663c571e7800af | 19d92bf7a25b9739b9f3c7be5bb057a29a4caa6e | /row_1.tst | 6c148f852713d99b52dbe45894263cf3bbb9a655 | [] | no_license | vasil-pashov/tic-tac-toe-bash-hw | 1e78f2bd7f53106e31c9c12c5be1d193e576b8c7 | 4260b0705c97f7e6b2e129a835291aa02967205d | refs/heads/master | 2021-01-01T05:29:41.398338 | 2016-05-16T07:06:35 | 2016-05-16T07:06:35 | 58,814,233 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 41 | tst | row_1.tst | a
b
(1,1)
(2,2)
(1,3)
(2,1)
(3,3)
(2,3)
|
703af8a154d5d218055303ee38fa77682e23c2d2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2267/CH7/EX7.14/ex7_14.sce | b84eb23416e360eca02f67faa5612583c8823142 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 659 | sce | ex7_14.sce | //Part A Chapter 7 Example 14
clc;
clear;
close;
rcv=71.5;//cm of Hg(Recorded condenser vaccum)
br=76.8;//cm of Hg(Barometer reading)
Tc=35;//degree C(Temperature of condensation)
Tw=27.6;//degree C(Temperature of hot well)
mc=1930;//kg(Mass of condensate/hour)
mw=62000;//kg(Mass of cooling water/hour)
T1=8.51;//degree C(Inlet temperature)
T2=26.24;//degree C(Outlet temperature)
pc=(br-rcv)/73.55*101.325;//kPa(condenser pressure)
p_partial=5.628;//kPa(at 35 degree C)
hf=146.68;//kJ/kg
hfg=2418.6;//kJ/kg
x=(mw*(T2-T1)*4.18/mc+4.18*Tw-hf)/hfg;//dryness fraction
disp("State of steam(Dryness fraction) entering condenser is "+string(x));
|
cc4919215251166e54911268eed1c6b7e1454b53 | 449d555969bfd7befe906877abab098c6e63a0e8 | /998/CH29/EX29.65/Ex65.sce | 29fc29a7273aac797d6396575a7a4283a0235600 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 218 | sce | Ex65.sce | //Ex:65
clc;
clear;
close;
r=42164;// in km
d_m=500;// in km
i=d_m/r;// the angle of inclination in rad
printf("The angle of inclination=%f rad",i);
printf("\n The angle of inclination=%f degree",i*(180/3.14)); |
eb5aa8bb93d33523d6037cf9f33837ba670f592a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2753/CH4/EX4.20/Ex4_20.sce | 9e0844cca868c6470fc25d8416197fe89d8b5ba3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 368 | sce | Ex4_20.sce | //Example 4.20:
clc;
clear;
close;
//given data :
format('v',5)
A=50;//gain without feedback
Af=25;//gain with feedback
Beta=(((A/Af)-1)/A);//feed back ratio
Ad=40;//new gain after ageing
Af1=(Ad/(1+(Beta*Ad)));//new gain with feedback
df=Af-Af1;// reduction in gain
pdf= (df/Af)*100;//percentage reduction in gain
disp(pdf," percentage reduction in gain is ,(%)=")
|
ac9f4b4b885684f3eb4fc30913fd570382a38b87 | 99b4e2e61348ee847a78faf6eee6d345fde36028 | /Toolbox Test/polyscale/polyscale6.sce | 4df09a6c75cadd1aa5ec8d31a60663912b8e6eca | [] | 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 | 186 | sce | polyscale6.sce | // no i/p args are passed to the function
y=polyscale();
disp(y);
//output
// !--error 4
//Undefined variable: a
//at line 25 of function polyscale called by :
//y=polyscale();
|
1437baac1d94518e3d86bf5ccc02176b310580ae | 449d555969bfd7befe906877abab098c6e63a0e8 | /32/CH11/EX11.03/11_03.sce | 54b63dd42577fd5e483e7147bd5cc7ce08e2cf3e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 472 | sce | 11_03.sce | //pathname=get_absolute_file_path('11.03.sce')
//filename=pathname+filesep()+'11.03-data.sci'
//exec(filename)
//Height of chimney(in m):
H=20
//Temperature of burnt gases(in K):
Tg=380+273
//Ambient air temperature(in K):
Ta=27+273
//Air supplied(in kg air per fuel):
m=2*Ta/(Tg-2*Ta)
printf("\n RESULT \n")
printf("\nAir supplied = %f kg/kg of fuel",m)
//Draught in water column(in mm):
hw=353*H*(1/Ta-(m+1)/(m*Tg))
printf("\nDraught = %f mm of water",hw) |
bb2c339b6b5e5cb9d657f50b204f235adb093601 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2885/CH12/EX12.1/ex12_1.sce | 0c94278e5d5fbd311959bbf8e8d3b0f5588ec6b3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 196 | sce | ex12_1.sce | //Calculate frequency of oscillations
clear;
clc;
//soltion
//given
L=55*10^-6;//H
C=300*10^-12;//F
fo=1/(2*%pi*sqrt(L*C));
printf("The frequency of oscillations= %.0f kHz\n",fo/1000);
|
ff2ad027cf0ee5b5f0f983f4624a9fec62cd2281 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1964/CH4/EX4.11/ex4_11.sce | fcc480314a6e36b4a3d4cae3e66737c7facc96ce | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 390 | sce | ex4_11.sce | //Chapter-4, Example 4.11, Page 137
//=============================================================================
clc
clear
//INPUT DATA
I1=5;//current in A
I=10;//current in A
I2=I/sqrt(2);
//CALCULATIONS
i3=sqrt(((2*I1)^2)+(I2^2));
mprintf("rms value of current is %1.2f A respectively\n",i3);
//=================================END OF PROGRAM==============================
|
f70cc7bb89b61726e590ef39fa2dbd744a9e4572 | 1bb72df9a084fe4f8c0ec39f778282eb52750801 | /test/TECG.prev.tst | 134894236e5f6607c4304333892bb22e9b00e35a | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | gfis/ramath | 498adfc7a6d353d4775b33020fdf992628e3fbff | b09b48639ddd4709ffb1c729e33f6a4b9ef676b5 | refs/heads/master | 2023-08-17T00:10:37.092379 | 2023-08-04T07:48:00 | 2023-08-04T07:48:00 | 30,116,803 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 499 | tst | TECG.prev.tst | Expanding for base=3, level=3, reasons+features=base,same,similiar,evenexp norm,showfail
Refined variables=k,x,y
[0+1k,0+1x,0+1y]: unknown -> [1] [0,0,0] 3k-x²-3y²-1
---------------- level 0
expanding queue[0]^-1,meter=[1,3,1]: 3k-x²-3y²-1
[0+1k,0+3x,0+1y]: failure constant=-1, vgcd=3 [0,0,0] 3k-9x²-3y²-1
[0+1k,1+3x,0+1y]: failure constant=-2, vgcd=3 [0,1,0] 3k-6x-9x²-3y²-2
[0+1k,2+3x,0+1y]: failure constant=-5, vgcd=3 [0,2,0] 3k-12x-9x²-3y²-5
endexp[0]
Proof [1] mod 3: 3k-x²-3y²-1
|
9b3514ad5c5b47f0afb0178beae743d362967125 | 449d555969bfd7befe906877abab098c6e63a0e8 | /671/CH3/EX3.3/3_3.sce | 810c2f2e65f0034787dbe538898efacea86292cf | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 245 | sce | 3_3.sce | function C=seriesC(C1,C2)
C=C1*C2/(C1+C2)
endfunction
V=100
Cp=1+2
Ceq=seriesC(Cp,6)
q=Ceq*V
q1=q*(1/(1+2))
q2=q-q1
disp(q2,q1,q)
E6=q*q/2/6/1000
E1=q1*q1/2/1/1000
E2=q2*q2/2/2/1000
Enet=E1+E2+E6
disp(Enet,E6,E2,E1) |
a501694ad5de6fb184bf8440af22061c6ef6275a | 449d555969bfd7befe906877abab098c6e63a0e8 | /659/CH6/EX6.3cs/Casestudy6_3.sce | 58db705a6949d786babf6f6cfe3822e872ad1a99 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 460 | sce | Casestudy6_3.sce | // Case Study:-Chapter 6
// 3.Minimum Cost
for p=0:0.1:10
cost=48-8*p+p^2;
if(p==0) ,
cost1=cost;
continue; //Use of continue statement
end
if(cost>=cost1) ,
break; //Use of break statement
end
cost1=cost;
p1=p;
end
p =(p+p1)/2.0;
cost=40-8*p+p^2; //Computes the cost
//print the result
printf("MINIMUM COST=%.2f AT p=%.1f\n",cost,p); |
26fb798bc5f57777c2fa5fc20149816b65728ea7 | 8217f7986187902617ad1bf89cb789618a90dd0a | /source/2.4/macros/tdcs/tdinit.sci | 13369b2cb4b597422f48adf7fd355c499edcb9b7 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | clg55/Scilab-Workbench | 4ebc01d2daea5026ad07fbfc53e16d4b29179502 | 9f8fd29c7f2a98100fa9aed8b58f6768d24a1875 | refs/heads/master | 2023-05-31T04:06:22.931111 | 2022-09-13T14:41:51 | 2022-09-13T14:41:51 | 258,270,193 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 4,593 | sci | tdinit.sci | function []=tdinit()
// Copyright INRIA
tit=["bioreactor model (bioreact)";
"competition model (compet)";
"system with limit cycle (cycllim)";
"linear system (linear)";
"quadratic model (linper)";
"linear system with a feedback (lincom)";
"prey predator model (p_p)"]
ii=x_choose(tit," Systems Initialisation ");
// bioreactor
if ~isdef('k');k=2.0;end
if ~isdef('debit');debit=1.0;end
if ~isdef('x2in');x2in=3.0;end
// competition
if ~isdef('ppr');ppr=1/100 ;end
if ~isdef('ppa');ppa=1/20000;end
if ~isdef('pps');pps=1/200 ;end
if ~isdef('ppb');ppb=1/10000 ;end
if ~isdef('ppk');ppk=1000 ;end
if ~isdef('ppl'); ppl=500;end
if ~isdef('ppm'); ppm=1/100;end
// linear
if ~isdef('alin'); alin=eye(2,2);end;
// limit cycle
if ~isdef('qeps'); qeps=0.1;end;
// quadratic
if ~isdef('q1linper'); q1linper=eye(2,2);end;
if ~isdef('q2linper'); q2linper=eye(2,2);end;
if ~isdef('rlinper'); rlinper=0.0;end;
// linear and feedback
if ~isdef('lic_a'); lic_a=eye(2,2);end;
if ~isdef('lic_b'); lic_b=[1;1];end;
// pray predator
if ~isdef('p_ppr');p_ppr=1/100 ;end
if ~isdef('p_ppa');p_ppa=1/20000;end
if ~isdef('p_ppm');p_ppm=1/100 ;end
if ~isdef('p_ppb');p_ppb=1/10000 ;end
if ~isdef('p_ppk');p_ppk=1000 ;end
select ii,
case 1 then [k,debit,x2in]=ibio();
case 2 then [ppr,ppa,pps,ppb,ppk,ppl]=icompet();
case 3 then [qeps]=icycl();
case 4 then [alin]=ilinear();
case 5 then [alin,qeps,q1linper,q2linper,rlinper]=ilinp();
case 6 then [lic_a,lic_b]=ilic();
case 7 then [p_ppr,p_ppa,p_ppm,p_ppb,p_ppk]=ip_p();
end
[k,debit,x2in,ppr,ppa,pps,ppb,ppk,ppl,qeps,q1linper,q2linper,...
rlinper,ppm,alin,p_ppr,p_ppa,p_ppm,p_ppb,p_ppk,lic_a,lic_b]= resume(k,debit,x2in,...
ppr,ppa,pps,ppb,ppk,ppl,qeps,...
q1linper,q2linper,rlinper,ppm,alin,p_ppr,p_ppa,p_ppm,p_ppb,p_ppk,lic_a,lic_b)
function [k,debit,x2in]=ibio()
// initialisation du bioreactur
// Copyright INRIA
tit=[" bioreactor model initialisation";
"x(1): biomass concentration ";
"x(2): sugar concentration";
" ";
"xdot(1)=mu_td(x(2))*x(1)- debit*x(1)";
"xdot(2)=-k*mu_td(x(2))*x(1)-debit*x(2)+debit*x2in";
"mu(x):= x/(1+x)"];
x=x_mdialog(tit,['k';'debit';'x2in'],[string(k);string(debit);string(x2in)]);
k=k;debit=debit;x2in=x2in;
if x<>[] then k=evstr(x(1));debit=evstr(x(2));x2in=evstr(x(3));end
function [ppr,ppa,pps,ppb,ppk,ppl]=icompet()
// Copyright INRIA
tit=[" competition model initialisation";
"xdot(1) = ppr*x(1)*(1-x(1)/ppk) - u*ppa*x(1)*x(2)";
"xdot(2) = pps*x(2)*(1-x(2)/ppl) - u*ppb*x(1)*x(2)"];
x=x_mdialog(tit,['ppr';'ppa';'pps';'ppb';'ppk';'ppl'],...
string([ppr;ppa;pps;ppb;ppk;ppl]));
// ['1/100';'1/20000';'1/200';'1/10000';'1000';'500']);
ppr=ppr;ppa=ppa;pps=pps;ppb=ppb;ppk=ppk;ppl=ppl;
if x<>[] then ppr=evstr(x(1));
ppa=evstr(x(2));
pps=evstr(x(3));
ppb=evstr(x(4));
ppk=evstr(x(5));
ppl=evstr(x(6));end
function [qeps]=icycl()
// Copyright INRIA
//[qeps]=icycl()
tit=[" system with limit cycle ";
" xdot=a*x+qeps(1-||x||**2)x";" Enter qeps"];
qeps_r=x_matrix(tit,qeps);
if qeps_r<>[] then qeps=qeps_r;end
function [alin]=ilinear()
// Copyright INRIA
rep=x_matrix(['xdot=a*x';'Matrice 2x2 du systeme lineaire'],alin);
if rep<>[] then alin=rep;end
function [alin,qeps,q1linper,q2linper,rlinper]=ilinp()
// Copyright INRIA
tit=[" quadratic model ";
"xdot= a*x+(1/2)*qeps*[(x'')*q1*x;(x'')*q2*x]+r"];
x=x_mdialog(tit,['qeps';'r'],...
[string(qeps);string(rlinper)]);
qeps=qeps;
rlinper=rlinper;
alin=alin;
q1linper=q1linper;
q2linper=q2linper;
qeps=qeps;
rlinper=rlinper;
if x<>[] then rlinper=evstr(x(2));
qeps=evstr(x(1));
end
rep=x_matrix([tit;'Enter a'],alin);
if rep<>[] then alin=rep;end
rep=x_matrix([tit;'Enter q1linper'],q1linper);
if rep<>[] then q1linper=rep;end
rep=x_matrix([tit;'Enter q2linper'],q2linper);
if rep<>[] then q2linper=rep;end
function [lic_a,lic_b]=ilic()
// Copyright INRIA
tit=[" linear system with a feedback ";
"xdot= a*x +b*(-k*x);"];
rep=x_matrix([tit;"Enter a"],lic_a)
if rep<>[] then lic_a=rep;end
rep=x_matrix([tit;"Enter b"],lic_b)
if rep<>[] then lic_b=rep;end
function [p_ppr,p_ppa,p_ppm,p_ppb,p_ppk]=ip_p()
// Copyright INRIA
tit=[" pray predator model initialisation";
"xdot(1) = p_ppr*x(1)*(1-x(1)/p_ppk) - p_ppa*x(1)*x(2) - u*x(1);"
"xdot(2) = -p_ppm*x(2) + p_ppb*x(1)*x(2) - u*x(2);"];
x=x_mdialog(tit,['p_ppr';'p_ppa';'p_ppm';'p_ppb';'p_ppk'],...
string([p_ppr;p_ppa;p_ppm;p_ppb;p_ppk]));
p_ppr=p_ppr;
p_ppa=p_ppa;
p_ppm=p_ppm;
p_ppb=p_ppb;
p_ppk=p_ppk;
if x<>[] then p_ppr=evstr(x(1));
p_ppa=evstr(x(2));
p_ppm=evstr(x(3));
p_ppb=evstr(x(4));
p_ppk=evstr(x(5));
end
|
860e9429f1264a6b4f53dd91cb3e8b71c699b98f | 449d555969bfd7befe906877abab098c6e63a0e8 | /1061/CH2/EX2.10/Ex2_10.sce | 3fd8be472fb9941475a8733009bcc5fb99f53c42 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 296 | sce | Ex2_10.sce | //Ex:2.10
clc;
clear;
close;
n1=1.50;// core refractive index
n2=(99/100)*1.50;// cladding refractive index
x_c=(asin(n2/n1))*180/%pi;// critical angle in degree
n_m=sqrt(n1^2-n2^2);// numerical aperture
printf("critical angle = %f degree",x_c);
printf("\n numerical aperture = %f",n_m); |
2a6b017c3d09590f47047d4c0ffdad4d823e38cc | 449d555969bfd7befe906877abab098c6e63a0e8 | /647/CH1/EX1.7/Example1_7.sce | 4020671196d1b3b297371b98b8d488f4c986412a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 418 | sce | Example1_7.sce | clear;
clc;
// Example: 1.7
// Page: 9
// Solution
printf("Example: 1.7 - Page: 9\n\n");
//*****Data*****//
P = 560*10^3;// [Pa]
Vinit = 3;// [cubic m]
Vfinal = 5;// [cubic m]
Wext = 210*10^3;// [J]
//*************//
W = P*(Vfinal - Vinit);// [J]
// Again the system receives 210 kJ of work from the external agent.
W = W - Wext;// [J]
printf("Actual Work done by the system is %.1e J\n",W); |
aca1e6dcdca7950dc506cb9717a961cf51e12b75 | 01ecab2f6eeeff384acae2c4861aa9ad1b3f6861 | /sci2blif/sci2blif_added_blocks/join.sce | 0fabb9b9aa3f93142c8b9b8a88d1b27c84538045 | [] | 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 | 458 | sce | join.sce | //**************************** Join ********************************
if(blk_name.entries(bl)=='join') then
for ss= 1:scs_m.objs(blk_objs(bl)).model.rpar(1)
spl_fix=[spl_fix;'net'+ string(blk(blk_objs(bl),ss+1+numofip))+"_",'net'+string(blk(blk_objs(bl),2))+"_"]
spl_fix=[spl_fix;'out:net'+ string(blk(blk_objs(bl),ss+1+numofip))+"_",'out:net'+string(blk(blk_objs(bl),2))+"_"]
spl_fix_chg=%t;
// disp(spl_fix)
end
end
|
cf45ad195e1d8cfb6c003a6170ebfcba42bd263a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2735/CH16/EX16.10/Ex16_10.sce | 98bd57453bde2ff3cfd582b28558a1b9eb94c4c2 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | Ex16_10.sce | clc
clear
//Initialization of variables
N2=78.1 //Moles of Nitrogen
M=29 //Molar mass of Air
ba=2.12 //Basis
x4=0.3 //Moles of Ch4
x5=3.7 //Moles of H2
x6=14.7 //moles of H2o
//calculations
O2=N2/3.76
c=14.7
b= x4*4 + x5*2 + x6*2
a=b/ba
AF=(O2+N2)*M/(a*12 + b)
//results
printf("Air fuel ratio = %.1f lbm air/lbm fuel",AF)
|
5e16c2860a746066934b322511b63d5b970d86d7 | b4bbf9b2a475b5cf299b30bf5e0c621e32f6c832 | /test/assign1/bridge.tst | 41ce62559545e3600dde552baf88d9fac34a140a | [] | no_license | apetresc/castro | 1ec1ac1307542487aa1be14c335170f7a1347bf2 | 843165af7c946188a2dd772384cd2d579723c99d | refs/heads/master | 2022-02-20T14:28:41.962893 | 2019-10-07T08:41:59 | 2019-10-07T08:41:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 139 | tst | bridge.tst | boardsize 4
play w a1
play b b1
play w a2
play b b2
play w a3
play b b3
1 havannah_winner
#? [none]
play w a4
2 havannah_winner
#? [white]
|
17cb0b392ca7cb93fccd53c17324e60688e13b60 | eb7eeb04a23a477e06f3c0e3d099889caee468b4 | /src/examples/scilab/IoGenericScilabSimulation.sce | a242a0ebe20800ec51118ac5c2016958ba51c453 | [] | no_license | mikeg64/iome | 55699b7d7b3d5c1b006d9c82efe5136b8c909dfd | cc1c94433133e32776dcf16704ec4ec337b1b4a0 | refs/heads/master | 2020-03-30T15:57:33.056341 | 2016-04-13T09:24:27 | 2016-04-13T09:24:27 | 151,387,236 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 64,951 | sce | IoGenericScilabSimulation.sce | //To use these functions make sure the location of the IOME iogs application
//is on the path
//Linux export IOME_HOME=PATHTOIOME
//Linux export PATH=$PATH":$IOME_HOME/bin"
//Windows set IOME_HOME=PATHTOIOME
//Windows set PATH=%PATH%;$IOME_HOME/bin
function [vec]=stringtovec(stringvar, vsize, separator)
vec=zeros(vsize,1);
newformatstring='';
formatmark='%f'
for i=1:vsize
if i>1 then
formatstring=sprintf("%s%s%s",newformatstring,separator,formatmark);
else
formatstring=sprintf("%s",formatmark);
end
newformatstring=formatstring;
end
vec=msscanf(-1,stringvar,formatstring);
endfunction
function [vecstring]=vectostring(vec,separator)
[r,vsize]=size(vec);
vecstring='';
for i=1:vsize
if i>1 then
newvecstring=sprintf("%s%s%f",vecstring,separator,vec(i));
else
newvecstring=sprintf("%f",vec(i));
end
vecstring=newvecstring;
end
endfunction
function [result]=GetNSteps(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getnsteps %d %d %s", id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetNSteps Error!');
result=-1;
end
//status=0;
endfunction
function [result]=GetStep(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getstep %d %d %s", id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetStep Error!');
result=-1;
end
//status=0;
endfunction
function [status]=SetNSteps(var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setnsteps %d %d %d %s", var,id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetNSteps Error!');
status=-1;
end
endfunction
function [status]=SetStep(var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setstep %d %d %d %s", var, id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetStep Error!');
status=-1;
end
endfunction
function [status]=ExitIOME(elist)
//Stop the server and exit IOME
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs exitiome %d %d %s",id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ExitIOME Error!');
status=-1;
end
endfunction
function [status]=RunSimulation(simfile, outfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs runsimulation %s %s %d %d %s",simfile, outfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('RunSimulation Error!');
status=-1;
end
endfunction
function [simid]=SubmitSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs submitsimulation %s %d %s", simfile, port,server);
result=unix_g(scommand);
simid=msscanf(result,'%d');
catch
disp('SubmitSimulation Error!');
simid=-1;
end
endfunction
function [simid]=RequestSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs requestsimulation %s %d %s", simfile, port,server);
result=unix_g(scommand);
simid=msscanf(result,'%d');
catch
disp('RequestSimulation Error!');
simid=-1;
end
endfunction
function [simid]=RunRequestedSimulation(elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs runrequestedsimulation %d %d %s", id, port,server);
result=unix_g(scommand);
simid=msscanf(result,'%d');
catch
disp('RunRequestedSimulation Error!');
simid=-1;
end
endfunction
function [status]=SimulationStatus(elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs simulationstatus %d %d %s", id, port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('SimulationStatus Error!');
status=-1;
end
endfunction
function [status]=SetSimulationStatus(newstatus,elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs setsimulationstatus %d %d %d %s", newstatus, id, port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('SetSimulationStatus Error!');
status=-1;
end
endfunction
function [status]=GetSimulationResult(outfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs getsimulationresult %s %d %d %s", outfile, id,port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('GetSimulationResult Error!');
status=-1;
end
endfunction
function [status]=DeleteSimulation(elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs deletesimulation %d %d %s", id, port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('DeleteSimulation Error!');
status=-1;
end
endfunction
function [status]=ReadSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs readsimulation %s %d %d %s", simfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ReadSimulation Error!');
status=-1;
end
endfunction
function [status]=ReadLocalSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs readlocalsimulation %s %d %d %s", simfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ReadLocalSimulation Error!');
status=-1;
end
endfunction
function [status]=NewSimulation(simname,xslname, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs newsimulation %s %s %d %d %s", simname,xslname, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('NewSimulation Error!');
status=-1;
end
endfunction
function [status]=WriteSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs writesimulation %s %d %d %s", simfile, id,port,server);
disp(scommand)
result=unix_g(scommand);
simwid=mopen(simfile,'w');
mfprintf(simwid,'%s',result);
mclose(simwid);
status=0;
catch
disp('WriteSimulation Error!');
status=-1;
end
endfunction
function [status]=WriteLocalSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs writelocalsimulation %s %d %d %s", simfile, id,port,server);
disp(scommand)
result=unix_g(scommand);
simwid=mopen(simfile,'w');
mfprintf(simwid,'%s',result);
mclose(simwid);
status=0;
catch
disp('WriteLocalSimulation Error!');
status=-1;
end
endfunction
function [status]=AddMetadata(name, property,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addmetadata %s %s %d %d %s", name, property, id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddMetadata Error!');
status=-1;
end
endfunction
function [status]=SetMetadata(name, property,elist)
//SetMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setmetadata %s %s %d %d %s", name, property, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetMetadata Error!');
status=-1;
end
endfunction
function [property]=GetMetadata(name,elist)
//GetMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getmetadata %s %d %d %s", name, id,port,server);
property=unix_g(scommand);
status=0;
catch
disp('GetMetadata Error!');
status=-1;
end
endfunction
function [status]=AddDoubleParam(name, doub, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam double %s %f %d %d %d %s", name, doub,flag, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddDoubleParam Error!');
status=-1;
end
endfunction
function [result]=GetDoubleParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam double %s %d %d %s", name, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%f');
catch
disp('GetDoubleParam Error!');
result=-1;
end
//status=0;
endfunction
function [status]=SetDoubleParam(name, doub,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam double %s %f %d %d %s", name, doub, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetDoubleParam Error!');
status=-1;
end
endfunction
function [status]=AddIntParam(name, var, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam int %s %d %d %d %d %s", name, var,flag, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddIntParam Error!');
status=-1;
end
endfunction
function [result]=GetObjNum(elist)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getobjnum %d %d %s", name, var,flag, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetObjNum Error!');
status=-1;
end
endfunction
function [result]=GetIntParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam int %s %d %d %s", name, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetIntParam!');
result=-1;
end
//status=0;
endfunction
function [result]=SetIntParam(name, var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam int %s %d %d %d %s", name, var, id,port,server);
result=unix_g(scommand);
catch
disp('SetIntParam!');
result=-1;
end
endfunction
function [status]=AddStringParam(name, var, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam string %s %s %d %d %d %s", name, var,flag, id,port,server);
status=unix_g(scommand);
catch
disp('AddStringParam!');
status=-1;
end
endfunction
function [result]=GetStringParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam string %s %d %d %s", name, id,port,server);
result=unix_g(scommand);
catch
disp('GetStringParam!');
result=-1;
end
//status=0;
endfunction
function [status]=SetStringParam(name, var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam string %s %s %d %d %s", name, var, id,port,server);
status=unix_g(scommand);
catch
disp('SetStringParam!');
status=-1;
end
endfunction
function [status]=AddVecParam(name, var, vsize,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
vecstring=vectostring(var,' ');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs addparam vec %s %s %d %d %d %d %s", name, uvecstring,vsize,flag, id,port,server);
status=unix_g(scommand);
catch
disp('AddVecParam!');
status=-1;
end
endfunction
function [vec]=GetVecParam(name, vecsize,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam vec %s %d %d %d %s", name,vecsize, id,port,server);
result=unix_g(scommand);
vec=stringtovec(result, vecsize,' ');
catch
disp('GetVecParam!');
vec=-1;
end
endfunction
function [result]=SetVecParam(name, vin, vecsize,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
vecstring=vectostring(vin, ',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs setparam vec %s %s %d %d %d %s", name, uvecstring,vecsize, id,port,server);
result=unix_g(scommand);
catch
disp('SetVecParam!');
result=-1;
end
endfunction
function [result]=AddMatParam(name, var,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
[nr,nc]=size(var);
try
ind=1;
for i=1:nr
for j=1:nc
vvar(ind)=var(i,j);
ind=ind+1;
end
end
matstring=vectostring(vvar',' ');
//disp(matstring);
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umatstring=sprintf('""%s""',matstring);
scommand=sprintf("iogs addparam mat %s %s %d %d %d %d %d %s", name, umatstring,nr,nc,flag, id,port,server);
//disp(scommand);
result=unix_g(scommand);
catch
disp('AddParMatam!');
result=-1;
end
endfunction
function [mat]=GetMatParam(name,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam mat %s %d %d %d %d %s", name,nr,nc, id,port,server);
result=unix_g(scommand);
tmat=stringtovec(result, nr*nc,' ');
ind=1;
for i=1:nr
for j=1:nc
mat(i,j)=tmat(ind);
ind=ind+1;
end
end
catch
disp('GetParamMat error!');
mat=-1;
end
status=0;
endfunction
function [vvar]=SetMatParam(name, var, elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
[nr,nc]=size(var);
ind=1;
vvar=zeros(nr*nc);
for i=1:nr
for j=1:nc
vvar(ind)=var(i,j);
ind=ind+1;
end
end
vecstring=vectostring(vvar,' ');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs setparam mat %s %s %d %d %d %d %s", name, uvecstring,nr,nc, id, port,server);
result=unix_g(scommand);
catch
disp('SetMatParam error!');
result=-1;
end
status=0;
endfunction
function [status]=Addmmat3dParam(name, var, ni,nj,nk,nr,nc,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
vvar(ind)=var(i1,i2,i3,i,j);
ind=ind+1;
end
end
end
end
end
matstring=vectostring(vvar, ni*nj*nk*nr*nc,',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umatstring=sprintf('""%s""',matstring);
scommand=sprintf("iogs addparam mmat3d %s %s %d %d %d %d %d %d %d %d %s", name, umatstring,ni,nj,nk,nr,nc,flag, id, port,server);
status=unix_g(scommand);
catch
disp('Addmmat3dParam Error!');
status=-1;
end
endfunction
function [mat]=Getmmat3dParam(name, ni,nj,nk,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam mmat3d %s %d %d %d %d %d %d %d %s", name,ni,nj,nk,nr,nc, id,port,server);
result=unix_g(scommand);
tmat=stringtovec(result, ni*nj*nk*nr*nc,',');
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
mat(i1,i2,i3,i,j)=tmat(ind);
ind=ind+1;
end
end
end
end
end
catch
disp('Getmmat3dParam Error!');
mat=-1;
end
endfunction
function [vec]=Setmmat3dParam(name, var, ni,nj,nk,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
tmat(ind)=var(i1,i2,i3,i,j);
ind=ind+1;
end
end
end
end
end
mstring=vectostring(tmat, ni*nj*nk*nr*nc,',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umstring=sprintf('""%s""',mstring);
scommand=sprintf("iogs setparam mmat3d %s %s %d %d %d %d %d %d %d %s", name, umstring, ni,nj,nk,nr,nc, id,port,server);
vec=unix_g(scommand);
catch
disp('Setmmat3dParam Error!');
vec=-1;
end
endfunction
function [objnum]=GetObjNum(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getobjnum %d %d %s",id, port,server);
objnum=unix_g(scommand);
catch
disp('GetObjNum Error!');
objnum=-1;
end
endfunction
function [numobj]=GetNumObj(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getnumobj %d %d %s", id, port,server);
numobj=unix_g(scommand);
catch
disp('GetNumObj Error!');
numobj=-1;
end
endfunction
function [status]=GroupBarrier(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs groupbarrier %d %d %s", id, port,server);
status=unix_g(scommand);
catch
disp('GroupBarrier Error!');
status=-1;
end
endfunction
function [status]=DeleteParam(paramname,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs deleteparam %s %d %d %s", paramname,id, port,server);
status=unix_g(scommand);
catch
disp('DeleteParam Error!');
status=-1;
end
endfunction
function [paramlist]=ListParam(paramtype,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs listparam %s %d %d %s", paramtype,id, port,server);
paramlist=unix_g(scommand);
catch
disp('ListParam Error!');
paramlist=-1;
end
endfunction
//To use these functions make sure the location of the IOME iogs application
//is on the path
//Linux export IOME_HOME=PATHTOIOME
//Linux export PATH=$PATH":$IOME_HOME/bin"
//Windows set IOME_HOME=PATHTOIOME
//Windows set PATH=%PATH%;$IOME_HOME/bin
function [vec]=stringtovec(stringvar, vsize, separator)
vec=zeros(vsize,1);
newformatstring='';
formatmark='%f'
for i=1:vsize
if i>1 then
formatstring=sprintf("%s%s%s",newformatstring,separator,formatmark);
else
formatstring=sprintf("%s",formatmark);
end
newformatstring=formatstring;
end
vec=msscanf(-1,stringvar,formatstring);
endfunction
function [vecstring]=vectostring(vec,separator)
[r,vsize]=size(vec);
vecstring='';
for i=1:vsize
if i>1 then
newvecstring=sprintf("%s%s%f",vecstring,separator,vec(i));
else
newvecstring=sprintf("%f",vec(i));
end
vecstring=newvecstring;
end
endfunction
function [result]=GetNSteps(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getnsteps %d %d %s", id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetNSteps Error!');
result=-1;
end
//status=0;
endfunction
function [result]=GetStep(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getstep %d %d %s", id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetStep Error!');
result=-1;
end
//status=0;
endfunction
function [status]=SetNSteps(var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setnsteps %d %d %d %s", var,id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetNSteps Error!');
status=-1;
end
endfunction
function [status]=SetStep(var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setstep %d %d %d %s", var, id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetStep Error!');
status=-1;
end
endfunction
function [status]=ExitIOME(elist)
//Stop the server and exit IOME
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs exitiome %d %d %s",id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ExitIOME Error!');
status=-1;
end
endfunction
function [status]=RunSimulation(simfile, outfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs runsimulation %s %s %d %d %s",simfile, outfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('RunSimulation Error!');
status=-1;
end
endfunction
function [simid]=SubmitSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs submitsimulation %s %d %s", simfile, port,server);
result=unix_g(scommand);
simid=msscanf(result,'%d');
catch
disp('SubmitSimulation Error!');
simid=-1;
end
endfunction
function [status]=SimulationStatus(elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs simulationstatus %d %d %s", id, port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('SimulationStatus Error!');
status=-1;
end
endfunction
function [status]=GetSimulationResult(outfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs getsimulationresult %s %d %d %s", outfile, id,port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('GetSimulationResult Error!');
status=-1;
end
endfunction
function [status]=DeleteSimulation(elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Submit the generic simulation
//Simulation Config name
//returns
try
scommand=sprintf("iogs deletesimulation %d %d %s", id, port,server);
result=unix_g(scommand);
status=msscanf(result,'%d');
catch
disp('DeleteSimulation Error!');
status=-1;
end
endfunction
function [status]=ReadSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs readsimulation %s %d %d %s", simfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ReadSimulation Error!');
status=-1;
end
endfunction
function [status]=ReadLocalSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs readlocalsimulation %s %d %d %s", simfile, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('ReadLocalSimulation Error!');
status=-1;
end
endfunction
function [status]=NewSimulation(simname,xslname, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs newsimulation %s %s %d %d %s", simname,xslname, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('NewSimulation Error!');
status=-1;
end
endfunction
function [status]=WriteSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs writesimulation %s %d %d %s", simfile, id,port,server);
disp(scommand)
result=unix_g(scommand);
simwid=mopen(simfile,'w');
mfprintf(simwid,'%s',result);
mclose(simwid);
status=0;
catch
disp('WriteSimulation Error!');
status=-1;
end
endfunction
function [status]=WriteLocalSimulation(simfile, elist)
//function [status]=InitIOME(simname, configname, statename,port,server)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
//Start the generic simulation
//Simulation name
//Config name
//State file name
//port
try
scommand=sprintf("iogs writelocalsimulation %s %d %d %s", simfile, id,port,server);
disp(scommand)
//result=unix_g(scommand);
//simwid=mopen(simfile,'w');
//mfprintf(simwid,'%s',result);
//mclose(simwid);
status=0;
catch
disp('WriteLocalSimulation Error!');
status=-1;
end
endfunction
function [status]=AddMetadata(name, property,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addmetadata %s %s %d %d %s", name, property, id, port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddMetadata Error!');
status=-1;
end
endfunction
function [status]=SetMetadata(name, property,elist)
//SetMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setmetadata %s %s %d %d %s", name, property, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetMetadata Error!');
status=-1;
end
endfunction
function [property]=GetMetadata(name,elist)
//GetMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getmetadata %s %d %d %s", name, id,port,server);
property=unix_g(scommand);
status=0;
catch
disp('GetMetadata Error!');
status=-1;
end
endfunction
function [status]=AddDoubleParam(name, doub, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam double %s %f %d %d %d %s", name, doub,flag, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddDoubleParam Error!');
status=-1;
end
endfunction
function [result]=GetDoubleParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam double %s %d %d %s", name, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%f');
catch
disp('GetDoubleParam Error!');
result=-1;
end
//status=0;
endfunction
function [status]=SetDoubleParam(name, doub,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam double %s %f %d %d %s", name, doub, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('SetDoubleParam Error!');
status=-1;
end
endfunction
function [status]=AddIntParam(name, var, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam int %s %d %d %d %d %s", name, var,flag, id,port,server);
result=unix_g(scommand);
status=0;
catch
disp('AddIntParam Error!');
status=-1;
end
endfunction
function [result]=GetObjNum(elist)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getobjnum %d %d %s", name, var,flag, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetObjNum Error!');
status=-1;
end
endfunction
function [result]=GetIntParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam int %s %d %d %s", name, id,port,server);
sresult=unix_g(scommand);
result=msscanf(sresult,'%d');
catch
disp('GetIntParam!');
result=-1;
end
//status=0;
endfunction
function [result]=SetIntParam(name, var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam int %s %d %d %d %s", name, var, id,port,server);
result=unix_g(scommand);
catch
disp('SetIntParam!');
result=-1;
end
endfunction
function [status]=AddStringParam(name, var, flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs addparam string %s %s %d %d %d %s", name, var,flag, id,port,server);
status=unix_g(scommand);
catch
disp('AddStringParam!');
status=-1;
end
endfunction
function [result]=GetStringParam(name,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam string %s %d %d %s", name, id,port,server);
result=unix_g(scommand);
catch
disp('GetStringParam!');
result=-1;
end
//status=0;
endfunction
function [status]=SetStringParam(name, var,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs setparam string %s %s %d %d %s", name, var, id,port,server);
status=unix_g(scommand);
catch
disp('SetStringParam!');
status=-1;
end
endfunction
function [status]=AddVecParam(name, var, vsize,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
vecstring=vectostring(var,' ');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs addparam vec %s %s %d %d %d %d %s", name, uvecstring,vsize,flag, id,port,server);
status=unix_g(scommand);
catch
disp('AddVecParam!');
status=-1;
end
endfunction
function [vec]=GetVecParam(name, vecsize,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam vec %s %d %d %d %s", name,vecsize, id,port,server);
result=unix_g(scommand);
vec=stringtovec(result, vecsize,' ');
catch
disp('GetVecParam!');
vec=-1;
end
endfunction
function [result]=SetVecParam(name, vin, vecsize,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
vecstring=vectostring(vin, ',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs setparam vec %s %s %d %d %d %s", name, uvecstring,vecsize, id,port,server);
result=unix_g(scommand);
catch
disp('SetVecParam!');
result=-1;
end
endfunction
function [result]=AddMatParam(name, var,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
[nr,nc]=size(var);
try
ind=1;
for i=1:nr
for j=1:nc
vvar(ind)=var(i,j);
ind=ind+1;
end
end
matstring=vectostring(vvar',' ');
//disp(matstring);
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umatstring=sprintf('""%s""',matstring);
scommand=sprintf("iogs addparam mat %s %s %d %d %d %d %d %s", name, umatstring,nr,nc,flag, id,port,server);
//disp(scommand);
result=unix_g(scommand);
catch
disp('AddParMatam!');
result=-1;
end
endfunction
function [mat]=GetMatParam(name,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam mat %s %d %d %d %d %s", name,nr,nc, id,port,server);
result=unix_g(scommand);
tmat=stringtovec(result, nr*nc,' ');
ind=1;
for i=1:nr
for j=1:nc
mat(i,j)=tmat(ind);
ind=ind+1;
end
end
catch
disp('GetParamMat error!');
mat=-1;
end
status=0;
endfunction
function [vvar]=SetMatParam(name, var, elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
[nr,nc]=size(var);
ind=1;
vvar=zeros(nr*nc);
for i=1:nr
for j=1:nc
vvar(ind)=var(i,j);
ind=ind+1;
end
end
vecstring=vectostring(vvar,' ');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
uvecstring=sprintf('""%s""',vecstring);
scommand=sprintf("iogs setparam mat %s %s %d %d %d %d %s", name, uvecstring,nr,nc, id, port,server);
result=unix_g(scommand);
catch
disp('SetMatParam error!');
result=-1;
end
status=0;
endfunction
function [status]=Addmmat3dParam(name, var, ni,nj,nk,nr,nc,flag,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
vvar(ind)=var(i1,i2,i3,i,j);
ind=ind+1;
end
end
end
end
end
matstring=vectostring(vvar, ni*nj*nk*nr*nc,',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umatstring=sprintf('""%s""',matstring);
scommand=sprintf("iogs addparam mmat3d %s %s %d %d %d %d %d %d %d %d %s", name, umatstring,ni,nj,nk,nr,nc,flag, id, port,server);
status=unix_g(scommand);
catch
disp('Addmmat3dParam Error!');
status=-1;
end
endfunction
function [mat]=Getmmat3dParam(name, ni,nj,nk,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getparam mmat3d %s %d %d %d %d %d %d %d %s", name,ni,nj,nk,nr,nc, id,port,server);
result=unix_g(scommand);
tmat=stringtovec(result, ni*nj*nk*nr*nc,',');
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
mat(i1,i2,i3,i,j)=tmat(ind);
ind=ind+1;
end
end
end
end
end
catch
disp('Getmmat3dParam Error!');
mat=-1;
end
endfunction
function [vec]=Setmmat3dParam(name, var, ni,nj,nk,nr,nc,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
ind=1;
for i1=1:ni
for i2=1:nj
for i3=1:nk
for i=1:nr
for j=1:nc
tmat(ind)=var(i1,i2,i3,i,j);
ind=ind+1;
end
end
end
end
end
mstring=vectostring(tmat, ni*nj*nk*nr*nc,',');
//put double quotes around the vec string so that it is
//passed into unix shell script as a single variable
umstring=sprintf('""%s""',mstring);
scommand=sprintf("iogs setparam mmat3d %s %s %d %d %d %d %d %d %d %s", name, umstring, ni,nj,nk,nr,nc, id,port,server);
vec=unix_g(scommand);
catch
disp('Setmmat3dParam Error!');
vec=-1;
end
endfunction
function [objnum]=GetObjNum(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getobjnum %d %d %s",id, port,server);
objnum=unix_g(scommand);
catch
disp('GetObjNum Error!');
objnum=-1;
end
endfunction
function [numobj]=GetNumObj(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs getnumobj %d %d %s", id, port,server);
numobj=unix_g(scommand);
catch
disp('GetNumObj Error!');
numobj=-1;
end
endfunction
function [status]=GroupBarrier(elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs groupbarrier %d %d %s", id, port,server);
status=unix_g(scommand);
catch
disp('GroupBarrier Error!');
status=-1;
end
endfunction
function [status]=DeleteParam(paramname,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs deleteparam %s %d %d %s", paramname,id, port,server);
status=unix_g(scommand);
catch
disp('DeleteParam Error!');
status=-1;
end
endfunction
function [paramlist]=ListParam(paramtype,elist)
//AddMetadata(name, property, port)
nargin=length(elist);
if nargin>0 then
server=elist(1);
if nargin>1 then
port=elist(2);
if nargin>2 then
id=elist(3);
else
id=0;
end
else
port=8080;
end
else
server='localhost';
port=8080;
id=0;
end
try
scommand=sprintf("iogs listparam %s %d %d %s", paramtype,id, port,server);
paramlist=unix_g(scommand);
catch
disp('ListParam Error!');
paramlist=-1;
end
endfunction
|
263721ebfe36b10e093679acb9c68c15c3e6e0f2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /764/CH8/EX8.17.a/data8_17.sci | 37eb1d73f637e65cbae5d6d23a55697f8e786467 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 596 | sci | data8_17.sci |
//(Welded and Riveted Joints) Example 8.17
//Plate thickness d (mm)
d = 25
//Reversed axial load acting on the plates P (kN)
P = 100
//Throat of the weld t (mm)
t = 25
//Ultimate tensile strength of the weld material Sut (N/mm2)
Sut = 450
//Factor of safety fs
fs = 2
reliability = 90
//Operation
//Nomenclature:
//1 - Ground
//2 - Machined or cold drawn
//3 - Hot-rolled
//4 - Forged
op = 4
//Type of weld
//1 - Reinforced butt-weld
//2 - Toe of transverse fillet-weld
//3 - End of parallel fillet weld
//4 - T-butt joint with sharp corners
w = 1
|
664ef74febb68f33d50ccebb123e200c510ff75d | 449d555969bfd7befe906877abab098c6e63a0e8 | /3250/CH3/EX3.3/Ex3_3.sce | fbb8cb052196c5394d4d54001f0e632438c29a68 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,532 | sce | Ex3_3.sce | clc
// Given that
A = 150*6 // Cross-section of strips in mm^2
w = 150 // Width of the strip in mm
ti = 6 // Thickness in mm
pA = 0.20 // Reduction in area
d = 400 // Diameter of steel rolls in mm
Ys = 0.35// Shear Yield stress of the material before rolling in KN/mm^2
Ys_ = 0.4// Shear Yield stress of the material after rolling in KN/mm^2
mu = 0.1 // Cofficient of friction
mu_ = 0.005 // Cofficient of friction in bearing
D = 150 // The diameter of bearing in mm
v = 30 // Speed of rolling in m/min
// Sample Problem 3 on page no. 115
printf("\n # PROBLEM 3.3 # \n")
tf =0.8*ti
Ys_a = (Ys + Ys_)/2
r=d/2
thetaI = sqrt((ti-tf)/r)
lambdaI=2*sqrt(r/tf)*atan(thetaI *sqrt(r/tf))
lambdaN = (1/2)*((1/mu)*(log(tf/ti)) + lambdaI)
thetaN =(sqrt(tf/r))*(tan((lambdaN/2)*(sqrt(tf/r))))
Dtheta_a = thetaN/4
Dtheta_b = (thetaI- thetaN)/8
i = 0
for i = 0:4
theta = i*Dtheta_a
y = (1/2)* (tf+r*theta^2)
lambda = 2*sqrt(r/tf)*atand(theta*(%pi/180) *sqrt(r/tf))
p_a = 2*Ys_a*(2*y/tf)*(exp(mu*lambda))
end
I1 = (Dtheta_a/3) *(0.75+.925+4*(.788+.876)+2*.830)
for i = 0:8
theta1 = i*Dtheta_b + thetaN
y = (1/2)* (tf+r*theta1^2)
lambda = 2*sqrt(r/tf)*atand(theta1*(%pi/180) *sqrt(r/tf))
p_b = 2*Ys_a*(2*y/ti)*(exp(mu*(lambdaI-lambda)))
end
I2 = (Dtheta_b/3)*(0.925+.75+4*(.887+.828+.786+.759) + 2*(.855+.804+.772))
F = r*(I1 + I2)
F_ = F*w
T = (r^2)*mu*(I2-I1)
T_ =T*w
W = v*(1000/60)/r
P_ = 2*T_*W
Pl = mu_*F_*D*W
P = Pl+P_
printf("\n The mill power = %f kW",P/1000)
// Answer in the book is given as 79.18 kW
|
09644927a6eba8f73823b9257b7e5dfa94e000bd | 449d555969bfd7befe906877abab098c6e63a0e8 | /608/CH33/EX33.10/33_10.sce | 4f942091ca0aaddfb8b054db4f9ab0bf878d9bbb | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 826 | sce | 33_10.sce | //Problem 33.10: For the circuit shown in Figure 33.52 determine the current flowing in the inductive branch by using Norton’s theorem.
//initializing the variables:
V1 = 20; // in volts
V2 = 10; // in volts
R1 = 2; // in ohm
R2 = 1.5; // in ohm
R3 = %i*2.95; // in ohm
R4 = 3; // in ohm
//calculation:
//The inductive branch is initially short-circuited, as shown in Figure 33.53.
//From Figure 33.53,
I1 = V1/R1
I2 = V2/R4
Isc = I1 + I2
//If the voltage sources are removed, the impedance, z, ‘looking in’ at a break made in AB is given by
z = R1*R4/(R1 + R4)
//The Norton equivalent network is shown in Figure 33.54, where current I is given by
I = (z/(z + R2 + R3))*Isc
printf("\n\n Result \n\n")
printf("\n the current flowing in the inductive branch is %.2f + (%.2f)i A",real(I), imag(I)) |
b5544b5b79c5d121958311d8483d0e5a74599cfb | 449d555969bfd7befe906877abab098c6e63a0e8 | /1373/CH7/EX7.2/Chapter7_Example2.sce | 6081a29159f3a8a23e84b7732f8036c80357db08 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,178 | sce | Chapter7_Example2.sce | //Chapter-7, Example 7.2, Page 275
//=============================================================================
clc
clear
//INPUT DATA
Ta=20;//Temperature of air in degree C
Tp=134;//Temperature of heated plate in degree C
v=3;//Velocity of flow in m/s
L=2;//Length of plate in m
W=1.5;//Width of plate in m
x=0.4;//Distance of plane from the plate in m
k=(15.06*10^-6);//Kinematic viscosity in m^2/s
//CALCULATIONS
Tf=(Ta+Tp)/2;//Film temperature in degree C
pw=0.998;//Density of air at 77 degree C
Cp=1009;//Specific heat of air at 77 degree C
kw=(20.76*10^-6);//Kinematic viscosity of air at 77 degree C
k=0.03;//Thermal conductivity of air at 77 degree C
Pr=0.697;//prantl number of air at 77 degree C
Re=(v*x)/kw;//Reynolds number
Nu=(0.332*Re^0.5*Pr^(1/3));//Nusselts number
h=(Nu*k)/x;//Heat transfer coefficient in W/m^2.K
h1=(h*2);//Average value of heat transfer coefficient in W/m^2.K
Q=h1*x*W*(Tp-Ta);//Heat flow in W
Q1=(2*Q);//Heat flow from both sides of the plate in W
//OUTPUT
mprintf('Heat flow from both sides of the plate is %3.0f W',Q1)
//=================================END OF PROGRAM==============================
|
0900e72738b48c6ce0520f59731327400532724e | 449d555969bfd7befe906877abab098c6e63a0e8 | /2024/CH8/EX8.1/8_1.sce | 8862c59ad38257586e47605531351e936d4fdc5c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 165 | sce | 8_1.sce | clc
//Initialization of variables
R=1.986 //B/mol R
t2=1100 //R
t1=1000 //R
//calculations
wrev=R*(t2-t1)
//results
printf("work done = %.1f Btu/mol",wrev)
|
5fd77f3b87a5a9e1830e873be846e752c6075973 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3648/CH27/EX27.1/Ex27_1.sce | c521109454084eb59ea894b25df4ff01a1d8a8e3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 323 | sce | Ex27_1.sce | //Example 27_1
clc();
clear;
//What fraction of atomic mass of Uranium is due to its electrons
n=92 //Units in constant
mass=0.000549 //Units in u
tmass=235 //units in u
per=(n*mass)/tmass //Units in fractions
printf("The fraction of atomic mass of Uranium is due to its electrons is=%.6f",per)
|
29550b33941e94b9644a2abbda1eb315ab19d534 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3843/CH9/EX9.2/Ex9_2.sce | 7dd0ad003b2e6d4839a81a784cf13ce2b3aeecce | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 641 | sce | Ex9_2.sce | // Example 9_2
clc;funcprot(0);
// Given data
m=20;// The mass flow rate of air in kg/min
P_4=1600;// kPa
T_1=20+273;// K
P_1=100;// kPa
n=0.90;// The efficiency of the compressor
c_p=1.00;// kJ/kg.K
k=1.4;// The specific heat ratio
// Calculation
P_2=sqrt(P_1*P_4);// kPa
T_3=T_1;// K
T_2a=T_1*(P_2/P_1)^((k-1)/k);// K
// Assume T_2'=T_2a
// P_4/P_3=P_2/P_1
T_4a=T_3*(P_2/P_1)^((k-1)/k);// K
T_2=T_1+((1/n)*(T_2a-T_1));// K
T_4=T_2;// K
W_comp=((m/60)*c_p*(T_2-T_1))+((m/60)*c_p*(T_4-T_3));// The required power in kW
printf("\nThe power required to drive the two-stage adiabatic compressor,W_comp=%3.0f kW",W_comp);
|
00a05505cb250f5b2bb61a8808993d580e572cab | 95a91e0c642afba8090e47bd70e3efb36da36e43 | /UP.eps/old_files/Phi_q.1_linux.sce | 4f0c9589896b764ccbc54319c46a2e71019a5c64 | [] | no_license | Varvara08/myrepo | f4f2d4e0da09b9eea225deab49d3dfd49d861266 | 588458d7d92407761cc9cd7cc3273e70aa9f84b0 | refs/heads/master | 2021-01-20T17:20:40.176769 | 2016-08-17T13:10:46 | 2016-08-18T10:38:17 | 63,784,698 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 12,649 | sce | Phi_q.1_linux.sce |
clear;
lines(0);
np=100;
q=3;
//rang=190/300
for w=list(210,220,240,260,280,300)
msig = 1 // номер строки, отвечающая нужной нам плотности прививки, с которой мы будем считывать
msig1 =2
msig2 =3
msig3 =4
msig4 =5
msig5 =6
msig6 =7
msig7 =8
msig8 =9
msig9 =10
msig10 =11
msig11 =12
msig12 =13
msig13 =14
msig14 =15
msig15 =16
msig16 =17
msig17 =18
msig18 =19
msig19 =20
msig20 =21
msig21 =22
msig22 =23
msig23 =24
msig24 =25
msig25 =26
msig26 =27
msig27 =28
msig28 =29
msig29 =30
msig30 =31
msig31 =32
msig32 =33
msig33 =34
msig34 =35
msig35 =36
msig36 =37
msig37 =38
msig38 =39
msig39 =40
msig40 =41
msig41 =42
msig42 =43
msig43 =44
msig44 =45
msig45 =46
msig46 =47
msig47 =48
msig48 =49
msig49 =50
msig50 =51
msig51 =52
msig52 =53
msig53 =54
msig54 =55
msig55 =56
msig56 =57
msig57 =58
msig58 =59
msig59 =60
msig60 =61
msig61 =62
msig62 =63
msig63 =64
msig64 =65
msig65 =66
msig66 =67
msig67 =68
msig68 =69
msig69 =70
msig70 =71
msig71 =72
msig72 =73
msig73 =74
msig74 =75
msig75 =76
msig76 =77
msig77 =78
msig78 =79
msig79 =80
msig80 =81
msig81 =82
msig82 =83
msig83 =84
msig84 =85
msig85 =86
msig86 =87
msig87 =88
msig88 =89
msig89 =90
msig90 =91
msig91 =92
msig92 =93
msig93 =94
msig94 =95
msig95 =96
msig96 =97
msig97 =98
msig98 =99
msig99 =100
msig100 =101
msig101 =102
msig102 =103
msig103 =104
msig104 =105
msig105 =106
msig106 =107
msig107 =108
msig108 =109
msig109 =110
msig110 =111
msig111 =112
msig112 =113
msig113 =114
msig114 =115
msig115 =116
msig116 =117
msig117 =118
msig118 =119
msig119 =120
msig120 =121
msig121 =122
msig122 =123
msig123 =124
msig124 =125
msig125 =126
msig126 =127
msig127 =128
msig128 =129
msig129 =130
msig130 =131
msig131 =132
msig132 =133
msig133 =134
msig134 =135
msig135 =136
msig136 =137
msig137 =138
msig138 =139
msig139 =140
msig140 =141
msig141 =142
msig142 =143
msig143 =144
msig144 =145
msig145 =146
msig146 =147
msig147 =148
msig148 =149
msig149 =150
msig150 =151
msig151 =152
msig152 =153
msig153 =154
msig154 =155
msig155 =156
msig156 =157
msig157 =158
msig158 =159
msig159 =160
msig160 =161
msig161 =162
msig162 =163
msig163 =164
msig164 =165
msig165 =166
msig166 =167
msig167 =168
msig168 =169
msig169 =170
msig170 =171
msig171 =172
msig172 =173
msig173 =174
msig174 =175
msig175 =176
msig176 =177
msig177 =178
msig178 =179
msig179 =180
msig180 =181
msig181 =182
msig182 =183
msig183 =184
msig184 =185
msig185 =186
msig186 =187
msig187 =188
msig188 =189
msig189 =190
msig190 =191
msig191 =192
msig192 =193
msig193 =194
msig194 =195
msig195 =196
msig196 =197
msig197 =198
msig198 =199
msig199 =200
msig200 =201
msig201 =202
msig202 =203
msig203 =204
msig204 =205
msig205 =206
msig206 =207
msig207 =208
msig208 =209
msig209 =210
msig210 =211
msig211 =212
msig212 =213
msig213 =214
msig214 =215
msig215 =216
msig216 =217
msig217 =218
msig218 =219
msig219 =220
msig220 =221
msig221 =222
msig222 =223
msig223 =224
msig224 =225
msig225 =226
msig226 =227
msig227 =228
msig228 =229
msig229 =230
msig230 =231
msig231 =232
msig232 =233
msig233 =234
msig234 =235
msig235 =236
msig236 =237
msig237 =238
msig238 =239
msig239 =240
msig240 =241
msig241 =242
msig242 =243
msig243 =244
msig244 =245
msig245 =246
msig246 =247
msig247 =248
msig248 =249
msig249 =250
msig250 =251
msig251 =252
msig252 =253
msig253 =254
msig254 =255
msig255 =256
msig256 =257
msig257 =258
msig258 =259
msig259 =260
msig260 =261
msig261 =262
msig262 =263
msig263 =264
msig264 =265
msig265 =266
msig266 =267
msig267 =268
msig268 =269
msig269 =270
msig270 =271
msig271 =272
msig272 =273
msig273 =274
msig274 =275
msig275 =276
msig276 =277
msig277 =278
msig278 =279
msig279 =280
msig280 =281
msig281 =282
msig282 =283
msig283 =284
msig284 =285
msig285 =286
msig286 =287
msig287 =288
msig288 =289
msig289 =290
msig290 =291
msig291 =292
msig292 =293
msig293 =294
msig294 =295
msig295 =296
msig296 =297
msig297 =298
msig298 =299
msig299 =300
msig300 =301
msig301 =302
msig302 =303
msig303 =304
msig304 =305
j=0;
sigma=400;
s0 = '/home/alexk/AlexK/IMC/StarBrush/Neutral/n=' + string(np) + '/q=' + string(q) + 'den' +'/m=' + string(w) +'/' ;
s = s0 + 'CSBrush_m=' + string(w) + '_' + string(sigma) + '.dat';
s1 = '/home/alexk/AlexK/IMC/StarBrush/Neutral/n=' + string(np) + '/Result/Phi/';
a=fscanfMat(s);
[m,n]=size(a);
j=j+1;
b(1,j)=a(msig1,2)*20
b(2,j)=a(msig2,2)*20
b(3,j)=a(msig3,2)*20
b(4,j)=a(msig4,2)*20
b(5,j)=a(msig5,2)*20
b(6,j)=a(msig6,2)*20
b(7,j)=a(msig7,2)*20
b(8,j)=a(msig8,2)*20
b(9,j)=a(msig9,2)*20
b(10,j)=a(msig10,2)*20
b(11,j)=a(msig11,2)*20
b(12,j)=a(msig12,2)*20
b(13,j)=a(msig13,2)*20
b(14,j)=a(msig14,2)*20
b(15,j)=a(msig15,2)*20
b(16,j)=a(msig16,2)*20
b(17,j)=a(msig17,2)*20
b(18,j)=a(msig18,2)*20
b(19,j)=a(msig19,2)*20
b(20,j)=a(msig20,2)*20
b(21,j)=a(msig21,2)*20
b(22,j)=a(msig22,2)*20
b(23,j)=a(msig23,2)*20
b(24,j)=a(msig24,2)*20
b(25,j)=a(msig25,2)*20
b(26,j)=a(msig26,2)*20
b(27,j)=a(msig27,2)*20
b(28,j)=a(msig28,2)*20
b(29,j)=a(msig29,2)*20
b(30,j)=a(msig30,2)*20
b(31,j)=a(msig31,2)*20
b(32,j)=a(msig32,2)*20
b(33,j)=a(msig33,2)*20
b(34,j)=a(msig34,2)*20
b(35,j)=a(msig35,2)*20
b(36,j)=a(msig36,2)*20
b(37,j)=a(msig37,2)*20
b(38,j)=a(msig38,2)*20
b(39,j)=a(msig39,2)*20
b(40,j)=a(msig40,2)*20
b(41,j)=a(msig41,2)*20
b(42,j)=a(msig42,2)*20
b(43,j)=a(msig43,2)*20
b(44,j)=a(msig44,2)*20
b(45,j)=a(msig45,2)*20
b(46,j)=a(msig46,2)*20
b(47,j)=a(msig47,2)*20
b(48,j)=a(msig48,2)*20
b(49,j)=a(msig49,2)*20
b(50,j)=a(msig50,2)*20
b(51,j)=a(msig51,2)*20
b(52,j)=a(msig52,2)*20
b(53,j)=a(msig53,2)*20
b(54,j)=a(msig54,2)*20
b(55,j)=a(msig55,2)*20
b(56,j)=a(msig56,2)*20
b(57,j)=a(msig57,2)*20
b(58,j)=a(msig58,2)*20
b(59,j)=a(msig59,2)*20
b(60,j)=a(msig60,2)*20
b(61,j)=a(msig61,2)*20
b(62,j)=a(msig62,2)*20
b(63,j)=a(msig63,2)*20
b(64,j)=a(msig64,2)*20
b(65,j)=a(msig65,2)*20
b(66,j)=a(msig66,2)*20
b(67,j)=a(msig67,2)*20
b(68,j)=a(msig68,2)*20
b(69,j)=a(msig69,2)*20
b(70,j)=a(msig70,2)*20
b(71,j)=a(msig71,2)*20
b(72,j)=a(msig72,2)*20
b(73,j)=a(msig73,2)*20
b(74,j)=a(msig74,2)*20
b(75,j)=a(msig75,2)*20
b(76,j)=a(msig76,2)*20
b(77,j)=a(msig77,2)*20
b(78,j)=a(msig78,2)*20
b(79,j)=a(msig79,2)*20
b(80,j)=a(msig80,2)*20
b(81,j)=a(msig81,2)*20
b(82,j)=a(msig82,2)*20
b(83,j)=a(msig83,2)*20
b(84,j)=a(msig84,2)*20
b(85,j)=a(msig85,2)*20
b(86,j)=a(msig86,2)*20
b(87,j)=a(msig87,2)*20
b(88,j)=a(msig88,2)*20
b(89,j)=a(msig89,2)*20
b(90,j)=a(msig90,2)*20
b(91,j)=a(msig91,2)*20
b(92,j)=a(msig92,2)*20
b(93,j)=a(msig93,2)*20
b(94,j)=a(msig94,2)*20
b(95,j)=a(msig95,2)*20
b(96,j)=a(msig96,2)*20
b(97,j)=a(msig97,2)*20
b(98,j)=a(msig98,2)*20
b(99,j)=a(msig99,2)*20
b(100,j)=a(msig100,2)*20
b(101,j)=a(msig101,2)*20
b(102,j)=a(msig102,2)*20
b(103,j)=a(msig103,2)*20
b(104,j)=a(msig104,2)*20
b(105,j)=a(msig105,2)*20
b(106,j)=a(msig106,2)*20
b(107,j)=a(msig107,2)*20
b(108,j)=a(msig108,2)*20
b(109,j)=a(msig109,2)*20
b(110,j)=a(msig110,2)*20
b(111,j)=a(msig111,2)*20
b(112,j)=a(msig112,2)*20
b(113,j)=a(msig113,2)*20
b(114,j)=a(msig114,2)*20
b(115,j)=a(msig115,2)*20
b(116,j)=a(msig116,2)*20
b(117,j)=a(msig117,2)*20
b(118,j)=a(msig118,2)*20
b(119,j)=a(msig119,2)*20
b(120,j)=a(msig120,2)*20
b(121,j)=a(msig121,2)*20
b(122,j)=a(msig122,2)*20
b(123,j)=a(msig123,2)*20
b(124,j)=a(msig124,2)*20
b(125,j)=a(msig125,2)*20
b(126,j)=a(msig126,2)*20
b(127,j)=a(msig127,2)*20
b(128,j)=a(msig128,2)*20
b(129,j)=a(msig129,2)*20
b(130,j)=a(msig130,2)*20
b(131,j)=a(msig131,2)*20
b(132,j)=a(msig132,2)*20
b(133,j)=a(msig133,2)*20
b(134,j)=a(msig134,2)*20
b(135,j)=a(msig135,2)*20
b(136,j)=a(msig136,2)*20
b(137,j)=a(msig137,2)*20
b(138,j)=a(msig138,2)*20
b(139,j)=a(msig139,2)*20
b(140,j)=a(msig140,2)*20
b(141,j)=a(msig141,2)*20
b(142,j)=a(msig142,2)*20
b(143,j)=a(msig143,2)*20
b(144,j)=a(msig144,2)*20
b(145,j)=a(msig145,2)*20
b(146,j)=a(msig146,2)*20
b(147,j)=a(msig147,2)*20
b(148,j)=a(msig148,2)*20
b(149,j)=a(msig149,2)*20
b(150,j)=a(msig150,2)*20
b(151,j)=a(msig151,2)*20
b(152,j)=a(msig152,2)*20
b(153,j)=a(msig153,2)*20
b(154,j)=a(msig154,2)*20
b(155,j)=a(msig155,2)*20
b(156,j)=a(msig156,2)*20
b(157,j)=a(msig157,2)*20
b(158,j)=a(msig158,2)*20
b(159,j)=a(msig159,2)*20
b(160,j)=a(msig160,2)*20
b(161,j)=a(msig161,2)*20
b(162,j)=a(msig162,2)*20
b(163,j)=a(msig163,2)*20
b(164,j)=a(msig164,2)*20
b(165,j)=a(msig165,2)*20
b(166,j)=a(msig166,2)*20
b(167,j)=a(msig167,2)*20
b(168,j)=a(msig168,2)*20
b(169,j)=a(msig169,2)*20
b(170,j)=a(msig170,2)*20
b(171,j)=a(msig171,2)*20
b(172,j)=a(msig172,2)*20
b(173,j)=a(msig173,2)*20
b(174,j)=a(msig174,2)*20
b(175,j)=a(msig175,2)*20
b(176,j)=a(msig176,2)*20
b(177,j)=a(msig177,2)*20
b(178,j)=a(msig178,2)*20
b(179,j)=a(msig179,2)*20
b(180,j)=a(msig180,2)*20
b(181,j)=a(msig181,2)*20
b(182,j)=a(msig182,2)*20
b(183,j)=a(msig183,2)*20
b(184,j)=a(msig184,2)*20
b(185,j)=a(msig185,2)*20
b(186,j)=a(msig186,2)*20
b(187,j)=a(msig187,2)*20
b(188,j)=a(msig188,2)*20
b(189,j)=a(msig189,2)*20
b(190,j)=a(msig190,2)*20
b(191,j)=a(msig191,2)*20
b(192,j)=a(msig192,2)*20
b(193,j)=a(msig193,2)*20
b(194,j)=a(msig194,2)*20
b(195,j)=a(msig195,2)*20
b(196,j)=a(msig196,2)*20
b(197,j)=a(msig197,2)*20
b(198,j)=a(msig198,2)*20
b(199,j)=a(msig199,2)*20
b(200,j)=a(msig200,2)*20
b(201,j)=a(msig201,2)*20
b(202,j)=a(msig202,2)*20
b(203,j)=a(msig203,2)*20
b(204,j)=a(msig204,2)*20
b(205,j)=a(msig205,2)*20
b(206,j)=a(msig206,2)*20
b(207,j)=a(msig207,2)*20
b(208,j)=a(msig208,2)*20
b(209,j)=a(msig209,2)*20
b(210,j)=a(msig210,2)*20
b(211,j)=a(msig211,2)*20
b(212,j)=a(msig212,2)*20
b(213,j)=a(msig213,2)*20
b(214,j)=a(msig214,2)*20
b(215,j)=a(msig215,2)*20
b(216,j)=a(msig216,2)*20
b(217,j)=a(msig217,2)*20
b(218,j)=a(msig218,2)*20
b(219,j)=a(msig219,2)*20
b(220,j)=a(msig220,2)*20
b(221,j)=a(msig221,2)*20
b(222,j)=a(msig222,2)*20
b(223,j)=a(msig223,2)*20
b(224,j)=a(msig224,2)*20
b(225,j)=a(msig225,2)*20
b(226,j)=a(msig226,2)*20
b(227,j)=a(msig227,2)*20
b(228,j)=a(msig228,2)*20
b(229,j)=a(msig229,2)*20
b(230,j)=a(msig230,2)*20
b(231,j)=a(msig231,2)*20
b(232,j)=a(msig232,2)*20
b(233,j)=a(msig233,2)*20
b(234,j)=a(msig234,2)*20
b(235,j)=a(msig235,2)*20
b(236,j)=a(msig236,2)*20
b(237,j)=a(msig237,2)*20
b(238,j)=a(msig238,2)*20
b(239,j)=a(msig239,2)*20
b(240,j)=a(msig240,2)*20
b(241,j)=a(msig241,2)*20
b(242,j)=a(msig242,2)*20
b(243,j)=a(msig243,2)*20
b(244,j)=a(msig244,2)*20
b(245,j)=a(msig245,2)*20
b(246,j)=a(msig246,2)*20
b(247,j)=a(msig247,2)*20
b(248,j)=a(msig248,2)*20
b(249,j)=a(msig249,2)*20
b(250,j)=a(msig250,2)*20
b(251,j)=a(msig251,2)*20
b(252,j)=a(msig252,2)*20
b(253,j)=a(msig253,2)*20
b(254,j)=a(msig254,2)*20
b(255,j)=a(msig255,2)*20
b(256,j)=a(msig256,2)*20
b(257,j)=a(msig257,2)*20
b(258,j)=a(msig258,2)*20
b(259,j)=a(msig259,2)*20
b(260,j)=a(msig260,2)*20
b(261,j)=a(msig261,2)*20
b(262,j)=a(msig262,2)*20
b(263,j)=a(msig263,2)*20
b(264,j)=a(msig264,2)*20
b(265,j)=a(msig265,2)*20
b(266,j)=a(msig266,2)*20
b(267,j)=a(msig267,2)*20
b(268,j)=a(msig268,2)*20
b(269,j)=a(msig269,2)*20
b(270,j)=a(msig270,2)*20
b(271,j)=a(msig271,2)*20
b(272,j)=a(msig272,2)*20
b(273,j)=a(msig273,2)*20
b(274,j)=a(msig274,2)*20
b(275,j)=a(msig275,2)*20
b(276,j)=a(msig276,2)*20
b(277,j)=a(msig277,2)*20
b(278,j)=a(msig278,2)*20
b(279,j)=a(msig279,2)*20
b(280,j)=a(msig280,2)*20
b(281,j)=a(msig281,2)*20
b(282,j)=a(msig282,2)*20
b(283,j)=a(msig283,2)*20
b(284,j)=a(msig284,2)*20
b(285,j)=a(msig285,2)*20
b(286,j)=a(msig286,2)*20
b(287,j)=a(msig287,2)*20
b(288,j)=a(msig288,2)*20
b(289,j)=a(msig289,2)*20
b(290,j)=a(msig290,2)*20
b(291,j)=a(msig291,2)*20
b(292,j)=a(msig292,2)*20
b(293,j)=a(msig293,2)*20
b(294,j)=a(msig294,2)*20
b(295,j)=a(msig295,2)*20
b(296,j)=a(msig296,2)*20
b(297,j)=a(msig297,2)*20
b(298,j)=a(msig298,2)*20
b(299,j)=a(msig299,2)*20
b(300,j)=a(msig300,2)*20
b(301,j)=a(msig301,2)*20
b(302,j)=a(msig302,2)*20
b(303,j)=a(msig303,2)*20
b(304,j)=a(msig304,2)*20
//sig = msig*0.001; // плотность прививки, соответствующая номеру строки msig
sout = s1 + 'Phi_q=' + string(q) +'_sigma='+string(sigma)+ '_m='+string(w) + '_np=' + string(np) + '.dat';
u=file('open',sout,'unknown');
write(u, b, '(f12.6,32(e16.6))');
file('close',u);
end
|
abaa23a9d820ee99baeca7f1a9585e76f4fc6830 | 3cbee2296fd6b54f80587eead83813d4c878e06a | /sci2blif/sci2blif_added_blocks/mult.sce | 0904bdf9399f7e1eb744e6d893c1065ba4216416 | [] | no_license | nikhil-soraba/rasp30 | 872afa4ad0820b8ca3ea4f232c4168193acbd854 | 936c6438de595f9ac30d5619a887419c5bae2b0f | refs/heads/master | 2021-01-12T15:19:09.899590 | 2016-10-31T03:23:48 | 2016-10-31T03:23:48 | 71,756,442 | 0 | 0 | null | 2016-10-24T05:58:57 | 2016-10-24T05:58:56 | null | UTF-8 | Scilab | false | false | 553 | sce | mult.sce | //**************************** MULT ************************************
if (blk_name.entries(bl) =='mult') then
mputl("# MULT",fd_w);
mputl(".subckt mult in[0]=net"+string(blk(blk_objs(bl),2))+'_'+ string(1)+ " in[1]=net"+string(blk(blk_objs(bl),3))+'_'+ string(1)+ " in[2]=net"+string(blk(blk_objs(bl),4))+'_'+ string(1)+ " in[3]=net"+string(blk(blk_objs(bl),5))+'_'+ string(1)+" out[0]=net"+ string(blk(blk_objs(bl),2+numofip))+'_'+ string(1)+" out[1]=net"+ string(blk(blk_objs(bl),3+numofip))+'_'+ string(1),fd_w);
mputl(" ",fd_w);
end
|
c78685f4b2d295e91e8f275abfde67128e1880c6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2135/CH3/EX3.8/Exa_3_8.sce | 43a26b5c200779b3cbc7149dca9961b249972850 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 517 | sce | Exa_3_8.sce | //Exa 3.8
clc;
clear;
close;
format('v',6);
//Given Data :
Wdot=200;//W
t1=40;//degree centigrade
//Q2dot=20*(t1-t2);//W
//COP=Q2dot/W2dot=T2/(T1-T2)
//(t1-t2)/(W2dot/20)=(t1+273)/(t1-t2)
//20*t1^2+20*t2^2-20*2*t1*t2-t1*Wdot-273*Wdot
//(t2+273)/(t1-t2)=(t1-t2)/(Wdot/20)
//t2^2-(2*t1+(Wdot/20))*t2-273*(Wdot/20)+t1^2
P=[1 -(2*t1+(Wdot/20)) -273*(Wdot/20)+t1^2];
t2=roots(P);
t2=t2(2);//degree C
//Taken only -ve value as t2 cant be greater than t1
disp(t2,"Temperature of cold space(degree C)");
|
fb365c23e74e979b352bf64363cda052bf4391e9 | 449d555969bfd7befe906877abab098c6e63a0e8 | /770/CH10/EX10.23/10_23.sce | 1dcfb45907bc7764e3e753564f03e3cdc70feb9d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,114 | sce | 10_23.sce | clear;
clc;
//Example - 10.23
//Page number - 366
printf("Example - 10.23 and Page number - 366\n\n");
//Given
T = 320 + 273.15;//[K]
R = 8.314;//[J/mol*K] - Universal gas constant
// For water
Tc = 647.1;//[K]
Pc = 220.55;//[bar]
Pc = Pc*10^(5);//[Pa]
// The cubic form of Redlich Kwong equation of state is given by,
// V^(3) - ((R*T)/P)*V^(2) - ((b_1^(2)) + ((b_1*R*T)/P) - (a/(T^(1/2)*P))*V - (a*b)/(T^(1/2)*P) = 0
// At 320 C and 70 bar pressure
P_1 = 70;//[bar]
P_1 = P_1*10^(5);//[Pa]
a = (0.42748*(R^(2))*(Tc^(2.5)))/Pc;//[Pa*m^(6)*K^(1/2)/mol]
b = (0.08664*R*Tc)/Pc;//[m^(3)/mol]
// Solving the cubic equation
deff('[y]=f1(V)','y=V^(3)-((R*T)/P_1)*V^(2)-((b^(2))+((b*R*T)/P_1)-(a/(T^(1/2)*P_1)))*V-(a*b)/(T^(1/2)*P_1)');
V1=fsolve(1,f1);
V2=fsolve(10,f1);
V3=fsolve(100,f1);
// The largest root is considered because at 320 C and 70 bar vapour phase exists.
V_1 = V1;//[m^(3)/mol]
// Thus compressibility factor is
Z_1 = (P_1*V_1)/(R*T);
// For Redlich-Kwong equation of state
// log(f/P) = Z - 1 - log(V_1/(V_1-b)) + (a/(b*R*(T^(3/2))))*log(V/(V+b))
f_1 = P_1*(exp(Z_1-1-log(Z_1)+log(V_1/(V_1-b))+(a/(b*R*(T^(3/2))))*log(V_1/(V_1+b))));//[Pa]
f_1 = f_1*10^(-5);//[bar]
printf(" The fugacity of water vapour at 320 C and 70 bar pressure is %f bar\n\n",f_1);
// At 320 C and 170 bar pressure, we have
P_2 = 170;//[bar]
P_2 = P_2*10^(5);//[Pa]
// Solving the cubic equation
deff('[y]=f2(V)','y=V^(3)-((R*T)/P_2)*V^(2)-((b^(2))+((b*R*T)/P_2)-(a/(T^(1/2)*P_2)))*V-(a*b)/(T^(1/2)*P_2)');
V4 = fsolve(1,f2);
V5 = fsolve(10,f2);
V6 = fsolve(100,f2);
// The above equation has only 1 real root,other two roots are imaginary. Therefore,
V_2 = V6;//[m^(3)/mol]
// Thus compressibility factor is
Z_2 = (P_2*V_2)/(R*T);
// For Redlich-Kwong equation of state
// log(f/P) = Z - 1 - log(V_1/(V_1-b)) + (a/(b*R*(T^(3/2))))*log(V/(V+b))
f_2 = P_2*(exp(Z_2-1-log(Z_2)+log(V_2/(V_2-b))+(a/(b*R*(T^(3/2))))*log(V_2/(V_2+b))));//[Pa]
f_2 = f_2*10^(-5);//[bar]
printf(" The fugacity of water vapour at 320 C and 170 bar pressure is %f bar\n\n",f_2);
|
e1c009d1b63617879b1292fec8f401ac40f8c1ab | 449d555969bfd7befe906877abab098c6e63a0e8 | /3769/CH5/EX5.18/Ex5_18.sce | f95c8e35637b14a9761ffe698144231316553e61 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 150 | sce | Ex5_18.sce | clear
//Given
l=1.001
A=1.001
//Calculation
R=l*A
R1=R-1
A=R1*100
//Result
printf("\n Percentage change in its resistance is %0.1f percentage",A)
|
e5fd5c92ab995fed2672f819b25ea10174d4c100 | 449d555969bfd7befe906877abab098c6e63a0e8 | /48/CH4/EX4.5/eg_4_5.sce | 82073dc804e2f5ce9d166beb44d15a90659143cc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 15,323 | sce | eg_4_5.sce | //f=x^y^z+wxz+xy+v^w^yz^
clc;
n=4;
k=[0 0 0 0;
1 0 1 1;
0 1 1 0;
1 1 1 0];
k(:,:,2)=[0 0 0 0;
1 0 1 1;
0 1 1 0;
0 1 1 0];
//k=[1 0 0 0;
// 0 0 0 0;
// 0 0 0 0;
// 0 0 1 0];
//k(:,:,2)=[1 0 0 0;
// 0 0 0 0;
// 0 0 0 0;
// 1 0 0 0];
k(:,:,3)=zeros(n,n);
k(:,:,4)=zeros(n,n);
var=['y' 'z' 'v' 'w' 'x'];
p1=['y''z''' 'y''z' 'yz' 'yz'''];
p2=['v''w''x''';'v''w''x';'v''wx';'v''wx''';
'vw''x''';'vw''x';'vwx';'vwx'''];
cmn16=9;
cmn8=5;
cmn4=3;
cmn2=2;
temp=1;
printf('The minimal ecpression of the given Kmap ');
disp(k(:,:,1));
disp(k(:,:,2));
disp("is :");
printf('f');
printf("=");
//32 cells
for i=1:n
for j=1:n
for l=1:2
if(k(i,j,l)~=1 & k(i,j,l)~=2)
temp=0;
break;
end
end
end
end
if(temp==1)
printf("1");
abort;
end
//16 cells
//8+8 row cells
z1=ones(2,4,2);
z2=ones(4,2,2);
temp1=['00' '01' '11' '10'];
temp2=['000' '001' '011' '010' '100' '101' '111' '110'];
for i=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=[k(i,:,1:2);k(t,:,1:2)];
z1=[k(i,:,3:4);k(t,:,3:4)];
if(noof3(z,0)==0 & noof3(z1,1)<cmn16)
k(i,:,3:4)=ones(4,2);
k(t,:,3:4)=ones(4,2);
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
k(i,:,3:4)=ones(1,4,2);
k(t,:,3:4)=ones(1,4,2);
end
end
//8+8 column cells
for j=1:n
if(j==4)
t=1;
else
t=j+1;
end
z=[k(:,j,1:2) k(:,t,1:2)];
z1=[k(:,j,3:4) k(:,t,3:4)];
if(noof3(z,0)==0 & noof3(z1,1)<cmn16)
k(:,j,3:4)=ones(4,2);
k(:,t,3:4)=ones(4,2);
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,t));
c=strsplit(temp2(1,j+4));
d=strsplit(temp2(1,t+4));
c1=check(a,b,c,d);
for in=1:max(size(c1))
if(c1(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c1(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf("+");
k(:,j,3:4)=ones(1,4,2);
k(:,t,3:4)=ones(1,4,2);
end
end
//4x4 front matrix
if(number_of(k(:,:,1),0)==0 & number_of(k(:,:,3),1)<cmn16)
printf(var(3));
printf('''');
k(:,:,3)=ones(4,4);
end
//4x4 rear matrix
if(number_of(k(:,:,2),0)==0 & number_of(k(:,:,4),1)<cmn16)
printf(var(3));
k(:,:,4)=ones(4,4);
end
//8 cells
//2x2 front and rear cells
for i=1:n
for j=1:n
if(i==4)
t=1;
else
t=i+1;
end
if(j==4)
u=1;
else
u=j+1;
end
z=k(i,j,1:2);
z(1,2,:)=k(i,u,1:2);
z(2,1,:)=k(t,j,1:2);
z(2,2,:)=k(t,u,1:2);
z1=k(i,j,3:4);
z1(1,2,:)=k(i,u,3:4);
z1(2,1,:)=k(t,j,3:4);
z1(2,2,:)=k(t,u,3:4);
if(noof3(z,0)==0 & noof3(z1,1)<cmn8)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,u));
c=strsplit(temp2(1,4+j));
d=strsplit(temp2(1,4+u));
c1=check(a,b,c,d);
for in=1:max(size(c1))
if(c1(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c1(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
k(i,j,3:4)=ones(1,1,2);
k(i,u,3:4)=ones(1,1,2);
k(t,j,3:4)=ones(1,1,2);
k(t,u,3:4)=ones(1,1,2);
printf("+");
end
end
end
//1x4 front and rear cells
for i=1:n
z=k(i,:,1:2);
z1=k(i,:,3:4);
if(noof3(z,0)==0 & noof3(z1,1)<cmn8)
printf(p1(i));
printf("+");
k(i,:,3:4)=ones(1,4,2);
end
end
//4x1 front and rear cells
for j=1:n
z=k(:,j,1:2);
z1=k(:,j,3:4);
if(noof3(z,0)==0 & noof3(z1,1)<cmn8)
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,u));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf("+");
k(:,j,3:4)=ones(1,2,4);
end
end
//2x4 front cells
for i=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=k(i,:,1);
z(2,:,1)=k(t,:,1);
z1=k(i,:,3);
z1(2,:,1)=k(t,:,3);
if(number_of(z,0)==0 & number_of(z1,1)<cmn8)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
printf('%s''',var(3));
printf("+");
k(i,:,3)=ones(1,4);
k(t,:,3)=ones(1,4);
end
end
//2x4 rear cells
for i=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=k(i,:,2);
z(2,:,1)=k(t,:,2);
z1=k(i,:,4);
z1(2,:,1)=k(t,:,4);
if(number_of(z,0)==0 & number_of(z1,1)<cmn8)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
printf(var(3));
printf("+");
k(i,:,4)=ones(1,4);
k(t,:,4)=ones(1,4);
end
end
//4x2 front cells
for j=1:n
if(j==4)
u=1;
else
u=j+1;
end
z=k(:,j,1);
z(:,2,1)=k(:,u,1);
z1=k(:,j,3);
z1(:,2,1)=k(:,u,3);
if(number_of(z,0)==0 & number_of(z1,1)<cmn8)
a=strsplit(temp2(1,i));
b=strsplit(temp2(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
printf('%s''',var(3));
printf("+");
k(:,j,3)=ones(4,1);
k(:,u,3)=ones(4,1);
end
end
//4x2 rear cells
for j=1:n
if(j==4)
u=1;
else
u=j+1;
end
z=k(:,j,2);
z(:,2,1)=k(:,u,2);
z1=k(:,j,4);
z1(:,2,1)=k(:,u,4);
if(number_of(z,0)==0 & number_of(z1,1)<cmn8)
a=strsplit(temp2(1,i));
b=strsplit(temp2(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(4+in));
else
if(c(in)==0 & a(in)=='1')
printf(var(4+in));
end
end
end
printf(var(3));
printf("+");
k(:,j,4)=ones(4,1);
k(:,u,4)=ones(4,1);
end
end
//4 cells
//1x4 front cells
for i=1:n
z=k(i,:,1);
z1=k(i,:,3);
if(number_of(z,0)==0 & number_of(z1,1)<cmn4)
printf(p1(1,i));
printf('%s''',var(3));
printf("+");
k(i,:,3)=ones(1,4);
end
end
//1x4 rear cells
for i=1:n
z=k(i,:,2);
z1=k(i,:,4);
if(number_of(z,0)==0 & number_of(z1,1)<cmn4)
printf(p1(1,i));
printf(var(3));
printf("+");
k(i,:,4)=ones(1,4);
end
end
//4x1 front cells
for j=1:n
z=k(:,j,1);
z1=k(:,j,3);
if(number_of(z,0)==0 & number_of(z1,1)<cmn4)
printf(p2(j,1));
printf("+");
k(:,j,3)=ones(4,1);
end
end
//4x1 rear cells
for j=1:n
z=k(:,j,2);
z1=k(:,j,4);
if(number_of(z,0)==0 & number_of(z1,1)<cmn4)
printf(p2(4+j,1));
printf("+");
k(:,j,4)=ones(4,1);
end
end
//2x1 front and rear matrix
for i=1:n
for j=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=[k(i,j,1);k(t,j,1)];
z(:,:,2)=[k(i,j,2) k(t,j,2)];
z1=[k(i,j,3);k(t,j,3)];
z1(:,:,2)=[k(i,j,4) k(t,j,4)];
if(noof3(z,0)==0 & noof3(z1,1)<cmn4)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,4+j));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf('+');
k(i,j,3)=1;k(t,j,3)=1;
k(i,j,4)=1; k(t,j,4)=1;
end
end
end
//1x2 front and rear matrix
for i=1:n
for j=1:n
if(j==4)
u=1;
else
u=j+1;
end
z=[k(i,j,1) k(i,u,1)];
z(:,:,2)=[k(i,j,2) k(i,u,2)];
z1=[k(i,j,3) k(i,u,3)];
z1(:,:,2)=[k(i,j,4) k(i,u,4)];
if(noof3(z,0)==0 & noof3(z1,1)<1)
printf(p1(i));
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,u));
c=strsplit(temp2(1,4+j));
d=strsplit(temp2(1,4+j));
c1=check(a,b,c,d);
for in=1:max(size(c1))
if(c1(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c1(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf('+');
k(i,j,3)=1; k(i,u,3)=1;
k(i,j,4)=1; k(i,u,4)=1;
end
end
end
//2 cells
//1x2 front cells
for i=1:n
for j=1:n
if(j==4)
u=1;
else
u=j+1;
end
z=[k(i,j,1) k(i,u,1)];
z1=[k(i,j,3) k(i,u,3)];
if(number_of(z,0)==0 & number_of(z1,1)<cmn2)
printf(p1(1,i));
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,u));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf('+');
k(i,j,3)=1; k(i,u,3)=1;
end
end
end
//1x2 rear cells
for i=1:n
for j=1:n
if(j==4)
u=1;
else
u=j+1;
end
z=[k(i,j,2) k(i,u,2)];
z1=[k(i,j,4) k(i,u,4)];
if(number_of(z,0)==0 & number_of(z1,1)<cmn2)
printf(p1(1,i));
a=strsplit(temp2(1,4+j));
b=strsplit(temp2(1,4+u));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(2+in));
else
if(c(in)==0 & a(in)=='1')
printf(var(2+in));
end
end
end
printf('+');
k(i,j,4)=1; k(i,u,4)=1;
end
end
end
//2x1 front cells
for i=1:n
for j=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=[k(i,j,1);k(t,j,1)];
z1=[k(i,j,3) k(t,j,3)];
if(number_of(z,0)==0 & number_of(z1,1)<cmn2)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
printf(p2(j,1))
printf('+');
k(i,j,3)=1; k(i,u,3)=1;
end
end
end
//2x1 rear cells
for i=1:n
for j=1:n
if(i==4)
t=1;
else
t=i+1;
end
z=[k(i,j,2);k(t,j,2)];
z1=[k(i,j,4) k(t,j,4)];
if(number_of(z,0)==0 & number_of(z1,1)<cmn2)
a=strsplit(temp1(1,i));
b=strsplit(temp1(1,t));
c=strcmp(a,b);
for in=1:max(size(c))
if(c(in)==0 & a(in)=='0')
printf('%s''',var(in));
else
if(c(in)==0 & a(in)=='1')
printf(var(in));
end
end
end
printf(p2(4+j,1))
printf('+');
k(i,j,4)=1; k(i,u,4)=1;
end
end
end
//1 cell front and rear matrix
for i=1:n
for j=1:n
z=k(i,j,1:2);
z1=k(i,j,3:4);
if(noof3(z,0)==0 & noof3(z1,1)<cmn2)
printf(p1(1,i));
a=strsplit(temp2(1,j));
b=strsplit(temp2(1,4+j));
c=strcmp(a,b);
for in=2:max(size(c))
if(a(in)=='0' & c(in)==0)
printf('%s''',var(2+in));
else
if(a(in)=='1' & c(in)==0)
printf(var(2+in));
end
end
end
printf('+');
k(i,j,3:4)=ones(1,1,2);
end
end
end
//single cell
for i=1:n
for j=1:n
for z=1:2
if(k(i,j,z)==1 & k(i,j,z+2)==0)
printf(p2(j,1));
printf(p1(1,i));
printf('+');
end
end
end
end
printf('0'); |
56bdf9666c796fa32daa4906cd0b1bf7788461c4 | 645b54435638226a1dfff613a3516b3d8756740e | /nand/projects/07_/MemoryAccess/SimpleStaticTest/SimpleStaticTest.tst | f0301e5300f14d728ded71529aa04d441de865cd | [] | no_license | lebronjamesking/brianrepo | 7582c1f166a5b10e57e3e2618503e7c95643850e | aa68ee0b5567957a98b0acb5fe9a73429ea0773e | refs/heads/master | 2021-01-10T09:16:00.197088 | 2011-01-23T20:52:18 | 2011-01-23T20:52:18 | 45,513,556 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 181 | tst | SimpleStaticTest.tst | rom-load SimpleStaticTest.asm,
output-file SimpleStaticTest.out,
compare-to SimpleStaticTest.cmp,
output-list RAM[256]%D1.6.1;
set RAM[0] 256,
repeat 200 {
ticktock;
}
output;
|
c9ce27653cf706ee4b2f5738cfbcbf04cb68496e | 449d555969bfd7befe906877abab098c6e63a0e8 | /1673/CH7/EX7.11/7_11.sce | fec8a0bb07109377377dc84147d34c0f815dad53 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 296 | sce | 7_11.sce | //ill conditioned linear system
//example 7.11
//page 277
clc;clear;close;
A=[25 24 10;66 78 37;92 -73 -80];
de_A=det(A);
for i=1:3
s=0;
for j=1:3
s=s+A(i,j)^2
end
s=sqrt(s);
k=de_A/s;
end
if k<1 then
printf(' the fuction is ill conditioned')
end
|
0103112a301f05e675ba1f56c9fc9a48857ceae2 | 4483ff664b4d01c53114a7fc535625c197c8f989 | /green routing/fiin.sce | 048705f4feb9414e81508e9469550fbe29f60f79 | [] | no_license | winash1618/myproject | be9b77d4a405edce7e625a999803016b50ab99d0 | 2132e76e6a996bee19f356a2b68af827fa6c621b | refs/heads/master | 2022-12-06T06:09:06.487979 | 2020-08-20T02:00:54 | 2020-08-20T02:00:54 | 288,880,158 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 10,971 | sce | fiin.sce | // this is 8 vehicle
clc
clear
rokl=1
x=4
z=15
pop=10
iter=1000
mest=1000*ones(1,pop)
a=zeros(pop,z)
rag=zeros(iter)
ryg=zeros(iter)
cap=[288 95 115 133 107 22 34 28 186 190 33 56 100 90 82 143 68 166 44 73 72 60 68 8 20
]
tim=[0 40 1.5 39 6.8 11 16 12 36 20 27 17 51 4.5 17;
40 0 42 9.1 43 38 33 39 51 41 48 45 21 34 33;
1.5 42 0 40 8.3 12 17 13 38 22 29 19 52 5.4 18;
39 9.1 40 0 41 36 32 38 42 40 42 43 12 32 32;
6.8 43 8.3 41 0 4.6 17 12 37 21 28 18 53 11 19;
11 38 12 36 4.6 0 13 7.8 32 16 23 13 49 11 15;
16 33 17 32 17 13 0 4.8 25 9 16 7.5 44 13 5;
12 39 13 38 12 7.8 4.8 0 24 8.2 15 6.7 50 12 9.8;
36 51 38 42 37 32 25 24 0 17 7.6 16 38 37 24;
20 41 22 40 21 16 9 8.2 17 0 8.4 5.9 43 21 8.5;
27 48 29 42 28 23 16 15 7.6 8.4 0 13 38 28 15;
17 45 19 43 18 13 7.5 6.7 16 5.9 13 0 48 18 13;
51 21 52 12 53 49 44 50 38 43 38 48 0 34 34;
4.5 34 5.4 32 11 11 13 12 37 21 28 18 34 0 11;
17 33 18 32 19 15 5 9.8 24 8.5 15 13 34 11 0;
]
dib=[6.8 33 8.3 32 9.2 4.6 9.2 5.8 30 14 21 11 44 6.6 9.9;
8.9 36 10 34 9.2 4.6 8 3.2 27 11 18 8.6 47 9.2 13;
15 42 16 41 15 11 10 5.6 27 14 21 8.6 53 15 15;
17 44 18 43 17 13 9.9 5.9 19 8.2 15 2.4 45 17 15;
]
cad=rand(pop,z)
for i=1:pop
for j=1:z
for k=1:z
if cad(i,k)==min(cad(i,:))
a(i,j)=k
cad(i,k)=10000
break
end
end
end
end
best=a
c=a
temp=zeros(pop,x)
tempo=zeros(pop,x)
temo=zeros(pop,x)
function [kom,kiq,temo] =findmut(z1,zkom)
temo=zeros(pop,x)
rep=zeros(pop,z)
kiq=zeros(pop,z)
for ka=1:pop
po=zeros(x,z)
ckom=zkom(ka,:)
i=1
for k=1:x
r=1
while i<min(ckom) & i<=z
po(k,r)=z1(ka,i)
r=r+1
if i<=z
i=i+1
end
end
for g=1:x-1
if ckom(g)==min(ckom)
ckom(g)=100
break
end
end
end
mik=1
bii=7+(15)*(1-(y/iter))
bi=(1.05-(y/iter))
for k=1:x
for i=1:z
bi1=rand(1,1)
if po(k,i+1)~=0
if tim(po(k,i),po(k,i+1))>bii & bi1<bi
rep(ka,mik)=po(k,i+1)
end
if dib(k,po(k,1))>bii & i==1 & bi1<bi
rep(ka,mik)=po(k,1)
end
mik=mik+1
else
if po(k,i)~=0
if po(k,i+1)==0 & dib(k,po(k,i))>bii & bi1<bi
rep(ka,mik)=po(k,i)
end
temo(ka,k)=i
end
break
end
end
end
end
kom=zkom
kiq=rep
endfunction
function [dis2] =finddis(z1,zkom)
tempi=zeros(pop,x)
dis2=zeros(pop,x)
for ka=1:pop
po=zeros(x,z)
i=1
ckom=zkom(ka,:)
for k=1:x
r=1
while i<min(ckom) & i<=z
po(k,r)=z1(ka,i)
r=r+1
if i<=z
i=i+1
end
end
for g=1:x-1
if ckom(g)==min(ckom)
ckom(g)=100
break
end
end
end
for k=1:x
for i=1:z
if po(k,i+1)~=0
dis2(ka,k)=dis2(ka,k)+tim(po(k,i),po(k,i+1))
else
break
end
end
end
for k=1:x
for i=1:z
if(po(k,i)~=0)
tempi(ka,k)=tempi(ka,k)+1
end
end
if tempi(ka,k)>0
dis2(ka,k)=dis2(ka,k)+dib(k,po(k,1))+dib(k,po(k,tempi(ka,k)))
end
end
end
endfunction
function [n] = mutate(b,kiu,temi)
gnd=ones(pop,x)
for k=1:pop
for i=1:x
if i==1
gnd(k,i)=0
else
gnd(k,i)=gnd(k,i-1)+temi(k,i-1)
end
end
oll=rand(1,1)
if oll<0.3 then
xio=rand(1,1)
if xio<(y/iter)
r=1
for i=1:x
poll=rand(1,1)
if i==1
mut1=1+round((temi(k,i)-1)*rand(1,1))
mut2=1+round((temi(k,i)-1)*rand(1,1))
if poll<0.2 & mut1>0 & mut2>0 & mut1~=mut2
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
r=r+1
end
else
mut1=gnd(k,i)+round((temi(k,i)-1)*rand(1,1))
mut2=gnd(k,i)+round((temi(k,i)-1)*rand(1,1))
if poll<0.2 & mut1>0 & mut2>0 & mut1~=mut2
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
r=r+1
end
end
if r~=1
break;
end
end
else
mut1=1+round((z-1)*rand(1,1))
mut2=1+round((z-1)*rand(1,1))
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
end
else
for mi=1:x
if kip(k,mi)~=0
mut1=1+round((z-1)*rand(1,1))
temper=b(k,mut1)
b(k,mut1)=b(k,mi)
b(k,mi)=temper
end
end
end
end
n=b
endfunction
function [n] = mutate1(b,kiu,temi)
gnd=ones(pop,x)
for k=1:pop
for i=1:x
if i==1
gnd(k,i)=0
else
gnd(k,i)=gnd(k,i-1)+temi(k,i-1)
end
end
oll=rand(1,1)
if oll<0.7 then
xio=rand(1,1)
if xio<(y/iter)
r=1
for i=1:x
poll=rand(1,1)
if i==1
mut1=1+round((temi(k,i)-1)*rand(1,1))
mut2=1+round((temi(k,i)-1)*rand(1,1))
if poll<0.2 & mut1>0 & mut2>0 & mut1~=mut2
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
r=r+1
end
else
mut1=gnd(k,i)+round((temi(k,i)-1)*rand(1,1))
mut2=gnd(k,i)+round((temi(k,i)-1)*rand(1,1))
if poll<0.2 & mut1>0 & mut2>0 & mut1~=mut2
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
r=r+1
end
end
if r~=1
break;
end
end
else
mut1=1+round((z-1)*rand(1,1))
mut2=1+round((z-1)*rand(1,1))
temper=b(k,mut2)
b(k,mut2)=b(k,mut1)
b(k,mut1)=temper
end
else
for mi=1:x
if kip(k,mi)~=0
mut1=1+round((z-1)*rand(1,1))
temper=b(k,mut1)
b(k,mut1)=b(k,mi)
b(k,mi)=temper
end
end
end
end
n=b
endfunction
function [z1] =roulewheel(dis2,z1,zkom)
tdis=zeros(1,pop)
pdis=zeros(1,pop)
cdis=zeros(1,pop)
calm=z1
for i=1:pop
tdis(i)=sum(dis2(i,:))
tdis(i)=1/(1+tdis(i))
end
for i=1:pop
pdis(i)=tdis(i)/(sum(tdis))
end
for i=1:pop
if i==1
cdis(i)=cdis(i)+pdis(i)
else
cdis(i)=cdis(i-1)+pdis(i)
end
end
for i=1:pop
jin=rand(1,1)
for j=1:pop
if j==1
if jin<cdis(j)
calm(i,:)=z1(j,:)
break
end
else
if cdis(j-1)<jin & jin<=cdis(j)
calm(i,:)=z1(j,:)
break
end
end
end
end
z1=calm
endfunction
function [a,dis1,temp]=aisrule(a,kop)
pest=1000*ones(1,pop)
aa=a
iter1=10
rag1=zeros(iter1)
ryg1=zeros(iter1)
for io=1:iter1
dix=zeros(pop,x)
myg=zeros(1,pop)
temt=zeros(pop,x)
[kop,kip,temt] =findmut(aa,kop)
[aa]=mutate1(aa,kip,temt)
[dix]=finddis(aa,kop)
for i=1:pop
myg(i)=sum(dix(i,:))
if pest(i)>myg(i) then
a(i,:)=aa(i,:)
pest(i)=myg(i)
dis1(i,:)=dix(i,:)
//kop(i,:)=lkop(i,:)
temp(i,:)=temt(i,:)
end
end
[aa]=roulewheel(dis1,a,kop)
rag1(io)=min(pest)
ryg1(io)=io
end
plot(ryg1,rag1)
endfunction
toper=1000
kip=zeros(pop,z)
kip1=kip
kiq=kip
esup=zeros(1,z)
bkom=1+round((z-1)*rand(pop,(x-1)))
kop=bkom
bbom=zeros(pop,(x-1))
gd=zeros(1,x)
for y=1:iter
dis=zeros(pop,x)
dis1=zeros(pop,x)
kop=1+round((z-1)*rand(pop,(x-1)))
[a,dis1,temp]=aisrule(a,kop)
[bkom,kip1,tempo] =findmut(c,bkom)
[c]=mutate(c,kip1,tempo)
[dis]=finddis(c,bkom)
mog=zeros(1,pop)
mog1=zeros(1,pop)
for i=1:pop
mog(i)=sum(dis(i,:))
mog1(i)=sum(dis1(i,:))
if mog(i)>mog1(i) then
c(i,:)=a(i,:)
mog(i)=mog1(i)
dis(i,:)=dis1(i,:)
bkom(i,:)=kop(i,:)
tempo(i,:)=temp(i,:)
end
if toper>mog(i) then
toper=mog(i)
esup=c(i,:)
gd=tempo(i,:)
rokl=y
end
if mest(i)>mog(i)
best(i,:)=c(i,:)
mest(i)=mog(i)
dist(i,:)=dis(i,:)
bbom(i,:)=bkom(i,:)
end
end
c=best
bkom=bbom
dis=dist
rag(y)=min(mest)
ryg(y)=y
a=c
[a]=roulewheel(dis,a,bkom)
end
plot(ryg,rag)
tomp=zeros(1,x)
sup=esup
for j=1:x
if(j==1)
tomp(j)=gd(j)
else
tomp(j)=tomp(j-1)+gd(j)
end
end
fine=zeros(x,z)
for j=1:x
if j==1 then
for k=1:tomp(j)
fine(j,k)=sup(k)
end
else
i=1
for k=tomp(j-1)+1:tomp(j)
fine(j,i)=sup(k)
i=i+1
end
end
end
namer=[ "KARTHIKAPURAM" "KARMALAGIRI KSS LTD" "UDAYAGIRI" "SREEPURAM" "VIJAYAGIRI" "OTTATHAI" "THADIKADAVU" "MEEMBATTY" "KOONAM KSS" "PADAPPENGAD" "PANNIYOOR KSS" "VILAKKANNUR" "KALIKKADAVU" "NEDUVODE" "VIMALASSERY"
]
bmc=["ARANGAM" "KOTTAYAD" "VELLAD" "NADUVIL"
]
yum=0
for i=1:1:x
for j=1:z
if fine(i,j)>0
if j==1
disp(bmc(i))
disp(dib(i,fine(i,j)))
yum=yum+dib(i,fine(i,j))
end
disp(namer(fine(i,j)))
if j~=gd(i) then
disp(tim(fine(i,j),fine(i,j+1)))
yum=yum+tim(fine(i,j),fine(i,j+1))
end
if j==gd(i)
disp(dib(i,fine(i,j)))
yum=yum+dib(i,fine(i,j))
disp(bmc(i))
end
end
end
end
disp(yum)
|
ca1c5319d2c83fcc5ee9c9ca23a6749022199c01 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2126/CH2/EX2.6/6.sce | e67969c963d4fd97748f39f95fca6625b0ea46bb | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,549 | sce | 6.sce | clc
clear
//Input data
D1=15 //Entry diameter in cm
D2=30 //Exit diamater in cm
P1=0.96 //Inlet pressure in bar
T1=340 //Inlet temperature in K
C1=185 //INlet velocity in m/s
k=1.4 //Adiabatic Constant
R=287 //Specific gas constant in J/kg-K
//Calculation
A1=%pi*D1^2/4 //Entry area in cm^2
A2=%pi*D2^2/4 //Exit area in cm^2
a_1=sqrt(k*R*T1) //Sound velocity in m/s
M1=C1/a_1 //Inlet mach number
p1=0.843 //Ratio of inlet pressure to Stagnation pressure from gas tables @M1,k=1.4
Po1=P1/p1 //Stagnation pressure in bar
t1=0.952 //Ratio of inlet temperature to Stagnation temperature from gas tables @M1,k=1.4
To1=T1/t1 //Stagnation temperature in K
a1=1.34 //Ratio of inlet area to critical area from isentropic gas tables @M1,k=1.4
At=A1/a1 //critical area in cm^2
a2=A2/At //Area ratio
M2=0.1088 //Exit mach number from gas tables @a2,k=1.4
p2=0.992 //Ratio of exit pressure to Stagnation pressure from isentropic gas tables @M2,k=1.4
P2=Po1*p2 //exit pressure in bar
t2=0.9976 //Ratio of exit temperature to Stagnation temperature from isentropic gas tables @M2,k=1.4
T2=To1*t2 //exit temperature in K
C2=sqrt(k*R*T2)*M2 //Exit velocity in m/s
F1=P1*10^5*A1*10^-4*(1+(k*(M1^2))) //Force exerted at entry in kN
F2=P2*10^5*A2*10^-4*(1+(k*(M2^2))) //Force exerted at exit in kN
F=(F2-F1)*10^-3 //Force exerted on the diffuser walls in kN, wrong answer in textbook
//Output
printf('(A)Exit pressure is %3.3f bar\n (B)Exit velocity is %3.2f m/s\n (C)Force exerted on the diffuser walls is %3.3f kN',P2,C2,F)
|
d7736ae3e03d7f012f17c2fd2c011ac7f5ca72f2 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3843/CH9/EX9.8/Ex9_8.sce | 180e13eac28e46ebc628538c72084f17364a687a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 688 | sce | Ex9_8.sce | // Example 9_8
clc;funcprot(0);
// Given data
r=10;// The compression ratio
P_1=200;// kPa
T_1=100+273;// K
T_3=600+273;// K
R=0.287;// kJ/kg.K
k=1.4;// The specific heat ratio
// Calculation
v_1=(R*T_1)/P_1;// m^3/kg
T_4=T_3;// K
v_4=(T_4/T_1)*v_1;// m^3/kg
v_2=v_4/r;// m^3/kg
T_2=T_1;// K
P_2=(R*T_2)/v_2;// kPa
P_3=P_2;// kPa
v_3=(R*T_3)/P_3;// m^3/kg
w_out=(R*T_1*log(v_2/v_1))+(P_2*(v_3-v_2))+(R*T_3*log(v_4/v_3))+(P_1*(v_1-v_4));// The work output in kJ/kg
T_L=T_1;// K
T_H=T_3;// K
n=1-(T_L/T_H);// The thermal efficiency
q_in=w_out/n;// The heat input in kJ/kg
printf("\nThe work output,w_out=%3.0f kJ/kg \nThe heat input,q_in=%3.0f kJ/kg",w_out,q_in);
|
991f33ae916fe3722f91d34acbf3cf2e914c557f | 449d555969bfd7befe906877abab098c6e63a0e8 | /1658/CH22/EX22.6/Ex22_6.sce | 237b196276f3ad45e74206df627f43c65533304e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 226 | sce | Ex22_6.sce | clc;
//e.g 22.6
IDSS=10*10**-3;
VDD=20;
IDQ=IDSS/2;
disp('mA',IDQ*10**3,"ID=");
VDSQ=VDD/2;
disp('V',VDSQ*1,"VDS=");
VGS=-2.2;
RD=(VDD-VDSQ)/IDQ;
disp('Kohm',RD*10**-3,"RD=");
RS=-VGS/IDQ;
disp('ohm',RS*1,"RS=");
|
907e1dbfaa3d6c29175e164122f3ad9e96f99b63 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3630/CH2/EX2.2/Ex2_2.sce | 5ff55a7f1afbd905c87f9478cdfaa67b48437872 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 379 | sce | Ex2_2.sce | clc;
//ex2.2
VD1=0; //Volt//diode is forward bias for ideal diode total Rideal=0 so VD1=IT*Rideal=0V
R1=1000; //kilo ohm;
VS=5; //Volt //voltage across voltage source
IT=(VS/R1)-(VD1/R1);//Ampere;apply kvl in the circuit
VR1=IT*R1; //Volt//apply ohms law voltage across resistance
disp( 'Volt',VD1*1,"VD1=");
disp( 'mAmpere',IT*1000,"IT=");
disp( 'Volt',VR1*1,"VR1=");
|
9ca2d656b88e91759b7231b742ad1df0ee3a1cac | 1d7cb1dbfad2558a4145c06cbe3f5fa3fc6d2c08 | /Scilab/SparamToolBox/SparamToolbox/v1.2/x86_64/sci_gateway/c/builder_gateway_c.sce | 5ac2f5732f391d9969d0b3c9c704aaf4606c839d | [] | no_license | lrayzman/SI-Scripts | 5b5f6a8e4ae19ccff53b8dab7b5773e0acde710d | 9ab161c6deff2a27c9da906e37aa68964fabb036 | refs/heads/master | 2020-09-25T16:23:23.389526 | 2020-02-09T02:13:46 | 2020-02-09T02:13:46 | 66,975,754 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,125 | sce | builder_gateway_c.sce | // ====================================================================
// Allan CORNET
// Simon LIPP
// INRIA 2008
// This file is released into the public domain
// ====================================================================
//if MSDOS then
// to manage long pathname
// includes_src_c = '-I""' + get_absolute_file_path('builder_gateway_c.sce') + '../../src/c""';
//else
includes_src_c = '-I' + get_absolute_file_path('builder_gateway_c.sce') + '../../src/c';
//end
// PutLhsVar managed by user in sci_sum and in sci_sub
// if you do not this variable, PutLhsVar is added
// in gateway generated (default mode in scilab 4.x and 5.x)
WITHOUT_AUTO_PUTLHSVAR = %t;
tbx_build_gateway('sparlib_c', ['sptlbx_readtchstn','sptlbx_readtchstn';'sptlbx_writetchstn','sptlbx_writetchstn' ],..
['sptlbx_readtchstn.c', 'sptlbx_writetchstn.c'], ..
get_absolute_file_path('builder_gateway_c.sce'), ..
['../../src/c/liberr_codes', '../../src/c/libread_tchstn', '../../src/c/libwrite_tchstn'],'',includes_src_c);
clear WITHOUT_AUTO_PUTLHSVAR;
clear tbx_build_gateway;
|
fc2b35a65c2d3297bd7075a767ef06ae0e1584dc | d9e20e3e491ed05049f4f1a44021e96499a581ba | /src/particula.sce | 135f9d9a645c893c9beb03785ac4bdb483eff6e7 | [] | no_license | josenalde/applied-math | 1e13000bec5e92fa828bee3193607cf8a200a604 | 76a9aab93d69e4be6b564cae72c441bc648444d4 | refs/heads/master | 2021-01-10T09:21:01.369665 | 2020-09-21T22:56:42 | 2020-09-21T22:56:42 | 46,852,259 | 3 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 1,238 | sce | particula.sce | // Derivadas na prática: simulação de fenômeno descrito por equação dif.
// Autor: Josenalde Oliveira - Matemática Aplicada II
// A velocidade do corpo no tempo é associada à taxa de variação do espaço
// percorrido em função do tempo, ou seja, v(t) = ds/dt
// Problema: tem-se disponível a relação desta taxa de variação, mas não
// sabemos como a partícula se desloca no tempo
// Solução: resolver a equação diferencial
// intervalo de simulação (integração)
h = 0.01; // segundos
// amostra inicial - instante discreto: t = k
k = 2;
tMax = 10;
t = 0;
// condicao inicial (cm)
s(1) = 10;
while (t <= tMax)
// taxa de variação do espaço percorrido no tempo
dsdt = 6*(t^2) -10*t + 3; // taxa de variação do espaço percorrido no tempo
s(k) = s(k - 1) + h*(dsdt);
// atualizacoes
s(k - 1) = s(k);
k = k + 1;
t = t + h;
end
// Plotar grafico
// vetor do tempo (eixo X)
t = 0:h:tMax+h;
// Função analítica que descreve o movimento da partícula
sreal = 2.*t.^3 - 5.*t.^2 + 3.*t + 4;
//plot(t, s);
plot(t, s, 'b', t, sreal, 'r'); //legend('Estimado', 'Analítico');
//title('Movimento de uma partícula');
//xlabel('tempo (s)');
//ylabel('cm');
|
cab50e0f20d2ffb77060f622af2889c72deffd20 | e04f3a1f9e98fd043a65910a1d4e52bdfff0d6e4 | /New LSTMAttn Model/.data/lemma-split/GOLD-TEST/zpv.tst | 3038cb7d186878025783598d894694915005e870 | [] | no_license | davidgu13/Lemma-vs-Form-Splits | c154f1c0c7b84ba5b325b17507012d41b9ad5cfe | 3cce087f756420523f5a14234d02482452a7bfa5 | refs/heads/master | 2023-08-01T16:15:52.417307 | 2021-09-14T20:19:28 | 2021-09-14T20:19:28 | 395,023,433 | 3 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 5,770 | tst | zpv.tst | zaka=zĭ săka=zĭ V;POT
zaka=zĭ rzaka=zĭ V;HAB
zaka=zĭ guzaka=zĭ V;PFV
u+tooˀ gútooˀ V;POT
u+tooˀ batooˀ V;PFV
u+tooˀ rutooˀ V;HAB
asa guasa V;PFV
asa rasa V;HAB
asa gâsa V;POT
u+zûˀu=zhibi bazûˀu=zhibi V;PFV
u+zûˀu=zhibi gúzûˀu=zhibi V;POT
u+zûˀu=zhibi ruzûˀu=zhibi V;HAB
u+s+ialda basialda V;PFV
u+s+ialda gúsialda V;POT
u+s+ialda rusialda V;HAB
tuyí gítuyí V;POT
tuyí bituyí V;PFV
tuyí rtuyí V;HAB
zhuuˀn rzhuuˀn V;HAB
zhuuˀn guzhuuˀn V;PFV
zhuuˀn shŭn V;POT
kayí rkayí V;HAB
kayí gíkayí V;POT
kayí bikayí V;PFV
zu rzu V;HAB
zu sû V;POT
zu guzu V;PFV
zu sŭ V;POT
adzhi radzhi V;HAB
adzhi gâdzhi V;POT
adzhi gudzhi V;PFV
daˀabi rdaˀabi V;HAB
daˀabi bidaˀabi V;PFV
daˀabi gídaˀabi V;POT
u+siŏba rusiŏba V;HAB
u+siŏba basiŏba V;PFV
u+siŏba gúsiŏba V;POT
u+txeldá batxeldá V;PFV
u+txeldá rutxeldá V;HAB
u+txeldá gútxeldá V;POT
shătxi rshătxi V;HAB
shătxi gushătxi V;PFV
shătxi gíshătxi V;POT
dzhuuˀyi tshŭyi V;POT
dzhuuˀyi gudzhuuˀyi V;PFV
dzhuuˀyi rdzhuuˀyi V;HAB
năba gunăba V;PFV
năba gínăba V;POT
năba rnăba V;HAB
u+s+iaˀatshu basiaˀatshu V;PFV
u+s+iaˀatshu gúsiaˀatshu V;POT
u+s+iaˀatshu rusiaˀatshu V;HAB
laʔ gulaʔ V;PFV
laʔ tâʔ V;POT
laʔ rlaʔ V;HAB
dxiˀidzhu gídxiˀidzhu V;POT
dxiˀidzhu bidxiˀidzhu V;PFV
dxiˀidzhu rdxiˀidzhu V;HAB
na gína V;POT
na rna V;HAB
na guna V;PFV
u+tshîʔtshí rutshîʔtshí V;HAB
u+tshîʔtshí batshîʔtshí V;PFV
u+tshîʔtshí gútshîʔtshí V;POT
zhoˀoba rzhoˀoba V;HAB
zhoˀoba bizhoˀoba V;PFV
zhoˀoba gízhoˀoba V;POT
gaˀadzí bigaˀadzí V;PFV
gaˀadzí rgaˀadzí V;HAB
gaˀadzí gígaˀadzí V;POT
a+rooˀ rarooˀ V;HAB
a+rooˀ barooˀ V;PFV
a+rooˀ gárooˀ V;POT
u+tshiiˀ gútshiiˀ V;POT
u+tshiiˀ rutshiiˀ V;HAB
u+tshiiˀ batshiiˀ V;PFV
a+dziiˀn gádziiˀn V;POT
a+dziiˀn badziiˀn V;PFV
a+dziiˀn radziiˀn V;HAB
atshí ratshi V;HAB
atshí gâtshi V;POT
atshí gutshi V;PFV
iunga biunga V;PFV
iunga dxîunga V;POT
iunga riunga V;HAB
dzhuʔn rdzhuʔn V;HAB
dzhuʔn gídzhuʔn V;POT
dzhuʔn bidzhuʔn V;PFV
dzhagá rdzhagá V;HAB
dzhagá gídzhagá V;POT
dzhagá bidzhagá V;PFV
a+dzhiiˀ gádzhiiˀ V;POT
a+dzhiiˀ badzhiiˀ V;PFV
a+dzhiiˀ radzhiiˀ V;HAB
dxîʔyí rdxîʔyí V;HAB
dxîʔyí txîʔyí V;POT
dxîʔyí gudxîʔyí V;PFV
u+shiˀi=duʔ gúshiˀi=duʔ V;POT
u+shiˀi=duʔ rushiˀi=duʔ V;HAB
u+shiˀi=duʔ bashiˀi=duʔ V;PFV
dzhibí rdzhibí V;HAB
dzhibí gídzhibí V;POT
dzhibí bidzhibí V;PFV
ieˀetu rieˀetu V;HAB
ieˀetu bieˀetu V;PFV
ieˀetu dxîeˀetu V;POT
u+zaˀabi ruzaˀabi V;HAB
u+zaˀabi bazaˀabi V;PFV
u+zaˀabi gúzaˀabi V;POT
gapá kăpá V;POT
gapá gudapá V;PFV
gapá rgapá V;HAB
ieˀedu rieˀedu V;HAB
ieˀedu dxîeˀedu V;POT
ieˀedu bieˀedu V;PFV
a+diʔtshí gádiʔtshí V;POT
a+diʔtshí radiʔtshí V;HAB
a+diʔtshí badiʔtshí V;PFV
roˀobá rroˀobá V;HAB
roˀobá txŏbá V;POT
roˀobá guroˀobá V;PFV
dzhaʔ rdzhaʔ V;HAB
dzhaʔ bidzhaʔ V;PFV
dzhaʔ gídzhaʔ V;POT
aˀa guta V;PFV
aˀa gâˀa V;POT
aˀa raˀa V;HAB
iaˀa=ñi riaˀa=ñi V;HAB
iaˀa=ñi dxîaˀa=ñi V;POT
iaˀa=ñi biaˀa=ñi V;PFV
yaˀadzhu biyaˀadzhu V;PFV
yaˀadzhu gíyaˀadzhu V;POT
yaˀadzhu ryaˀadzhu V;HAB
daˀapá rdaˀapá V;HAB
daˀapá gídaˀapá V;POT
daˀapá bidaˀapá V;PFV
u+ñă=laaˀdzi ruñă=laaˀdzi V;HAB
u+ñă=laaˀdzi bañă=laaˀdzi V;PFV
u+ñă=laaˀdzi gúñă=laaˀdzi V;POT
a+tăʔa ratăʔa V;HAB
a+tăʔa gátăʔa V;POT
a+tăʔa batăʔa V;PFV
a+doˀoba badoˀoba V;PFV
a+doˀoba gádoˀoba V;POT
a+doˀoba radoˀoba V;HAB
u+ga ruga V;HAB
u+ga baga V;PFV
u+ga gúga V;POT
zhuˀubí=dxa gízhuˀubí=dxa V;POT
zhuˀubí=dxa rzhuˀubí=dxa V;HAB
zhuˀubí=dxa bizhuˀubí=dxa V;PFV
a+găaˀ ragăaˀ V;HAB
a+găaˀ gágăaˀ V;POT
a+găaˀ bagăaˀ V;PFV
u+s+ia gúsia V;POT
u+s+ia basia V;PFV
u+s+ia rusia V;HAB
a+tasa batasa V;PFV
a+tasa ratasa V;HAB
a+tasa gátasa V;POT
u+răʔa barăʔa V;PFV
u+răʔa rurăʔa V;HAB
u+răʔa gúrăʔa V;POT
zobá guzobá V;PFV
zobá rzobá V;HAB
zobá sŏbá V;POT
u+tusha rutusha V;HAB
u+tusha gútusha V;POT
u+tusha batusha V;PFV
sheʔla gusheʔla V;PFV
sheʔla gísheʔla V;POT
sheʔla rsheʔla V;HAB
dxiʔtsi rdxiʔtsi V;HAB
dxiʔtsi gídxiʔtsi V;POT
dxiʔtsi bidxiʔtsi V;PFV
a+gaˀald=yu ragaˀald=yu V;HAB
a+gaˀald=yu bagaˀald=yu V;PFV
a+gaˀald=yu gágaˀald=yu V;POT
dxipa txĭpa V;POT
dxipa gudxipa V;PFV
dxipa rdxipa V;HAB
iashi riashi V;HAB
iashi biashi V;PFV
iashi dxîashi V;POT
u+s+iăʔn/u+s+ăʔn gúsiăʔn/ăʔn V;POT
u+s+iăʔn/u+s+ăʔn basiăʔn/ăʔn V;PFV
u+s+iăʔn/u+s+ăʔn rusiăʔn/ăʔn V;HAB
bwĕʔe rbwĕʔe V;HAB
bwĕʔe kwĕʔe V;POT
bwĕʔe gulĕʔe V;PFV
zhăla gízhăla V;POT
zhăla rzhăla V;HAB
zhăla bizhăla V;PFV
shiˀidxi bishiˀidxi V;PFV
shiˀidxi rshiˀidxi V;HAB
shiˀidxi gíshiˀidxi V;POT
alá ralá V;HAB
alá gualá V;PFV
alá gâlá V;POT
uˀuyi=dzhiˀidzhi bwiˀiyi=dzhiˀidzhi V;PFV
uˀuyi=dzhiˀidzhi gûˀuyi=dzhiˀidzhi V;POT
uˀuyi=dzhiˀidzhi ruˀuyi=dzhiˀidzhi V;HAB
u+shoˀoba rushoˀoba V;HAB
u+shoˀoba gúshoˀoba V;POT
u+shoˀoba bashoˀoba V;PFV
u+sidzi basidzi V;PFV
u+sidzi rusidzi V;HAB
u+sidzi gúsidzi V;POT
u+s+iăba basiăba V;PFV
u+s+iăba rusiăba V;HAB
u+s+iăba gúsiăba V;POT
u+sa+zhidzí gúsazhidzí V;POT
u+sa+zhidzí basazhidzí V;PFV
u+sa+zhidzí rusazhidzí V;HAB
ri=gunâʔla biri=gunâʔla V;PFV
ri=gunâʔla gíri=gunâʔla V;POT
ri=gunâʔla rri=gunâʔla V;HAB
aldă gualdă V;PFV
aldă gâldă V;POT
aldă raldă V;HAB
zaˀabi/zaˀabi=tĕ rzaˀabi/zaˀabi=tĕ V;HAB
zaˀabi/zaˀabi=tĕ guzaˀabi/zaˀabi=tĕ V;PFV
zaˀabi/zaˀabi=tĕ sâˀabi/zaˀabi=tĕ V;POT
yuuˀ=tĕ tshŭuˀ=tĕ V;POT
yuuˀ=tĕ ryuuˀ=tĕ V;HAB
yuuˀ=tĕ guyuuˀ=tĕ V;PFV
ĭnn bĭnn V;PFV
ĭnn dxĭnn V;POT
ĭnn rĭnn V;HAB
|
0555dc238588fd2a1f0bc5f87fb213d6c48b6f92 | e0124ace5e8cdd9581e74c4e29f58b56f7f97611 | /3899/CH10/EX10.2/Ex10_2.sci | 34aec28f0233c33c171c15b8ed48a8c904bfafc7 | [] | no_license | psinalkar1988/Scilab-TBC-Uploads-1 | 159b750ddf97aad1119598b124c8ea6508966e40 | ae4c2ff8cbc3acc5033a9904425bc362472e09a3 | refs/heads/master | 2021-09-25T22:44:08.781062 | 2018-10-26T06:57:45 | 2018-10-26T06:57:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 353 | sci | Ex10_2.sci | clear all;
t=-%inf:%inf;
w=2*%pi*%i
K=4
k=0:0.004:4;
sigma=0
Wmax=w.*k./K;
function x=f(t);
x=sign(t).*exp(-sigma.*abs(t)).*exp(-%i.*w.*t)
endfunction
Y=intg(-10,10,f)
// for the CTFS of x(t)=u(t)
f=1 // Analog frequency f=1 Hz
U=(1/%i*2*%pi*f)+(1/2).*[ones(1,1)]
disp(Y,'The CTFS of sgn(t)=')
disp(U,'The CTFS of sgn(t)=')
|
9d7a61acb116eabf4b0fe91bebcc877b75336287 | 449d555969bfd7befe906877abab098c6e63a0e8 | /278/CH24/EX24.13/ex_24_13.sce | 2131d12ad2feac65f3c2ac4d40f3a62ac508d2bb | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 611 | sce | ex_24_13.sce | //find..
clc
//solution
//given
P=30000//W
N=750//rpm
a=(%pi/180)*12.5
pn=0.1//N/mm62
Kl=1.75
t=42//N/mm^2
//D=6*b
T=60*P/(2*%pi*N)*Kl*1000//N-mm
//d=(T*16/(%pi*t))^(1/3)//mm
printf("dia of shaft is,%f mm\n",(T*16/(%pi*t))^(1/3))
printf("dia of shaft is say,50 mm\n")
d=50//mm
//T=2*%pi*u*pn*R^2*b
//b=R/3
//T=0.042*R^3
R=(T/0.042)^(1/3)//mm
printf("mean dia of shaft is,%f mm\n",2*R)
D=2*R
b=D/6
printf("face width is,%f mm\n",b)
//ref fig 24.9
r1=R+ (b/2)*sin(a)//mm
printf("radius of outr clutch is,%f mm\n",r1)
r2=R-(b/2)*sin(a)//mm
printf("radius of inner clutch is,%f mm\n",r2) |
86aecc5447d40a4715cabb3a7dcd268c9bd06c9c | 449d555969bfd7befe906877abab098c6e63a0e8 | /2789/CH3/EX3.2/Ex3_2.sce | 3a84bccc6a927ac5c955253a29e6d6c4f368d641 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 197 | sce | Ex3_2.sce | clear;
clc;
//page no. 83
v = 5;// fps
a_t = 0;
a_r = v^2 /2;// ft/sec^2
printf('Radial component of acceleration = %.1f ft/sec^2\n Tangential component of acceleration = %d ',a_r,a_t);
|
795ebdb03ed420b85dbb723c0ad06fb472683c23 | 786b8b062cc8e4ad6a2a39294d02777c4ec4cb78 | /FreeEDA/LPCSim/LPCSim/NR.sci | 229fb64e2d6285c242ef5389b1f50adac2157e8a | [] | no_license | FOSSEE/FreeEDA | fc379b9927e63f0b29e66f69284beddff07d43c8 | 0c9f3b3885338be0420773ac2007d8ac54aa7412 | refs/heads/master | 2021-01-18T15:16:58.922680 | 2014-12-09T10:59:41 | 2014-12-09T10:59:41 | 23,788,370 | 6 | 3 | null | 2014-09-26T09:05:17 | 2014-09-08T11:29:52 | Python | UTF-8 | Scilab | false | false | 8,217 | sci | NR.sci | // NR.sci is a scilab file to perform linearization of nonlinear element using Newton-Raphson method. It is developed for a scilab based circuit simulator. It is written by Yogesh Dilip Save (yogessave@gmail.com).
// Copyright (C) 2012 Yogesh Dilip Save
// This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// It is modified by Yogesh Dilip Save for FreeEDA Software on October 2012
function flag=checkForDeviceChar(voltage,current)
global g;
global model;
Edges=edge_number(g);
flag=%t;
X=1;
for edge_cnt = 1:Edges,
if(g.edges.data.type(edge_cnt)=='D')
tempModel=model(X);
Is=tempModel(2); Vt=tempModel(3);
currentByDiodeChar=Is*(exp(voltage(edge_cnt)/Vt)-1);
diodeCurrent=current(edge_cnt)+current(edge_cnt+1);
if(abs(currentByDiodeChar)<1d-9)
err=(diodeCurrent-currentByDiodeChar);
else
err=(diodeCurrent-currentByDiodeChar)*100/currentByDiodeChar;
end
if(abs(err)>0.001)
flag=%f; break;
end
X=X+1;
clear tempModel;
elseif(g.edges.data.type(edge_cnt)=='X')
tempModel=model(X);
generateCallingLibF(tempModel(1));
exec('getlib.sci',-1);
currentByFunc=func(voltage(edge_cnt),model(X));
currentByAnalysis=current(edge_cnt)+current(edge_cnt+1);
if(abs(currentByFunc)<1d-9)
err=(currentByAnalysis-currentByFunc);
else
err=(currentByAnalysis-currentByFunc)*100/currentByFunc;
end
if(abs(err)>0.001)
flag=%f; break;
end
X=X+1;
clear tempModel;
elseif(g.edges.data.type(edge_cnt)=='M')
Vgs=voltage(edge_cnt+2);
Vds=voltage(edge_cnt);
tempModel=model(X);
[Vt,beta1]=getMosPara(tempModel);
if(tempModel(1)=='P')
if(Vgs>Vt) //Cut-OFF region
currentByFunc=0;
elseif((Vgs<=Vt) & (Vds<(Vgs-Vt))) // Saturation region
currentByFunc=-beta1/2*(Vgs-Vt)*(Vgs-Vt);
else // Linear region
currentByFunc=-beta1*((Vgs-Vt)*Vds-Vds*Vds/2);
end
else
if(Vgs<Vt) //Cut-OFF region
currentByFunc=0;
elseif((Vgs>=Vt) & (Vds>(Vgs-Vt))) // Saturation region
currentByFunc=beta1/2*(Vgs-Vt)*(Vgs-Vt);
else // Linear region
currentByFunc=beta1*((Vgs-Vt)*Vds-Vds*Vds/2);
end
end
currentByAnalysis=current(edge_cnt)+current(edge_cnt+1);
if(abs(currentByFunc)<1d-9)
err=(currentByAnalysis-currentByFunc);
else
err=(currentByAnalysis-currentByFunc)*100/currentByFunc;
end
if(abs(err)>0.0001)
flag=%f; break;
end
X=X+1;
clear tempModel;
end
end
endfunction
function [A,B]=NR(A,B,voltage,current,NRitr)
global g;
global model;
X=1;
Edges=edge_number(g);
for edge_cnt = 1:Edges,
if(g.edges.data.type(edge_cnt)=='D')
tempModel=model(X);
Is=tempModel(2); Vt=tempModel(3); Vtlimit=80*Vt; // Diode Parameter
tempVoltage=voltage(edge_cnt);
tempCurrent=current(edge_cnt)+current(edge_cnt+1);
// Voltage Limiting
if(~(tempVoltage==0))
while(tempVoltage > Vtlimit)
tempVoltage = log(tempVoltage);
end
while(tempVoltage < -Vtlimit)
tempVoltage = -log(-tempVoltage);
end
end
// In forword bisaed use diode current to find voltage
if(tempVoltage>=0 & tempCurrent>=0)
tempVoltage = Vt*log(tempCurrent/Is+1);
end
// Update diode conductance and current source
Gnew=Is/Vt*exp(tempVoltage/Vt);
Gupdate=Gnew-g.edges.data.value(edge_cnt)
g.edges.data.value(edge_cnt)=Gnew;
Inew=Is*(exp(tempVoltage/Vt)-1)-Gnew*tempVoltage;
Iupdate=Inew-g.edges.data.value(edge_cnt+1);
g.edges.data.value(edge_cnt+1)=Inew;
// Update matrix A and rhs vector
source=g.edges.tail(edge_cnt)-1;
sink=g.edges.head(edge_cnt)-1;
if(~(source==0))
A(source,source) = A(source,source) + Gupdate;
B(source) = B(source)-Iupdate;
end
if(~(sink==0))
A(sink,sink) = A(sink,sink) + Gupdate;
B(sink) =B(sink) + Iupdate;
end
if(~(sink==0) & ~(source==0))
A(source,sink) = A(source,sink) - Gupdate;
A(sink,source) = A(sink,source) - Gupdate;
end
X=X+1;
clear tempModel;
elseif(g.edges.data.type(edge_cnt)=='X')
tempVoltage=voltage(edge_cnt);
tempCurrent=current(edge_cnt)+current(edge_cnt+1);
tempModel=model(X);
generateCallingLibF(tempModel(1));
exec('getlib.sci',-1);
// Update conductance and current source of nonlinear device
Gnew=jacobian(tempVoltage,model(X));
Gupdate=Gnew-g.edges.data.value(edge_cnt)
g.edges.data.value(edge_cnt)=Gnew;
Inew=func(tempVoltage,model(X))-Gnew*tempVoltage;
Iupdate=Inew-g.edges.data.value(edge_cnt+1);
g.edges.data.value(edge_cnt+1)=Inew;
// Update matrix A and rhs vector
source=g.edges.tail(edge_cnt)-1;
sink=g.edges.head(edge_cnt)-1;
if(~(source==0))
A(source,source) = A(source,source) + Gupdate;
B(source) = B(source)-Iupdate;
end
if(~(sink==0))
A(sink,sink) = A(sink,sink) + Gupdate;
B(sink) =B(sink) + Iupdate;
end
if(~(sink==0) & ~(source==0))
A(source,sink) = A(source,sink) - Gupdate;
A(sink,source) = A(sink,source) - Gupdate;
end
X=X+1;
clear tempModel;
elseif(g.edges.data.type(edge_cnt)=='M')
Vgs=voltage(edge_cnt+2);
Vds=voltage(edge_cnt);
tempModel=model(X);
[Vt,beta1]=getMosPara(tempModel);
Vtlimit=abs(80*Vt);
// MOS Voltage Limiting
if(~(Vgs==0))
while(Vgs > Vtlimit)
Vgs = log(Vgs)
end
while(Vgs < -Vtlimit)
Vgs = -log(-Vgs)
end
end
if(~(Vds==0))
while(Vds > Vtlimit)
Vds = log(Vds);
end
while(Vds < -Vtlimit)
Vds = -log(-Vds);
end
end
// Update conductance and current source of MOSFET
if(tempModel(1)=='P')
if(Vgs>Vt) //Cut-OFF region
Gnew=1e-12;
Inew=0;
elseif((Vgs<=Vt) & (Vds<(Vgs-Vt))) // Saturation region
Gnew=1e-12;
Inew=-beta1/2*(Vgs-Vt)*(Vgs-Vt);
else // Linear region
Gnew=abs(beta1*((-Vgs+Vt)+Vds));
Inew=-beta1/2*Vds*Vds;
end
else
if(Vgs<Vt) //Cut-OFF region
Gnew=1e-12;
Inew=0;
elseif((Vgs>=Vt) & (Vds>(Vgs-Vt))) // Saturation region
Gnew=1e-12;
Inew=beta1/2*(Vgs-Vt)*(Vgs-Vt);
else // Linear region
Gnew=abs(beta1*((Vgs-Vt)-Vds));
Inew=beta1/2*Vds*Vds;
end
end
Gupdate=Gnew-g.edges.data.value(edge_cnt)
g.edges.data.value(edge_cnt)=Gnew;
Iupdate=Inew-g.edges.data.value(edge_cnt+1);
g.edges.data.value(edge_cnt+1)=Inew;
// Update matrix A and rhs vector
source=g.edges.tail(edge_cnt)-1;
sink=g.edges.head(edge_cnt)-1;
if(~(source==0))
A(source,source) = A(source,source) + Gupdate;
B(source) = B(source)-Iupdate;
end
if(~(sink==0))
A(sink,sink) = A(sink,sink) + Gupdate;
B(sink) =B(sink) + Iupdate;
end
if(~(sink==0) & ~(source==0))
A(source,sink) = A(source,sink) - Gupdate;
A(sink,source) = A(sink,source) - Gupdate;
end
X=X+1;
clear tempModel;
end
end
endfunction
|
40843823ce1aebd936ceefa6c10f199309e26fce | 449d555969bfd7befe906877abab098c6e63a0e8 | /1118/CH6/EX6.1/eg6_1.sce | 6b05376f0aca796586febbdb031be489fe058a7e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 141 | sce | eg6_1.sce | clear;
clc;
uts=5758; //ultimate tensile strength
l=200;
wt=.604;
h=uts/2;
sag=wt*l*l/(8*h);
printf("The sag is:%.3f m",sag);
|
f89c5dd0b81b1e01399951221fcba316cb474822 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2276/CH11/EX11.4/chapter11_ex4.sce | 8617d9ac3be6fc26052608d6df5492e1614fa157 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,265 | sce | chapter11_ex4.sce | clc
clear
//input
vht=100;//higher threshold voltage in volts
rl1=5;//resistance of load in kiloohms
rl2=10;//load resistance in kiloohms
//calculations
//for rl1
//when va=0
ia1=vht/rl1;//anode current in milliamperes
//when va=100
ia2=0;//since va=vht
//for rl2
//when va=0
ia3=vht/rl2;//anode current in milliamperes
//when va=100
ia4=0;//since va=vht
//two load lines are drawn on VI graph which coincides the aanode characteristic curve at four points
//using the data given
//point 1
vg1=0;//grid voltage in volts
va1=71;//anode voltage in volts
i1=5.9;//anode current in milliamperes
//point 2
vg2=-2;//grid voltage in volts
va2=79;//anode voltage in volts
i2=4.3;//anode current in milliamperes
//point 3
vg3=0;//grid voltage in volts
va3=57;//anode voltage in volts
i3=4.3;//anode current in amperes
//point 4
vg4=-2;//grid voltage in volts
va4=68;//anode voltage in volts
i4=3.2;//anode current in amperes
//output
mprintf('for a load of 5kiloohm,the operating points are \n vg=%3.0fV: va=%3.0fV ia=%3.1fmA \n vg=%3.0fV: va=%3.0fV ia=%3.1fmA \n for a load of 10 kiloohms,the operating points are \n vg=%3.0fV: va=%3.0fV ia=%3.1fmA \n vg=%3.0fV: va=%3.0fV ia=%3.1fmA',vg1,va1,i1,vg2,va2,i2,vg3,va3,i3,vg4,va4,i4)
|
d809888d5b027658cef7d8820e78db95fc8724e1 | 15b814fbf5ba965e98871286249c9f382d1eee4c | /adaptive/simulation07/state_observer.sce | 193f8088675da7eee6b118ddc95db408a7db5556 | [] | no_license | oscarkremer/disciplines | b5338f3a97c7a20e4b39618d7da0d4396dc35f07 | b8d1ca9da37f81c99ee08dbee795d2d936597666 | refs/heads/master | 2020-07-22T14:57:42.643799 | 2019-12-07T15:51:40 | 2019-12-07T15:51:40 | 207,239,678 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,854 | sce | state_observer.sce | xdel(winsid());//fechar janelas de figuras
clear();//limpar memória
clc();//limpar console
t0 = 0;
delta_t = 0.001;
final_time = 20;
t = (0:delta_t:final_time);
t = t'
ifinal=size(t);ifinal=ifinal(1);
F = 10*ones(ifinal, 1);
m = 40;
b = 10;
k = 100;
s = poly(0, 's');
g = syslin('c', 1/m/(s^2 +b*s/m+ k/m))
y = csim(F', t', g)';
filtro = 1/(s+1)^3;
hf = syslin('c', filtro);
u_fil = csim(F', t', hf);
y_fil = csim(y', t', hf);
dy_fil = csim(y', t', s*hf);
d2y_fil = csim(y', t', s*s*hf);
P = 10000000*eye(3, 3);
theta_plot = zeros(3, ifinal);
p = zeros(ifinal);
m_hat = zeros(ifinal);
k_hat = zeros(ifinal);
b_hat = zeros(ifinal);
p(1) = norm(P, 'fro')
theta = [0;0;0];
x1 = zeros(ifinal);
x2 = zeros(ifinal);
x0=[0;0];
A = [-b/m 1; -k/m 0];
B = [0; 1/m];
x1(1) = x0(1);
x2(1) = x0(2);
x_alpha = [0.2; 0.3];
x1_alpha = zeros(ifinal);
x2_alpha = zeros(ifinal);
x1_alpha(1) = x_alpha(1);
x2_alpha(1) = x_alpha(2);
for i=1:ifinal
y_fil = csim(y', t', hf);
fi = [u_fil(i) -y_fil(i) -dy_fil(i)]';
K =P*fi/(1+fi'*P*fi);
P = (eye(3,3) - K*fi')*P;
p(i) = norm(P, 'fro')
theta = theta + K*(d2y_fil(i) - fi'*theta);
d2y_fil_hat(i) = fi'*theta;
theta_plot(:,i) = theta;
xp = A*x0 + B*F(i);
x0 = x0 + xp*delta_t;
x1(i) = x0(1);
x2(i) = x0(2);
A_p = [-theta_plot(3, i) 1; -theta_plot(2, i) 0];
b_p = [0;theta_plot(1, i)];
K = [44;10] - [theta_plot(3,i); theta_plot(2,i)];
y_alpha = [1 0]*x_alpha;
xdot_alpha = A_p*x_alpha + b_p*F(i) + K*(x1(i)-y_alpha(1))
x_alpha = x_alpha + xdot_alpha*delta_t;
x1_alpha(i) = x_alpha(1);
x2_alpha(i) = x_alpha(2);
end
figure(1)
plot(t,theta_plot')
figure(4); //Criando uma janela gráfica
plot2d(t, x1,5);//vermelho
plot2d(t, x1_alpha)
figure(5); //Criando uma janela gráfica
plot2d(t, x2',5);//vermelho
plot2d(t, x2_alpha);
|
86059c03e01c6ebc2d224ade7022ff3f2a81444c | 449d555969bfd7befe906877abab098c6e63a0e8 | /1628/CH12/EX12.2/Ex12_2.sce | 59fc5c4651b2a7f83dee43f75a99446242e2b8b0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 828 | sce | Ex12_2.sce |
// Example 12.2
Vl=415; // Supply Voltage
Vph=Vl/sqrt(3); // Phase Voltage
p1=10000; // Load of 10-kW
p2=8000; // Load of 8-kW
p3=5000; // Load of 5-kW
IR=p1/Vph; //Current by ( 10-kW Load )
disp(' Current by ( 10-kW Load ) = '+string(IR)+' Amp');
IY=p2/Vph; // Current by ( 8-kW Load )
disp(' Current by ( 8-kW Load ) = '+string(IY)+' Amp');
IB=p3/Vph; // nCurrent by ( 5-kW Load )
disp(' Current by ( 5-kW Load ) = '+string(IB)+' Amp');
IH=IY*cosd(30)-IB*cosd(30); // Horizontal Current
IV=IR-IY*sind(30)-IB*sind(30); // Vertical Current
IN=sqrt(IH^2+IV^2); // Current in Neutral Conductor
disp(' Current in Neutral Conductor = '+string(IN)+' Amp');
// p 410 12.2
|
c4a370748ecab8b4fa37efe91c3bd6363ac76b74 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2294/CH8/EX8.19/EX8_19.sce | 1d6b00c1461c214e0803ee3c873265131b8b522b | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,286 | sce | EX8_19.sce |
//Example 8.19.1
//Use fourier transform to determine the response of the following signal
clc;
clear all;
n=-10:10
for i=1:length(n)
if n(i)>=1 then
x(i)=(3/4)^n(i);
h(i)=(1/2)^n(i);
else
x(i)=0;
h(i)=0;
end
end
subplot(3,2,1)
plot(x,n);
xtitle('(a)x(n)');
subplot(3,2,2)
plot(h,n);
xtitle('(b)h(n)');
X=fft(x,-1);
H=fft(h,-1);
subplot(3,2,3)
plot(X,n);
xtitle('(c)X(n)');
subplot(3,2,4)
plot(H,n);
xtitle('(d)H(n)');
Y=H.*X;
subplot(3,2,5)
plot(Y,n);
xtitle('(e)Y(n)');
y=fft(Y,1);
disp(y,'The output response is:');
subplot(3,2,6)
plot(y,n);
xtitle('(f)y(n)');
clf()
//Example 8.19.2
//Use fourier transform to determine the response of the following signal
clc;
clear;
n=-10:10
for i=1:length(n)
if n(i)>=1 then
x(i)=(-1)^n(i);
h(i)=(1/2)^n(i);
else
x(i)=0;
h(i)=0;
end
end
subplot(3,2,1)
plot(x,n);
xtitle('x(n)');
subplot(3,2,2)
plot(h,n);
xtitle('h(n)');
X=fft(x,-1);
H=fft(h,-1);
subplot(3,2,3)
plot(X,n);
xtitle('X(n)');
subplot(3,2,4)
plot(H,n);
xtitle('H(n)');
Y=H.*X;
subplot(3,2,5)
plot(Y,n);
xtitle('Y(n)');
y=fft(Y,1);
disp(y,'The output response is:');
subplot(3,2,6)
plot(y,n);
xtitle('y(n)');
|
60dd85e5e9655c0d6cc50e27194bba00491a7af1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1892/CH3/EX3.8/Example3_8.sce | 2c41a01bb188b7f353971801dfa72b98ee82415f | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 317 | sce | Example3_8.sce | // Example 3.8
clear; clc; close;
format('v',6);
// Given data
m=4;//phases
Beta=1.5;//in degree
//Calculations
//Formula : Beta=360/m/Nr
Nr=360/m/Beta;//no. of rotor teeth
disp(Nr,"No. of rotor teeth ; ");
Ns=Nr;//no. of stator teeth
disp(Ns,"In multi stack motor, Stator teeth = rotor teeth = ");
|
cce836b461ce1bbce1158b6738b916b3464e2e84 | 449d555969bfd7befe906877abab098c6e63a0e8 | /3760/CH4/EX4.33/Ex4_33.sce | a0cb162e5255d88281cd229a177a9a533e97d9d5 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,606 | sce | Ex4_33.sce | //ANSWER GIVEN IN THE BOOK FOR THIS QUESTION IS INCORRECT.
clc;
//Neglecting armature reaction & magnetic saturation
//Assuming rotational losses to remain constant
V=230;//Supply voltage
P=15000;//power rating of dc series motor in watts
Il_1=80;//line current rated
Il_2=40;//line current assuming that motor draws half the rated current at rated voltage
Ia_1=Il_1;//armature current at line current equal to 80 A.
Ia_2=Il_2;//armature current at line current equal to 40 A.
n1=1000;//rated speed in rpm
//Full load losses expressed as percentage of motor input:-
//Armature ohmic loss=2.8%(including brush loss)
//Field ohmic loss=2.2%
//Rotational loss=2.2%
P_ip=V*Il_1;//full load input
P_ohmic=P_ip*(5.4/100)//As percent of total ohmic losses=2.2+2.8=5.4%
//But P_ohmic=Il*Il*(Ra+Rs); where (Ra+Rs)=(armature + series field) resistance
//(Ra+Rs)=P_ohmic/(Il*Il)=0.115 ohms
//Let, r=(Ra+Rs)
r=0.115;
//PART(a)-
Ea1=V-(Ia_1*r);//counter emf at line current = 80 A
Ea2=V-(Ia_2*r);//counter emf at line current = 40 A
//Since the magnetic saturation is neglected, phi_1=k*80 & phi_2=k*40; where k=constant & phi_1 & phi_2 are flux per pole at line currents 80 & 40 A respectively.
//(Ea1/Ea2)=(n1*phi_1)/(n2*phi_2) or (220.8/225.4)=(1000*80)/(n2*40); where Ea1=220.8 V Ea2=225.4 V.
n2=(1000*80*225.4)/(40*220.8);//speed in rpm
printf('The speed of rotation of motor when the motor draws half the rated current at rated voltage is %f rpm.',round(n2));
//PART(b)-
Pr=P_ip*(2.2/100);//rotational losses
Psh=Ea2*Ia_2-Pr;
printf('\nThe shaft output power is %f W.',Psh);
|
2f90a08cdba29cbe86023c5044724c159f7a8cea | 449d555969bfd7befe906877abab098c6e63a0e8 | /70/CH6/EX6.3.1/6_3_1.sci | 68e83af1c8616e9c7fae4b7e2da0ae3af5f5433c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 173 | sci | 6_3_1.sci | //332
clear;
close;
clc;
A=[-1 2 2]';
disp(A,'A=');
[U diagnol V]=svd(A);
disp(U,'U=');
disp(diagnol,'diagnol=');
disp(V','V''=');
disp(U*diagnol*V','A=U*diagnol*V''')
//end |
4c47df8fba7366a2c6fb3a317b63294e0bc2b8de | 449d555969bfd7befe906877abab098c6e63a0e8 | /3557/CH13/EX13.6/Ex13_6.sce | 7dad32b69190dbb047ea518056d6628acef4272c | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 674 | sce | Ex13_6.sce | //Example 13.6//
C=12.01;//amu //atomic mass of carbon //(From Appendix 1)
H=1.008;//amu //atomic mass of hydrogen //(From Appendix 1)
O=16.00;//amu //atomic mass of oxygen //(From Appendix 1)
a=6;//Number of atoms
b=2;//Number of atom
mw=((a*C)+(a*H)+O)+1.5*(C+(b*H)+O)-1.5*((b*H)+O)
mprintf("mw = %f g (Answer is not mentioned in the texbook)",mw)
//the mass of the polymer i question is
p=1.4;//g/cm^3
V=10;//cm^3
m=p*V
mprintf("\nm = %i g",m)
//Therefore the numbers of mers in the cylinder is
c=0.6023*10^24;//mers //Avogardo's Number
n1=m/(mw/c)
mprintf("\nn1 = %e mers",n1)
//which gives the molecular weight
wt=n1*mw
mprintf("\nwt = %e amu",wt)
|
f7a7387fd682b1afe67fdd063ddb15360bad2c32 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2522/CH15/EX15.4/exm15_4.sce | 05cc50e493994b437c10a93d98646a1ca64b870e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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,053 | sce | exm15_4.sce | // page no 484
// example no 15.4
// INSTRUCTIONS TO GENERATE SQUARE WAVE PULSE FROM COUNTER 1
clc;
printf('Control Word \n \n');
printf('D7 D6 D5 D4 D3 D2 D1 D0 \n');
printf('0 1 1 1 0 1 1 0 = 76H \n \n');
printf('D7,D6=01 Select counter 1 \n');
printf('D5,D4=11 Load 16 bit count \n');
printf('D3,D2,D1=011 Mode 3 \n');
printf('D0=0 Binary Count \n \n');
printf('Count \n \n');
count=(1*10^-3)/(0.5*10^-6);
printf('Count= ');
disp(count);
b=dec2hex(2000);
disp(b);
printf('in hexadecimal \n \n');
printf('Instructions \n \n');
printf('SQWAVE: \n');
printf('MVI A,01110110B \n'); // control word mode 3 & counter 1.
printf('OUT 83H \n'); // write in 8254 control register.
printf('MVI A,D0H \n'); // low order byte of the count.
printf('OUT 81H \n'); // load counter 1 with low order byte.
printf('MVI A,07H \n'); // high order byte of the count.
printf('OUT 81H \n'); // load counter 1 with high order byte
printf('HLT');
|
97b9e8ba70d6dfa2700ecaba15c368fecf053688 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1118/CH8/EX8.5/eg8_5.sce | 7ba2c6b11bc594b705ff07d6adb82250f480f3c0 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 366 | sce | eg8_5.sce | clear;
//clc();
s3q=10*10^6;
vl=10.5*1000;
il=s3q/(sqrt(3)*vl);
iph=il;
zph=5;
printf("\n Voltage drop in the line is: %.2f V",zph*iph);
//b).using per unit method to soolve
sb=10;
vlb=11;
vpu=vl/vlb;
sb3q=12;
spu=s3q/sb3q;
ipu=spu/vpu;
zpu=zph*sb3q/vlb^2;
v=zpu*ipu*vlb/sqrt(3);
printf("\n voltage drop in the line per phase is: %.2f V",v);
|
2c4d82ec5dabbb9f463c677d1503c3cd52e39670 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1118/CH26/EX26.7/eg26_7.sce | 4ec9842cb124e6351b7331b1aa0a357f7fd12c85 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 291 | sce | eg26_7.sce | clear;
//clc();
p1=500;
p2=100;
q1=acosd(.707);
q2=acosd(0.95);
lkvar=(p1*tand(q1) - (p1+p2)*tand(q2));
printf("The kVAr is:%.2f kVAr\n",lkvar);
kva=sqrt(p2*p2 + lkvar*lkvar);
printf("The kVA is:%.2f kVA\n",kva);
pf=(p2/kva);
printf("The power factor is:%.3f leading\n",pf);
|
d141534892c8425c334df66aa9fa27af88972cf1 | 449d555969bfd7befe906877abab098c6e63a0e8 | /1871/CH7/EX7.8/Ch07Ex8.sce | bc370f75b0b7e27f391029336fd007ecf2f7e2cd | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 876 | sce | Ch07Ex8.sce | // Scilab code Ex7.8: Pg:295 (2008)
clc;clear;
c = 3e+08; // Velocity of light, m/s
e = 1.6e-019; // Charge of an electron, coulomb
B = 0.5; // Maximum magnetic field at the electron orbit, Weber per meter square
D = 1.5; // Diameter of the orbit, meter
R = D/2; // Radius of the orbit, meter
omega = 50; // frequency of alternating current through electromagnetic coils, Hz
N = c/(4*2*%pi*omega*R); // Number of revolutions
E = B*e*R*c/1.6e-013; // Final energy of the electrons, MeV
E_av = (E*1e+06)/N; // Average energy per revolution, eV
printf("\nThe energy per revolution of the electron = %4.1f eV ", E);
printf("\nThe average energy of electron = %3.0f eV ", E_av);
// Result
// The energy per revolution of the electron = 112.5 eV
// The average energy of electron = 353 eV
// The answer is given wrong in the textbook |
82691998549fca37869cd874055d56b9c823d9e4 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2267/CH6/EX6.2/ex6_2.sce | 4d1a5b902469db245b2c4725b97b367e05b76440 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 564 | sce | ex6_2.sce | //Part A Chapter 6 Example 2
clc;
clear;
close;
T1=27+273;//K
T2=100+273;//K
T3=400+273;//K
m=5;//kg
cp=4.2;//kJ/kgK
cp2=2260;//kJ/kg
delta_T=100-27;//degree C
Q1=m*cp*delta_T;//kJ/K
delta_S1=Q1/T1//kJ/K
Q2=m*cp2;//kJ/K
delta_S2=Q2/T2//kJ/K
R=8.314/34;//kJ/kgK
//cp_steam=R*(3.5+1.2*T+0.14*T^2)*10^-3;//kJ/kgK
//delta_S3=m*cp_steam/T*dT
delta_S3=integrate('m*R*(3.5/T+1.2+0.14*T)*10^-3','T',T2,T3);//kJ/K
delta_S=delta_S1+delta_S2+delta_S3;//kJ/K
disp("Total entropy change = "+string(delta_S)+" kJ/K");
//Answer in the book is not accurate.
|
90a5ac8599826901b1bf7ef717a9ded1a88f7051 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2873/CH11/EX11.3/Ex11_3.sce | 43835d627a4ef8edd60c43ed30a99c40b88e0c0a | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 470 | sce | Ex11_3.sce | // Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clear;
clc;
disp("Engineering Thermodynamics by Onkar Singh Chapter 11 Example 3")
T1=(-27+273);//temperature of refrigerator in K
W=3*.7457;//work input in KJ/s
Q=1*3.5;//refrigeration effect in KJ/s
disp("COP=T1/(T2-T1)=Q/W")
COP=Q/W
COP=1.56;//approx.
disp("equating,COP=T1/(T2-T1)")
disp("so temperature of surrounding(T2)in K")
disp("T2=T1+(T1/COP)")
T2=T1+(T1/COP)
|
9889f5deaa874f20bcbdc62a328b72a46aa9be6e | f492a134695f6d4b2ec01d572569f961a169ef38 | /reversi/tests/vert_down.tst | e116783fa2fd0b266bbba684732d74728aeaffa7 | [] | no_license | rileythomp/cpp-games | a51b06964a2466268aff733fb5d2a4ec1ce2752f | 1b98e9b33ba5ae7aadb6d7a2e9c45cb266727f0c | refs/heads/master | 2022-06-10T16:09:02.322242 | 2022-05-24T19:10:45 | 2022-05-24T19:10:45 | 157,655,018 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 35 | tst | vert_down.tst | p
asdf
fdsa
2
3
7
7
1
3
0
3
quit
q
|
7eb515e2d2e84c47557a1186c579c3c97fe8f34c | d5b7d8ad996a3217cacad6b5986a0319216c359c | /MAM3085F_2015_Tutorial_7_Answers.sce | 5129b17968fdbd229cb7c3d9413b98b5a3f8be11 | [] | no_license | JamesGrobbo/Spoon-Knife | 413e465181d0bbf6923e8d295fbecc9769ce4316 | 6a52ebc8e6bb8df31b3680588782ffa2721383d0 | refs/heads/master | 2022-11-30T02:42:47.164732 | 2020-08-20T18:42:19 | 2020-08-20T18:42:19 | 288,239,275 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 5,169 | sce | MAM3085F_2015_Tutorial_7_Answers.sce | // Utility function: takes operator op
// op must be a function of a vector, producing a vector
// and op must be linear i.e. op(a + b) = op(a) + op(b)
// and op(k*a)=k*op(b)
// result: matrix m representation of op
// i.e op(x) = m * x
// simple linear algebra: m consists of columns op(ei)
// where ei is a basis vector
clc;clear
function m = mkMatrix(n, op)
m = zeros(n,n);
e = eye(n,n); // all basis vectors
for i=1:n do
m(:,i) = op(e(:,i)) // apply op to e_i
end
endfunction
function w=ff(v)
n = length(v);
w = zeros(n,1);
for i=1:(n-1) do
w(i) = 3*v(i) -v(i+1);
end
w(n) = v(n);
endfunction
m = mkMatrix(5,ff);
v = [2;1;4;5;1];
sol = m \ v;
// Represent each block of our system:
// each block takes a incoming flow (or flows)
// and produces resulting flow(s)
function f2 = mixer(f1, f7)
f2 = f1 + f7;
endfunction
function f3 = reactor(X,f2)
S = [-1/3 -1 1/3 1/3 0]';
change = X * f2(2) * S;
f3 = f2 + change;
endfunction
// takes a splitting vector Alpha
function [f4, f5] = condenser(Alpha, f3)
f5 = Alpha .* f3;
f4 = (1 - Alpha) .* f3;
endfunction
// takes a purge fuctor Beta
function [f6, f7] = purger(Beta, f5)
f6 = Beta * f5;
f7 = (1-Beta)*f5;
endfunction
// utility: get constituents out of the overall flow
function [f1, f2, f3, f4, f5, f6, f7] = splitFlow(F)
f1 = F(1:5);
f2 = F(6:10);
f3 = F(11:15);
f4 = F(16:20);
f5 = F(21:25);
f6 = F(26:30);
f7 = F(31:35);
endfunction
// A
// for each block OUT = blockFunction(IN)
// where IN and OUT are all parts of F
// thus, mass balance is OUT - blockFunction(IN)
// + constraints. In this case we specify the feed f1
// thus the constraint is simple: f1 -> f1
function b = massBalanceA(F)
Alpha = [1,1,0,0,1]';
Beta = 0.12281;
X = 0.6;
[f1, f2, f3, f4, f5, f6, f7] = splitFlow(F);
F2 = mixer(f1,f7);
F3 = reactor(X, f2);
[F4 F5] = condenser(Alpha,f3);
[F6 F7] = purger (Beta,f5);
b2 = F2 - f2; // mixer mass balance
b3 = F3 - f3; // reactor mass balance
b4 = F4 - f4; // condenser for f4
b5 = F5 - f5; // condenser for f5
b6 = F6 - f6; // purger for f6
b7 = F7 - f7; // purger for f7
c = f1; // constraint
b = [b2;b3;b4;b5;b6;b7;c];
endfunction
// RHS of mass balance
feed = [0.249 0.747 0 0 0.004]';
// for all but last bit, bA must be 0 (to satisfy mass balance)
bA = [zeros(30,1); feed];
AA = mkMatrix(35, massBalanceA);
FA = AA \ bA;
[f1A, f2A, f3A, f4A, f5A, f6A, f7A] = splitFlow(FA);
factorA = 155 / f4A(3);
FAfinal = factorA * FA;
// B
// the only change is the constraint: wwe specify f2(1), f2(2), f1(3), f1(4)
// and use mol fraction of inerts in f1 (feed) x15 = 0.004
// x15 = f15/(sum f1), i.e. f15 - x15 * sum(f1) = 0
function b = massBalanceB(F)
Alpha = [1,1,0,0,1]';
Beta = 0.12281;
X = 0.004;
[f1, f2, f3, f4, f5, f6, f7] = splitFlow(F);
F2 = mixer(f1,f7);
F3 = reactor(X,f2);
[F4 F5] = condenser(Alpha,f3);
[F6 F7] = purger (Beta,f5);
b2 = F2 - f2;
b3 = F3 - f3;
b4 = F4 - f4;
b5 = F5 - f5;
b6 = F6 - f6;
b7 = F7 - f7;
x = 0.004;
cLast = f1(5) - x * sum(f1);
c = [f2(1); f2(2); f1(3); f1(4); cLast];
b = [b2;b3;b4;b5;b6;b7;c];
endfunction
// f21 = 28, f22 = 70, f13=f14=0 and the constraint on inerts
bB = [zeros(30,1); [28; 70; 0; 0; 0]];
AB = mkMatrix(35, massBalanceB);
FB = AB \ bB;
[f1B, f2B, f3B, f4B, f5B, f6B, f7B] = splitFlow(FB);
factorB = 155 / f4B(3);
FBfinal = factorB * FB;
//=================================================================
//Tutorial 7 Question 1
//=================================================================
x=1:1:7;//Stream counter
names=['CO2' 'H2' 'CH3OH' 'H2O' 'Inerts']';//Components
flow=['Component/Flow' 'kmol/hr' 'kmol/hr' 'kmol/hr' 'kmol/hr' 'kmol/hr' 'kmol/hr' 'kmol/hr'];//Flow units
frac=['Component/Molfrac' '[-]' '[-]' '[-]' '[-]' '[-]' '[-]' '[-]'];//mole frac units (dimensionless)
fr=[f1B./sum(f1B) f2B./sum(f2B) f3B./sum(f3B) f4B./sum(f4B) f5B./sum(f5B) f6B./sum(f6B) f7B./sum(f7B)];//Mole fracs
total=[sum(f1B) sum(f2B) sum(f3B) sum(f4B) sum(f5B) sum(f6B) sum(f7B)];//Total flows for each stream
csvWrite(['Stream' string(x);flow;names string([f1B f2B f3B f4B f5B f6B f7B]);'Total' string(total);frac;names string(fr)],'streamtable_q1.csv');
//=================================================================
//Tutorial 7 Question 2
//=================================================================
x=[];A=[];b=[];F=[];
A=[1 1 1;0.04 0.54 0.26;0.93 0.24 0];
b=[10 2 6]';
x1=[0.2 0.6 0.2]';x2=[0.04 0.93 0.03]';x3=[0.54 0.24 0.22]';x4=[0.26 0 0.74]';
F=A\b;
F1=10;F2=F(1);F3=F(2);F4=F(3);
x=1:1:4;
flow2=['Component/Flow' 'mol/s' 'mol/s' 'mol/s' 'mol/s'];
comps=['Species 1' 'Species 2' 'Species 3']';
frac2=['Component/Molfrac' '[-]' '[-]' '[-]' '[-]'];
flows=[F1.*x1 F2.*x2 F3.*x3 F4.*x4];//Species flows for each stream
csvWrite(['Stream' string(x);flow2;comps string(flows);'Total' string([F1 F2 F3 F4]);frac2;comps string([x1 x2 x3 x4])],'streamtable_q2.csv');
|
a0880bda7d65357b9fe012d8d3c7a247fcd3f3a8 | 449d555969bfd7befe906877abab098c6e63a0e8 | /389/CH10/EX10.10/Example10_10.sce | c4d84712a04572e6c1220f06a9992158b13087cc | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 804 | sce | Example10_10.sce | clear;
clc;
// Illustration 10.10
// Page: 552
printf('Illustration 10.10 - Page: 552\n\n');
// Solution
//****Data****//
B = 1150;// [kg/h]
//*******//
// x and y are taken in weight ratio.
x1_prime = 0.0101;// [Wt. fraction]
xF_prime = 0.0101;// [Wt. fraction]
y2_prime = 0;// [Wt. fraction]
x2_prime = 0.001001;// [Wt. fraction]
y1_prime = 0.0782;// [Wt. fraction]
// From Illustration 10.4:
A = 990;// [kg/h]
// At the dilute end:
m1_prime = 0.798;
Value1 = m1_prime*B/A;
// At the concentrated end:
m2_prime = 0.953;
Value2 = m2_prime*B/A;
ValueAv = (Value1*Value2)^0.5;
// From Eqn. 10.116:
// Since y2_prime = 0
Value3 = x2_prime/x1_prime;
NtoR = (log((1/Value3)*(1-(1/ValueAv))+(1/ValueAv)))/(1-(1/ValueAv));
printf("Number of theoretical Unit : %f\n",NtoR); |
3aa50e66f773bb5a62f10f92e03d7b5a0d0eb56f | 449d555969bfd7befe906877abab098c6e63a0e8 | /623/CH20/EX4.3.13/U4_C3_13.sce | 3b88f3e84bdf85dd8dbb8778051d74922a45d0bb | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 398 | sce | U4_C3_13.sce | //variable initialization
R=109734 //(cm-1)
T=24477 //(cm-1)
Zeff=1
n=3
//calculation
delta=n-(Zeff*sqrt(R/T)); //quantum defect for 3p configuration of sodium
printf("\nΔ = %.3f",delta);
|
41360bd454227ca3f615d0dfa11dce18f3322dee | 7e1b0b7ceda8e9c25d67d330a7bb5e562a01f27a | /ProbInverses/TP1/02lsItere.sce | fb7df43fe53d81d7af3b655a8881c9173d0ac097 | [] | no_license | sebherv/master2 | 59b8232e62bef140636bfad8c986bbd10e7d7beb | b8cd8bcde1ae3ae7a5bca58183804faa21456dd8 | refs/heads/master | 2021-09-13T19:33:50.766722 | 2018-02-09T15:09:24 | 2018-02-09T15:09:24 | 103,376,025 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 228 | sce | 02lsItere.sce |
figure;
sigma = 8.0;
e=ones(20,1);
C=ones(1,20);
Ct=diag(C)/sigma;
x=linspace(1,10,20);
plot(X,d2,"ro");
//K=1
G=e;
for K=0:4
if K > 1
G=[G X.^(K-1)]
end
m=inv(G'*Ct*G)*G'*Ct*d2;
ymod=m' *X.^K
end |
1744bf5f56ec907f0df28d546bef823d67f98e31 | 99b4e2e61348ee847a78faf6eee6d345fde36028 | /Toolbox Test/rc2poly/rc2poly6.sce | 76ec32604108159ea2a932b429bfba66dcc322dd | [] | 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 | 130 | sce | rc2poly6.sce | //check o/p when matrix containiig single element is passed
t=[2];
z=[5];
[k] = rc2poly(t);
disp(k);
//output
//1. 2.
|
95ca9e8c485ad1c808909a02a1b3e19dea3ab7b0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2318/CH3/EX3.35/ex_3_35.sce | 96b44b238140aa075b64077c11ca11c202eb71e3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 305 | sce | ex_3_35.sce | //Example 3.35:unknown resistance
clc;
clear;
close;
P=100.24;//ohms
Q=200;//ohms
S=100.03;//ohms
x=(P/Q)*S*10^-6;//ohms
q=200;//ohms
r=700;//micro ohms
p=100.31;//ohms
y=((q*r*10^-6)/(p+q+(r*10^-6)));//ohms
z=((P/Q)-(p/q));//ohms
R=x+(y*z);//micro ohms
disp(R*10^6,"unknown resistance is ,(micro-ohm)=")
|
64a9bb8cfc14ded849683e15df9f63437e488abb | 048b7c76423fe27dee2e31a52bae93c95883614e | /macros/cceps.sci | 8360085aa24cb5561d921c3820c8251e04d03715 | [] | no_license | vu2swz/FOSSEE-Signal-Processing-Toolbox | aa5f283d050be62418dddbf41552f197b9949c4c | d97a4b7e2f0f25fb5cd94bd90a3b822592179d1e | refs/heads/master | 2021-08-19T20:06:19.346872 | 2017-11-27T09:57:21 | 2017-11-27T09:57:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 529 | sci | cceps.sci | function y = cceps (x,correct)
//Return the complex cepstrum of the vector x
//Calling Sequence
//cceps (x)
//cceps(x, correct)
//Description
//This function return the complex cepstrum of the vector x. If the optional argument correct has the value 1, a correction method is applied. The default is not to do this.
funcprot(0);
//
rhs = argn(2)
if(rhs<1 | rhs>2)
error("Wrong number of input arguments.")
end
select(rhs)
case 1 then
y = callOctave("cceps",x)
case 2 then
y = callOctave("cceps",x,correct)
end
endfunction
|
6894713c1679766f26383ed2d87c298629604e11 | 449d555969bfd7befe906877abab098c6e63a0e8 | /965/CH11/EX11.2/2.sci | 8d1aac88bbea1c68c2dc8eb7e88ffe5cbaf13385 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 243 | sci | 2.sci | clc;
clear all;
disp("surface temperature of sun")
lmax=0.49;//mu m
T=2898/lmax;//mu.m
disp("K",T, "surface temperature of sun = ")
sigma=5.67*10^(-8);
Eb=sigma*T^4;//W/m^2
disp("W/m^2",Eb,"The total rate of energy emmision, Eb =")
|
cf45f014eb7e84b59519c8323f6799c6fc7c1c7d | ebfed86dee276110294a4e93fa80377908bbd317 | /macros/trainCascadeObjectDetect.sci | 36d210419b49fcbc431a99aacb6e0a3cc7cc8563 | [] | no_license | gursimarsingh/FOSSEE-Image-Processing-Toolbox | a9d46b698c98566fec867eb2ce3cfeb427058d5c | 165f6d7d1f20262a1637a923c6aad6e663ad1538 | refs/heads/master | 2021-08-16T19:18:59.591175 | 2017-11-08T17:55:04 | 2017-11-08T17:55:04 | 96,531,802 | 0 | 0 | null | 2017-07-07T11:21:10 | 2017-07-07T11:21:10 | null | UTF-8 | Scilab | false | false | 9,042 | sci | trainCascadeObjectDetect.sci | // Copyright (C) 2015 - IIT Bombay - FOSSEE
//
// This file must be used under the terms of the CeCILL.
// This source file is licensed as described in the file COPYING, which
// you should have received as part of this distribution. The terms
// are also available at
// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
// Author: Gursimar Singh
// Organization: FOSSEE, IIT Bombay
// Email: toolbox@scilab.in
// Training dataset credits AT&T Laboratories Cambridge
function trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,varargin)
// It creates trained cascade XML file which can be use for object/face detection.
//
// Calling Sequence
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile)
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg,"nsplits",nsplits);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg,"nsplits",nsplits,"minHitRate",minHitRate);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg,"nsplits",nsplits,"minHitRate",minHitRate,"maxFalseAlarmRate",maxFalseAlarmRate);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg,"nsplits",nsplits,"minHitRate",minHitRate,"maxFalseAlarmRate",maxFalseAlarmRate,"w",width);
// trainCascadeObjectDetect(outputFolder,negativeImages,positiveFile,"numStages",numStages,"featureType",featureType,"numPos",numPos,"numNeg",numNeg,"nsplits",nsplits,"minHitRate",minHitRate,"maxFalseAlarmRate",maxFalseAlarmRate,"w",width,"h",height);
//
// Parameters
// outputFolder: Folder name to store trained cascade (cascade.xml) and intermediate files
// negativeImages: path to a negative images folder.Accepted file formats are .jpg,.jpeg,.png,.bmp,.pgm.
// positiveFile: path to the vector file which contains sample data.
// Name-Value Pair arguments:
// numPos: number of positive samples. Default-30
// numNeg: number of negative samples. Default- 20
// nsplits: number of splits. Default- 2
// numStages: number of cascade stages to be trained. Default- 30
// featureType: Type of features to be used, possible types are HAAR, LBP, HOG. Default-HAAR
// minHitRate: Minimal desired hit rate for each stage of the classifier and value in the range 0 and 1 inclusive. Default- 0.995
// maxFalseAlarmRate: Maximal desired false alarm rate for each stage of the classifier and value in the range 0 and 1 inclusive. Default- 0.5
// w: Width of training samples (in pixels). Default-25
// h: Height of training samples (in pixels). Default-25
//
// Description
// By using postiveFile.vec and negative.txt created using negativeImages folder, trainCascade will create cascade.xml file inside the outputFolder which is used to detect objects in an image.
//
// Examples
// //Training a obejct classifier using one positive image.
// CreateSample("images/positive.jpg","positive.vec","images/negative_samples","num",100);
// trainCascadeObjectDetect("positive_samples","images/negative_samples","positive.vec","numStages",6);
// im=imread("images/jellyfish.jpg");
// [image,bbox]=CascadeObjectDetector(im,"positive_samples/cascade.xml");
// imshow(image);
//
// Examples
// //Training a obejct classifier using the image dataset which contains subfolders within the positiveImages directory.
// CreateSampleFromFile("images/trainset_face","positive_faces.vec",400,"recursive");
// trainCascadeObjectDetect("positive_samples_faces","images/negative_samples","positive_faces.vec","numPos",300,"numStages",5);//number of positive samples used in trainCascade Object Detect must not be more than 90% of total number of poitive images in vec file
// im=imread("images/faces.jpg");
// img=CascadeObjectDetect(im,"positive_samples_faces/cascade.xml",1.04,1,8,[50,50],[150,150]);
// imshow(img);
//
//See also
//CreateSampleFromFile
//CascadeObjectDetect
//
//Authors
//Gursimar Singh
[lhs rhs]=argn(0);
if rhs<3 then
error(msprintf(" Not enough input arguments"))
elseif rhs>21 then
error(msprintf(" Too many input arguments to the function"))
elseif modulo(rhs-3,2)
error(msprintf(" wrong number of input arguments,name-value pairs not macthed"))
end
//validating variables
if ~isdir(negativeImages)
error(msprintf(" wrong input argument #3,existing directory expected"))
end
//default values
numPos=20;
numNeg=20;
numStages=10;
nsplits=2;
featureType="HAAR"
minHitRate=0.995
maxFalseAlarmRate=0.5
w=25
h=25
for i=1:2:rhs-3
if strcmpi(varargin(i),"numPos")==0 then
i=i+1;
numPos=varargin(i);
if numPos<0 then
error(msprintf(" numPos value must be positive"))
end
disp(numPos);
elseif strcmpi(varargin(i),'numNeg')==0 then
i=i+1;
numNeg=varargin(i);
if numNeg<0 then
error(msprintf(" numNeg value must be positive"))
end
elseif strcmpi(varargin(i),'numStages')==0 then
i=i+1;
numStages=varargin(i);
if numStages<0 then
error(msprintf(" numStages value must be positive"))
end
elseif strcmpi(varargin(i),'nslits')==0 then
i=i+1;
nsplits=varargin(i);
if nsplits<0 then
error(msprintf(" nsplits value must be positive"))
end
elseif strcmpi(varargin(i),'featureType')==0 then
i=i+1;
featureType=varargin(i);
if strcmpi(featureType,'haar') & strcmpi(featureType,'lbp') & strcmpi(featureType,'hog')
error(msprintf(" wrong input argument #%d,featureType not matched",i));
end
elseif strcmpi(varargin(i),'minHitRate')==0 then
i=i+1;
minHitRate=varargin(i);
if minHitRate<0 | minHitRate>1 then
error(msprintf(" minHitRate value must lie in between 0 and 1"))
end
elseif strcmpi(varargin(i),'maxFalseAlarmRate')==0 then
i=i+1;
maxFalseAlarmRate=varargin(i);
if maxFalseAlarmRate<0 | minFalseRate>1 then
error(msprintf(" maxFalseAlarmRate value must lie in between 0 and 1"))
end
elseif strcmpi(varargin(i),'w')==0 then
i=i+1;
w=varargin(i);
if h<0 then
error(msprintf(" w value must be positive"))
end
elseif strcmpi(varargin(i),'h')==0 then
i=i+1;
h=varargin(i);
if h<0 then
error(msprintf(" h value must be positive"))
end
else
error(msprintf(_(" Wrong value for input argument #%d",i)));
end
end
if ~isfile('negative.txt')
if isdir(negativeImages)
if getos()=="Linux"
temp=strcat(["ls ",negativeImages])
elseif getos()=="Windows"
temp=strcat(["dir ",negativeImages])
end
s=unix_g(temp);
[noOfFilesInFolder noOfCols]=size(s);
fd = mopen('negative.txt','wt');
for i=1:noOfFilesInFolder
[path,fname,extension]=fileparts(s(i))
if ~strcmp(extension,".jpg") | ~strcmp(extension,".jpeg") | ~strcmp(extension,".png") | ~strcmp(extension,".bmp") | ~strcmp(extension,".pgm") | ~strcmp(extension,".JPG") | ~strcmp(extension,".JPEG") | ~strcmp(extension,".PNG") | ~strcmp(extension,".BMP") | ~strcmp(extension,".PGM")
mfprintf(fd,'%s/%s\n',negativeImages,s(i));
end
end
mclose(fd);
end
end
if isdir(outputFolder)
removedir(outputFolder);
end
createdir(outputFolder);
disp("Training Cascade:");
cmd=sprintf("opencv_traincascade -data %s -vec %s -bg negative.txt -numPos %d -numNeg %d -numStages %d -nsplits %d -featureType %s -minHitRate %d -maxFalseAlarmRate %d -w %d -h %d",outputFolder,positiveFile,numPos,numNeg,numStages,nsplits,featureType,minHitRate,maxFalseAlarmRate,w,h);
unix_w(cmd);
endfunction
|
f35bd4a3ab3a9635854b813c5d681cfdec5086ab | 449d555969bfd7befe906877abab098c6e63a0e8 | /2459/CH13/EX13.3/Ex13_3.sce | 5ecf2a54da9b956fe992bb50da54a7520e956d91 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 991 | sce | Ex13_3.sce | // chapter 13
// example 13.3
// page 278
Vcc=15 // V
Re=2 // kilo ohm
Rc=1 // kilo ohm
Rl=1 // kilo ohm
Vbe=0.7 // V
// dc load line
// when Ic=0, Vce=Vcc i.e. Vce=15 and when Vce=0, Ic=Vcc/(Rc+Re) i.e. Ic=15/3
// so equation of load line becomes Ic=-(1/3)*Vce+15
clf()
x=linspace(0,15,5)
y=-(1/3)*x+5
plot2d(x,y,style=3,rect=[0,0,16,6])
xtitle("dc load line-green ac load line-blue","collector emitter voltage(volts)","collector current(mA)")
V2=5 // V
// since voltage across R2 is V2=5 V and V2=Vbe+Ie*Re we get
Ie=(V2-Vbe)/Re
Ic=Ie
Vce=Vcc-Ic*(Rc+Re)
printf("the operating point is %.3f V and %.3f mA \n",Vce,Ic)
// ac load line
R_AC=Rc*Rl/(Rc+Rl) // ac load
V_ce=Vce+Ic*R_AC // maximum collector emitter voltage
I_c=Ic+Vce/R_AC // maximum collector current
// the equation of ac load line in terms of V_ce and I_c becomes
y=-(I_c/V_ce)*x+I_c
plot2d(x,y,style=2,rect=[0,0,10,20])
|
6d97e961fdbd1f95d928b2dcc9558c2e93545f56 | 1db0a7f58e484c067efa384b541cecee64d190ab | /macros/phasedelay.sci | 19aeded75e1fc56412a0d85ac428bf20773f5213 | [] | no_license | sonusharma55/Signal-Toolbox | 3eff678d177633ee8aadca7fb9782b8bd7c2f1ce | 89bfeffefc89137fe3c266d3a3e746a749bbc1e9 | refs/heads/master | 2020-03-22T21:37:22.593805 | 2018-07-12T12:35:54 | 2018-07-12T12:35:54 | 140,701,211 | 2 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 3,108 | sci | phasedelay.sci | //Author: Parthasarathi Panda
//parthasarathipanda314@gmail.com
function [phi, varargout]=phasedelay(varargin)
//cas variable is 2 if sos form is involved and 1 if direct rational form is given
//(sos,n) or (sos,w) or (sos,'whole')or (b,a) is the input
//cas variable is 2 if sos form is involved and 1 if direct rational form is given
//cas1 variable is 1 if f is to be given as output, 2 other wise
[nargout,nargin]=argn();
//do not forget to execute 'phaseInputParseAs_sos' and 'phaseInputParseAs_ab' before running
v=size(varargin(1));
if size(v)>2 then
error ('invalid input dimension');
end
[n,k]=size(varargin(1));
if type(varargin(1))~=1 then
error ('check the input type');
end
if (n==1 & k==6) then //not clear if sos or (a,b)
v=size(varargin(2));
if (nargin==1) //(sos) is the input
cas=2;
[sos,w,cas1,fs]=phaseInputParseAs_sos(varargin,nargin);
elseif (varargin(2)=='whole') //(sos,'whole')is the input
cas=2;
[sos,w,cas1,fs]=phaseInputParseAs_sos(varargin,nargin);
else //taking it as (a,b)
cas=1;
[a,b,w,cas1,fs]=phaseInputParseAs_ab(varargin,nargin);
end
elseif (n==1 | k==1) then
cas=1;
[a,b,w,cas1,fs]=phaseInputParseAs_ab(varargin,nargin);
elseif k==6 then //first variable is sos
cas=2;
[sos,w,cas1,fs]=phaseInputParseAs_sos(varargin,nargin);
end
//cas,cas1,fs,w,[(a,b),sos]
if cas==1 then
[m,n]=size(a);
N=[0:n-1];
M=N'*w;//computing matrix Mij=(i-1)*wj
num=(a*exp(%i*M));//the operation computes phase of sum(ak*exp(i*w*k))
num_dot=(%i*(a.*N)*exp(%i*M));//computing the derivative on those points
phdel_num=(imag(num_dot).*real(num)-imag(num).*real(num_dot))./(abs(num).*abs(num));
[m,n]=size(b);
N=[0:n-1];
M=N'*w;
den=(b*exp(%i*M));//the operation computes phase of sum(ak*exp(i*w*k))
den_dot=(%i*(b.*N)*exp(%i*M));//computing the derivative on those points
phdel_den=(imag(den_dot).*real(den)-imag(den).*real(den_dot))./(abs(den).*abs(den));
phi=(phdel_num-phdel_den);
0;
else
[n,k]=size(sos)
N=[0,1,2];
M=N'*w;
num=(sos(:,4:6)*exp(%i*M));//the operation computes phase of sum(ak*exp(i*w*k))
num_dot=(%i*(sos(:,4:6).*(ones(n,1)*N))*exp(%i*M));//computing the derivative on those points
phdel_num=(imag(num_dot).*real(num)-imag(num).*real(num_dot))./(abs(num).*abs(num));
den=(sos(:,1:3)*exp(%i*M));//the operation computes phase of sum(ak*exp(i*w*k))
den_dot=(%i*(sos(:,1:3).*(ones(n,1)*N))*exp(%i*M));//computing the derivative on those points
phdel_den=(imag(den_dot).*real(den)-imag(den).*real(den_dot))./(abs(den).*abs(den));
phi_mat=phdel_num-phdel_den;
phi=sum(phi_mat,1);//summing each of the componenet second order system phases
end
if cas1==1 then
varargout(2)=w*fs/(2*%pi);
end
endfunction
|
7eeda813902f62d448f905983c19f3da91a558cd | 33d7960e39a3e71591538dccbe1dd4014c377e78 | /Exercise_22.sce | 1964e8dac433004152775b31c65038463b3505dc | [] | no_license | wiiwins/Compfin | 529e2997994babb9e3795283ddbd8ec782131148 | 2629685421e970a369ec797b76dda3d2803bcbcf | refs/heads/master | 2020-05-18T01:25:39.357847 | 2019-06-27T11:21:46 | 2019-06-27T11:21:46 | 184,090,400 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,898 | sce | Exercise_22.sce | //C-Exercise22
//Jurain Kahl
//Nattawut Phanrattinon
funcprot(0);
exec("CompFin_2019_SS_BS_Price_Int.sce")
//computes the initial price of European call options with identicall maturity T and strikes K = (K1, ..., Kn)
function V0 = BS_EuCall_FFT (S0, r, sigma, T, K, R, N, M, kappa1)
//model parameters delta and kappa (4.15)
delta = M/N;
kappa = kappa1 + ((1:N)-1) *((2*%pi) / M );
//function f_tilde according to (4.11) for kappa = 0
function y = f_tilde(z)
y = 1/ (z*(z-1));
endfunction
//characteristic function at time 0 of the Black-Scholes model given on page 41
function y = chi(u)
y = exp(%i*u*(log(S0)+r*T) -(%i*u+u^2)*((sigma^2)/2)*T);
endfunction
//function g given by (4.13)
function y = g(u)
y = f_tilde(R+%i*u) * chi(u-%i*R);
endfunction
//setting x according to (4.17)
x = ones(1,N)
for n=1:N
x(n)= g((n-1/2)*delta) * delta * exp(-%i*(n-1)*delta * kappa1);
end
//the fourier transform of x
x_hat = fft(x);
//computing (4.18)
V_kappa = exp(-r*T + (1-R)*kappa)*(1/%pi).*real(x_hat.*exp(-(%i/2)*delta*kappa));
//computing the price of the option using linear interpolation
V0 = interpln([kappa;V_kappa],log(K));
endfunction
//testing
S0 = 100;
r = 0.05;
sigma = 0.2;
T = 1;
K = (80:180);
R = 1.1;
N = 2^11;
M = 50;
kappa1 = log(80);
V1 = BS_EuCall_FFT (S0, r, sigma, T, K, R, N, M, kappa1)
//payoff for European call using Black-Scholes integration formula
V2 = zeros(K);
i=1;
for j=K
function y = g(x)
y=max(0,x-j);
endfunction
V2(i)=BS_Price_Int(S0, r, sigma, T, g);
i=i+1;
end
//plotting both computations
plot(K, V1)
plot(K, V2, 'red')
title("Comparison of FFT and Black-Scholes integration formula")
xlabel("Strikes")
ylabel("Value of option at time 0")
legend("FFT", "BS integration", 4)
|
16371f62791c904508cd68c853b2bfc31e62ddf3 | 8217f7986187902617ad1bf89cb789618a90dd0a | /browsable_source/2.3.1/Unix-Windows/scilab-2.3/macros/percent/%rolss.sci | eb3839bde4259f94c8e29b6cf988ee29e75961ce | [
"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 | 95 | sci | %rolss.sci | function r=%rolss(s1,s2)
//%rolss(s1,s2) <=> s1==s2 , s1 rational, s2 state-space
//!
r=%f
|
d88d6de492992b824d5bae46b9f480bacf1e06a0 | 449d555969bfd7befe906877abab098c6e63a0e8 | /761/CH13/EX13.5/13_5.sce | 787ddd12788434b51994ecc7cbd6615aad77f119 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 521 | sce | 13_5.sce | clc;
// page no 447
// prob no 13_5
//signal with bandwidth Bbb=200 kHz & SNR=20 dB spred at chip rate 50:1
Bbb=200*10^3;//Bandwidth
Gp=50;//chip rate
SNR_in=20;//SNR is 20 dB without spreading
//Determination of BW after spreading
Brf=Gp*Bbb;
disp('MHz',Brf,'The value of BW after spreading');
//Converting into dB
Gp_dB=10*log10(Gp);
disp('dB',Gp_dB,'The value of processing gain');
//Determination of SNR after spreadng
SNR_out=SNR_in-Gp_dB;
disp('dB',SNR_out,'The value of SNR after spreading in dB'); |
d871a3b80fa017dd2718e2b7985f3c431769eab1 | 56743f362de98f910919780918c86679ec136d3e | /resolucao-provas/2017-2018/2º Teste Prático v1.sce | eb42bcea2fa6d0d2c598f0862aa2effaf8c2f536 | [] | no_license | andre-paulo98/fichas-ei-a1s2-MD | aaf75e6b45cbac7ebbf92949deb783ce6f1201b7 | 99c50eb08cf409ce8e5aa8301728dbe9148e16c5 | refs/heads/master | 2022-02-24T23:13:49.293944 | 2019-10-06T17:50:26 | 2019-10-06T17:50:26 | 171,472,323 | 0 | 0 | null | null | null | null | UTF-8 | Scilab | false | false | 1,923 | sce | 2º Teste Prático v1.sce | clc
clear
// 1.a)
Re1R = readxls("Material/dados.xls")(1).value
exec("Material/funcoes.sce", -1)
disp ("Re1R")
disp(Re1R)
// 1. b)
// Equivalência => RST
// 143
isR = verifica1(Re1R)
isS = verifica4(Re1R)
isT = verifica3(Re1R)
if isR == %t & isS == %t & isT == %t
disp("A matrix Re1R é uma relação de equivalência")
else
if isR == %f
disp("A matriz não é uma relação de equivalência pois não é reflexiva")
end
if isS == %f
disp("A matriz não é uma relação de equivalência pois não é simétrica")
end
if isT == %f
disp("A matriz não é uma relação de equivalência pois não é transitiva")
end
end
////////
// 2
////////
grafoOrientado = readxls("Material/dados.xls")(2).value
caminhos = bool2s(grafoOrientado)
a = caminhos^5
S = zeros(9,9)
for i=1:5
S=S+caminhos^i
end
disp("2.a) Existem " + string(S(3,7)) + " caminhos de 3 para 7 com comprimento igual ou menor a 5")
// 2b
function Y=fonte(M,v)
//M: matriz de adjacências do grafo G
Y=%t;
[a b]=size(M)
soma=0
for i=1:b
soma=soma + M(i,v)
end
if soma <> 0
Y=%f
end
endfunction
// 2c
function [Q,M]=Warshall_MIN(W)
[u,v]=size(W)
for i=1:u
for j=1:v
if W(i,j)<>0 then
M(i,j)=string(i)+string(j)
else
M(i,j)='-'
end
end
end
for i=1:u
for j=1:v
if W(i,j)==0
Q(i,j)=%inf;
else
Q(i,j)=W(i,j);
end
end
end
for p=1:u
for i=1:u
for j=1:v
if (Q(i,j)>Q(i,p)+Q(p,j)) then
M(i,j)=M(i,p)+part(M(p,j), 2:length(M(p,j)))
end
Q(i,j)=min(Q(i,j),Q(i,p)+Q(p,j))
end
end
end
endfunction
[a b] = Warshall_MIN(grafoOrientado)
disp("O caminho mais curto de 1 para 8 é: " + string(b(1,8)) + " e tem como peso: " + string(a(1,8)))
|
2df80cbe72295118d185a934ea62f80f48bff5ee | 449d555969bfd7befe906877abab098c6e63a0e8 | /770/CH14/EX14.15/14_15.sce | 370b96578b5806a2ebc2317a330653e690f13b96 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 831 | sce | 14_15.sce | clear;
clc;
//Example - 14.15
//Page number - 485
printf("Example - 14.15 and Page number - 485\n\n")
//Given,
T = 25 + 273.15;//[K] - Temperature
mol_CaCl2 = 0.001;//[mol/kg] - Molality of HCl
A = 0.510;//[(kg/mol)^(1/2)]
Z_positive = 2;//Stoichiometric coefficient of 'Ca' ion
Z_negative = -1;//Stoichiometric coefficient of 'Cl' ion
m_Ca_positive = mol_CaCl2;
m_Cl_negative = 2*mol_CaCl2;
// I = 1/2*[((Z_positive)^(2))*m_Ca_positive + ((Z_negative)^(2))*m_Cl_negative]
I = 1/2*(((Z_positive)^(2))*m_Ca_positive + ((Z_negative)^(2))*m_Cl_negative);
//Using Debye-Huckel limiting law wee get,
// log(Y1) = -A*(abs(Z_positive*Z_negative))*(I^(1/2)))
Y = 10^(-A*(abs(Z_positive*Z_negative))*(I^(1/2)));
printf("The mean activity coefficient at 25 C using Debye-Huckel limiting law is Y = %f\n\n",Y);
|
21b0deb1531abc5c63c2de93969bc18cc59548da | 449d555969bfd7befe906877abab098c6e63a0e8 | /2342/CH2/EX2.8/EX2_8.sce | 7ae6503a6038260d5b8659d176d534b732b1764e | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 552 | sce | EX2_8.sce | // Exa 2.8
clc;
clear;
close;
format('v',7)
// Given data
d = 10.5;// in gm/cc
At = 108;// atomic weight
N_A = 6.025*10^23;// in /gm mole
r = 10^-3;// in m
q = 1.6*10^-19;// in C
// The number of electrons per unit volume
n = (N_A/At)*d;// in /cm^3
n = n * 10^6;// in /m^3
A = %pi*((r)^2);// in m^2
I = 2;// in A
// Evaluation of drivt velocity with the help of current
// I = q*n*A*V;
V = I/(n*q*A);// in m/s
disp(V,"The drift velocity in m/s is");
// Note: Calculation in the book is wrong, so the answer in the book is wrong.
|
aa2d4b7ffd87722d349a5e29fdd1ad1735a6b67d | 449d555969bfd7befe906877abab098c6e63a0e8 | /2168/CH3/EX3.6/Chapter3_example6.sce | 5be34231d9669adbd345cf91086793a64cb217d3 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 982 | sce | Chapter3_example6.sce | clc
clear
//Input data
T1=40+273//Temperature at the beginning of compression in K
p1=1//Pressure at the beginning of compression in kg/cm^2
p2=15//Pressure at the end of adabatic compression in kg/cm^2
T3=2000+273//Maximum temperature during the cycle in K
Cv=0.17//Specific heat at constant volume in kJ/kg.K
g=1.4//Ratio of specific heats
//Calculations
T2=T1*(p2/p1)^((g-1)/g)//Temperature at the end of adabatic compression in K
na=(1-(T1/T2))*100//Air standard efficiency in percent
q=(Cv*(T3-T2))//Heat added in kcal/kg of air
W=((na/100)*q)//Workdone per kg of air in kcal
W1=(4.28*W)//Workdone per kg of air in kg.m
p3=(p2*(T3/T2))//Pressure at the end of constant volume heat addition in kg/cm^2
p4=(p3*p1)/p2//Pressure at the end of adiabatic expansion in kg/cm^2
//Output
printf('(a) The heat supplied is %3.0f kcal/kg of air \n (b) The workdone is %i kcal/kg of air \n (c) The pressure at the end of adiabatic expansion is %3.2f kg/cm^2',q,W,p4)
|
156e82e0a4ee665f2e91ca47f25c2b3da7fa55b6 | 449d555969bfd7befe906877abab098c6e63a0e8 | /2231/CH6/EX6.1/Ex_6_1.sce | 3a6cbefb91aff12d3293022b58572ad4d9c571c2 | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 320 | sce | Ex_6_1.sce | //Example 6_1
clc;
clear;close;
//Given data:
hp=[50 100 150 120 0];//hp
t=[20 20 10 20 15];//seconds
//Solution :
hp_rms_t=0;//initializing
for i=1:5
hp_rms_t=hp_rms_t+(hp(i)^2*t(i));//hp
end
hp_rms=sqrt(hp_rms_t/sum(t));//hp
disp(hp_rms,"Required hp(rms)");
disp("Motor size should be 100 hp");
|
20fd51751250ea7a64b9180db7aae21aa684b05a | 449d555969bfd7befe906877abab098c6e63a0e8 | /1163/CH20/EX20.1/example_20_1.sce | 2e404fce3ecb5773bcceda361e9660dadbb4352f | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 2018-02-03T05:31:52 | 2018-02-03T05:31:52 | 37,975,407 | 3 | 12 | null | null | null | null | UTF-8 | Scilab | false | false | 703 | sce | example_20_1.sce | clear;
clc;
disp("--------------Example 20.1---------------")
// 01000010 - first 8 bits of IP4 packet
p="01000010";
s=strsplit(p,4); // split into two
v=bin2dec(s(1)); // version
d=bin2dec(s(2)); // header length
bytes=d*4; // formula
if(((bytes > = 20 )&((v == 4) |(v == 6)))) //minimum number of bytes is 20 and version should be IP4 or IP6
printf("The packet is accepted .");
else
printf("There is an error in this packet. The 4 leftmost bits %s show the version, which is correct.\nThe next 4 bits %s show an invalid header length %d. The minimum number of bytes in the header must be 20.\nThe packet has been corrupted in transmission.",s(1),s(2),bytes); // display result
|
08f0447d70f2a96d225ee1d1504e7af11312d54a | 449d555969bfd7befe906877abab098c6e63a0e8 | /2282/CH5/EX5.15/ex5_15.sce | 827061577e5b7b59e5a40186bc4d49beddf11a5d | [] | no_license | FOSSEE/Scilab-TBC-Uploads | 948e5d1126d46bdd2f89a44c54ba62b0f0a1f5e1 | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df | refs/heads/master | 2020-04-09T02:43:26.499817 | 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 | ex5_15.sce | //Example 5.15, page no-208
clear
clc
f1=2.4 //first signal frequency
f2=3.2 //2nd signal frequency
f3=3.4 //3rd signal frequency
//minimum sampling rate for each of the signals would be twice the highest frequency component
sr=3*(f3*2)
st=10^6/(sr*10^3)
printf("Sampling rate of the composite signal = %.1f kHz \n Sampling interval of the composite signal = %.0f micro second",sr,st)
|
482c00b65c8d905e3f3d3153ceb180a9187c99ad | cb412970af67cd342235f1ad29668c7ac9a2dfed | /mt_demo/t_demo.sci | 8f10e3afc02335ba247fa6ae3c6b52bc50ec3c6e | [] | no_license | dowaiko/mt_tutorial41 | cdab43af761897afc940ae64deb7df423bdd5776 | d21788c424e2c1df2ecc46ca6ae270e393433e85 | refs/heads/master | 2020-04-10T13:25:27.584350 | 2019-05-31T13:37:08 | 2019-05-31T13:37:08 | 161,050,504 | 0 | 1 | null | null | null | null | UTF-8 | Scilab | false | false | 5,442 | sci | t_demo.sci | clear;
clf; // clear
//scf; // add
printf('\n');
printf('************** t demo ****************');
printf('\n');
printf('Enter a File Name of T Unit');
UnitSpaceFile = input('File Name(.xls)?: ',"string");
//printf('./' +UnitSpaceFile+'.xls\n');
T_Mat_Sheets = readxls('./' + UnitSpaceFile + '.xls'); // EXELファイルの読み出し
Sheet = T_Mat_Sheets(1); // Sheetの抜き出し
TMate = Sheet.value; // 数値の取り出し
SampleCount = size( TMate, 1);
ItemCount = size( TMate, 2);
printf('SampleCount =');
disp(string(SampleCount));
printf('ItemCount =');
disp(string(ItemCount));
printf('\n');
// 予備計算
for j = 1: ItemCount,
x1( 1, j) = 0, //行列の初期化
//x2( 1, j) = 0, //行列の初期化
for i = 1: SampleCount,
x1( 1, j) = x1( 1, j) + TMate( i, j), // 1乗の総和を求める
//x2( 1, j) = x2( 1, j) + MTAMate( i, j)^2; // 2乗の総和を求める
end,
end
// 算術平均
for j = 1: ItemCount,
m( 1, j) = x1( 1, j) / SampleCount;
end
//printf('m =');
//disp(string(m));
//printf('\n');
/* 信号空間の検証 */
printf('Enter a File Name of T Signal');
TSigFile = input('File Name(.xls)?: ',"string");
//printf('./' +TSigFile+'.xls\n');
TSig_Sheets = readxls('./' + TSigFile + '.xls'); // EXELファイルの読み出し
SigSheet = TSig_Sheets(1); // Sheetの抜き出し
TSig = SigSheet.value; // 数値の取り出し
SampleCountS = size( TSig, 1);
ItemCountS = size( TSig, 2);
printf('SampleCountS =');
disp(string(SampleCountS));
printf('ItemCountS =');
disp(string(ItemCountS));
printf('\n');
//
if ItemCount <> ItemCountS then
printf(' T Signal Material is not Suitable\n'),
break;
end
// 正規化
for j = 1: ItemCountS,
for i = 1: SampleCountS,
u( i, j) = TSig( i, j) - m( 1, j);
end;
end
//printf('u =');
//disp(string(u));
//printf('\n');
r=0;
for i = 1: SampleCountS,
r = r + u( i, ItemCountS)^2;
end
L=zeros(1,ItemCountS-1);
St=zeros(1,ItemCountS-1);
Beta=zeros(1,ItemCountS-1);
Sb=zeros(1,ItemCountS-1);
Ve=zeros(1,ItemCountS-1);
Eta=zeros(1,ItemCountS-1);
for j = 1: ItemCountS-1,
for i = 1: SampleCountS,
L( 1, j) = L( 1, j) + u( i, ItemCountS)*u(i,j),
St( 1, j) = St( 1, j) + u(i,j)^2,
end,
Beta( 1, j) = L( 1, j) / r,
Sb( 1, j) = Beta( 1, j)*L( 1, j),
Ve( 1, j) = (St( 1, j)-Sb( 1, j))/(SampleCountS-1),
Eta( 1, j) = (Sb( 1, j)-Ve( 1, j))/(Ve( 1, j)*r),
if Eta( 1, j)<0 then Eta( 1, j)=0; end;
end
//printf('Beta =');
//disp(string(Beta));
//printf('Eta =');
//disp(string(Eta));
printf('\n');
/* 評価対象の検証 */
printf('Enter a File Name of T Evaluation1');
TEvaFile = input('File Name(.xls)?: ',"string");
//printf('./' +TEvaFile+'.xls\n');
TEva_Sheets = readxls('./' + TEvaFile + '.xls'); // EXELファイルの読み出し
EvaSheet = TEva_Sheets(1); // Sheetの抜き出し
TEva = EvaSheet.value; // 数値の取り出し
SampleCountE = size( TEva, 1);
ItemCountE = size( TEva, 2);
printf('SampleCountE =');
disp(string(SampleCountE));
printf('ItemCountE =');
disp(string(ItemCountE));
printf('\n');
//
if ItemCount <> ItemCountE then
printf(' T Evaluation Material is not Suitable\n'),
break;
end
// 正規化
for j = 1: ItemCountE-1,
for i = 1: SampleCountE,
w( i, j) = TEva( i, j) - m( 1, j);
end;
end
// 予測
Mn = zeros(SampleCountE,1);
Md = zeros(SampleCountE,1);
for i = 1: SampleCountE,
for j = 1: ItemCountE-1,
Mn( i, 1) = Mn( i, 1) + Eta( 1, j) * w( i, j) / Beta( 1, j),
Md( i, 1) = Md( i, 1) + Eta( 1, j);
end,
M( i, 1) = Mn( i, 1) / Md( i, 1),
Z( i, 1) = M( i, 1) + m( 1, ItemCount);
end
subplot(2,1,1);
plot( Z( :, 1), TEva( :, ItemCountE), '.');
plot( Z( :, 1), Z( :, 1), 'k-');
a=get("current_axes");
a.data_bounds=[3000,3000;6000,6000]
xlabel("Predicted PPD[10^4KW]");
ylabel("Actual PPD[10^4KW]");
/* 評価対象の検証 */
printf('Enter a File Name of T Evaluation2');
TEvaFile = input('File Name(.xls)?: ',"string");
//printf('./' +TEvaFile+'.xls\n');
TEva_Sheets = readxls('./' + TEvaFile + '.xls'); // EXELファイルの読み出し
EvaSheet = TEva_Sheets(1); // Sheetの抜き出し
TEva = EvaSheet.value; // 数値の取り出し
SampleCountE = size( TEva, 1);
ItemCountE = size( TEva, 2);
printf('SampleCountE =');
disp(string(SampleCountE));
printf('ItemCountE =');
disp(string(ItemCountE));
printf('\n');
//
if ItemCount <> ItemCountE then
printf(' T Evaluation Material is not Suitable\n'),
break;
end
// 正規化
for j = 1: ItemCountE-1,
for i = 1: SampleCountE,
w( i, j) = TEva( i, j) - m( 1, j);
end;
end
// 予測
Mn = zeros(SampleCountE,1);
Md = zeros(SampleCountE,1);
for i = 1: SampleCountE,
for j = 1: ItemCountE-1,
Mn( i, 1) = Mn( i, 1) + Eta( 1, j) * w( i, j) / Beta( 1, j),
Md( i, 1) = Md( i, 1) + Eta( 1, j);
end,
M( i, 1) = Mn( i, 1) / Md( i, 1),
Z( i, 1) = M( i, 1) + m( 1, ItemCount);
end
subplot(2,1,2);
plot( Z( :, 1), TEva( :, ItemCountE), '.');
plot( Z( :, 1), Z( :, 1), 'k-');
a=get("current_axes");
a.data_bounds=[3000,3000;6000,6000]
xlabel("Predicted PPD[10^4KW]");
ylabel("Actual PPD[10^4KW]");
|
eabf9a4b98d00ed90ee4055de7c3a8eff1ce88b6 | 717ddeb7e700373742c617a95e25a2376565112c | /3137/CH8/EX8.2/Ex8_2.sce | 0b95660484874e061bb6571d02d4854ec6f4780f | [] | 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 | 491 | sce | Ex8_2.sce | //Initilization of variables
//length matrix
L1=[0,4,6] //m
//Bending moment matrix
B=[0,400,0] //N.m
//Shear force plotting
//Here the left side and right side lengths are considered as close as 4 to keep up with right and left distinctions
L=[0,3.999,4,5.99998,6]
S=[100,100,-200,-200,0]
//Calculations cum Result
subplot(221)
plot(L1,B)
xtitle("Bending Moment Diagram","Span","Bending Moment")
subplot(222)
plot(L,S,L,0)
xtitle("Shear Force Diagram","Span","Shear Force")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.