Open Loop Transfer Function from Differential Equations

In summary, the problem involves finding the Laplace transforms of \dot{x} = Vcos(θ) and \dot{y} = Vsin(θ) when \dot{θ} = u (\frac{θ}{U} = \frac{1}{s}). The problem statement is vague and it is unclear whether closed-form transfer functions are required or if a simulation using a software like Simulink or Excel is needed. One approach is to define a function θ(t), representing the angle of the car as it switches lanes, and use it to compute x'(t), y'(t), x(t), and y(t) by integration. Another possibility is to define θ(t) in terms of its time derivative
  • #1
logan233
11
0

Homework Statement



Generate an open loop u(t) and simulate. Plot x(t) and y(t)

[itex]\dot{x}[/itex] = Vcos(θ)
[itex]\dot{y}[/itex] = Vsin(θ)
[itex]\dot{θ}[/itex] = u

I am given initial values. All are 0 except for [itex]\dot{x}[/itex](0) = V.

Homework Equations



Laplace Transform Tables

The Attempt at a Solution



I think I know how to find the transfer functions [itex]\frac{X}{U}[/itex] and [itex]\frac{Y}{U}[/itex], which is what I'm assuming the problem statement is asking for. I first found [itex]\frac{θ}{U}[/itex] which is equal to [itex]\frac{1}{s}[/itex]. I am now trying to find the transfer functions [itex]\frac{X}{θ}[/itex] and [itex]\frac{Y}{θ}[/itex] so that I can multiply it by the transfer function θ/U. My problem is finding the Laplace transform of the given [itex]\dot{x}[/itex] and [itex]\dot{y}[/itex] equations. I know that the Laplace transform of cos(at) and sin(bt) are s/(s^2 + a^2) and b/(s^2 + b^2) respectively, however I am not sure of these transforms when the input is inside of the cosine and sine functions. My original thinking was the transfer functions X/θ and Y/θ would simply be given as V*s/(s^2 + 1) and V/(s^2+1) respectively but because the cosine and sine arguments aren't simply at and bt I am being thrown off.

SUMMARY:
I am trying to find the Laplace transforms of [itex]\dot{x}[/itex] = Vcos(θ) and [itex]\dot{y}[/itex] = Vsin(θ) when [itex]\dot{θ}[/itex] = u ([itex]\frac{θ}{U}[/itex] = [itex]\frac{1}{s}[/itex])
 
Physics news on Phys.org
  • #2
Are you sure you're supposed to find closed-form transfer functions?

As I interpret the problem, they want you to generate an arbitrary u(t), then run a software simulation to get x(t) and y(t).
 
  • #3
rude man said:
Are you sure you're supposed to find closed-form transfer functions?

As I interpret the problem, they want you to generate an arbitrary u(t), then run a software simulation to get x(t) and y(t).

Thank you for the reply.

I'm actually not sure I'm supposed to find the closed-form transfer functions. The problem statement is kind of vague.

I am unclear as to how I would simulate this. Or what I am even simulating.

Just thinking about that off the top of my head, I would make a time vector and a vector for theta, which would range from 0 to pi/4 as by inspection that is the highest angle the car takes when switching lanes. Then I could produce plots of x_dot(t) vs t and y_dot(t) vs t and integrate. Is this what you had in mind?
 
  • #4
Car? Switching lanes?
Maybe you should state the entire problem verbatim.

You can use simulation software like Simulink. You can also use Excel.
With excel, put time in column A, u(t) in B (you make this whatever you want), theta in column C = integrated u(t), then sin theta and cos theta in D and E, then x-dot and y-dot in F and G, then x and y in H and I.
 
  • #5
I didn't state the entire problem because there really isn't much to it. I thought I had a better grasp on it than I apparently do. Here is the entire problem, including the picture used to describe the motion of the car as it switches lanes.

I am still unsure of how I would simulate this. I ran a little program in MATLAB using a time vector with the given times, a theta vector using the driving angle of the car (by inspection), and created x_dot, y_dot, x, and y vectors.

(I set V = 1)
x_dot = cos(theta);
y_dot = sin(theta);
x = sin(theta);
y = -cos(theta)

Plotting these vectors versus time, though, doesn't make too much sense as y is always negative and the x plot doesn't really describe motion in the x direction at all.

Thank you for your help.
 

Attachments

  • HW1.pdf
    43.5 KB · Views: 306
  • #6
One problem I recognize that I did is integrate x_dot and y_dot incorrectly. x_dot and y_dot are dx/dt and dy/dt respectively, therefore when I integrate I am integrating the left with respect to x (or y) and the right side with respect to t. However, I believe theta is also a function of time so I am not sure how to handle that.
 
  • #7
My new train of thought is this...

d(theta)/dt = u -----> d(theta) = u*dt -----> theta = u*t
dx/dt = Vcos(theta) -----> dx = Vcos(theta)*dt -----> dx = Vcos(u*t)*dt -----> x = (V/u)*sin(u*t);
dy/dt = Vsin(theta) -----> dy = Vsin(theta)*dt -----> dy = Vsin(u*t)*dt -----> y = (V/u) - (V/u)*cos(u*t);

My plot for x seems to make more sense using this, as the plot shows that the car is traveling in the x direction with a large positive slope, before the slope turns negative when the velocity is split between the x and y directions at t = 7, and finally the slope increases sharply in the positive direction when the car has completed its lane switch. The y vs. t plot, however, still doesn't make much sense to me as it seems to be a copy of the x vs t plot.
 
Last edited:
  • #8
.
logan233 said:
My new train of thought is this...

d(theta)/dt = u -----> d(theta) = u*dt -----> theta = u*t

theta = ∫u(t)dt but = u*t only if u is not a function of time. But it obviously is. θ starts at 0, goes to some max value, then (apparently) symmetrically returns to zero. So u cannot be a constant since u = dθ/dt.

x is in the direction of travel along the road, and y points "up" on the page. Then θ has to be some function of time such that θ(0) = θ(14) = 0 and θ(7) = maximum. It's up to you to define this function. It will define the shape of the "S" curve as the car shifts lanes.

One possibility is θ(t) = θ0sin(πt/14), 0 < t < 14. θ0 would be the max value of θ.

Now you can compute x'(t) and y'(t), then x(t) and y(t) by integration.
You can also compute u(t) by integration but I don't see why you need to unless θ(t) has to be defined in terms of its time derivative u(t) rather than by itself as I did above.
 
Last edited:
  • #9
Okay this all makes perfect sense.

I now have clear plots of x_dot vs. t and y_dot vs. t that describe the x and y direction velocities. My problem is now calculating the integrals of these functions.

Integrating [itex]\dot{x}[/itex] = Vcos(θ0sin(πt/14)) (as well as the y_dot equation) is proving to be quite difficult. I first tried to do the integration by hand, but integration by parts and substitution don't work. I then tried to integrate using a Simulink simulation where I simply read the x_dot and y_dot arrays from the MATLAB work space and fed them into a continuous integrator (1/s), however this doesn't appear to be producing the correct plots. Do you have any method you would recommend to integrate these equations?

Thanks.
 
Last edited:
  • #10
I figured it out using Excel and trapezoidal areas. Thank you for your help.
 
  • #11
can you explain how you solved it?
 
  • #12
what was the function you used for u(t)? am not clear on what has to be generated...
 
  • #13
rude man explained it in his posts above very well in my opinion. I don't know if there is anything I can add to any of it that will add to the information.

rude man, could you explain what the problem is looking for in Part 3?
The problem states, "Simulate open loop control with error in x and y, x(k+1) ← f(x(k),u(k)) + εk"

I interpret this as finding the difference between the actual position given by the picture and the simulated position given by the integration from Part 1. However, I don't have the actual position as that is what I thought we were trying to simulate in Part 1?
 
  • #14
logan233 said:
Okay this all makes perfect sense.

I now have clear plots of x_dot vs. t and y_dot vs. t that describe the x and y direction velocities. My problem is now calculating the integrals of these functions.

Integrating [itex]\dot{x}[/itex] = Vcos(θ0sin(πt/14)) (as well as the y_dot equation) is proving to be quite difficult. I first tried to do the integration by hand, but integration by parts and substitution don't work. I then tried to integrate using a Simulink simulation where I simply read the x_dot and y_dot arrays from the MATLAB work space and fed them into a continuous integrator (1/s), however this doesn't appear to be producing the correct plots. Do you have any method you would recommend to integrate these equations?

Thanks.

I'm sorry I came up with an example for θ(t) for which x' and y' are difficult to integrate. Have you tried Wolfram Alpha? You'd have to pick a value for θ0, like maybe θ0 = 30 deg = π/6.

Don't waste time figuring out how to integrate. Either use tables, or Wolfram or similar, or find another function!

Come up with a different θ(t) that also starts at zero at t = 0, peaks at t = 7 and gets back to zero at t = 14. How about a couple of ramps up & down:
θ(t) = θ0(t/7), 0 < t < 7, θ(t) = θ0(14 - t)/7, 7 < t < 14?
 
  • Like
Likes 1 person
  • #15
logan233 said:
rude man, could you explain what the problem is looking for in Part 3?
The problem states, "Simulate open loop control with error in x and y, x(k+1) ← f(x(k),u(k)) + εk"

I interpret this as finding the difference between the actual position given by the picture and the simulated position given by the integration from Part 1. However, I don't have the actual position as that is what I thought we were trying to simulate in Part 1?

This I have to think about myself! Will try to help later.
 
  • #16
Second thoughts: I just remembered, you're doing a discrete-time simulation. So you will do the integration by rectangular or (better) trapezoidal integration, as you said you already did. So you don't have to try to come up with a closed-form integral. Excel can easily handle functons like sin[cos(x)] etc.
 
  • #17
rude man said:
Second thoughts: I just remembered, you're doing a discrete-time simulation. So you will do the integration by rectangular or (better) trapezoidal integration, as you said you already did. So you don't have to try to come up with a closed-form integral. Excel can easily handle functons like sin[cos(x)] etc.

Yes. I spent a good amount of time trying to do it on MATLAB/Simulink first, but when I tried it on Excel it was much easier to come up with the integral.
 
  • #18
in the second question.. from what i understood, should we change the value of u(t) after every second? right now it is a square wave for a single lane change.. if we have to keep it constant for a second, does it mean we use a periodic square wave?? i hope u can understand what i mean...
 
  • #19
libran06 said:
in the second question.. from what i understood, should we change the value of u(t) after every second? right now it is a square wave for a single lane change.. if we have to keep it constant for a second, does it mean we use a periodic square wave?? i hope u can understand what i mean...

A square wave for u(t) would be good:
u(t) = k, 0 < t < 7
u(t) = -k, 7 < t < 14.

This in fact would give you the ramp-up/ramp-down for theta I suggested in post 16.
 

Related to Open Loop Transfer Function from Differential Equations

1. What is an open loop transfer function?

An open loop transfer function is a mathematical representation of the relationship between the input and output of a system, without any feedback. It is derived from the differential equations that describe the system's behavior.

2. How is an open loop transfer function calculated?

The open loop transfer function can be calculated by taking the Laplace transform of the system's differential equations and solving for the output in terms of the input. This results in a rational function with the input and output as variables.

3. What is the significance of an open loop transfer function?

The open loop transfer function provides important information about a system's behavior, such as its stability, response to different inputs, and its frequency response. It also serves as a starting point for designing control systems.

4. Can the open loop transfer function be used to predict a system's behavior?

Yes, the open loop transfer function can be used to predict a system's behavior, such as its response to different inputs and its stability. However, it does not take into account any feedback and external disturbances, so it may not accurately represent the actual system behavior.

5. How is the open loop transfer function different from the closed loop transfer function?

The open loop transfer function represents the system without any feedback, while the closed loop transfer function takes into account the feedback and external disturbances. This means that the closed loop transfer function provides a more accurate representation of the actual system behavior.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
448
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
696
  • Engineering and Comp Sci Homework Help
Replies
16
Views
1K
Replies
23
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
Back
Top