"Initial conditions solve failed to converge" Problem in Simscape/Simulink
5 views (last 30 days)
Show older comments
Hello Sir,
I am really very badly stuck in Simscape. I need a small push here. Basically I am working in Memristor model in electrical domain.
Let me elaborate it a little bit: I have to satisfy following set of equations:
q(phi) = k2*phi - 0.5*(k1 - k2)(phi - delta - phi - delta) ---(1)
W(phi) = dq/d(phi) = k1 if phi < delta and k2 if phi > delta ---(2)
i = v*w ------(3)
Since this is a memristor design, it satisfy basic equs:
i = dq/dt
and
v = d(phi)/dt
The error I get is :
Initial conditions solve failed to converge. ...Equations (including nonlinear equations) of one or more components may be dependent or inconsistent. This can cause problems in transient initialization. Here is the set of components involved: 'untitled2/LCMemristor2' Equation locations are: 'C:/Users/Shital/Desktop/NewFolder2/+NewMemristor/LCMemristor2.ssc' (line 31)
'C:/Users/Shital/Desktop/NewFolder2/+NewMemristor/LCMemristor2.ssc' (line 54)
Component: Simulink | Category: Block error
For this I have written following code:
component LCMemristor2 < foundation.electrical.branch
outputs
w_out = { 0.0, 'Ohm^-1' } ; %Memductance
phi_out = { 0.0, 'V*s' } ; %phi
q_out = { 0.0, 'A*s' } ; %q
end
parameters
k1 = {-3e4, 'Ohm^-1'}; %First Constant
k2 = {9e4, 'Ohm^-1'}; %Second Constant
phi_0 = {1e-14, 'V*s'}; %Initial value of phi
delta = {1e-12, 'V*s'}; % Point in phi axis where the slope changes
end
variables
phi = {0, 'V*s'};
q = {0, 'A*s'};
w = {0, 'Ohm^-1'};
end
function setup
phi = phi_0;
q = 0;
w = 0;
end
equations
q == k2*phi + 0.5*(k1 - k2) * (abs(phi + delta) - abs(phi - delta)); %LINE 31 ERROR MEANS HERE
if (abs(phi) < delta)
q == k1*phi;
w == k1;
else
q == k2*phi;
w == k2; %LINE 54 ERROR MEANS HERE
end
i==w*v;
w_out == w;
phi_out == phi;
q_out == q;
end
end
Any help would be highly appreciated.
Best regards, Shital Joshi
0 Comments
Answers (0)
See Also
Categories
Find more on Trimming and Linearization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!