How to give a step input in Matlab?

In summary, the conversation discusses a state space equation with a term called theta double dot that has a positive step for 0.136 milliseconds and a negative step for the next 0.136 milliseconds, with a value of 0 at all other times. The expected outcome is a graph with a nature similar to an oscilloscope display. The poster is using Matlab ODE45 to solve the equation and is seeking help with defining the acceleration function. They also mention the values of Omega, Zeta, Gamma(i) divided by M(i), and theta double dot for different intervals. They have included a code and a picture for reference.
  • #1
Ben9622111222
31
0
Hello,

I have a state space equation at hand.. This attached with this...
upload_2015-9-25_7-50-55.png

Now the term (theta double dot) is a positive step for 0,136 milli seconds and negative step for next 0,136 millisecond and 0 at all other times.
So that when I simulate I will get a graph as below:
upload_2015-9-25_7-53-54.png

This is the nature of the graph I am expecting.

Iam using Matlab ODE45 to solve this. It is pretty easy I think, but I can't figure out how to give this acceleration function.

I hope the question is clear. The values are

Omega = 219,
Zeta = 0,03
Gamma(i) divided by M(i)=0,01
theta double dot = -63 and +63 in the above said intervals respectively.
 

Attachments

  • upload_2015-9-25_7-59-11.png
    upload_2015-9-25_7-59-11.png
    144.2 KB · Views: 424
Physics news on Phys.org
  • #2
Posting code would be more helpful than that picture :smile:

The value of the independent variable (t in your case) is passed to the user-defined function calculating the derivatives. You can easily calculate the value of ##\ddot{\theta}## in that function using if's based on the value of t.
 
  • #3
The code I used and the results are attached here. Obviously its wrong. The expected nature of the curve is like the one shown in the first post( the oscilloscope display). Please help if anyone knows.
matlab code.JPG
command line.JPG
matlab graph.JPG
 

1. How do I give a step input in Matlab?

To give a step input in Matlab, you can use the step function. This function takes in a transfer function or state space model as an input and plots the step response.

2. What is the syntax for the step function in Matlab?

The syntax for the step function in Matlab is: step(sys), where sys is the transfer function or state space model.

3. Can I customize the step input in Matlab?

Yes, you can customize the step input in Matlab by specifying additional parameters in the step function. These parameters include the time range, number of points, and plot style.

4. How can I plot the step response in Matlab?

To plot the step response in Matlab, you can use the step function and assign the output to a variable. Then, you can use the plot function to plot the response.

5. Is there a way to simulate a step input in Matlab?

Yes, you can simulate a step input in Matlab by creating a time vector and using the lsim function to simulate the response. This function takes in the system model, input signal, and time vector as inputs.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
5K
  • Differential Equations
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Advanced Physics Homework Help
Replies
6
Views
1K
  • STEM Academic Advising
Replies
13
Views
2K
Replies
2
Views
2K
Back
Top