I have a system of linear equations with several conditions describing a kinematic analysis of an automatic gearbox. The system is the following:
where all values Z are positive.
Then the following conditions are applied
These conditions are permanently valid. Thereafter other conditions are going to be applied according to the engaged gear. For example in fifth gear, the further conditions are:
The aim is to obtain a symblic equation expression consisting of parameters Z, which defines the gear ratio between the output and input. The gear ratio in 5th gear is for instance
Mathematically the system has 12 unknonws and 11 equations, so it gives exactly the expression for the ratio between the output and input as a function of parameters Z.
The transmission has a total of 10 gears, so it would be pretty difficult to make all manually.
My idea was creating a code as follows:
syms Z1A Z2A Z3A Z4A Z1B Z2B Z3B Z4B positive
eqn1 = w1A*Z1A + w1B*Z1B == w1C*(Z1A+Z1B);
eqn2 = w2A*Z2A + w2B*Z2B == w2C*(Z2A+Z2B);
eqn3 = w3A*Z3A + w3B*Z3B == w3C*(Z3A+Z3B);
eqn4 = w4A*Z4A + w4B*Z4B == w4C*(Z4A+Z4B);
cond_gear5_1 = w4C == w3C;
cond_gear5_2 = w2B == w4A;
Sol = solve([eqn1 eqn2 eqn3 eqn4 ...
cond1 cond2 cond3 cond4 ...
cond_gear5_1 cond_gear5_2 ratio], i)
I was probably too optimistic about getting the desired expression from Matlab. The problem is that I don't know how to make it work.
Each advice is appreciated.
UPDATE: I tried a different approach using consecutive substitutions. I implemented the permanently valid conditions already in the system of equations.
syms Z1A Z2A Z3A Z4A Z1B Z2B Z3B Z4B positive
eqn1 = w2A*Z1A + w1B*Z1B == w4B*(Z1A+Z1B);
eqn2 = w2A*Z2A + w3A*Z2B == w2C*(Z2A+Z2B);
eqn3 = w3A*Z3A + w4A*Z3B == w3C*(Z3A+Z3B);
eqn4 = w4A*Z4A + w4B*Z4B == w4C*(Z4A+Z4B);
eqn2 = subs(eqn2,w2C,w4A);
eqn3 = subs(eqn3,w3C,w4C);
Sol_w2A = solve(eqn1, w2A); eqn2 = subs(eqn2,w2A,Sol_w2A);
Sol_w4B = solve(eqn2, w4B); eqn4 = subs(eqn4,w4B,Sol_w4B);
Sol_w3A = solve(eqn3, w3A); eqn4 = subs(eqn4,w3A,Sol_w3A);
eqn4 = subs(eqn4,w4C,i*w4A);
Sol_i = solve(eqn4, i); Sol_i = expand(Sol_i); Sol_i = simplify(Sol_i);
pretty(Sol_i)
Z1A Z2A Z3A Z4A + Z1A Z2A Z3A Z4B + Z2A Z3A Z4A Z1B + Z1A Z3A Z2B Z4B + Z1A Z2B Z3B Z4B
---------------------------------------------------------------------------------------------------------
Z1A Z2A Z3A Z4A + Z1A Z2A Z3A Z4B + Z2A Z3A Z4A Z1B + Z1A Z3A Z2B Z4B + Z2A Z3A Z1B Z4B + Z1A Z2B Z3B Z4B