<< computing_experiment computing_experiment ModelingSystemDynamicEvidence >>

computing_experiment >> computing_experiment > ComputingExperiment

ComputingExperiment

Implements a computational experiment for a custom system defined as an xcos diagram

Syntax

[SystemOutputChatacteristics,..
SystemProps]=ComputingExperiment(SystemOutputChatacteristicsNames,..
SystemShema,SystemParametrsNames,SystemParametrsValues[,..
absolutTolErr[,relativeTolErr[,simulationTime[,..
timeStepMax[,Solver[,toleranceTime]]]]]])
[SystemOutputChatacteristics,..
SystemProps]=ComputingExperiment(SystemOutputChatacteristicsNames,..
SystemShema[,absolutTolErr[,relativeTolErr[,simulationTime[,..
timeStepMax[,Solver[,toleranceTime]]]]]])

Arguments

SystemOutputChatacteristicsNames

Array of names of system output characteristics in xcos-diagram (see block TOWS_c). Array dimension 1xM

SystemShema

Xcos diagram of the user system (see type Xcos diagram structure)

SystemParametrsNames

The names of the system parameters in the xcos diagram (see the context property Xcos diagram structure). Array of strings of dimension 1xM

SystemParametrsValues

System parameter values in the xcos diagram (see the context property in Xcos diagram structure), specified by the corresponding SystemParametrsNames. Array of real numbers of dimension 1xM.

absolutTolErr

The absolute error of integration in xcos (see the tol (1) atol property in Xcos diagram structure). Positive real number

relativeTolErr

Relative error of integration in xcos (see the tol (2) rtol property in Xcos diagram structure). Positive real number

simulationTime

Simulation time in xcos (see the tf property in Xcos diagram structure). Positive real number

timeStepMax

Maximum time integration step in xcos (see tol (7) hmax property in Xcos diagram structure). Positive real number

Solver

Solver view in xcos (see the tol (6) solver property in Xcos diagram structure). Is integer in the range from 0 to 100 - solver code

toleranceTime

The time value error in xcos is the minimum time integration step (see the tol (3) ttol property in Xcos diagram structure). Positive real number

Return values

SystemOutputChatacteristics

Cell-array (see cell-arrays) scilab-variables of the system output characteristics in an xcos-diagram, which are a data structure that includes time fields and value fields (see block TOWS_c). Array dimension 1xM

SystemProps

User-defined properties of a custom system xcos diagram (type Xcos diagram structure)

Description

Simulates (computational experiment) a user system, specified in the form of an xcos diagram, for its various parameters (specified in the context).

Gives the dynamics of the user-specified output characteristics of the system (in the diagram, they are specified in the form of blocks TOWS_c) in the form of scilab variables of these blocks

All graphic windows open during the simulation are not deleted.

Examples

//Forming the path to the xcos-diagram Proba1.zcos
[a, pathlib] = libraryinfo("computing_experimentlib");
clear a;
pathlib = strncpy(pathlib, length(pathlib) - length('macros')) + 'xcos';
pathdiagram = fullfile(pathlib, 'Proba1.zcos');

//Running a computational experiment
SystemParametrsNames = ['b', 'd'];//Parameter names
SystemParametrsValues = [1.5, 3.81];//Parameter values
SystemOutputChatacteristicsNames = ['A1', 'A3', 'A2'];//Model Output Property Names
SystemShema = xcosDiagramToScilab(pathdiagram);//System diagram
[SystemModelOutputChatacteristics,..//System output characteristics
 SystemProps..//System properties
 ]=ComputingExperiment(SystemOutputChatacteristicsNames,...//Model output characteristics names
                       SystemShema,...//System diagram
                       SystemParametrsNames,...//Parameter names
                       SystemParametrsValues,...//Parameter values
                       0.5E-6,..//Absolute error
                       0.7E-6,..//Relative error
                       10.0,..//Simulation time
                       0.8E-4,..//Maximum time integration step
                       1,..//Solver type
                       1E-10..//Time error
                       );

//Result
disp(SystemModelOutputChatacteristics);
disp(SystemProps);

See also


Report an issue
<< computing_experiment computing_experiment ModelingSystemDynamicEvidence >>