Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3684 closed defect (fixed)

index reduction fails with a singular jacobian

Reported by: Adam Dershowitz Owned by: Willi Braun
Priority: critical Milestone: 1.9.4
Component: Backend Version: v1.9.4-dev-nightly
Keywords: Cc:

Description

I have run into a problem where one of my models shows no results in OMEdit. If I run a simulation and then I try to plot results for any variables, I don't see any values, except for variables that don't change at all. Even "time" doesn't show anything.
The model doesn't report any errors, and appears to complete.
To debug I tried to output a csv and then to just view it. That file has just a single row of data after the header. My other models seem to work correctly (at least I haven't yet seen this error with other models)
I have tested a number of different versions and I have narrowed down the problem's appearance:
The problem doesn't occur in 1.9.4~dev-701 but does occur in 1.9.4~dev.beta1-3-g3e511de and all "beta1" versions I have tried since then (I haven't tried every one, but I have tried as recent as 1.9.4~dev.beta1-94-g8721141.)
Unfortunate, I can't publicly post the model that is showing this problem. Any suggestions for what might be wrong? It seems as though either the simulation just quits early, with no error, or the simulation just doesn't write the data that it should, with no error.

Change History (12)

comment:1 by Adam Dershowitz, 9 years ago

I just tried to run this in OMShell, instead of OMEdit. In OMShell, here is what I get:

>> simulate(FlowPackage.VarySlopeM2)
record SimulationResult
    resultFile = "",
    simulationOptions = "startTime = 0.0, stopTime = 3600.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'FlowPackage.VarySlopeM2', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
    messages = "Simulation execution failed for model: FlowPackage.VarySlopeM2
assert            | debug   | Error, singular Jacobian for dynamic state selection at time 7.200000
|                 | |       | Use -lv LOG_DSS_JAC to get the Jacobian
stdout            | warning | Integrator attempt to handle a problem with a called assert.
assert            | debug   | Error, singular Jacobian for dynamic state selection at time 3.600000
|                 | |       | Use -lv LOG_DSS_JAC to get the Jacobian
stdout            | info    | model terminate | Simulation terminated by an assert at time: 3.6
",
    timeFrontend = 0.6805860410000001,
    timeBackend = 0.251583305,
    timeSimCode = 0.04466246,
    timeTemplates = 0.123499822,
    timeCompile = 0.847006519
end SimulationResult;
Warning: There are iteration variables with default zero start attribute. Use +d=initialization for more information.

So, I guess there are a few different things going on.
1) Why did this model work in prior to the beta nightly, but no longer does
2) What does the above error indicate?
3) Why doesn't OMEdit report any error or problem.

comment:2 by Adam Dershowitz, 9 years ago

One other observation is that my results variable list includes a $STATESET1 with a single variable called: der(x)
That is not a variable that I created.

comment:3 by Adam Dershowitz, 9 years ago

What strikes me as particularly strange is that the problem is not with initialization. It finds reasonable values for that. And, even if I make a simulation that is static (doesn’t change in time) it successfully initializes, and if I review the initialization variables they seem reasonable. But, if I view the log of the Jacobian, what I see is a warning at the first stepSize followed be a debug error of a singular Jacobian. Then the same thing warning and error at half the stepStep time (ie for first at .002 seconds then at 0.001 seconds) For this simulation pipeHt1.v and pipeHt1.phi were reasonable at initialization and neither one is zero. And, for this simplified simulation, those same initial results should be valid at all times. Yet below the jacobian is singular. This error did not occur in versions prior to beta1.

LOG_DSS_JAC       | info    | Caluculate one col:
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[0]= 1.000000
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[1]= 0.000000
LOG_DSS           | warning | jacobian 1x2 [id: 0]
|                 | |       | | -0.00000e+00 0.00000e+00 
|                 | |       | | pipeHt1.v
|                 | |       | | pipeHt1.phi
assert            | debug   | Error, singular Jacobian for dynamic state selection at time 0.002000
|                 | |       | Use -lv LOG_DSS_JAC to get the Jacobian
stdout            | warning | Integrator attempt to handle a problem with a called assert.
LOG_DSS_JAC       | info    | Caluculate one col:
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[0]= 0.000000
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[1]= 1.000000
LOG_DSS_JAC       | info    | Caluculate one col:
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[0]= 1.000000
|                 | |       | | seed: data->simulationInfo->analyticJacobians[index].seedVars[1]= 0.000000
LOG_DSS           | warning | jacobian 1x2 [id: 0]
|                 | |       | | -0.00000e+00 0.00000e+00 
|                 | |       | | pipeHt1.v
|                 | |       | | pipeHt1.phi
assert            | debug   | Error, singular Jacobian for dynamic state selection at time 0.001000
|                 | |       | Use -lv LOG_DSS_JAC to get the Jacobian
stdout            | info    | model terminate | Simulation terminated by an assert at time: 0.001

comment:4 by Lennart Ochel, 9 years ago

Milestone: Future1.9.4

in reply to:  1 comment:5 by anonymous, 9 years ago

Replying to dersh:

That file has just a single row of data after the header.

Have you try to change the stopTime? e.g 2.0

comment:6 by Adam Dershowitz, 9 years ago

Yes. In fact when I was first testing I was using 3600 sec for the stopTime and the error is still at step 1 (ie 3600/500) seconds.

comment:7 by Adam Dershowitz, 9 years ago

Additionally, I see the same error in a version where v should actually change in time, so the results should be different.
So, it really seems like it is successfully initializing, so time 0 is correct, but then is not using those values, but is instead using 0, at the first time step.

comment:8 by Willi Braun, 9 years ago

Component: *unknown*Backend
Owner: changed from somebody to Willi Braun
Status: newassigned
Summary: No results in OMEditindex reduction fails with a singular jacobian

comment:9 by Willi Braun, 9 years ago

For the symbolic jacobian I activated recently the module "wrapFunctionCall" which leads to a side effect, that the following assumption isn't true any more: all equations of the symbolic jacobian are none discrete, so no need to generate such.

comment:10 by Willi Braun, 9 years ago

Resolution: fixed
Status: assignedclosed

Fixed in 5a950a9.

comment:11 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:12 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.