Error: Initial conditions solve failed to converge. in a simscape simulation

Hey there!
I have a problem with a Simscape model:
I made a component, which combines 2 mechanical rotational inputs into one mechanical rotational output.
Code:
component my_Leistungsaddierer
% my_Leistungsaddierer
nodes
P1 = foundation.mechanical.rotational.rotational; % P1: left
P2 = foundation.mechanical.rotational.rotational; % P2: left
P3 = foundation.mechanical.rotational.rotational; % P3: right
end
parameters
ratio1 = { 1, '1' };
ratio2 = { 1, '1' };
eta = {0.97, '1'};
end
variables
T1 = { 0, 'N*m' };
T2 = { 0, 'N*m' };
T3 = { 0, 'N*m' };
w1 = { 0, 'rad/s'};
w2 = { 0, 'rad/s'};
w3 = { 0, 'rad/s'};
end
function setup
through( T1, P1.t, [] );
through( T2, P2.t, [] );
through( T3, P3.t, [] );
across (w1, P1.w, []);
across (w2, P2.w, []);
across (w3, P3.w, []);
% Parameter range checking
if ratio1 == 0
pm_error('simscape:NotZero','Leistungsaddiere ratio1')
end
if ratio2 == 0
pm_error('simscape:NotZero','Leistungsaddiere ratio2')
end
if eta == 0
pm_error('simscape:NotZero','Leistungsaddierer eta')
end
end
equations
-T3 == (ratio1 * eta * T1)+(ratio2 * eta * T2);
if T1 > T2
w3 == w1*(1/ratio1);
w2 == w3*ratio2;
elseif T2 > T1
w3 == w2*(1/ratio2);
w1 == w3*ratio1;
else
w3 == w2*(1/ratio2);
w1 == w3*ratio1;
end
end
end
When i connect the inputs with constant Torque Sources it works, but if i connect it with my system, the error:
"Initial conditions solve failed to converge."
appears.
Does somebody have a clue why this error is happening? The System without my component is working well.
Greetings

Réponses (0)

Catégories

En savoir plus sur Simscape dans Centre d'aide et File Exchange

Question posée :

le 15 Mai 2014

Community Treasure Hunt

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

Start Hunting!

Translated by