Using a changing variable within a while loop for a script
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I have created a script, 'Gear_Optimisation', That can use gear values tpo determine a veicles acceleration, velocity etc over a given distnace.
I know what to change the gear ratios and note the effect. I could do this manually but there are 10 billion combinations so could take a while.
Variable FD is a 3 row vector, Gear_1 5 row, Gear_2 19 Row and Gear_3 to Gear_6 44 row vectors.
Is there a way i can go through each value effectively?
Sorry if this seems a basic question or isn't possible
Thanks in advance
load('Gear_Ratios.mat')
Transmission_efficiency=0.92;
while
Final_Drive=FD;
First=Gear_1;
Second=Gear_2;
Third=Gear_3;
Fourth=Gear_4;
Fifth=Gear_5;
Sixth=Gear_6;
Gear_Optimisation
end
1 Commento
Alan Weiss
il 13 Apr 2017
Sorry, I do not understand what you are trying to do. Are you trying to determine at what time to change each gear in order to have the lowest time past a certain marker, or to have the vehicle reach a certain speed the soonest or some such optimization problem?
In any case, discrete problems are usually difficult to solve unless they can be formulated as an MILP (linear objective and constraints), or unless there is a lot of structure to the problem.
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Control Design in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!