Here are my questions:
1) How do i perform small-angle approximation (linearization) on a nonlinear DE using Maple. This is necessary to create a state-space representation of the DEs. By small-angle approximation i mean that:
theta(t)^2 = 0
and so on....
I tried using manual substitution using the "subs" command. It is not a very feasible method. I have tried "dsolve" command. Not what i want since i only want to linearize the DEs and not solve for a particular angle.
2) My second question is regarding defining outputs of the "DiffEquation" command. Usually it will go:
DEQ1:=DiffEquation(EQ1,inputvariable=[u(t)], outputvariable=[y(t)], statevariable=[y(t)]);
What if i want to include the derivative of a variable as output as well? Placing "diff(x(t),t)" as the output returns an error. The workaround i have tried is as follows:
define both q1(t) = x(t) and q2(t)=diff(x(t),t) as EQ2 and EQ3. Then set the outputvariable as q1(t) and q2(t). This works, but when i export to MATLAB/Simulink, the outputs of the S-Function block are now q1(t) and q2(t), which is ok but not desired since it will confusing to trace back that q1(t) = theta(t), q2(t) = diff(theta(t),t). This is especially for systems with lots of variables.