PDA

View Full Version : Cornering Force distribution



Silente
12-22-2009, 12:03 PM
I know this topic may be already discussed in the past, but i ma not able to find the answer i am looking for on the forum.

I am doing a basic vehicle dynamic simulation based on tire data.

I am struggling to find the solution on how to determine lateral forces on each wheel.

I know vertical load on each contact patch, i know overall lateral forces of each axle, but how to determine how much of this force is taken by each of the two wheels? And so how to calculate also SA of each wheel?

Thx

BillCobb
12-22-2009, 03:31 PM
The sum of the front and rear forces is the sideslip accelaration (F/M) and the difference is the yaw acceleration (M/Izz). If you are running a model with a roll degree of freedom, then the roll moments must then be accounted for, front and rear load transfer calclated, and a delta front and delta rear load added and subtracted from the static wheel weights. You really shouldn't ignore the tire MZ outputs, either. Therefore the 'problem' is to iterate for front and rear slip angles to produce the required resultant force AND moment balance. Iteration is not necessary if you are running a purely linear model. Nonlinear tires require the iterative technique.

A vehicle does not react to steer angles in the sense of going where the wheel vectors are 'pointed'. You perturb the vehicle's balance with an input moment, and the chassis and tires at both axles react to this moment with some forces and moments to counteract it. Its a simplification to drive a vehicle dynamics model with a steer angle input, but the vehicle does not go to where its steered. It goes to where ever in Hell it has to to counterbalance the perturbation. I should know, I live about 20 miles from Hell, Michigan...

Silente
12-22-2009, 04:14 PM
BillCobb thanks for your reply.

I am looking only to steady state cornering now, with the only centrifugal force acting (no acceleration or braking).

I have already calculated wheels vertical load because of wheight transfer. So now, as i said, i know normal load on each tire and the lateral force of each axle, to have a force and moments balace (yaw acceleration = 0 ----> Steady state).

Of course i have also tire data, so for a given vertical load i know how to correlate tire forces and slip angles.

But i have anyway 4 unknonws (the 4 cornering forces) and only 2 equations (Force equilibrium ad moments equilibrium). So i think i have to make some assumptions to have each tire cornering force.

I tryed considering that every tire had to take a force proportional to its vertical load and to lateral accelereation of the whole car..but it doesn's seems to work...

Any advice?

Thanks

oz_olly
12-22-2009, 04:33 PM
If you know the corner radius through Ay=V^2/r then you can work out the slip angles by choosing a cg slip angle (also known as Beta). If you set a steering angle, delta then you have everything you need to know, go ahead and sum the forces and moments. The way I have done it is to iterate on Beta for a given lateral acceleration to find the trimmed condition N=0 or moment about the cg equals zero. My simulation is currently very simple. I am hoping to add roll stiffness, steering effects (ackerman, castor, kpi) and eventually tractive force at the driven wheels to balance the slip angle drag.

When I was working on this I thought I was doing something with a slight sense of originality. Having looked around the forum there are many people who have made such a simulation. The thread on "Yaw Moment" covers the topic pretty well. Also, read the chapter in Millikens Race Car Vehicle Dynamics on Milliken Moment Method or MMM. They did what you are trying to do about 30 years ago. The chapter is very good for interpreting the information your sim should create.

Now I just have to work out how to turn the work I have done into a research masters. It is going to be kind of hard seeing as I haven't done anything original.

Cheers

Olly

scott_rfr
12-22-2009, 04:35 PM
Silente the best way to do it if you have tire data is an iteration routine. You know normal load on each tire, so to compute that tire force you also need to know slip angle. So run through a range of steering and sideslip values, compute Fy and Mz and wait the the solution converges. Convergence can be when sum of moments is equal to zero.

Also just because your doing a steady-state sim does not mean you have to have yaw moment = zero. See OptimumG CVD. What you can do is iterate until the Ay from the tires is equal to the Ay input.

Scott

Silente
12-23-2009, 06:00 AM
Oz_olly,
thanks for your help.

I read that chapter and now i understand a little bit better what you mean.

But i have still some doubts.

When i know corner radius i can work out ackermann steering quite easily, but how i can chose Beta?

You said to iterate on it till you have a Trimmed condition, but on Milliken all this stuff is referred to a bycicle model. What about the difference between the two slip angles?

Zac
12-23-2009, 06:12 AM
Are the right and left slip angles independent?

Silente
12-23-2009, 06:25 AM
i would say that they are correlated by toe, steering geometry (at the front) but also by track and corner radius..

Silente
12-23-2009, 08:12 AM
i am trying to fix the problem.

another question...

the two conditions are that the sum of all the Fy is equal to Centrigufal force and that N=0.

To obtain this we must work on Beta and on delta.

Then we can obtain SA and then forces on tires.

Oz_olly you said to chose a Delta. This means you don't make it to change during your iterations and keep it fixed?

BillCobb
12-23-2009, 10:59 AM
With a fixed radius (let's say 100m), you will be iterating a delta. Keep in mind that with the same tire/rim/pressure combination on the front and rear axle and a 45/55 front weight distribution and without a front biased weight transfer distribution, the vehicle will be oversteering and there will be no convergence: The car will be unstable and spin out... The inclusion of the Mzs on the rigid body will help this a bit, but not enough to stabilize the vehicle.

Silente
12-23-2009, 11:24 AM
thanks for the advice about wheight distribution and tire.

I am now trying to make write the iteration routine.

Did you using a specific numerical method to do so?

Which language did you use to write your software?

exFSAE
12-23-2009, 11:27 AM
Pick a radius / lateral acceleration.

Ay = (a constant)
N = 0 (or whatever value you'd like)

Two equations, two unknowns (delta, beta). Easy to solve in Matlab. Bet you could even do it in Excel.

Best to start at infinite radius / 0 lat acc and creep up on limit behavior so you don't run into the non-convergence Bill mentions.

oz_olly
12-23-2009, 03:04 PM
I have been working on my model overnight. Just fixing up things like variable names and sign convention. I still have some work to do though at it's most simple stage as I know it's not working properly. The concept of what I have to do is very easy to understand, I just suck at programming things because I am a very visual person.

I am using matlab to write my model, this allows me to use the MRA Tyre Model as a function. After setting all the chassis parameters like wheel base, mass, cg position, tracks etc I set an array of longitudinal velocities and a corner radius. From this I can determine the lateral acceleration Ay.

When I choose a Beta it allows me to geometrically locate the turn centre, in turn giving the slip angles on the rear wheels. Then if I choose a steering angle delta I have the slip angles on the front wheels. For the given Beta, I iterate through delta to find the angle where the sum of the lateral forces coming from the tyres is equal (within a reasonable accuracy) to the inertial lateral acceleration force m*Ay. I then sum the moments including the Mz's about the CG. If it doesn't equal zero I use a new Beta and go again. My model iterates using a bisection method. It is not very computationally efficient but it usually finds the correct delta for a given beta in about 20 iterations.

exFSAE
12-23-2009, 07:05 PM
Originally posted by oz_olly:
I have been working on my model overnight. Just fixing up things like variable names and sign convention. I still have some work to do though at it's most simple stage as I know it's not working properly. The concept of what I have to do is very easy to understand, I just suck at programming things because I am a very visual person.

I am using matlab to write my model, this allows me to use the MRA Tyre Model as a function. After setting all the chassis parameters like wheel base, mass, cg position, tracks etc I set an array of longitudinal velocities and a corner radius. From this I can determine the lateral acceleration Ay.

When I choose a Beta it allows me to geometrically locate the turn centre, in turn giving the slip angles on the rear wheels. Then if I choose a steering angle delta I have the slip angles on the front wheels. For the given Beta, I iterate through delta to find the angle where the sum of the lateral forces coming from the tyres is equal (within a reasonable accuracy) to the inertial lateral acceleration force m*Ay. I then sum the moments including the Mz's about the CG. If it doesn't equal zero I use a new Beta and go again. My model iterates using a bisection method. It is not very computationally efficient but it usually finds the correct delta for a given beta in about 20 iterations.

Why not just make an objective function and use Matlab's built in solvers? Then you can solve delta and beta simultaneously without having to go one beta value at a time.

oz_olly
12-23-2009, 07:39 PM
Hey exFSAE

Could you please explain a little bit more? My Matlab skills are very basic. What is an objective function? I knew my way of doing it was very poor in terms of efficiency so I am keen to improve it.

Cheers

Olly

Zac
12-23-2009, 08:21 PM
I'd recommend looking at the help file for the optimization toolbox. it will explain everything pretty well and give some good examples. but basically, the optimization toolbox is just a collection of some built in functions that do the same thing you're doing now. they're just faster to setup, faster to run, and likely more reliable than anything you can come-up with on your own.

the objective function is just some user defined function that evaluates the quality of some model fit, in this case the difference between desired and calculated acceleration. the objective function will be coupled with some solver that will take in an initial guess for some parameters, and iterate on them until it finds the "best fit."

Hector
12-23-2009, 08:50 PM
List of Matlab Optimization Functions (http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/bqnk0r0.html)

Personally, I'd do it with fmincon (http://www.mathworks.com/access/helpdesk/help/toolbox/optim/ug/fmincon.html)

Here's how:

First off, as you read the help file ignore the stuff about A, b, Aeq, beq, unless you need them that is. It doesn't sound like you should.

Secondly, created a Matlab function file (which different from a script file) that works as



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
absSumMoments = TyreForce(x0)
%beta = x0(1)
%delta = x0(2)
%more stuff in here, solve for moments, etc
absSumMoments = abs(sum(moments))
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



This function should take a guess values x0 = [betaguess, deltaguess] and should output the absolute value of the sum of moments. Since the lowest value of an absolute function is zero (all other answers being positive), the optimizer should find where the function is zero. Ta-da!

Lastly, we make a script file which calls our optimization function.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
lb=[betalb, deltalb] %Lower bounds it's allowed to guess
ub=[betaub, deltaub] %Highest values it can guess
x0 = [betaguess, deltaguess] %Where it starts looking
%Obviously, replace the values with your actual bounds and guesses

answers = fmincon(@TyreForce, x0,[ ],[ ],[ ],[ ],lb,ub)
%This is what actually finds the minimum of your function TyreForce
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Your solution will show up as
answers = [beta, delta]

One thing to keep in mind: with base settings fmincon isn't always acurate enough. In preparing this post, I used a function whose known minimum is at
x0=[0,0,10]

It gave me a solution of

answer =[0.029, 0.029, 10]

If you feel that you need better accuracy, add this line to the top of your script

newoptions = optimset('TolFun', smallnumber); %smallnumber is something very small, I think base is 1e-4

And change the fmincon line to

answers = fmincon(@TyreForce, x0,[ ],[ ],[ ],[ ],lb,ub,[ ],newoptions)

You can play around with smallnumber until you feel like you have the accuracy you need.

Silente
12-25-2009, 03:36 AM
a little bit out of topic...

I have seen some open source software which claims to be real alternatives to matlab.
One of them, Octave i think, seems to use the same language.

Since i had an old version of matlab which doesn't work with windows vista, i was thinking about one of this open source software..

What do you think about them?
Does anybody knows if the language and the existent functions are the same?

exFSAE
12-25-2009, 09:51 AM
I'm sure you could use Octave. Even if it doesn't have the built-in minimization functions of Matlab there are alternate approaches you could take.

Could take a Milliken Moment Method approach and make a matrix of combinations of Delta and Beta and solve for Ay and N at each point. This then maps out all trimmed and untrimmed solutions and gives good insight to handling (read up on it in RCVD). Chances are you won't nail the N = 0 points exactly. Depending on how accurate you want to get.. after you populate the initial matrix (which will probably be somewhat computationally intensive) you could make even use something like a 2d (maybe even 1d) Savitzky-Golay ish algorithm to find a pretty good guess for the 0 points.

I'm sure you could do this in Excel as well, but my VBA experience is very limited.

Silente
12-26-2009, 05:33 AM
I finally get Matlab.

I have to say, my knowledge about it is nearly 0, i am starting from the very beginning.

I usually use Excel for my calcs, but since i have to solve the problem of Delta and beta it's a good chance to learn matlab as well.

So i am going to ask very basic things, but maybe you can help me anyway.

I am trying to learn on how to create my sim. I would like to create something where you can specify every time your car parameters (Wheel base, CG, Ride height, Springs, ARBs, Tracks, Tires etc) and then say to matlab to do al the calcs you need.

After that, starting from tires data, i would like to make it solving Beta and Delta problem for a given Ay, or to iterarate also on it to find car grip limit.

For now, only lateral force, then i will add alligning torque and Fx as well.

Till now i am working on the command window only but when i change a variable value from the workspace i have seen it doesn't refresh all the other things like in excel. I know this is not excel, but i am trying to understand how to makehim doing what i need.

Could you give some advice on how to learn to use matlab for my purposes? Maybe a specific tutorial, some examples...

I have seen the editor is a very useful tool as well. But till now i didn't understand yet when it's better to use it http://fsae.com/groupee_common/emoticons/icon_biggrin.gif

Or maybe only on advice on how you would do to obtain the results i am looking for..

Thanks.
I think i am learning a lot from this thread!

Hector
12-26-2009, 08:47 AM
What you'll need is to create a Matlab function. I'd link to the Matlab help page on functions, but links have to be approved on this forum and that typically takes a day or two. So, you can Google search everything I'm talking about.

Anyways, create a Matlab function and then at the top you can declare all these constants you were talking about (car weight, wheel size, etc). If you want to make it easier to get these variables inside other functions, consider defining them as global variables first (again, Google it to find out how).

I honestly don't know much about the tire data. My team has it but I've only seen the output graphs. I've never actually messed with the files themselves. However, I believe they come with Matlab functions that turn the testing results into forces based on Pacejka or the MRA model. If this is true (and someone correct me if I'm wrong) you can then call these tire functions from within your main function to get whatever you're looking for.

The Matlab plot function is super easy to use, too, if you haven't already. Make sure to Google "for loops in Matlab" too so that you know the syntax for those, you'll need them a bunch.

Lastly, if you ever need to know how a function works, simply type help and then the function name into the workspace. For example

help plot

gives me help on how the plot function works.

Best of luck learning Matlab. It really is a great tool for mechanical engineers; it takes all the hard work out of programming and allows you to import and work with real world data quickly.

Silente
12-26-2009, 03:17 PM
thank you very much for your help for now!

Hope to understand a little bit more trying to do things!

Silente
02-08-2010, 02:36 AM
again on this topic.

i found some time to work on matlab in these days but i stuck with the way on finding Beta and Delta.

I wrote a function that, starting from cars data and pacejka coefficients calculates vertical loads on each wheel first and then, starting from a value Beta=0 and Delta=0 calculates 4 tyre forces (with pac 96 equation).

from here it calculates two new variables value:

Ftyre=abs(sum of tyre forces - Centrifugal Force)
Mtyre=abs(moments from front tyres-moments from rear tyres)=N

Now i have to find the way to make the program to iterate on beta and delta till Ftyre and Mtyre are both 0.

But i cannot find how.

By the way, i have a fixed corner radius and a fixed lateral acceleration. So everything about the corner now is fixed.

First of all..Is the way i used correct in your opinion?

Any suggestion on the way to make this iterative calculation?

Then i tried to look for optimization functions (i tried to use als fmincon, as suggested by Hector) but didn't find anything apparently useful.

Any help would be appreciated. Thanks!

exFSAE
02-08-2010, 06:15 AM
fgoalattain may be the function you want..

BillCobb
02-08-2010, 01:48 PM
fminsearch

When you find the solution vector for the nth g-level, use it as the seed for the (n+1)th g-level. If you want entertainment, make a bar chart of the nth iteration solution and use the chart's object parameter values to update the chart (no need to redraw it, just update the dependent values). That way you can "watch" your 'car' perform its test and know the solution is believable. No way that I know to post an example plot here, but I can stuff one onto the TTC forum area if you want to see it...

An example there which does Pacejka fitting does the same thing. This builds confidence in your solution technique.

Also, avoid the use of ABS function in your objective function module. It slows down the solution. Just use the difference of the squares. No need for SQRT either... The answer will be the same... There are actually 2 iteration loops present in this type of simulation: 1st one finds front and rear slip angles, second one finds the steer angle. Keep this in mind because the final, practical and accurate vehicle dynamics model will have other slip and camber angle modifiers incorporated into it. Otherwise, its just a thesis, not an accurate predictor of vehicle dynamic behavior.

Silente
02-08-2010, 03:41 PM
First of all thanks for your help.

sorry, maybe i am missing something but there is still one thing i don't understand.

both the optimization functions BillCobb and ExFsae suggest can optimize only one function at a time, isn'it? Or i am not understanding something?

in my case i have to otpimize both forces equilibrium and N=0. So how to apply them?

Again, if i understood properly BillCobb you are suggesting to iterate also on lateral acceleration? so now the parameters became Beta, Delta and also ay...

I need some help!

I am sorry if i am asking basic things but i am just starting with matlab...

BillCobb
02-08-2010, 05:05 PM
You would send out your fminsearch call with extra parameters being the requested g level, wheelbase, speed, front and rear track, etc. And, the parameters to be iterated are front slip angle, rear slip angle and delta or steer angle. You can also use global paramters to transmit the vehicle info to your function. (That's what I do actually). Give fminsearch the starting seed vector, maybe some upper and lower bound limits, and cross your fingers. Your function will need to call the Pacejka routine (or some other Matlab reachable interogation for tire forces and moments). Because your function is essential a 'vehicle' frozen in time, you can adapt it afterwards to add mass and inertial terms and then run it under Simulink. Now the independent variable will be steer and the response will be the angles and accelerations which you integrate to get yaw velocity, sideslip, roll velocity, and roll angle.

Next you need a systems engineering procedure to follow (Step, Freq-Resp. Sine, Pulse, Const. Radius. etc.) so you can interpret the results in open loop Systems Engineering terminology. Nonlinear gain, bandwidth, response time, etc. I'm not and 'Understeer' fan because its misleading.

BTW: Its not necessary for all teams to do this, it only takes ONE to make the effort. If they get it right, they have a BIG advantage.

exFSAE
02-08-2010, 05:28 PM
Bill's mention that the vehicle is 'frozen in time' is key. Lock it down to the most basic parameters. And while I agree that yes, even this most basic form of vehicle simulation can yield a big competitive advantage, that does swing fairly broadly year to year based on who joins and leaves every year. Even some of this basic stuff is beyond some teams which are usually gauged as very competitive.

As for your question, Silente, yes.. you only work on one function at a time. But that's all you need.

Not going to give away too much of this, but [N,Fy] = f(delta,beta) is really all you need. You can "creep up" on the limit solution by doing this at progressively higher speeds with some really easy FOR loops and anonymous functions.

oz_olly
02-09-2010, 03:16 AM
Guys,

I am having an awful lot of trouble trying to understand the fminsearch function. I have a function that looks like [N Fy]=f(Delta,Beta). I am going nuts trying to understand the syntax of fminsearch as the example given in Matlab help is a function x only I can't extrapolate f(x) to f(x y). Is it possible for you to explain the syntax in the terms of my problem. I hope you don't see this as giving me a freeby because I believe I have done the hard work figuring out the model and I am asking for help with a computational tool, not for the answer.

I was previously using an interative bisection method that gave pretty good results but was computationally quite slow, hence I am very interested in getting fminsearch to work.
I built my model as a constant radius steady state test that looped for an array of tangential velocity from say 0.1g up to ~1.5g where the model would stop as it had reached the limit condition or a heavily laden wheel exceded Slip Angle=12deg.

This is part of my work for my masters thesis but damn Matlab is making me feel STUPID.

Cheers

Olly

SNasello
02-09-2010, 04:25 AM
I believe fminsearch takes a function, and a starting value for input to the function. If you look back one page there is a simple code example. Its for fmincon but i think the syntax should work.

If you create an array x0 = [delta, beta], and have your function such that you have [N, Fy] = f(x0) then you would just have fminsearch(f,x0) as your function call.

If you do this in your function you would have to either replace delta and beta by x0(1) and x0(2) or just add these lines:

delta = x0(1);
beta = x0(2);

exFSAE
02-09-2010, 04:44 AM
Originally posted by oz_olly:
Guys,

I am having an awful lot of trouble trying to understand the fminsearch function. I have a function that looks like [N Fy]=f(Delta,Beta). I am going nuts trying to understand the syntax of fminsearch as the example given in Matlab help is a function x only I can't extrapolate f(x) to f(x y). Is it possible for you to explain the syntax in the terms of my problem. I hope you don't see this as giving me a freeby because I believe I have done the hard work figuring out the model and I am asking for help with a computational tool, not for the answer.

I was previously using an interative bisection method that gave pretty good results but was computationally quite slow, hence I am very interested in getting fminsearch to work.
I built my model as a constant radius steady state test that looped for an array of tangential velocity from say 0.1g up to ~1.5g where the model would stop as it had reached the limit condition or a heavily laden wheel exceded Slip Angle=12deg.

This is part of my work for my masters thesis but damn Matlab is making me feel STUPID.

Cheers

Olly

Don't use fminsearch then. Try fgoalattain. And don't forget to use the 'GoalsExactAchieve' option.

Silente
02-09-2010, 10:55 AM
Still one thing i don't understand and, again, it's a matlab problem, not a dynamic one.

I wrote a function which has as input a lot of variables that i had already declared in the workspace (actually i saved a workspace with al the variables i need and their value).

Between them i have also Beta and Delta or x0=[Beta,Delta].

but in this way optimization fuctions like fminsearch should work? Because i am actually not able to make them running.

I have to write a function where the output is Fy and N but the input are only beta and delta or i can keep my function with a lot of inputs and also beta and delta?

Now i have something like this:

din(m,CGh,RChf,RChr,Front,Hf,Hr,SprF,SprR,MRF,MRR, ARBF,ARBR,MRarbF,MRarbR,Radf,Radr,TRf,TRr,TireStif F,TireStifR,UNmF,UNmR,ay,wb,R,PCY1,PDY1,PDY2,PDY3, PEY1,PEY2,PEY3,PEY4,PKY1,PKY2,PKY3,PHY1,PHY2,PHY3, PVY1,PVY2,PVY3,PVY4,FZ0,FZ,gamma,asf,x0)

But i suspect it is not the right way.

SNasello
02-09-2010, 11:14 AM
By the looks of it you have Packejka coefficients in there and everything. I suggest what you do is create multiple function files. If you are making the same calculation multiple times (like the lateral force on each tire) there are many constants. At least two of your tires will be the same (i hope).

At the very least start by making a function for the pacejka model (i made one each for lateral force, longitudinal force, self aligning moment and overturning moment). Each function takes Fz, slip ratio, slip angle and camber angle as inputs. You need to have slip ratio in your lateral force model only if you have the combined coefficients.

The rest of the variables, like your vehicle parameters, should be set as global variables. That way you can have one .m file that has your vehicle parameters in it, but the other function files will still use those variables.


in one file (the main program) you write:

global [variable name]
[variable name] = value;

in all functions or m files that us the same variable just write:

global [variable name]

for all variables at the beginning of the function and you will be set.

This way in your function that calculates N and Fy from beta and delta, which is the one you want to solve with fminsearch or another optimization function, it wont be changing all your other parameters.

Silente
02-09-2010, 02:54 PM
i tried like you said but i am still have the same problem.

every time a i run the optimization function, it says that "Input argument ".." is undefined".

I probably still don't understand how to use this otpimization functions, but i think i wrote a line exactly how it is explained in the help.

I know my problem is mostly i still am not able to use matlab properly, but i hope you can all help me anyway.

Now i proceeded writing a function for each tire Fy and then another one for [Fy,N].
This is the function i want to optimize, as you said, but since all pacejka equations are in tire functions, here i don't have delta and Beta as an input anymore.

Anyway i still stop before all of this could became a problem.

SNasello
02-09-2010, 04:25 PM
I think you misunderstood me. You should still have your calculation of each tire Fy in your function for [Fy,N]. You can call functions within functions.

This way when your optimization makes an iteration on delta and beta, it passes it to the function for [Fy,N] which should translate delta and beta into a front and rear slip angle, which you use to calculate Fy. And so the iteration goes until N=0.

Zac
02-09-2010, 04:29 PM
You might find it helpful to work through some of the simple examples and tutorials that can be found in the help file and on the web.

Adambomb
02-09-2010, 08:24 PM
Ahh, the joys of debugging Matlab. It is an art form in itself. Although I'd still take that over debugging C++ any day!

As for the "undefined input argument" error, off the top of my head sounds like a variable wasn't passed to or from different functions. Remember, if a variable is to be accessed in an external function, it must be passed to that function in the argument list in the function definition.

Silente
02-11-2010, 08:23 AM
One thing i still don't understand.

[Fy,N] must be obtained with a function with only Beta and Delta as inputs in order to be able to use these optimization functions or they can be function with more inputs and, between them also Beta and Delta (or x0)?

Because when i try to run optimization functions with multiple inputs functions they don't work...

SNasello
02-11-2010, 08:53 AM
I suggest you read through all of the documentation on the optimization toolbox in matlab. You may find your answer there.

exFSAE
02-11-2010, 10:21 AM
Ok. Let's say you have the function

[Fy,N] = f(delta,beta)... or more generally varargout = f(varargin). Matlab's job is to adjust those inputs to match the output you specify.. It doesn't make sense then to have CG height, track width, and all that stuff as inputs. You want those fixed. Otherwise you wouldn't be able to solve the thing. You have two unknowns with two equations.

Zac
02-11-2010, 01:24 PM
Originally posted by Silente:
One thing i still don't understand.

[Fy,N] must be obtained with a function with only Beta and Delta as inputs in order to be able to use these optimization functions or they can be function with more inputs and, between them also Beta and Delta (or x0)?

Because when i try to run optimization functions with multiple inputs functions they don't work...

Multiple input functions or multiple inputs?

most of the optimization functions are setup like fmincon:

x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options)

but you can pass additional inputs into the function after the options argument(you can also declare global variables)

so your function call would look something like:

x = fmincon(fun,x0,A,b,Aeq,beq,lb,ub,nonlcon,options,i nput1,input2)

where inputs1, etc. would be whatever additional parameters you would need for your calculations

fun, would be the objective function that you're trying to minimize

and x0 would be the inital guess for the parameters that you want matlab to change in order to minimize the objective function. you'll have to input all of your parameters as a single argument in the form of an array, ie. [beta,delta];

Bill posted a pretty good optimization example on the TTC website, I'd suggest you look at it. I know I always pick up a trick or two when I go through Bill's code.

BillCobb
02-11-2010, 09:31 PM
I've posted an example of a vehicle dynamics simulation in Matlab that runs through the nonlinear tire data and has a crude load transfer mechanism in it. It also has the aligning moments applied to all wheels. It is very easy to use it for other types of inputs (Step, Frequency Response, Sine, Pulse Steer, etc.) Its currently set up to run a closed loop constant speed constant radius test procedure (ISO-4138). Adding a roll degree of freedom and its coupling terms to the front and rear slip angle variables can be easily done. As an exercise for the Student(s), try removing the aligning moments and load transfer terms. You should also be adding the OVTM surface data to the roll moment equation when you add it. This runs for me under Matlab 7.1. Hope it works for the rest of you...

Cris
02-15-2010, 02:35 AM
I am pleased to say I have just finished making the technical side of a calculator that does all of this. It is free... I just want people to use it for perosnal satisfaction! Within next few weeks it will include good explanations of how the theory works, now it just does the maths. The source code is also online so you can work out how the maths has been done from there. Hope you like it. site is:

suspensioncalculator
c
o
m

Silente
07-09-2010, 09:17 AM
Hi.

I come back on this topic after a long time.

During last months i worked on my code when i had time. It now seems to work, but i am not sure about the results. I am actually using a different approach from the one you suggested here.

Since i was not able to make minimization functions to work properly, i finally used an Equation Solving function (Fsolve)

This allows me to work directly on a fucntion written like:

[F]=name(x0)

where F = [Fy-centrifugal force, moments]

Fsolve works on Beta and Delta till both the components of the vector F are zero.

I used this approach because when i tried to use minimization functions, they always minimized only moments term or force term, not both (i writed something like "TireForces-Centrifugal force" for forces and "FrontTiresMoments-RearTiresmoments" for moments, both with abs to find a minimum that is zero). I guess i probably didn't understand properly the way to work with minimization functions.

Anyway Fsolve seems to work quite fine but i have 2 problems:

1) you cannot give lower or upper boundaries;

2)i have some strange results and i am quite sure they are not connected to code writing mistakes (wrong equations or similar).

So i would like to ask your help on how to use minimization functions or on how to write my script in order to make them working for me.

Does anybody has interest to compare his results with mine?

Thanks!

df_fsmb
08-22-2011, 08:38 PM
Nice topic.

Non-matlab, full VD question: You are all talking about fixing delta and iterating beta (or vicecersa) until we get to N=0. Someone, at the beginning of the topic, mentioned situations when N does not need to be 0. Also, MMM diagrams are written out for all the other values of N, not only 0.

So, could it be that we change the criteria for the end of the iteration in order to get the non 0 values for N and thus the full MMM diagram?

Of course, then I am a little confuse if we are talking about steady state or not...