symbolic variables in transfer functions

302 visualizaciones (últimos 30 días)
linofex
linofex el 21 de Dic. de 2015
Editada: Walter Roberson el 24 de Nov. de 2023
Hi all. I have a question about symbolic variables and
tf
function. I try to explain better: The questions of my exam are like: find the "k" where the system is BIBO of this transfer function. So, with Matlab I try to write the transfer function (I have few blocks)..
syms k; %where k is a real constant
s = tf('s'); % where s is the variable in the Laplace domain
G = 1/(2s+ k ); %should be the transfer function of one block that depends of k
but I get this errors:
Error using sym>tomupad (line 997)
Conversion to 'sym' from 'tf' is not possible.
Error in sym (line 139)
S.s = tomupad(x,'');
Error in sym/privResolveArgs (line 801)
argout{k} = sym(arg);
Error in sym/privBinaryOp (line 819)
args = privResolveArgs(A, B);
Error in * (line 216)
X = privBinaryOp(A, B, 'symobj::mtimes');
So, is make variables like z?
I hope that I have expressed well my problem.
  3 comentarios
Jeremy Shore
Jeremy Shore el 27 de Jul. de 2021
Although that is a good idea and often works well, Renato, some simulations can iterate for hours, even with optimization parameters set in the Response Optimizer tool with simulink, so symbolically solving for functions that can be of great complexity, including feed-foward control functions for systems engineering, would be very beneficial and helpful to not just get numerical solutions for parameters (that often do not work well and converge on local minima), but instead solve for tuning parameters and and other complex entities (like feed-forward functions) analytically. If I understand Linofex correctly, then I, too, am looking for a way to let MATLAb do block-diagram algebra symbolically so that I do not have to do it, which is quite error prone, expecially since it is me doing it.
Walter Roberson
Walter Roberson el 27 de Jul. de 2021
Editada: Walter Roberson el 24 de Nov. de 2023
It would indeed be useful if Mathworks could support more extensive symbolic control routines.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 21 de Dic. de 2015
In
s = tf('s'); % where s is the variable in the Laplace domain
you are creating a transfer function, not a variable.
In
G = 1/(2*s+ k ); %should be the transfer function of one block that depends of k
you are trying to multiply the transfer function by something, but transfer functions cannot be multiplied or added.
Perhaps you want
syms k
G = tf(1,[2 k])
I do not know how far you will be able to get with that, but it should avoid the problem of multiplying transfer functions.
  2 comentarios
Walter Roberson
Walter Roberson el 7 de Jun. de 2020
My response back then was incorrect: you can add tf and you can multiply them by scalars or tf.
However you cannot combine tf with Symbolic. In a later post I went into detail about was possible.

Iniciar sesión para comentar.


linofex
linofex el 21 de Dic. de 2015
I think that I made confusion. Rereading the help tf I see that tf('s') makes a transfer function, but my professor wrote this:
% Transfer function TC
s = tf('s');
G = (s+1)/(s^2+s+1); % definition of tf
G = tf([1 1],[1 1 1]); % other definition of G
So why the first
s = tf('s');
Thank you about the problem with the
k (solved)
  1 comentario
Najeh AlTaher
Najeh AlTaher el 6 de Jun. de 2020
How did you solve the k problem? its not working for me

Iniciar sesión para comentar.

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by