Are the full models available for vehicle dynamic blocks?

I'm trying to use the blocks in the Vehicle Dynamics Blockset, but there's not quite enough in the documentation for me to understand the full model being used for various blocks.
For example, in the Vehicle Body 3 DOF block, I'm trying to derive complete equations of motion from the documentation, but the documentation only seems to include information on the forces and some accelerations.
It would be very nice if there was clear information available describing how the vehicle's position and orientation changes with each time step, or how yaw rate is calculated. I tried looking under the mask of the block to see if this would provide any more information, but it seems like the underlying code is protected.
In short, I'm looking for a clearer understanding of how the outputs are calculated from the inputs, but the documentation doesn't really organize the equations this way, and it seems like some helpful information is left out.
Is there any more information available for these models?

11 Comments

The Theory section of the doc page looks like it has all of the equations that the block implements. What is missing?
For this particular block, I think most helpful would be equations for
The doc page has the equation: psidot = r (actually, it says r = psidot, which is the same thing).
I would think that xdot and ydot are found by integrating xddot and yddot starting from the user-specified initial conditions.
That's fair. And I guess since is given then I would integrate that to get .
Seems I might have all I need for this block, so can resolve this question. I felt like I was missing more information when trying to use some of the more advanced vehicle models, but I'll look more into those and ask a more specific question if I come across anything.
@Paul I'd assume there's no way for me to access the underlying P-code, is that correct?
Yes, as far as I know. I don't have access to that block at present. Was not aware that any Simulink blocks are implemented in p-code.
This is what the inside of the block looks like. The big vehicle model block is a function block that is primarily implemented with P-code. Seems to contradict the claim that the models for this blockset are "open".
Your help does resolve my issue with the 3 DOF block, but my main question about accessing the underlying full models still stands.
After thinking about it a bit more, I'm not actually sure that there's enough documentation for this block. The Info output contains the inertial frame position, but I don't see any documentation explaining how that is obtained.
It's not just a simple integral of acceleration and velocity, as we have to account for heading. Or more specifically, we have to account for change in heading when integrating to calculate delta position in the inertial frame. Would be very nice to have clear equations describing how that is done.
The block outputs xdot and ydot are the components of the inertial velocity resolved in body-fixed coordinates. Hence, the inertial velocity resolved in inertial coordinates would be
v_i = [cos(psi) , -sin(psi);sin(psi), cos(psi)]*[xdot;ydot];
Then, the inertial position would be found by integrating v_i starting from the specified initial conditions.
When I did that, got the exact same output as the position in the inertial frame (which I gather is considered to be the earth-fixed frame in this context) contained in the Info bus (InertFrm->CG-Disp->X(Y) )
Maybe the reference cited at the bottom of the page would be of use.
If you think the doc page is lacking, click one of the rating stars at the bottom of the page and then you'll get a pop-up box where you can enter comments.
Disclaimer: This thread is my very first exposure to the Vehicle Dynamics Blockset.
I keep coming across reasons why it would be nice if the models were fully open as advertised. Something is going on with the force calculations inside the P-code block that are causing the results to be slightly different than what the equations in the documentation yield. Is there really no way to access this?
I understand that you are noticing discrepancies between the results and the documented calculations. Unfortunately, there is no way of accessing the code within the P-code block. However, if you suspect there might be an error in the calculations, I recommend reaching out to MathWorks Technical support. You can raise a request using the following link: https://in.mathworks.com/support/contact_us.html
Hope this helps!

Sign in to comment.

Answers (0)

Categories

Find more on Programming in Help Center and File Exchange

Products

Release

R2024b

Asked:

on 21 Dec 2024

Commented:

on 7 Jan 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!