Opened 13 years ago

Last modified 13 years ago

#1652 closed defect (fixed)

Bound parameter is calculated fine but the value that ends up in the result file is the start value ...

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone:
Component: Version:
Keywords: Cc: Adrian Pop, Frenkel TUD, Martin Sjölund, Willi Braun

Description

Hi,

Seems there is an issue with propagation of the results
calculated by bound_parameter to the result file.
See an example of the problem here:
http://www.openmodelica.org/index.php/forum/topic?id=446
I actually edited Test.c and added a printout at the end
of bound_parameters and the parameter mod.result1 is correct.
I also added:

 printf("eq2 - mod.result1: %g global: %g\n", $Pmod$Presult1, globalData->parameters[2]); fflush(NULL);

in eqFunction_2 and both global and local data parameters[2] is 1, but still, in the result file we get 0.
Ok, found the error, but I don't know how to resolve it.
We have in callSolver:

sim_result = new simulation_result_mat(result_file_cstr.c_str(), start, stop);

This will write the parameters, but bound_parameters functions is only called later in solver_main!\\
We need to re-write parameter values after bound_parameters\\
We have this error both in the old (maybe also in the new) simulation runtime.

Cheers,
Adrian Pop/

Change History (4)

comment:1 by Adrian Pop, 13 years ago

I added Jens also as he worked on the simulation_result_mat.cpp quite a bit.

comment:2 by Adrian Pop, 13 years ago

Another weird thing in the simulation_result_map.cpp in the constructor is that we have rows and cols but they are never assigned any value and they end up put in the mat header and also
a lot of calculations are done based on them. Am I missing something?

comment:3 by Adrian Pop, 13 years ago

Don't bother to work on this, i'm almost done with a fix for c_runtime.
You can port it later to the new simulation runtime.

comment:4 by Adrian Pop, 13 years ago

I'll set this bug to fixed, but the fix should be ported to the new simulation runtime! See SCM Commits.

Note: See TracTickets for help on using tickets.