To
symbolically solve the set of algebraic equations shown below
(which are
linear in x and y), type
Variable x, y
Eqn[1] = 2*x + 3*y - sin(t)
Eqn[2] = 4*x + 5*y - cos(t)
Solve( Eqn = 0, x, y )
2 x + 3 y = sin(t)
4 x + 5 y = cos(t)
The response to this
Solve command is
-> x = 1.5*cos(t) - 2.5*sin(t)
-> y = 2*sin(t) - cos(t)
To
save commands (for subsequent re-use) or commands/responses, type
Advanced: To write a MATLAB® code to
solve for x and y for
0 ≤ t ≤ 4,
type
Variable x, y
Eqn[1] = 2*x + 3*y - sin(t)
Eqn[2] = 4*x + 5*y - cos(t)
Output t sec, x meter, y meter
Code Algebraic(Eqn = 0, x, y) [t = 0, 4, 1]
MGSolveLinearEqns.m
Running the MotionGenesis™-generated
.m file produces,
% FILE: MGSolveLinearEqns.1
%
% t x y
% (sec) (meter) (meter)
0.00E+00 1.500E+00 -1.000E+00
1.00E+00 -1.293E+00 1.143E+00
2.00E+00 -2.898E+00 2.235E+00
3.00E+00 -1.838E+00 1.272E+00
4.00E+00 9.115E-01 -8.560E-01