Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialization of Testing models #3

Closed
tbeu opened this issue Dec 14, 2016 · 8 comments
Closed

Initialization of Testing models #3

tbeu opened this issue Dec 14, 2016 · 8 comments

Comments

@tbeu
Copy link
Contributor

tbeu commented Dec 14, 2016

All of the testing models do not succeed to initialize in SimulationX. E.g., PhotoVoltaics.Testing.SimpleCellResistor. Depending on the solver it raises a Floating Point overflow exception, or simply stops to iterate.

@tbeu
Copy link
Contributor Author

tbeu commented Dec 14, 2016

From debugging the FP overflow

//_cell_m = 1.4892411615919498e+031;
_cell_diode_m=_cell_m;
_cell_diode_Ids=8.5399999999999991/(-1+exp(24.488272557445249/_cell_diode_m));

@christiankral
Copy link
Owner

christiankral commented Dec 14, 2016

cell.m is a parameter which is iterated in an initial equation of the class PhotoVoltaics.Components.Cells.Simple. The start value 1 is indicated:
final parameter Real m(start = 1, fixed = false) "Ideality factor of diode";

So I am not sure what the exact issue is in this case.

However, I updated the Testing examples in 6c81421, since the were still some initialization issues, most likely caused by the previously used record constructor of the examples. Package Testing should be OK by now. I was testing the all five examples with OpenModelica and they are running fine.

@tbeu
Copy link
Contributor Author

tbeu commented Dec 14, 2016

Looks like a tool issue which fails to solve the minimal model

model Simple
  final parameter Real m(start = 1, fixed = false);
  final parameter Real IsdRef(start = 1E-6, fixed = false);
  final parameter Real IphRef = 8.54;
  parameter Integer ns = 48;
  parameter Real VocRef = 30.2;
  final parameter Real VocCellRef = VocRef / ns;
  parameter Real VmpRef = 24.0;
  final parameter Real VmpCellRef = VmpRef / ns;
  parameter Real ImpRef = 7.71;
  constant Real Q = 1.6021766208E-19;
  parameter Real TRef = 298.15;
  final parameter Real VtCellRef = 1.38064852e-23 * TRef / Q;
initial equation 
  IphRef = IsdRef * (exp(VocCellRef / m / VtCellRef) - 1);
  IphRef = IsdRef * (exp(VmpCellRef / m / VtCellRef) - 1) + ImpRef;
end Simple;

@tbeu
Copy link
Contributor Author

tbeu commented Jan 26, 2017

We analyzed the problem. The reason that SimulationX fails is due to the damping strategy of the non-linear solver. If the number of iterations is increased, the solver converges to the expected solution.

The solver also converges with the standard solver settings, if the start values are set to be closer at the solution, i.e., m(start = 2) and IsdRef(start = 1E-4). You might consider to use this improved start values. Thanks.

@christiankral
Copy link
Owner

I was running into convergence problems in OpenModelica with the nonlinear solver, as well. You may be interested in https://trac.openmodelica.org/OpenModelica/ticket/4222. However, I will perform tests with your proposed start values.

@christiankral
Copy link
Owner

I incorporated you initial conditions into master and version v0.3.1. With the actual nightly built of OpenModelica the problems described in https://trac.openmodelica.org/OpenModelica/ticket/4222 also disappeared. So thanks a lot for your support.

@christiankral
Copy link
Owner

Do you think we can close this ticket, as your initial conditions are applied to the library?

@tbeu
Copy link
Contributor Author

tbeu commented Feb 24, 2017

We used this Simple.mo (with original initial value settings) example as test case to improve damping strategies of different solvers. So it was a very relevant test case.

@tbeu tbeu closed this as completed Feb 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants