Entering Transfer Function in MATLAB

Click For Summary

Discussion Overview

The discussion revolves around entering a transfer function into MATLAB, specifically focusing on the expression G(s) = -1/((C1+C2)s). Participants explore methods for implementing this in MATLAB, including the use of the tf() function and the ode45 function, as well as solving a set of equations related to the transfer function.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Homework-related

Main Points Raised

  • One participant inquires about entering the transfer function G(s) into MATLAB.
  • Another participant suggests using the tf() function if C1 and C2 are constants, while proposing the ode45 function for parameters.
  • A participant expresses confusion about how the ode45 function would assist in their specific case involving multiple equations.
  • The participant provides a set of equations they are working with, including G1, G2, G3, G4, G5, and G6, and seeks guidance on solving for Vout/Vin in MATLAB.
  • Later, the participant reports success using the solve function to address their problem.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method for entering the transfer function, as different approaches are suggested and one participant expresses confusion about the utility of the ode45 function.

Contextual Notes

The discussion includes assumptions about the nature of C1 and C2 (constants vs. parameters) and the specific equations involved, which may affect the applicability of the proposed methods.

pnjbi
Messages
6
Reaction score
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
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
 
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.
 
Think I got it.

Used the solve function.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K