Implements a computational experiment of a user system, given in the form of an xcos-diagram, with the calculation of the output dynamics of the system at specified times
[SystemOutputCharacteristics,.. SystemParametrsIndexes,.. SystemParametrs,.. TimesMomemts.. ]=ModelingSystemDynamicTimeGrid(SystemOutputCharacteristicsNames,.. SystemOutputCharacteristicsIndexes,.. SystemShemaName,TimeMoments,SystemParametrsNames,.. SystemParametrsValues[,absolutTolErr[,relativeTolErr[,.. simulationTime[,timeStepMax[,Solver[,toleranceTime]]]]]]) [SystemOutputCharacteristics,.. SystemParametrsIndexes,.. SystemParametrs.. ]=ModelingSystemDynamicTimeGrid(SystemOutputCharacteristicsNames,.. SystemOutputCharacteristicsIndexes,.. SystemShemaName,TimeMoments,SystemParametrsNames,.. SystemParametrsValues[,absolutTolErr[,relativeTolErr[,.. simulationTime[,timeStepMax[,Solver[,toleranceTime]]]]]]) [SystemOutputCharacteristics,.. SystemParametrsIndexes.. ]=ModelingSystemDynamicTimeGrid(SystemOutputCharacteristicsNames,.. SystemOutputCharacteristicsIndexes,.. SystemShemaName,TimeMoments,SystemParametrsNames,.. SystemParametrsValues[,absolutTolErr[,relativeTolErr[,.. simulationTime[,timeStepMax[,Solver[,toleranceTime]]]]]]) [SystemOutputCharacteristics.. ]=ModelingSystemDynamicTimeGrid(SystemOutputCharacteristicsNames,.. SystemOutputCharacteristicsIndexes,.. SystemShemaName,TimeMoments,SystemParametrsNames,.. SystemParametrsValues[,absolutTolErr[,relativeTolErr[,.. simulationTime[,timeStepMax[,Solver[,toleranceTime]]]]]])
Array of names of system output characteristics in xcos-diagram (see block TOWS_c). Array dimension 1xM
An array of indices of the dynamics of the output characteristics in the names of the output characteristics of the system in the xcos diagram (block TOWS_c). Array dimension 1xM
Full name of the user system xcos diagram file (extension .zcos, .xcos)
Cell-array (see cell-arrays) arrays (the dimension of each array is 1xN, N is different for each dynamics) discrete moments in time for each dynamics of the output characteristics specified by indices SystemOutputCharacteristicsIndexes
The names of the system parameters in the xcos diagram (see the context property in Xcos diagram structure). Array of strings of dimension 1xM
System parameter values in the xcos diagram (see the context property in Xcos diagram structure), specified by the corresponding SystemParametrsNames. NxM array of real numbers (each n-th row of N rows in the matrix is the corresponding n-th dynamics)
Absolute errors of integration in xcos (see the tol (1) atol property in Xcos diagram structure) of each dynamics. Array of positive real numbers of dimension 1xN
Relative errors of integration in xcos (see the tol (2) rtol property in Xcos diagram structure) of each dynamics. Array of positive real numbers of dimension 1xN
Simulation times in xcos (see the tf property in Xcos diagram structure) of each dynamics. Array of positive real numbers of dimension 1xN
Maximum time integration steps in xcos (see the tol (7) hmax property in Xcos diagram structure) of each dynamics. Array of positive real numbers of dimension 1xN
Solver views in xcos (see the tol (6) solver property in Xcos diagram structure) of each dynamics. An array of integers ranging from 0 to 100 - solver codes. The dimension of the solver codes is 1xN
Time errors in xcos are the corresponding minimum steps of integration over time (see the tol (3) ttol property in Xcos diagram structure) for each dynamics. Array of positive real numbers of dimension 1xN
Matrix of parameters of system output characteristics. It is a vertical concatenation of matrices of output characteristics of the system at discrete times for each dynamics of the system. The dimension of the MxQ matrix. Q is the total length of arrays of discrete time instants for each dynamics of the system
Column vector of indices of values of the system parameters, the names of which are specified in the array SystemParametrsNames
Matrix of system parameters, the names of which are specified in the SystemParametrsNames array and for which discrete values of the system's output characteristics are calculated at discrete times. Dimension of the MxQ matrix
Column vector of time instants corresponding to the parameters of the system's output characteristics SystemOutputChatacteristics
Simulates (computational experiment) a user system, specified in the form of an xcos diagram, for its various parameters (specified in the context).
Returns for each dynamics a matrix of discrete values of user-specified output characteristics of the system (specified in the diagram as TOWS_c blocks) at these discrete moments in time
All graphic windows open during the simulation are automatically deleted.
//Forming the path to the xcos-diagram Proba3.zcos [a, pathlib] = libraryinfo("computing_experimentlib"); clear a; pathlib = strncpy(pathlib, length(pathlib) - length('macros')) + 'xcos'; pathdiagram = fullfile(pathlib, 'Proba3.zcos'); //Running a computational experiment SystemParametrsNames = ['b', 'a', 'd'];//Parameter names SystemParametrsValues = [ 1.5, 0.81, 3.81; 2.25, 0.51, 6.81; 1.11, 0.93, 3.51];//Parameter values SystemOutputChatacteristicsNames = ['A1', 'A2', 'A3', 'A3'];//Model output charactristics names TimeMoments = cell(1, 3); TimeMoments{1} = [0.0:0.05:9.95]'; TimeMoments{2} = [0.0:0.1:9.9]'; TimeMoments{3} = [0.0:0.2:9.8]'; [SystemOutputCharacteristics,...//Output characteristic SystemParametrsIndexes,..//System parameter indices for which the output characteristics were calculated SystemParametrs,..//System parameters for which the output characteristics were calculated TimesMomemts..//Times moments ]=ModelingSystemDynamicTimeGrid(SystemOutputChatacteristicsNames,..//System output characteristic names [2, 1, 1, 3],..//System output characteristics indices fullfile(pathdiagram),..//System diagram name TimeMoments,..//Times moments SystemParametrsNames,..//Parameter names that define dynamics SystemParametrsValues,..//The values of the parameters that determine the dynamics [ 0.45E-6,0.63E-6,0.57E-6],..//Absolute errors [0.723E-6,0.39E-6,0.75E-6],..//Relative errors [10.0,11.0,12.9],..//Simulation times [0.81E-4,0.75E-4,0.87E-4],..//Maximum time integration steps [2,3,5],..//Solvers type [1E-10,1E-10,1E-10]..//Times tolerances ); //Result disp(SystemOutputCharacteristics); disp(SystemParametrsIndexes); disp(SystemParametrs); disp(TimesMomemts); | ![]() | ![]() |