Entering Transfer Function in MATLAB

In summary, the conversation discusses using Matlab to enter a transfer function and solve equations involving constants and parameters. The use of the tf() function and solving with ode45 and the solve function are mentioned as possible solutions.
  • #1
pnjbi
6
0
Hi,

I'm trying to enter this into matlab:

G(s) = -1/((C1+C2)s)

How can I enter this into matlab?

Thanks!
 
Physics news on Phys.org
  • #2
Tranfer function

Hi
If C1 and C2 are constants you can simply use tf() function.

If they are parameters using ode45 functions and a little code will help.

Best
 
  • #3
I can't seem to figure out how using the ode45 function will help me.
I have 4 equations:
G1 = sym('-1/((C1+C2)*s)')
G2 = sym('-C2*s')
G3 = sym('-1/(L2*s)')
G4 = sym('-1/((C3+C2)*s)')
G5 = sym('-1/(L4*s)')
G6 = G2

% Set up equations
V1 = ((-V1) + (-I2) + (-V3)*G6 + Vin)*G1
I2 = ((-V1) + (-V3))*G3
V3 = ((I2) + (-V1)*G2 + (-Vout))*G4
Vout = ((-V3) + (Vout))*G5

V1, I2, V3, Vout and I need to solve for Vout/Vin. How can I do this using Matlab?

Thanks.
 
  • #4
Think I got it.

Used the solve function.
 

1. How do I enter a transfer function in MATLAB?

To enter a transfer function in MATLAB, you can use the tf function and specify the coefficients of the numerator and denominator polynomials.

2. Can I use symbolic variables in my transfer function?

Yes, you can use symbolic variables by using the sym function and defining the transfer function in terms of these variables.

3. How do I plot the frequency response of a transfer function in MATLAB?

You can use the bode function to plot the magnitude and phase response of a transfer function, or the freqs function to plot the frequency response over a specific range.

4. Can I convert my transfer function to a state-space representation?

Yes, you can convert your transfer function to a state-space representation using the tf2ss function. This will give you the state-space matrices for your system.

5. How can I simulate the response of my transfer function in MATLAB?

You can use the step function to simulate the step response of your transfer function, or the lsim function to simulate the response to any arbitrary input signal.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
978
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
789
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
10
Views
2K
Back
Top