MATLAB Answers

Initial conditions fail to converge in simscape simulation?

조회 수: 71(최근 30일)
Chandana 14 Aug 2012
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
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
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
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
function setup
through( q, a.q, [] );
across( p, a.p, [] );
if p <= ppr
vf == z;
j = (va*(1-((ppr/p)^(1/k))))
vf == j;
q == vf.der
  댓글 수: 1
Dan 13 Dec 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.

댓글을 달려면 로그인하십시오.


Ryan G
Ryan G 15 Aug 2012
편집: Ryan G 15 Aug 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 15 Aug 2012
편집: K E 15 Aug 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 14 Dec 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