I've been trying to model a system of algebraic equations in Simscape (no physical system, just to understand the basics of across and through variables). The system consist of two basic algebraic equations: x+y=1 and x-11y=5. So i created a domain and 2 components codes shown below:
I defined x as across, y as through variable.
domain alg
variables
x = { 1 , '1' };
end
variables(Balancing = true)
y = { 1 , '1' };
end
end
Component One & Two:
component generic
nodes
A = solve_alg_v4.alg;
end
parameters
a = {1,'1'};
b = {1,'1'};
c = {1,'1'};
end
variables
x = { 1 , '1' };
y = { 1 , '1' };
end
branches
y : A.y -> *;
end
equations
x == A.x - B.x;
a*x + b*y == c;
end
end
When i build this, no problem is encountered and components are shown in the customised library. However when I connect two components and run the simulation it gives 'Steady state solve failed to converge' error.
The system looks like:
By the way i modelled the system by defining all variables as across (and each component has one node) it perfectly works and find solution to the system. However, still no good with through variable.
How would you solve this system with through and across variables?
0 Comments
Sign in to comment.