No video

Matlab ode45 Tutorial Part 2C: A Matrix Method (Faster)

  Рет қаралды 11,037

Scholastic Samaritan

Scholastic Samaritan

Күн бұрын

I finally got around to finishing the all the "subsections" of Part 2 of this tutorial. I didn't originally intend to make this video, but I was encouraged to do so after being asked about a faster way to put equations in state space form. This video shows an easy way to take physical, linear MDOF systems and put them in state space format using matrix equations. Be warned that in addition to requiring a linear system, this method assumes that the mass matrix is invertible. This method is not restricted to physical systems, but may be applied to any linear system of 2nd order ordinary differential equations (where the 2nd-order derivative matrix is invertible). Hope this helps!
As a warning to ME students attending UMCP and submitting ode45 assignments to Professor Nguyen: Don't think he won't expect you to understand and explain how this process works if you use it. If you use this on any of his assignments, I strongly recommend studying the derivation for this state space set-up.
Textbook:
Vibrations, Second Edition by Balakumar Balachandran and Edward B. Magrab
I want to give my sincerest thanks to the legendary Professor Vincent Nguyen at the University of Maryland, College Park. Without his help, I would never be able to understand how to use Matlab's ode solver like I do today.

Пікірлер: 29
@user-kl1xv8in2q
@user-kl1xv8in2q 3 жыл бұрын
YOU ARE MASTER. YOUR LESSON IS EXACTLY WHAT I NEED. THANK YOU SO MUCH!!
@EdgeSlice
@EdgeSlice 4 жыл бұрын
This was a very good video. It was exactly what I was looking for!
@srinivasanananth574
@srinivasanananth574 4 жыл бұрын
It is fine to understand how the matrix form of the given coupled system equations is obtained. But how matlab coding for this matrix equation will be different from the code for state space form is not clearly captured in the descriptions at hand_vs_matrix file. It will be better if the coding of this m file is scrolled slowly for better understanding.
@nicolasdias6154
@nicolasdias6154 4 жыл бұрын
Man, you are awesome !!! Great work !
@pirispistopa
@pirispistopa 4 жыл бұрын
hi there, I would like to know how you can solve your ODE if the forces also depend on the state values? thanks for the videos
@akshayram2944
@akshayram2944 4 жыл бұрын
Thanks for this video sir, If we have a non linearity in the system then how should i consider my function? Whether the Ode45 solver updates the value for every time interval?
@sonlehathanh5716
@sonlehathanh5716 2 жыл бұрын
Hi man, please let me know how to compute x''. Extract from Sdot={x',x''}. Sorry my English is not really good if you cant catch my mean.
@funtimes836
@funtimes836 8 ай бұрын
Is it possible to have your email to ask a few questions? or If I can have the code to understand things better
@mathunt1130
@mathunt1130 Жыл бұрын
It's better if you do a beamer document and then talk using that.
@deepa7433
@deepa7433 6 жыл бұрын
Hi, Many thanks for the wonderful tutorial. Are there tutorials for non-linear systems.For instance, I'm solving a non-linear system X' = F(X) using the function handle with ode45. X' and F(X) are column vectors. How can we solve something like X' = F(X) + B*X ? I am facing difficulty in using the function handle to solve this system. Any suggestions or references?
@pedrocalorio1655
@pedrocalorio1655 3 жыл бұрын
This method only works for linear systems? i.e., the matrices M, C and K MUST BE CONSTANTS right?
@zeyadsameh7588
@zeyadsameh7588 5 жыл бұрын
Do I have to insert all the constants in the function itself? So for example in the K matrix I have a lot of equations calculating each term in the matrix, would have to include all those equations inside the function? I followed the second method in the video (Practice2c) and I don't get neither errors nor do I get a plot. I only get a warning stating that the first function may be unused. Thanks in advance and for the video!
@eduardomoreira7624
@eduardomoreira7624 4 ай бұрын
you might have to call the values and plot them or you might have to call the function itself in the command window. I think I ran into a similar problem
@milannayek4911
@milannayek4911 6 жыл бұрын
Thank you very much for the video which I am looking for couple of month. I generally use lsim and ss command to solve state space problem. May I like to ask you can ODE45 holds good for system of very low to very high frequency. In my problem I have found eigenfrequencies are ranging from 3Hz to 16khZ. which gives wrong time responses, the high mode frequncy are accumulating when I increase degree of freedom. How to deal with that?
@TaterBot1000
@TaterBot1000 6 жыл бұрын
Well before I say anything, I want to ask how you're handling your system. MDOF systems can display rather unpredictable responses, especially as the system gets more complicated. If you're looking at particular modes where the masses respond at particular frequencies, you'll often have to force the initial conditions to agree with the modes you calculated. Otherwise, there's no guarantee that the response will match the eigenfrequencies. Are you removing forcing functions and changing the initial conditions to match the modes? I'm sure ode45 generally returns good responses. I've never tested high frequencies. But if your tolerances are good, then you should be able to get an accurate response. The solver shouldn't face problems at low frequencies. Worse case scenario: You can test another odeXY solver (just google Matlab numerical ode solver, and you should find the site where they list the different types). Just don't use ode23. Haha.
@nikolalisjak7734
@nikolalisjak7734 5 жыл бұрын
Could I do the operation "-inv[M]*([K]+[H])" in this way: "-M\([K]+[H])"?
@gauthierngandukalala7892
@gauthierngandukalala7892 4 жыл бұрын
Thanks bcp for this video, I would like to know How would you write the code when the stiffness matrix K(t) is time-varying?
@aloi5898
@aloi5898 4 жыл бұрын
I also have the same problem, did you find the solution??
@daniarevalo9880
@daniarevalo9880 6 жыл бұрын
Hello, very helpful tutorial! I was thinking how can I add a feedback control input to an ODE system...I designed a non linear control for a mechanical system, but this control input is dependent of the states values through some intertia matrix parameters. To be honest I'm kind of lost there.
@TaterBot1000
@TaterBot1000 6 жыл бұрын
Hmmm... Could you give me some more details on the problem and equations you're working with?
@daniarevalo9880
@daniarevalo9880 6 жыл бұрын
Scholastic Samaritan okay, let's see... I have the model in matrix form and my control law its something like this: ctrl=[-k*sign(s)-c1*x4-c2*x5-c3*x6]*(1/b), where the x Terms are State values of the system, s=c1*x1+c2*x2+c3*x3+...+x6 and b its a term compounded by components of the inverse inertia matrix of the system which means it is also dependent of the State values. My model is arranged like the one in this example but I don't know how to apply this control to my system. In your example, your input f(x) is a random function, in my case is a controller.
@TaterBot1000
@TaterBot1000 6 жыл бұрын
Okay. So to clarify a few things. 1) The system itself is linear/linearized, right? Only the controller input is nonlinear? I'm assuming this since you obtained a matrix form for the system. 2) If the system is linear, then the inertia matrix should only be composed of known terms. The state variables would be collected in their own vector, external to the inertia matrix. So if b is related to the mass matrix, it should still be safe to use as long as it isn't intertwined with the state vector. 3) Is b just a scalar that relates to the mass matrix? Or is b a matrix? 4) Also, about that control input. I'm assuming it's just a single input? We aren't seeing multiple different kinds of inputs into the system? (Another way of asking that would be "Does the forcing vector only have 1 nonzero term?)
@daniarevalo9880
@daniarevalo9880 6 жыл бұрын
No, it is a nonlinear system and a nonlinear control input. The system has 3 inputs, one is the input control and the other two can be zero, in that sense the force vector has only 1 nonzero term. b is scalar. By thr way, I´m receiving this message all the time: Warning: Failure at t=3.279749e+01. Unable to meet integration tolerances... I have simulated the whole system and controller in simulink with no problem, so I know the system works, but when I try to simulate with the same initial condition on the matlab program the simulation stops.
@daniarevalo9880
@daniarevalo9880 6 жыл бұрын
I'm trying to run the system in a matlab script because I want to create "a nested for loop" to calculate the gains for another controller, I don't know if there is a way to run a "for loop" in simulink.
@yt_guaguagua5198
@yt_guaguagua5198 2 жыл бұрын
May I ask some questions by email?
@a.n.h3734
@a.n.h3734 5 жыл бұрын
I have question , I want to ask with e-mail
Matlab ode45 Tutorial Part 3: Events Function Intro
26:33
Scholastic Samaritan
Рет қаралды 7 М.
Matlab ode45 (and Similar) Tutorial Part 1: The Basics
48:55
Scholastic Samaritan
Рет қаралды 49 М.
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 22 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 19 МЛН
The deeper meaning of matrix transpose
25:41
Mathemaniac
Рет қаралды 364 М.
Matlab ode45 Tutorial Part 2B: Another 2D Example
28:29
Scholastic Samaritan
Рет қаралды 8 М.
ME 340: Example, Solving ODEs using MATLAB's ode45 command
7:15
CPPMechEngTutorials
Рет қаралды 263 М.
MATLAB's ode45 Solver - Single Degree-of-Freedom Oscillator
9:33
Jousef Murad | Deep Dive
Рет қаралды 23 М.
Кто убил СССР: называем поименно
54:09
НО.Медиа из России
Рет қаралды 198 М.
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 22 МЛН