Inputting a time varying equation into system in simulink
Ältere Kommentare anzeigen
I am unsure of how to input a time varying equation into my system in simulink.
For example I want to input the function tau(t) = 0t for all t.
This gives me the option to change to a different time varying function instead of setting it to constant 0. However, I am unsure of how to do this because if i set my tau variable in workspace to 0, and try to input from workspace into my system it gives me an error message saying it must be a 2D matrix to account for the time values.
However, I do not know how to make my tau function into a matrix. I thought of using timeout variable however my simulink system does not run so I cannot use that variable.
Any help is appreciated as I am an absolute beginner when it comes to Simulink.
2 Kommentare
Sam Chak
am 4 Dez. 2022
Do you want to insert the function tau(t), or to solve an implicit function tau(t) = 0 for t?
Reed Smith
am 4 Dez. 2022
Akzeptierte Antwort
Weitere Antworten (1)
Sara Nadeau
am 5 Dez. 2022
0 Stimmen
My question is whether the function tau is actually part of the system you are trying to model or whether it's just that the result of the function tau represents the input to the system you are trying to model. I am not sure how to interpret wanting to "use the function tau(t) as input for my system". I can help you use the result or output from tau(t) as input for your system, though.
If you're just using tau to generate the input signal you need for your system, I have some additional questions so I can try to help you figure out how to load the data:
- It looks like you are passing a time value to tau to generate the data you're trying to load. Do you have access to this time data to use in constructing the input signal? For most input loading formats, you do need to provide the time data.
- Are these values evenly spaced in time? Are you using a uniform sample rate or step size to generate the data? If not, you must provide time values to accurately depict the input data.
This page provides simple code examples to create data in each format the From Workspace block supports: Load Data Using the From Workspace Block. These formats are also supported by other loading blocks, including root-level Inport blocks.
4 Kommentare
Reed Smith
am 6 Dez. 2022
I see...
is actually the Input Torque signal to the Inverted Pendulum.
It is not given for free. It is something to be "designed" so that the Pendulum bob maintains at the upward position.
Can you show the differential equation (also known as Equations of Motion) of the Inverted Pendulum?
Does it look like this
or this
Reed Smith
am 7 Dez. 2022
Sam Chak
am 7 Dez. 2022
You're welcome @Reed Smith. A few design options for tau,
are suggested in my edited Answer above. Select one of the tau equations and construct it using basic blocks in Simulink, like you did above.
If you find the tau equations and MATLAB code helpful, please consider accepting ✔ and voting 👍 the Answer. Thanks a bunch! 🙏
Kategorien
Mehr zu Programming finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



