Opened 12 years ago
Last modified 12 years ago
#1926 closed defect
hybrid initialization — at Version 1
Reported by: | Willi Braun | Owned by: | Lennart Ochel |
---|---|---|---|
Priority: | high | Milestone: | 1.9.0 |
Component: | Backend | Version: | |
Keywords: | Cc: | Jens Frenkel |
Description (last modified by )
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 = "stdout | warning | Error in initialization. Storing results and exiting. | | | | Use -lv LOG_INIT for more information. ", timeFrontend = 0.012162227000000001, timeBackend = 0.004835605000000001, timeSimCode = 0.0027522370000000003, timeTemplates = 0.0018435300000000001, timeCompile = 0.196330831, timeSimulation = 0.009741879, timeTotal = 0.22773643100000002 end SimulationResult; -0.9589242746631385 5.0 -0.9589242746631385 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.