Question

I am trying to use transfer functions with symbolic values but I only returns errors.

Is there a way to work with Laplace transformed in symbolic mode with MatLab?

Here an example that I am trying to do and the MatLab message error:

>> syms Ki Kp Te R;
>> s=tf('s');
>> g=((Kp*s+Ki)/s)
Error using sym>tomupad (line 1014)
Conversion to 'sym' from 'tf' is not possible.

Error in sym (line 139)
            S.s = tomupad(x,'');

Error in sym/privResolveArgs (line 823)
                    argout{k} = sym(arg);

Error in sym/privBinaryOp (line 838)
            args = privResolveArgs(A, B);

Error in  *  (line 216)
        X = privBinaryOp(A, B, 'symobj::mtimes');

I have tried some other forms to create a transfer function with no results:

>> sys=tf([Te],[0 Ki])
Error using tf (line 287)
The values of the "num" and "den" properties must be row vectors or cell arrays of row vectors, where each vector
is nonempty and containing numeric data. Type "help tf.num" or "help tf.den" for more information.
Était-ce utile?

La solution 2

The answer is Maple! It is awesome, and also there is MapleSim that is like Simulink/Xcos but you can use all kind of variables in transfer functions.

Autres conseils

You can't use transfer functions with symbolic variables. Check the documentation on tf:

sys = tf(num,den) creates a continuous-time transfer function with numerator(s) and denominator(s) specified by num and den. The output sys is:

  • A tf model object, when num and den are numeric arrays.
  • A generalized state-space model (genss) when num or den include tunable parameters, such as realp parameters or generalized matrices (genmat).
  • An uncertain state-space model (uss) when num or den are uncertain (requires Robust Control Toolbox™ software).
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top