Initial conditions fail to converge in simscape simulation?
3 次查看(过去 30 天)
显示 更早的评论
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 个评论
Dan
2012-12-13
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.
回答(3 个)
Ryan G
2012-8-15
编辑:Ryan G
2012-8-15
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.
0 个评论
K E
2012-8-15
编辑:K E
2012-8-15
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.
0 个评论
Guy Rouleau
2012-12-14
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?
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!