Initial conditions fail to converge in simscape simulation?

9 vues (au cours des 30 derniers jours)
Chandana
Chandana le 14 Août 2012
Hi,
I'm trying to make a custom hydraulic accumulator. I am trying to use the provided accumulator model as a base, and then modify it for my needs. The accumulator equates the flowrate depending on the rate of change of the fluid inside the accumulator. I am trying to program the following conditions:
When pressure < preload pressure
Accumulator fluid =0
Otherwise
Accumulator fluid = Capacity * (1-(preload/pressure)^(1/constant))
When I run my code, I get this error:
Nonlinear solver: Linear Algebra error. Failed to solve using iteration matrix. Initial conditions solve failed to converge.
I've tried changing the code, but I either get this error, or numerous other errors. Can anyone help me of give me a hint? I've been working on this for a couple weeks and I'd like to figure out what I'm doing wrong. My code is as shown below, thanks :
component sioux_chief_accumulator % Sioux Chief Accumulator % nodes a = foundation.hydraulic.hydraulic; % a:bottom end
parameters
va = { 1.4 'in^3'}; % accumulator capacity
ppr = { 18 'psi'}; % preload pressure
vpr = { 0, 'in^3'}; % inital fluid volume
k = {1.4,'1'}; % Specific heat ratio
z = {0, 'm^3'}; %zero
end
variables
q = { 0 , 'm^3/s' }; %flowrate 61023.8 in^3/s
p = { 0 , 'Pa' };%pressure
vf = { 0, 'm^3'}; %instantaneous fluid volume
% z = { 0, 'm^3'}; %zero-var state
% d = { 1, 'm^3/s'}; %dummy var
end
function setup
through( q, a.q, [] );
across( p, a.p, [] );
end
equations
if p <= ppr
vf == z;
else
let
j = (va*(1-((ppr/p)^(1/k))))
in
vf == j;
end
end
q == vf.der
end
end
  1 commentaire
Dan
Dan le 13 Déc 2012
Is this hydraulic accumulator being used in conjunction with other blocks? From what I've seen, you get errors like "Initial conditions solve failed to converge." when you assign a certain initial pressure in 1 chamber, while assigning a different initial pressure in another block that is connected to the 1st.

Connectez-vous pour commenter.

Réponses (3)

Ryan G
Ryan G le 15 Août 2012
Modifié(e) : Ryan G le 15 Août 2012
I would first clean up the code to utilize the same units, either standard or metric.
Second, in the if-else, when true vf is in m^3, when false vf is in in^3. Why are you using the let-in statement for a simple ==?
You can try running again once all that is resolved and it may solve the issue.

K E
K E le 15 Août 2012
Modifié(e) : K E le 15 Août 2012
I don't think it's the main issue, but just in case I will point out that let/in/end was introduced in R2009b. What version are you using? Also perhaps this blog post on visualization for debugging Simscape may have something useful for you.

Guy Rouleau
Guy Rouleau le 14 Déc 2012
I would go with Dan's comment: How is the block connected? If you have another component also setting the pressure of its node next to it, you will get this error.
If you insert an orifice between your accumulator and the rest of the notwork, does it help?

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by