-
Notifications
You must be signed in to change notification settings - Fork 17
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
fe_factory_fix bug #49
Comments
Hi @dthierry, sorry for getting back to you late on this. Actually, I had the Michael's example working. The issue occurred on both of the aspirin sims. In the past I remember getting those profiles where the concentrations dropped below zero in an element, however they now seem to fail on the third element. Can you please check those for me since mine are still failing? Additionally, while working on the FESimulator (the interface for Kipet and fe_factory) I noticed that these profiles have a strange jump at the second finite element. Everything seems ok from there onwards, but there may be an issue with the initialization or something? I know you are away right now, so I will try to check it out. And enjoy your time away from the office |
Ah, I see. I think we weren't able to solve the Aspirin problem to begin with. There were issues like what you just reported. |
The problem is that the inputs don't match exactly. There is something making interpolations for us automatically. Turning off that element should help for now. |
Hi @dthierry , I have been going over the PyomoSimulator class very closely today to try and figure out what the problem could be here. From what I can tell the problem is that, because the input data is not equally spaced, the interpolation is required in order to fix the input data in the correct places. Maybe just to give you the strategy that is being used here.
So then for the fix_from_trajectory this basically just uses the data file and fixes the relevant inputs to the values needed at the fe and ncp by using the interpolate_from_trajectory. Going through each dictionary, list and variable, I can't figure out what the problem in the set up is. Maybe I am missing something here, but I am really struggling to figure out what the problem here could be and don't see how the interpolation could be turned off. Unless I am not quite getting which interpolations you are referring to. |
I also run into issues solving my problem without jumps increasing the number of finite elements which seems really strange to me. I can solve it for up to 30 finite elements but if I choose a higher number, the solution already fails in the zeroth element. It converges to a point of local infeasibility. I am not sure whether this is a pyomo problem or finite element factory problem though. |
I am starting to think that it is a fe_factory issue. I have been carefully checking that all the parameters and variables are correctly initialized at each point in the pyomo model and it looks regular to me. When I input a low number of finite elements the model can solve, only if the PyomoSimulator solve is restricted to a single iteration, which makes me think that when it patches to the model something is off. As I increase the number of fe, it gets to a point where fe factory is able to work, however it fails when PyomoSimulator is called with an error evaluating one of the constraints. (again I can't seem to get the nl file for this since I am not sure how to get it to output when the solver fails). Finally as the number of fes increase to a certain number (not very high) I get a failure at the first element. When this occurs the ipopt output looks quite strange: " This program contains Ipopt, a library for large-scale nonlinear optimization. This is Ipopt version trunk, running with linear solver ma27. Number of nonzeros in equality constraint Jacobian...: 331 Total number of variables............................: 82 iter objective inf_pr inf_du lg(mu) ||d|| lg(rg) alpha_du alpha_pr ls Warning: Cutting back alpha due to evaluation error Number of Iterations....: 7
Objective...............: 0.0000000000000000e+00 0.0000000000000000e+00 Number of objective function evaluations = 14 EXIT: Restoration Failed! File "", line 1, in No idea how any of this is related at this stage. I think that when @dthierry is back on Tuesday we should sit down and try to figure out how all this fits together. |
We are still talking about the aspirin problem right? |
Yes but it seems so be the same problem for the aspirin problem and my problem. |
Small update here: Been testing with large numbers of elements and fe_factory will fail on the first element, even on the Michael's simulation, when you input a large number of elements(somewhere between 300 and 400). The same is true for the aspirin example. Something causes the first element to fail. I am not sure whether this is something to do with a derivative approaching a very large number or some other issue. When looking closely at the profiles for the Michael's sim, you can see a sharp change from the initial concentrations to another concentration, before a smooth profile is obtained. Is it related to this somehow? Perhaps fe_factory is not constructing the first element correctly? |
That is odd. I will check it out. Is this the |
Hey Mike, I couldn't find a problem with the Ex_5; even with 2000 FEs the problem seems to be fine. Also, the jump seems to be consistent with the results. |
Hey @mchlshort I have tested both python 2 and 3 and it doesn't seem to be a problem. (Ex_5_sm_fe_by_fe.py).
Python 2
Python 3
Python 2
Python 3
Was there something in particular that didn't work out before?
~~Dav
The text was updated successfully, but these errors were encountered: