I want to know the Solving Syntax for Ternary first-order equation on maxima.
For example;
F_A + F_C + F_E - 15 = 0; -F_A *0.4 + 15*0.2 m + F_E*0.4 = 0; F_C = 0.3*F_A + 0.3*F_E;
wanna know How to get the solution F_A, F_C, F _E?
I want to know the Solving Syntax for Ternary first-order equation on maxima.
For example;
F_A + F_C + F_E - 15 = 0; -F_A *0.4 + 15*0.2 m + F_E*0.4 = 0; F_C = 0.3*F_A + 0.3*F_E;
wanna know How to get the solution F_A, F_C, F _E?
Since this is a system of linear equations, one can call linsolve
to solve it.
(%i10) eq1: F_E + F_C + F_A - 15 = 0 $
(%i11) eq2: 3.0*m + 0.4*F_E - 0.4*F_A = 0 $
(%i12) eq3: F_C = 0.3*F_E + 0.3*F_A $
(%i13) linsolve ([eq1, eq2, eq3], [F_A, F_C, F_E]);
rat: replaced -0.4 by -2/5 = -0.4
rat: replaced 0.4 by 2/5 = 0.4
rat: replaced 3.0 by 3/1 = 3.0
rat: replaced -0.3 by -3/10 = -0.3
rat: replaced -0.3 by -3/10 = -0.3
195*m + 300 45 195*m - 300
(%o13) [F_A = -----------, F_C = --, F_E = - -----------]
52 13 52
Note that it's not necessary for all terms to have a numerical value -- in the solution above, m
is a free variable.
Note also that Maxima prefers exact numbers (i.e., integers and rational numbers) to inexact numbers (i.e., floating point). linsolve
converts floats to rationals and then works with the result.
Let those be =>
F_A = x; F_C = y; F_E = z;
x + y + z = 15
-0.4*x + 0.4*z = 3
0.3*x -y + 0.3*z = 0
On Mathlab, refer to the pic