diff options
author | nutricato | 2008-06-09 11:54:16 +0000 |
---|---|---|
committer | nutricato | 2008-06-09 11:54:16 +0000 |
commit | 716063e340cb99631fbd86b58e189c84600fff7b (patch) | |
tree | f215f81870648b6940d0530ea87112f0bc3bd5c4 /src/Scilab2C/SCI2CTests/test999_WorkingDir | |
parent | c9c6f29f2454c473af8df8d42b1763657467b76c (diff) | |
download | scilab2c-716063e340cb99631fbd86b58e189c84600fff7b.tar.gz scilab2c-716063e340cb99631fbd86b58e189c84600fff7b.tar.bz2 scilab2c-716063e340cb99631fbd86b58e189c84600fff7b.zip |
Diffstat (limited to 'src/Scilab2C/SCI2CTests/test999_WorkingDir')
-rw-r--r-- | src/Scilab2C/SCI2CTests/test999_WorkingDir/SCI2CInputParameters.sce | 87 | ||||
-rw-r--r-- | src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci | 46 |
2 files changed, 0 insertions, 133 deletions
diff --git a/src/Scilab2C/SCI2CTests/test999_WorkingDir/SCI2CInputParameters.sce b/src/Scilab2C/SCI2CTests/test999_WorkingDir/SCI2CInputParameters.sce deleted file mode 100644 index 7f22a340..00000000 --- a/src/Scilab2C/SCI2CTests/test999_WorkingDir/SCI2CInputParameters.sce +++ /dev/null @@ -1,87 +0,0 @@ -// -----------------------------------------------------------------
-// === hArtes/PoliBa/GAP SCI2C tool ===
-// === Authors: ===
-// === Raffaele Nutricato ===
-// === raffaele.nutricato@tiscali.it ===
-// === Alberto Morea ===
-// === ===
-// === *************** ===
-// === USER PARAMETERS ===
-// === *************** ===
-// === ===
-//
-// Copyright 2007 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-
-// ------------------------------------------
-// --- Specify Paths of User Scilab code. ---
-// ------------------------------------------
-UserSciCodeMainDir = 'D:\Nutricato_GAPSVN\PROGETTI_APERTI\POLIBA\hArtes\WP2_SCI2C\Software\Version_alpha\SCI2CTests\test999_WorkingDir';
-
-// --- Path + filename of the .sci main file of the code to be translated. ---
-// It is the entry point.
-UserScilabMainFile = fullfile(UserSciCodeMainDir,'scilabcode\mainfunction.sci');
-
-// --- List of the paths containing the .sci files written by the user. ---
-UserSciFilesPaths = ...
- [...
- fullfile(UserSciCodeMainDir,'scilabcode');...
- ];
-
-// --------------------------
-// --- End Specify paths. ---
-// --------------------------
-
-
-// ----------------------------
-// --- Select the run mode. ---
-// ----------------------------
-//RunMode = 'GenLibraryStructure';
-//RunMode = 'Translate';
-RunMode = 'All';
-
-// --- Select one of the following options. ---
-
-// 'GenLibraryStructure';
-// Generates the library structure and exits. It is very
-// useful when the user wants to manually change the files stored in that structure
-// before running the translation. 'GenLibraryStructure' option forces SCI2C to remove
-// the already existing WorkingDir and OutCCCodeDir directories.
-
-// 'Translate';
-// Performs the translation without generating the library structure. It means that the library
-// structure must be already existing. This is useful when the user doesn't want to spend time
-// to generate again that structure or when he wants to force the SCI2C tool to access to
-// a manually-changed library structure. 'Translate' option forces SCI2C to don't remove
-// the already existing WorkingDir. Only OutCCCodeDir directory will be removed.
-
-// 'All';
-// Performs all the actions listed above.
-
-// --------------------------------
-// --- End Select the run mode. ---
-// --------------------------------
-
-
-// ----------------------------
-// --- Translation Options. ---
-// ----------------------------
-// --- Enable (1) / Disable (0) copy of Scilab code into C code. ---
-// If 1 the Scilab code will be copied into the C code in order to show
-// how each Scilab code line has been translated into C code.
-CopySciCodeIntoCCode = 1;
-
-// --- Select the path style for the C code. ---
-// It can be:
-// windows
-// unix
-// cygwin
-CCompilerPathStyle = 'cygwin';
-
-// --- Path + File name of the main SCI2C library header file.
-Sci2CLibMainHeaderFName = 'D:\Nutricato_GAPSVN\PROGETTI_APERTI\POLIBA\hArtes\WP2_SCI2C\Software\Version_alpha\Scilab2C\CFiles\sci2cincludes\sci2clib.h';
-// --------------------------------
-// --- End Translation Options. ---
-// --------------------------------
diff --git a/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci b/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci deleted file mode 100644 index 75829d99..00000000 --- a/src/Scilab2C/SCI2CTests/test999_WorkingDir/scilabcode/mainfunction.sci +++ /dev/null @@ -1,46 +0,0 @@ -//SCI2C: DEFAULT_PRECISION= DOUBLE
- -function mainfunction()
- -// Knowing that -// (1) P * (V^gamma) = C -// Where -// P = Pressure -// V = Volume -// gamma,C = constants depending on the particular gas used. -// (2) log10(P) = log10(C) - gamma*log10(V) -// (3) x = log10(V) -// (4) y = log10(P) -// than (2) becomes: -// y = a + b*x; -// Where -// a = log10(C) -// b = -gamma -// Then thanks to this transformation it is possible to perform -// a linear regression to estimate gamma and C! - -Volume = [54.3 61.8 72.4 88.7 118.6 194.0]; -Pressure = [61.2 49.5 37.6 28.4 19.2 10.1]; -x = log10(Volume); -y = log10(Pressure); - -a = (sum(y)*sum(x.^2)-sum(x)*sum(x.*y))./(length(x)*sum(x.^2)-sum(x).*sum(x)); -b = (length(x)*sum(x.*y)-sum(x)*sum(y))./(length(x)*sum(x.^2)-sum(x).*sum(x)); - -// Other way to compute a and b -beq = sum((x-mean(x)).*(y-mean(y)))./sum((x-mean(x)).^2);
-aeq = mean(y)-mean(x)*beq;
- -C = 10 .^a; -gamma = -b; -disp('C') -disp(C) -disp('gamma'); -disp(gamma); -disp('a-aeq'); -disp(a-aeq) -disp('b-beq') -disp(b-beq) -// plot(Volume,Pressure); -// plot(Volume,(C ./(Volume.^gamma)),'r') -endfunction |