Steady-State to Transfer Function Using MATLAB

In summary, there is a conversation about using MATLAB to obtain a transfer function for a Controls class. The speaker has no experience with MATLAB but their professor requires its use. The speaker is having trouble running the function and receives an error related to a reserved name. The solution is to rename the .m file to something other than ss2tf. There may be issues with different versions of MATLAB not recognizing the command.
  • #1
pags920
21
0
I am trying to use MATLAB to obtain a transfer function, for my Controls class. I will be honest, I have no experience using MATLAB, but our professor insists on us using it to find the transfer function. MATLAB is not a prerequisite for this class. Before I start attempt to find my transfer function, I wanted to make sure I can run the function first. I am having trouble using it. Below is my code that I have on my .m file.

Code:
A=[0 500; -3.3333 -33.3333]
B=[0; 3.3333]
C=[1 0]
D=[0]

[NUM,DEM]=ss2tf(A,B,C,D,1)

When I run this .m file, I get the following error:

Code:
? Attempt to execute SCRIPT ss2tf as a function.

Error in ==> ss2tf at 6
[NUM,DEM]=ss2tf(A,B,C,D,1)

Can anyone help an inexperienced MATLAB user?
 
Physics news on Phys.org
  • #2
You can't name your .m file with a name that is reserved for a Matlab function (in this case ss2tf). So rename your .m file something other than ss2tf.m and it should work fine.

Unfortunately Matlab doesn't do any checking or enforcement of this other than giving you a vague error like that. But what is happening is that when it gets to the ss2tf function call in your .m file it is confused as to whether you want to call the .m file again or the Matlab function since they both have the same name.
 
  • #3
Apparently, this command doesn't work with my version of MATLAB. I have an older version, and I tried this on MATLAB 2010 and it works just fine.
 

Question 1: What is steady-state analysis and how is it related to transfer functions?

Steady-state analysis is a method used to analyze the behavior of a system over time when it has reached a state of equilibrium. It is related to transfer functions because transfer functions are mathematical representations of a system's steady-state response to a given input.

Question 2: How do you convert a steady-state system to a transfer function using MATLAB?

To convert a steady-state system to a transfer function using MATLAB, you can use the tf function. This function takes in the coefficients of the system's differential equations and outputs the transfer function in the form of a ratio of polynomials.

Question 3: What are the advantages of using MATLAB for steady-state to transfer function analysis?

One advantage of using MATLAB for steady-state to transfer function analysis is its ability to handle complex systems with multiple inputs and outputs. MATLAB also has built-in functions for calculating and visualizing transfer functions, making the process more efficient and accurate.

Question 4: Are there any limitations to using MATLAB for steady-state to transfer function analysis?

One limitation of using MATLAB for steady-state to transfer function analysis is that it relies on the user to input the correct coefficients for the system's differential equations. If these coefficients are incorrect or incomplete, the resulting transfer function may not accurately represent the system's behavior.

Question 5: Can you use MATLAB to simulate the response of a system given a transfer function?

Yes, MATLAB has a step function that allows you to simulate the response of a system given a transfer function. This function plots the step response of the system, which is the output when a step input is applied. This can be useful for analyzing the behavior and stability of a system.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
992
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
Back
Top