Opened 13 years ago
Last modified 13 years ago
#1926 closed defect
hybrid initialization — at Initial Version
| Reported by: | Willi Braun | Owned by: | Lennart Ochel |
|---|---|---|---|
| Priority: | high | Milestone: | 1.9.0 |
| Component: | Backend | Version: | |
| Keywords: | Cc: | Jens Frenkel |
Description
try to initialize following two models:
loadString("
model A1
parameter Real x(fixed=false) = if y>3 then sin(y) else 0;
parameter Real y(start=5);
initial equation
x = 0;
end A1;
model A2
Real x(fixed=false) = if y>3 then sin(y) else 0;
Real y(start=5);
initial equation
x = 0;
equation
when time > 0.5 then
y = 0;
end when;
end A2;
");
simulate(A1);
val(x,0);
val(y,0);
val(x,1);
val(y,1);
simulate(A2);
val(x,0);
val(y,0);
val(x,1);
val(y,1);
run it results in :
true
record SimulationResult
resultFile = "A1_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'A1', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
messages = "",
timeFrontend = 0.012285856000000001,
timeBackend = 0.004783636,
timeSimCode = 0.003330172,
timeTemplates = 0.001422459,
timeCompile = 0.199305583,
timeSimulation = 0.0066569970000000004,
timeTotal = 0.22785154100000002
end SimulationResult;
0.0
5.0
0.0
5.0
record SimulationResult
resultFile = "A2_res.mat",
simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 0.000001, method = 'dassl', fileNamePrefix = 'A2', storeInTemp = false, noClean = false, options = '', outputFormat = 'mat', variableFilter = '.*', measureTime = false, cflags = '', simflags = ''",
messages = "",
timeFrontend = 0.009759409,
timeBackend = 0.004888894,
timeSimCode = 0.002635039,
timeTemplates = 0.001217053,
timeCompile = 0.205227073,
timeSimulation = 0.00712046,
timeTotal = 0.230887109
end SimulationResult;
-0.9589242746631385
5.0
0.0
0.0
I would expect at least one of this solutions:
x = 0;
y = {sin(i*Pi) for i in 1:n};
Note:
See TracTickets
for help on using tickets.
