From: Konstantin Klein on 15 Jul 2010 17:48 Hi Arnaud, thanks very much for the lengthy and thoughtful response. First of all, yes, I am using R2009b and yes, the library is written in the Simscape language. However, I have not added the models to the existing pneumatics library (it is way too interconnected to reproduce the physical equations behind it and their behavior) but have created an entirely new one myself, which I shall describe briefly. The circuit consists mainly of two "kinds" of components: volumes (for the dynamic behavior) and different pneumatic resistances (which cause static pressure differences). These two alternate throughout the circuit, in other words, each static element sits in between two volumes and vice versa. The connectors carry the variables mass flow rate (flow variable, balancing = true) and pressure (potential variable, balancing = false). The Volumes have their volume (in m^3) and temperature as parameters (temperature control is uncritical and realized by someone else. I assume two constant temperature sections, heat flow is not included in my model, pipes are adiabatic) and mass and pressure as variables. Their sole equation is the ideal gas law, pressure = f ( mass ). The static elements (the compressor, the pipes, cooler and orifices) have explicit equations for the mass flow rate dependent of the pressure difference between the two adjacent volumes; mass_flow_rate = f ( pressure_difference ). Now for each time step, the solver should calculate the mass flow rate over each static element dependent on the current pressures, multiply it with the time step size, consequently calculate the new mass in each volume, derive the pressures via the gas law, and start at the beginning. My concept works out fine for simple circuits; however, when applying it to our real system with 20+ elements, I experience numerical instabilities that I can't get hold of. One frequent error, as described in the opening post, is the one with "Derivative Input 24". Hence, I suppose it would be very helpful to be able to interpret this error better, i.e. get a list of the "derivative inputs" and the actual system variables they are connected to. Again, thanks for your help, I'm thankful for anyone's contribution! Konstantin
From: Arnaud Miege on 16 Jul 2010 05:08 "Konstantin Klein" <kcklein(a)gmail.com> wrote in message <i1nvmk$br2$1(a)fred.mathworks.com>... > Hi Arnaud, thanks very much for the lengthy and thoughtful response. > > First of all, yes, I am using R2009b and yes, the library is written in the Simscape language. However, I have not added the models to the existing pneumatics library (it is way too interconnected to reproduce the physical equations behind it and their behavior) but have created an entirely new one myself, which I shall describe briefly. > > The circuit consists mainly of two "kinds" of components: volumes (for the dynamic behavior) and different pneumatic resistances (which cause static pressure differences). These two alternate throughout the circuit, in other words, each static element sits in between two volumes and vice versa. The connectors carry the variables mass flow rate (flow variable, balancing = true) and pressure (potential variable, balancing = false). > > The Volumes have their volume (in m^3) and temperature as parameters (temperature control is uncritical and realized by someone else. I assume two constant temperature sections, heat flow is not included in my model, pipes are adiabatic) and mass and pressure as variables. Their sole equation is the ideal gas law, pressure = f ( mass ). > > The static elements (the compressor, the pipes, cooler and orifices) have explicit equations for the mass flow rate dependent of the pressure difference between the two adjacent volumes; mass_flow_rate = f ( pressure_difference ). > > Now for each time step, the solver should calculate the mass flow rate over each static element dependent on the current pressures, multiply it with the time step size, consequently calculate the new mass in each volume, derive the pressures via the gas law, and start at the beginning. > > My concept works out fine for simple circuits; however, when applying it to our real system with 20+ elements, I experience numerical instabilities that I can't get hold of. One frequent error, as described in the opening post, is the one with "Derivative Input 24". Hence, I suppose it would be very helpful to be able to interpret this error better, i.e. get a list of the "derivative inputs" and the actual system variables they are connected to. > > Again, thanks for your help, I'm thankful for anyone's contribution! > > Konstantin Hi, As I said, it's difficult to tell where the error is coming from. Your best bet is probably to contact technical support. This would be also a good way to feed back any suggested improvement to the error message handling. One thing to watch out for when writing Simscape language files is what happens at zero flow, i.e. do you have any discontinuities. The relationship pressure = f(mass flow rate) may also be used the other way (flow rate = f(pressure)) by the solver, so it's important to avoid any potential discontinuities or divide by zero. I generally have a parameter to determine a flow rate threshold (generally quite small), and when the flow rate is below that threshold (in absolute value), I do a linear interpolation around zero flow. That ensures there's no issues around zero flow. Finally, what solver are you using? ode23t or ode15s are generally better suited for this type of problems. Tightening the absolute and relative tolerances may also help. You can also try the local solver with a fixed time step to see if it helps. HTH, Arnaud
|
Pages: 1 Prev: MATLAB R14 on WIndows 7 X64 ??? Next: Compiled Parallel Support |