Re: How to model motorcycle in ADVISOR? (hybrid and non-hybrid)

729 views
Skip to first unread message
Message has been deleted

Michael P O'Keefe

unread,
Mar 20, 2015, 1:00:28 AM3/20/15
to adv-veh...@googlegroups.com
Dear Ali,

There have been people who have simulated motorcycles with ADVISOR. For example, I just did a quick Google search and got this hit:


To get a quick estimate, try picking a powertrain that corresponds to the motorcycle you want to model and then change the weight and vehicle chassis characteristics (coefficient of drag and rolling resistance) to be more appropriate. I don't believe we have any engines specific to motorcycles in ADVISOR. You can start with VEH_CYCLE and WH_CYCLE (see http://adv-vehicle-sim.sourceforge.net/version_archive.html)


Hope that helps,

Michael

ali tahoori

unread,
Mar 20, 2015, 2:04:26 AM3/20/15
to adv-veh...@googlegroups.com

Thanks for your guidance. I will look further in PDF that you linked in post and say my opinion.

I want to know the full version of ADVISOR is the file that you add to sourceforge (http://sourceforge.net/p/adv-vehicle-sim/code/HEAD/tarball?path=/application/branches) or something else. Cause i download version 2003 of ADVISOR from sourceforge but its capacity is 29.97 M only....
Which of them are more appropriate?

Thanks for your kindness to solve students problems.
Regrad,
Ali Tahoori.

Michael P O'Keefe

unread,
Mar 20, 2015, 10:40:27 AM3/20/15
to adv-veh...@googlegroups.com
Ali,

Yes, you will need to download ADVISOR from SourceForge here:


If you're brand new to ADVISOR, I suggest reading the documentation in the /documentation folder of the ADVISOR download and then just playing around with the tool from within Matlab to get a feel for what it does.

Regards,

Michael

ali tahoori

unread,
Mar 20, 2015, 12:44:44 PM3/20/15
to adv-veh...@googlegroups.com
Dear Michael,
Thanks for your advice. I thought that 91.55 M source file include full version of software without bugs.! 
I am not very new in ADVISOR. I know how i works but my problem is something beyond the capability of ADVISOR, i think also!...
I think there is a unique software to calculate fuel consumption and it is ADVISOR only( true or ? ). Please let me know if i'm wrong.
Because of contacting people who wrote a paper is hard often, i'd rather to solve my problem here. (i mail to them and wait for their response, however i do not expect to see any movement)
Have you ever work with Simdriveline in simulink/matlab??? 
Do you think that there is a solution for fuel consumption and hybridization (for motorcycle in particular) in matlab?

Regard,
Ali Tahoori

Michael P O'Keefe

unread,
Mar 21, 2015, 12:49:06 AM3/21/15
to adv-veh...@googlegroups.com
There are quite a few simulation tools out there for vehicles (FASTSim, Autonomie, AVL Cruise) and then there is the Mathworks Matlab/Simulink libraries and then of course the Modelica stuff. It all depends what your situation is and what you want to do. I haven't used many of these tools in a while and I'm sure there are others I'm missing as well. I would recommending looking around and seeing if you can get trial versions to compare. ADVISOR is open-source but requires Matlab/Simulink to run -- this offers some unique opportunities but also some unique challenges.

Best of luck,

Michael

ali tahoori

unread,
Mar 21, 2015, 2:12:07 AM3/21/15
to adv-veh...@googlegroups.com
The software that you mentioned was really helpful.

Since yesterday i try to use Matlab/Simulink (specially simdriveline library), i see some fortunes to model my own case.
I find some Blocks in simulink that i can calculate fuel consumption,but the things that i couldn't find out clearly is about emission of internal combustion engine. I didn't see any sign of emission that is mentioned in simdriveline. Do you have any idea? 

I need some place like this "Group" (i mean forum or Google Group like this...) to ask my questions and experts answer that. Do you know any of them (specially for Matlab/Simulink or maybe for other softwares)? 

With respect,

Ali Tahoori.
  

Michael P O'Keefe

unread,
Mar 21, 2015, 10:14:44 AM3/21/15
to adv-veh...@googlegroups.com
I believe Mathworks has forums and then there is StackOverflow but in general you would have to search for this. I'm sure if you google around you can find something.

Regards,

Micahel

ali tahoori

unread,
Mar 24, 2015, 8:07:26 AM3/24/15
to adv-veh...@googlegroups.com
Hi
I want to know that can i use the simulink model of Engine, that it is ready in ADVISOR, individually for another case ??? 
I try to use simulink for my case but i couldn't find emission modeling in engine block... here i want to use ADVISOR engine model instead of Generic Engine Block in simulink and run my simulation in simulink,
Thanks.
 
Regard,
Ali Tahoori.

Michael P O'Keefe

unread,
Mar 24, 2015, 11:42:15 PM3/24/15
to adv-veh...@googlegroups.com
Ali,

ADVISOR is primarily run via the Graphic User Interface (GUI) or through a command-line tool called adv_no_gui (ADVISOR, no GUI). Between this forum and the documentation, both are fairly well documented. While it is possible to use the block diagrams in Simulink more directly (see, for example, the reorganized library blocks: http://adv-vehicle-sim.sourceforge.net/LibReorg.html), doing so is rather advanced and requires knowledge of Matlab, Simulink, and a bit about how ADVISOR works. If you're looking to reuse part of ADVISOR's simulink models, that would be the best place to start (look for block diagrams with a "2" at the end of the name). Note that you will want to check out the latest source from Sourceforge as it has a few additions to the reorganized library blocks.

Hope that helps,

Michael O'Keefe

ali tahoori

unread,
Mar 25, 2015, 1:12:06 AM3/25/15
to adv-veh...@googlegroups.com

I'm looking for use part of ADVISOR's simulink models for my own case. Something like just use engine model and then close the ADVISOR and use my own blocks and run simulink.
I couldn't get what you mean by this sentence. "look for block diagrams with a "2" at the end of the name" . Would you please clarify this for me?

Thanks.
Regard,
Ali Tahoori.

Michael P O'Keefe

unread,
Mar 25, 2015, 8:50:36 PM3/25/15
to adv-veh...@googlegroups.com
The only blocks that might work for use outside of ADVISOR's runtime are the "reorganized library blocks". Those blocks are in simulink files who's names end with a "2". For example, see this directory:


The only documentation we have on those is in the link I posted in a previous reply.

Using the blocks this way is an advanced use case so be prepared to do a lot of testing and exploration on your own. 

ali tahoori

unread,
Mar 26, 2015, 11:07:00 AM3/26/15
to adv-veh...@googlegroups.com
Thanks for your quick answering.
Here i am trying to find torque-speed map for motorcycle engine on internet, but i can't.
Do you know any lab or specific site which contain these kind of data sheet.? (I have a look on Argonne Lab but there is a downloadable data base for vehicles, not for motorcycle)
if you don't know particular place for downloading data, I want to know can i build BSFC map (torque-speed curve) with peak torque, horsepower and .... ? In better way, can i estimate BSFC map for engine of motorcycle.?
thanks.

Regard,
Ali Tahoori. 

Michael P O'Keefe

unread,
Mar 26, 2015, 8:33:53 PM3/26/15
to adv-veh...@googlegroups.com
Free/public data is difficult to come by. You might try searching academic and professional society papers (Society of Automotive Engineers).

Cheers,

Michael

ali tahoori

unread,
Mar 27, 2015, 2:30:49 AM3/27/15
to adv-veh...@googlegroups.com
Thanks.
If i didn't find it, Is my second question feasible?

Regard,
Ali Tahoori.

Michael P O'Keefe

unread,
Mar 27, 2015, 3:16:29 AM3/27/15
to adv-veh...@googlegroups.com
Dear Ali,

Sorry I skipped your second question.

With regard to estimating the BSFC, there are techniques in Heywood and such but you as the engineer have to answer the question yourself -- it comes down to what question you are trying to answer and how critical it will be to have an "exact" fuel consumption map. One way to think about this might be to try and "bound" your uncertainty -- what would be the most optimistic engine map; what would be the most pessimistic. If your study is not about the engine, you might use something as simple as an engine map representing a single efficiency throughout. If it's a serious project, maybe you can try justify getting some test data. If you can get an actual vehicle and you can estimate most of the remaining metrics, you might be able to get a sense for BSFC by doing constant speed testing, etc.

Just some ideas.

Regards,

Michael O'Keefe

ali tahoori

unread,
Mar 27, 2015, 6:55:10 AM3/27/15
to adv-veh...@googlegroups.com
No problem, sometime it happen.

Thanks. That give me better view of how i want to be exact on my thesis.
My question have another view. suppose that i couldn't reach exact data base about engine. Can i make BSFC or engine map by my self?
Because i read some text in this group about creating engine map in MATLAB or ADVISOR just by max torque at some rpm and max power at some rpm and ..... 
Cause i couldn't find specific discussion around this issue, i ask you above question. (i read somewhere about >>eng_map; or somethings else, is that related to?)
Thanks for your responding. I believe that you are answering my question with your kindness and i'll appreciate that and shows how generous you are.

Best wishes,
Ali Tahoori.
 

Michael P O'Keefe

unread,
Mar 27, 2015, 9:45:41 AM3/27/15
to adv-veh...@googlegroups.com
Sure, no problem.

Yes, of course you can make a BSFC map yourself. If you want to see how ADVISOR does it, just open any of the FC_*.m files (FC = fuel converter, a generic name for internal combustion engines, fuel cells, and electric traction motors for EV). You can decide to use ADVISOR's representation or you might decide to make your own. Fundamentally, a BSFC map (as ADVISOR models it) is going to answer the question of what is the BSFC as a function of engine output torque and engine output shaft speed:

   BSFC :: (T, w) -> BSFC

ADVISOR does have engine model although it is made for taking engine test data and turning it into an ADVISOR map. There is also the @eng_map class in the ADVISOR GUI folder that may be helpful.

If you're creating your own tool, you have flexibility in using a different approach (for example, you might want to use a function of output power to input fuel consumption or just efficiency). Perhaps consider several different modeling tools and look how they've done it. Read about some of the fundamental models in John Heywood's book, etc.

If you're looking for a quick payoff in terms of estimating some numbers with just a little investment in your time, you might want to check out FASTSim from NREL which was developed in Microsoft Excel. It's capabilities are limited versus ADVISOR but the advantage of the tool is that it gives good estimates of fuel consumption (currently oriented towards car/truck) while also being a model that has few parts and everything is right there in Excel sheets for you to modify.

Hope that helps. If you're making your own tool, definitely check the literature and see how it's been done in the past and improve upon it.

Kind regards,

Michael O'Keefe

ali tahoori

unread,
Apr 8, 2015, 9:42:18 AM4/8/15
to adv-veh...@googlegroups.com
Hi Michael,
How are you?? i hope you'll be great.
Finally i could find data that shows Torque, RPM and BSFC of engine of motorcycle. 
Now i am a bit confused about how i add this data to ADVISOR...
fc_map_spdfc_map_trq and fc_fuel_map_gpkWh should be change. In another word, i have to paste my data to each of these variables. Isn't it???

I have another question, why size of the these three variable isn't the same?? (i mean the size of matrix, number of elements...)

Thanks Michael for your answering in advance.

With Regard,
Ali Tahoori.

Michael P O'Keefe

unread,
Apr 8, 2015, 8:24:20 PM4/8/15
to adv-veh...@googlegroups.com
It's probably easiest to start with an existing data/fuel_converter/fc_*.m file and modify it. fc_fuel_map* is a matrix indexed by two vectors, fc_map_spd (the rows of the matrix) and fc_map_trq (the columns). You can try things out on the command-line and preview your changes by looking at the efficiency maps in the ADVISOR GUI (see the vehicle definition screen -- the first major screen).

Hope that helps.

Michael

ali tahoori

unread,
Apr 9, 2015, 2:10:46 AM4/9/15
to adv-veh...@googlegroups.com
Thanks Michael
but i couldn't understand what do you exactly mean.
The fe_fuel_map in fc_*.m file is defined in below: 
>> fc_fuel_map=fc_fuel_map_gpkWh.*fc_map_kW/3600;   (i copy from fc_*.m )

Should i replacing fc_map_spdfc_map_trq and fc_fuel_map_gpkWh with my data or not?? 

All data that i have is something like image i attached.

Regard,
Ali Tahoori.

2015-04-09_11-22-01.jpg

Michael P O'Keefe

unread,
Apr 9, 2015, 2:56:58 AM4/9/15
to adv-veh...@googlegroups.com
Hey Ali,

Load the file with the ADVISOR gui and look at the variables in the Matlab workspace browser -- you can see their shape their. If you're new to MATLAB, you may need to read up on what the different operations do.

Hope that helps,

Michael

ali tahoori

unread,
Apr 9, 2015, 4:07:54 AM4/9/15
to adv-veh...@googlegroups.com
Hi
I am not new in MATLAB at all. The problem i have is i am not satisfying with your demonstrations. The things i should do is just select one of the FC_*.m and then alter  these parameters (fc_map_spdfc_map_trq and fc_fuel_map_gpkWh). save it with new name and that's it. Is that right?

Regard,
Ali Tahoori. 

Michael P O'Keefe

unread,
Apr 10, 2015, 12:36:43 AM4/10/15
to adv-veh...@googlegroups.com
That's right, just load a file from the ADVISOR Gui and browse and play with the variables from the FC_*.m file. Most if not all of the files are annotated -- I'm going from memory but basically you have a torque vector and a speed vector and then a matrix that gives you the BSFC for the fuel converter at each of the torque x speed points: so 2 vectors and a matrix. To make sure the data is the right direction that the model needs, you can study the existing data files or just put in some fake data that makes it obvious what value is in what part of the engine map and then use the GUI to examine the engine map efficiency contours (from the ADVISOR GUI Vehicle Input screen).

ali tahoori

unread,
Apr 15, 2015, 3:38:12 AM4/15/15
to adv-veh...@googlegroups.com
Dear Michael,
I have a problem when i want to change the m.file of fc_*.m (Fuel Converter) and then save it. It seems to be problem to save my new modified m file.
The error has attached to this post as jpg file. Please let me know how can i fix this problem. when i want to save my new m file, this error take place simultaneously. 
Thanks for every things.

Best wishes,
Ali Tahoori.
2015-04-15_12-05-51.jpg

Michael P O'Keefe

unread,
Apr 15, 2015, 8:05:27 AM4/15/15
to adv-veh...@googlegroups.com
"Access is denied" usually indicates your directory is "read-only". Check that you can write to the ADVISOR directories by clicking on them from your operating system "windows explorer" and changing the access to read/write.

ali tahoori

unread,
Apr 15, 2015, 3:51:32 PM4/15/15
to adv-veh...@googlegroups.com
Wow, what a mysterious and odd problem, really!
I have just right click on my MATLAB folder which located in this directory C:\Program Files\MATLAB. And then uncheck Read-Only tick, apply this change and click OK finally.
Unfortunately nothings change Michael. When i right click on MATLAB folder, tick is checked (i mean that nothings new happen , Read-Only check box is active still.)
How can i uncheck this check box..?
Thanks.

Respect,
Ali Tahoori.

Michael P O'Keefe

unread,
Apr 15, 2015, 8:31:20 PM4/15/15
to adv-veh...@googlegroups.com
Your unzip program can sometimes cause an unzipped archive to be read-only.

In the past, I've been able to right-click on the read-only folder and set the read-only to read/write but you may also need to look for something like "recursively apply to all subfolders". You might have to do a more general search -- I have to think this information is out on StackOverflow or somewhere if you're still stuck.

Regards,

Michael O'Keefe

ali tahoori

unread,
Apr 16, 2015, 5:15:10 AM4/16/15
to adv-veh...@googlegroups.com
Hi Michael,
Are you about this solution??? Because i think that error is not related to this problem. I check most of my folder and see Read-only's checkbox is active for all of them.
And there is no solution to change this condition almost. Is that solution work for you???

Michael P O'Keefe

unread,
Apr 16, 2015, 8:19:31 AM4/16/15
to adv-veh...@googlegroups.com
Hi Ali,

Unfortunately, I don't know your exact situation.

I was just suggesting what has worked for me in the past in older versions of Windows. Somehow your folder has become read only and you need all the folders to be set read/write. I believe you definitely need <advisor>/gui/optionlists to be read/write. For a worst case scenario, you need to change that path to read/write manually.

If this doesn't work, you will need to get help from someone who knows the details of your operating system. I searched for "windows recursively set permissions" and came across these:

ali tahoori

unread,
Apr 16, 2015, 11:07:10 AM4/16/15
to adv-veh...@googlegroups.com
Dear Michael,
Thanks for your cooperation in my problem. I'll appreciate this.
I use ADVISOR in other PC which has 2010 vesion of MATLAB. In this PC m files can be edited surprizingly.!!!
Could you believe that...?!!!!
Firstly,I want to use 2014 version, is there any solution...???
Another concern is that i heard that fully removing ADVISOR is not possible, it create some file in C drive (Somewhere inside windows files) that we can't delete that. Is that true or just rumor ?!???
At last not least, how can i reach other people in this group? (i want to ask them about version of MATLAB they use...)
Thanks really much in advance.

With Fully Respect,
Ali Tahoori

Michael P O'Keefe

unread,
Apr 16, 2015, 8:20:55 PM4/16/15
to adv-veh...@googlegroups.com
Replies inline below:

On Thursday, April 16, 2015 at 9:07:10 AM UTC-6, ali tahoori wrote:
Dear Michael,
Thanks for your cooperation in my problem. I'll appreciate this.
I use ADVISOR in other PC which has 2010 vesion of MATLAB. In this PC m files can be edited surprizingly.!!!

It's my understanding that all MATLAB versions and m-files can be edited.
 
Could you believe that...?!!!!
Firstly,I want to use 2014 version, is there any solution...???

ADVISOR has not been tested on 2014 but we would be happy to know if it works.
 
Another concern is that i heard that fully removing ADVISOR is not possible, it create some file in C drive (Somewhere inside windows files) that we can't delete that. Is that true or just rumor ?!???

That's completely not true. ADVISOR is fully contained in the zip archive you download. If you want to delete it, delete the zip archive. Who told you this?
 
At last not least, how can i reach other people in this group? (i want to ask them about version of MATLAB they use...)

Just post on the list. For the most part, I've been the only one answering questions but just recently others have started to step forward.

ali tahoori

unread,
Apr 17, 2015, 3:17:40 AM4/17/15
to adv-veh...@googlegroups.com
Hi Michael,
I found it finally. My mistake is where i paste ADVISOR source file to C:\Program Files\MATLAB\R2014b\toolbox ... "Access is denied" is appear due to the location of source file should not been in MATLAB. I run ADVISOR from Desktop and then that error vanished.
I want to tell my solution because others wouldn't make my mistake.

I want to know that what is Image2Map use for? Because i could provide picture of my engine. Is that really work for my case...?

Thanks alot.

Regard, 
Ali Tahoori

Michael P O'Keefe

unread,
Apr 17, 2015, 8:47:21 AM4/17/15
to adv-veh...@googlegroups.com
Glad to hear you solved your problem. Thank you for sharing your solution!

Image2Map is a tool to "digitize" a plot you want to import into ADVISOR (for example, an engine contour plot). It is useful when you find a component you want to model in a technical paper but they only give you, for example, a BSFC (break-specific fuel consumption) contour plot or efficiency contour map and not the raw data itself. Or perhaps you find a new driving profile but they also don't give you the raw data.

That having been said, I think there are now better tools on-line that are easier to use:


Regards,

Michael O'Keefe

ali tahoori

unread,
Apr 22, 2015, 4:00:39 AM4/22/15
to adv-veh...@googlegroups.com
Hi Michael,
Thanks for your last advise.
Here my question is what's different between "Load file" and "Vehicle" in advisor?
I want to share my experience that i catch recently. I find motorcycle model in advisor finally and the name is "VEH_CYCLE" from "Vehicle" part. But i can't distinguish difference between "Vehicle" and "Load file" of ADVISOR. When i alter the ''Load file" , the image of vehicle and its power train configuration changes also. But when i change the "vehicle" , nothing happen except designate input parameters of that kind of vehicle. 

Thanks Michael in advance.

Best wishes,
Ali Tahoori.

Michael P O'Keefe

unread,
Apr 22, 2015, 8:52:57 PM4/22/15
to adv-veh...@googlegroups.com
Hi Ali,

The file from "Load File" is stored in the "saved_vehicles" folder by default and you can open it and see what's inside if you're curious. A "Load File" or "Saved Vehicle File" will store all of the component settings for a single type of vehicle. In contrast, the "Vehicle" area is only going to change the settings for your vehicle characteristics. If you go through the trouble of setting up an entire vehicle, you will typically want to save it as a new "saved vehicle". Does that help?

Regards,

Michael O'Keefe

ali tahoori

unread,
Apr 23, 2015, 12:12:48 AM4/23/15
to adv-veh...@googlegroups.com
Hi Michael,
That would help a bit...!
I want to know that is there any configuration which is called TTR Hybrid power train...? (Through The Road). This article is about what i exactly want to say to you. (https://www.dropbox.com/s/yit4qlysrfjf6mw/A%20new%20energy%20control%20strategy%20for%20a%20through%20the%20road.pdf?dl=0
In this configuration electric motor is propel front tire and internal combustion engine propel rear wheel separately.
Is there any configuration like this in ADVISOR or not??? (I believe your answer will be negative, i thought.!!!)
If answer is negative could your please hint me somethings which help me to edit simulink file....
Additionally, i read this source (http://adv-vehicle-sim.sourceforge.net/LibReorg.html) but i can't get it right. i thought it is not useful a lot.

Thanks.

Regard, 
Ali Tahoori.

Michael P O'Keefe

unread,
Apr 23, 2015, 10:42:00 PM4/23/15
to adv-veh...@googlegroups.com
Hi Ali,

I know of one person who did build a through-the-road hybrid using the "reorganized blocks library" components in ADVISOR: http://adv-vehicle-sim.sourceforge.net/LibReorg.html

However, that person was a fellow ADVISOR developer and Matlab/Simulink expert. It is definitely possible to build your own powertrains and TTR hybrid but it would require you to put in the work to teach yourself how the components work, how ADVISOR works, and how simulink works. There is no ready-made configuration.

The reorganized ADVISOR blocks allow you to "drag and drop" your powertrain components into a new simulink library instead of interacting through the ADVISOR GUI. They also allow you to have multiple instances of components. I haven't generally been recommending the reorganized library because it's not well documented or "easy" for most people. However, it is much simpler than the existing ADVISOR approach.

I'm not sure where to suggest going for general Simulink advice but I'm sure there are a lot of resources out there.

ali tahoori

unread,
Apr 28, 2015, 3:34:43 AM4/28/15
to adv-veh...@googlegroups.com
Dear Michael,
Firstly ,how can i add driving cycle to ADVISOR???
At last, can i access the data for these cycles in ADVISOR? (i want speed and time for some of cycles)

Thanks.

Respect,
Ali Tahoori

Michael P O'Keefe

unread,
Apr 28, 2015, 8:09:19 AM4/28/15
to adv-veh...@googlegroups.com

ali tahoori

unread,
May 4, 2015, 3:40:09 PM5/4/15
to adv-veh...@googlegroups.com
Hi Michael.
I try to enter my own driving cycle which named " WMTC2 ". it seems to be successful at first but during simulation an error occur. 
I attach command line in command window in jpg format.
Thanks.

Regard,
Ali Tahoori.  
2015-05-04_19-19-06.jpg

Michael P O'Keefe

unread,
May 4, 2015, 8:37:02 PM5/4/15
to adv-veh...@googlegroups.com
Hi Ali,

Hmm... nothing immediately comes to mind here. The error message is quite unhelpful, unfortunately.

I suspect some of the driving cycle data was not correctly defined. You might try comparing your drive cycle file with other pre-defined ones and make sure that the same variables are defined and that they have the same "shapes" (for matrices vs scalars, etc.).

Regards,

Michael O'Keefe

ali tahoori

unread,
May 5, 2015, 1:54:33 AM5/5/15
to adv-veh...@googlegroups.com
Thanks.
I'm sure that this driving cycle is a standard because of pick it up from this book "A refrence book of Driving cycles for use in the   measurement of road vehicle emissions" which is free to download. WMTC stand for World Motorcycle Test Cycle... I try to plot it in excel and the shape of it is reasonable. Please see attached file. 

Respect,
Ali Tahoori.
WMTC.xlsx

Michael P O'Keefe

unread,
May 5, 2015, 8:51:56 PM5/5/15
to adv-veh...@googlegroups.com
Hi Ali,

I'm not trying to criticize the drive cycle itself. My comment is that there is probably an error with respect to the variables and matlab definitions that represent the driving profile: perhaps a variable that ADVISOR expects was not defined or perhaps a variable has a different shape than expected -- I'm not sure.

A visual inspection of the file versus a working cycle file is the only thing I can suggest. You can try matlab's load command to load two files into a structure and do a comparative analysis to see if your CYC file is missing any variables or if any variables are not of an expected shape.

Regards,

Michael O'Keefe

ali tahoori

unread,
May 7, 2015, 5:42:27 AM5/7/15
to adv-veh...@googlegroups.com
Hi Michael,
I have a problem with concept of requested (required) parameters and achievable(available) parameters.
I create display in simulink for a conventional vehicle's GearBox block and get some data ...
here is a result at particular time step (t=10s):
 
Torque and Speed Requested at output of Gearbox : 98.4 N.m

Torque and Speed Requested at input of Gearbox : 7.3 N.m

Torque and Speed Available at input of Gearbox : 4.3 N.m

Torque and Speed Available at output of Gearbox : 58.73 N.m

what do above numbers mean actually?
I don't understand purpose of this parameters, however, i read documentations a lot about power flow and other things in ADVISOR.

Michael P O'Keefe

unread,
May 7, 2015, 4:12:06 PM5/7/15
to adv-veh...@googlegroups.com
Hi Ali,

You can read all about it here:


Let us know if you still have questions after looking at the documents.

Regards,

Michael O'Keefe

ali tahoori

unread,
May 18, 2015, 10:43:31 AM5/18/15
to adv-veh...@googlegroups.com
Hi Michael,
I changed the power train configuration to picture which i attached to this post. This configuration called, Through The Road (TTR) power train. In this kind of power train electric motor propel front wheel and ICE will operate on rear wheel.
Is this changes reasonable in simulink.? Because i thought that this change is doesn't make better condition for fuel consumption.
Thanks.

Ali Tahoori. 
2015-05-18_19-12-16.jpg

Michael P O'Keefe

unread,
May 18, 2015, 11:28:30 PM5/18/15
to adv-veh...@googlegroups.com
Hi Ali,

If you're asking whether the powertrain architecture is reasonable from an engineering standpoint, I can't give you any strong comments -- through-the-road hybrids have certainly been studied over the years and I know there is technical literature available; you might want to review those technical papers to get a better feel for the architecture and larger issues/challenges involved.

From the standpoint of creating the model to run with ADVISOR, unfortunately, ADVISOR's default simulink blocks use a "global" namespace and workspace so that means you cannot duplicate the same component more than once without namespace collisions. However, it looks like your components do not contain duplicates so you might be OK. The other concern would be to ensure that the control strategies are reasonable for the new architecture. That is work you'll need to do by exercising the model and observing key metrics that tell you how your powertrain components are operating. The "reorganized" blocksets were created to get rid of the namespace clash concern -- I've already mentioned those a couple of times but just want to make sure you're aware of them if you run into issues. For a traditional ADVISOR blockset, you will need to use the "custom" option from the GUI to load the component files you need to run your model.

It is good to have a sense of expectation on what the model should do and then simulate the model and compare the results as a means of debugging.

Best of luck. We'd love to hear from you if you have good results you'd like to share with the users on this forum.

Kind regards,

Michael O'Keefe


ali tahoori

unread,
May 21, 2015, 2:34:06 AM5/21/15
to adv-veh...@googlegroups.com
Thanks Michael for your advices.
I have confronted to really odd problem. If you take a close attention to my previous image that i attached, you'll see i try to connect Electric motor to rear wheel and ICE to front wheel (then i choose rear wheel drive Boolean in GUI). But there is somethings wrong with this configuration. I must connect Electric motor to front wheel and ICE to rear wheel to get close to Through The Road (TTR) configuration.
Surprisingly, when i change the configuration to real TTR and then click front wheel drive Boolean in GUI, the answers are the same.!!!

If you look at my configuration in advance, i omit Coupling and axle selection Blocks and connect rear wheel signal to Electric motor and front wheel signal to ICE (which is wrong configuration with right answer, i thought.). 

My first question is what Rear Wheel Drive boolean in GUI actually do? 

If i omit the axle selection block, it's effect should be vanish. So why does this effect ? (I couldn't find rear wheel drive variable in other place except in axle selection Block)

If i put Motor in front wheel (and ICE in rear wheel) i have to check front wheel drive in GUI to get reasonable answer and if i put ICE in front wheel (and Motor in rear wheel) i have to check rear wheel drive in GUI to get reasonable answer. Why this happen ???

My reasonable answer should be discussed later , because i define reasonable answer to trace all of the path of driving cycle without any miss. If i put Motor in front wheel (and ICE in rear wheel and then check front wheel drive in GUI or vice versa, my vehicle didn't miss any path. but if i select rear wheel drive for instance, not only the path didn't traced but SOC is not going to change significantly. And  the speed of motor is not reasonable and so on...

Thanks for sharing your time with mine to read this long post. I'll appreciate your kindness in advance.

With Regard,
Ali Tahoori.
 


Michael P O'Keefe

unread,
May 21, 2015, 12:18:47 PM5/21/15
to adv-veh...@googlegroups.com
Hi Ali,

I'll try to point you in the right direction but I can't remember and don't have the time to check in detail.

1. try to search within simulink for the wh_front_active_bool and wh_rear_active_bool to see exactly what the simulink model is doing. My first guess would be that both of those should be set to 1 (true) if you have a TTR hybrid
2. I did just run across the following in the documentation:

The vehicle dynamics calculations required for traction control and the wheel slip model assume that the front axle is the only drive axle.  Simple steps can be taken to correct the weight transfer calculation if you wish to model a rear-drive vehicle, and an example wheel file that accomplishes this is included.  Modeling a four-wheel drive vehicle requires involved Simulink reprogramming. 

This may mean you will have to dig into the wheel/axle block and modify how it works.

You may wish to look at <advisor directory>/models/library/lib_wheel2.mdl which was an attempt to modularize the components (note: you may need to check out/ download the latest version of ADVISOR from SourceForge by going here: https://sourceforge.net/p/adv-vehicle-sim/code/HEAD/tree/ and clicking "download snapshot" -- advisor itself is in the application/branches/advisor folder).

Despite the warning, I think there is a way to enable this but you will have to dig in to understand how the wheel/axle blocks work so as to configure them correctly.

This is a known weakness of ADVISOR: it is difficult to create new powertrain configurations.

Hope that gives you some directions to try. Kind regards,

Michael O'Keefe

ali tahoori

unread,
May 21, 2015, 3:33:05 PM5/21/15
to adv-veh...@googlegroups.com
Dear Michael,
I have searched all of the simulink almost to find  "wh_front_active_bool" parameters but i couldn't find it except in axle selection block. However, i have deleted this block, but there is somewhere else due to its effect on my work. Notice me if i am wrong.  Axle selection block is used for choosing which axle should propel the vehicle and by omitting this block this variable "wh_front_active_bool" shouldn't have affected on my work. Is that right?
I want to opposing with your opinion a bit for say that i have to choose four wheel drive. Why do you say that? In wheel block there is two output for rear axle or front axle, why should i keeping  axle selection block? It is not working for TTR configuration. 

Thanks.
Best Wishes.
Ali Tahoori.

Michael P O'Keefe

unread,
May 21, 2015, 5:01:06 PM5/21/15
to adv-veh...@googlegroups.com
HI Ali,

I don't have a lot of time to on ADVISOR support so I can't solve this problem for you; I can only suggest directions for you to investigate. Unfortunately, as you are discovering, ADVISOR was never really designed to make it easy to reconfigure the powertrain.

A couple of thoughts:

* make sure when you search simulink that you select the option to search linked library blocks and also block parameters; if you're unsure, check the help from Mathworks on Simulink
* I was not suggesting you need four-wheel drive; I only wished to point out that the powering of multiple axles was not an original design goal of ADVISOR which is why changing the Simulink is required
* an affective way to validate a new model is to first validate the pieces. Have you tried instrumenting the Wheel block and its sub-blocks to isolate the problem? Perhaps using scopes or plots or logging variables? That may be the most effective way after searching to discover what the cause of this issue is. Try feeding the block a known input stream and check that it calculates an expected result. If it doesn't, start tracing down into the sub-blocks of the wheel/axle blocks to isolate the problem.

ali tahoori

unread,
Jun 25, 2015, 6:40:26 AM6/25/15
to adv-veh...@googlegroups.com
Hi Michael,
I want to know why ADVISOR shows question marks on acceleration test in results when i check acceleration test box?
How can i make ADVISOR shows number to me instead of question marks!????

Thnaks.
Ali Tahoori.

Michael P O'Keefe

unread,
Jun 30, 2015, 9:49:00 PM6/30/15
to adv-veh...@googlegroups.com
Hi Ali,

Is your vehicle able to reach the top speed for the acceleration test? You can actually run the "acceleration test profile" as a normal drive cycle to check if your vehicle is doing anything strange -- the cycle is just a step function in speed.

Regards,

Michael O'Keefe

ali tahoori

unread,
Jul 28, 2015, 2:05:39 AM7/28/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum, michael....@gmail.com
Hi Michael,
Long time no see!...
I have a serious problem with mass of engine. After applying my scale to engine to meet the motorcycle specification, I found out even if I change the fc_mass parameter in m-file the number in screen didn't change. What is the number of mass show in main screen says to me specifically?
Due to its direct effect on Calculated mass, I confused a bit.

Thanks for your definition.

Sincerely,
Ali Tahoori. 

Michael P O'Keefe

unread,
Jul 28, 2015, 8:30:46 PM7/28/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum, a.tahoo...@gmail.com
Hi Ali,

The scaling relationships are documented here:


Otherwise, you can always override the mass of the entire vehicle and explicitly set it if you want to use some other algorithm. See this section of Chapter 2:


Cheers,

Michael

ali tahoori

unread,
Jul 28, 2015, 11:29:15 PM7/28/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum, michael....@gmail.com
Dear Michael,
I think a misunderstanding occur in this case.
I mean that after change in this equation: fc_mass=(fc_base_mass+fc_acc_mass)*(c1*fc_trq_scale+c2)*(c3*fc_spd_scale+c4)+fc_fuel_mass
the number which is shown in GUI didn't change proportionally ....
for instance, fc_mass shows 21 kg but the weight number in GUI is still 7 kg.

Respect,
Ali Tahoori 

Michael P O'Keefe

unread,
Jul 29, 2015, 12:36:24 AM7/29/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum, a.tahoo...@gmail.com
Hmm,

Well, the mass would have to be defined in the data file (fc_*.m) and loaded or set from the GUI screen. If you have any scaling variables applied (in this case, if fc_pwr_scale does not equal 1) that will change the calculation. Are you scaling the power? If so, that will scale the mass as well. One possible explanation is that fc_pwr_scale = 1/3.

Regards,

Michael O'Keefe

ali tahoori

unread,
Aug 11, 2015, 12:18:17 AM8/11/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum, a.tahoo...@gmail.com
Dear Michael,
I need more information about non-gui ADVISOR. How can I do that?
I want to optimize component sizing with Genetic Algorithm and I should couple GA with ADVISOR.... Can you help me a bit more?

Regard,
Ali Tahoori

Michael P O'Keefe

unread,
Aug 11, 2015, 12:39:26 AM8/11/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Information about running advisor without the gui (called 'adv-no-gui') is here:


There are also lots of Q&A on this forum. Please do a search.

Also, please notice and look through the examples that come with ADVISOR in the /optimization folder of the ADVISOR distribution. Note however, that some examples will only work if you have the appropriate matlab toolboxes and other 3rd party tools will not work (they were last tested prior to 2004).

ali tahoori

unread,
Aug 11, 2015, 1:47:18 AM8/11/15
to adv-veh...@googlegroups.com
When I read this paper, I find out that there is a solution definitely. It is published a few month ago.
Please take a look at it:

Michael do you know how can I access to people who post in this group.? I mean if I'd like to ask personal question or something else...
Can I reach their email or ...?

*********** Edited
Michael, when I run the default code which mentioned in : http://adv-vehicle-sim.sourceforge.net/advisor_ch2.html#2.3  It seems to have a problem...
I try this example code of Help Doc:
input.init.saved_veh_file='Parallel_defaults_in';[a,b]=adv_no_gui('initialize',input)
input.grade.param={'speed'};input.grade.value={55};[a,b]=adv_no_gui('grade_test',input)
input.modify.param={'veh_mass'};input.modify.value={1500};[a,b]=adv_no_gui('modify',input)
input.grade.param={'speed'};input.grade.value={55};[a,b]=adv_no_gui('grade_test',input)

but when I run first line, an error appear that says:
Error in adv_no_gui case {initialize}:

Cannot find an exact (case-sensitive) match for 'Parallel_defaults_in'
The closest match is: PARALLEL_defaults_in in C:\Users\FARA SYSTEM\Desktop\HEM\Software\Advisor\advisor2003 SourceForge\saved_vehicles\PARALLEL_defaults_in.m
[adv_no_gui] going to keyboard -- type return to continue code or dbquit to exit

Michael P O'Keefe

unread,
Aug 11, 2015, 8:05:04 AM8/11/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
The error is caused by Matlab. When ADVISOR was written, MATLAB was not sensitive to file case but now it is. Be sure to exactly match the case of the file name for 'parallel_defaults_in'.

As for reaching people who post to this group, you can post here. If someone wishes to directly share their email with you, they may but I cannot do it for them.

Michael O'Keefe

ali tahoori

unread,
Sep 5, 2015, 2:43:31 AM9/5/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
First of all, I want to say thank you and express my deep gratitude for all of your kindness about answering my question and pursuing my issues. I appreciated it definitely.
After that, unfortunately, I have to say that I still have a problem with Through The Road configuration (or separately parallel hybrid schematic). Although I modified simulink model, there is a issue in following driving cycle profile by my own motorcycle. I attached picture of my modified simulink model. (Please take a look at it...)
I run the simulation with the parameters which depicted in attached file from first window of GUI. Also I attached the results of my simulation.
If you take a close look at first diagram you'll find out how my motorcycle missing the path.
I need your opinion about how can I fix this problem.

Regard,
Ali Tahoori
2015-09-05_10-29-13.jpg
2015-09-05_11-00-31.jpg
2015-09-05_11-06-14.jpg

Michael P O'Keefe

unread,
Sep 5, 2015, 10:07:30 AM9/5/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Just a couple of thoughts:

- have you determined you have enough power to overcome the roadload (i.e., is your engine or motor big enough?) You only have 7 kW for the engine and 2 kW for the motor -- that seems really low but then I see your mass is also very low. Have you done basic calculations to get a feel for your performance? Basic roadload equations?
- if yes to above, have you tuned your final drive ratio and gearing to allow you to rotate the shafts fast enough to actually meet your speed targets? You have an overall ratio of 9 for gearing -- is that sufficient to allow your engine/motor speed to rotate the wheels at the right speed?

One thought is to put scopes on your simulink block or examine the variables on the workspace after the run and plot the *_spd_req, *_spd_ach, *_trq_req, *_trq_ach and look for any funny values. Look at a working model such as the passenger car model to get a sense for where these values should be.

Hope that helps. Best of luck!

Michael O'Keefe

ali tahoori

unread,
Sep 6, 2015, 4:19:16 AM9/6/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
That's amazing. Thank you Michael. That was a great tip that you mentioned.
I am sure about the power of my motor and ICE. A simple 125cc motorcycle produce 7 or 8 kW of power. But I need your guidance a bit more. When I calculated the power from sizing relations for my specific performance index, I just calculated the value of P (of Power) of electric motor. The only parameters that I can change in ADVISOR is mc_trq_scale and mc_spd_scale to meet my particular value of Power. What is a relationship between Power of mc and Torque in ADVISOR? (I've attached a chinese cataloge of Hub-motor. It produce a unbelievable torque with 1 kW power...!)
Final drive ratio influence a lot in my results. The default value of fd_ratio in my gearbox m file is 1. when I increase this value, it give me better speed tracing profile.
A fundamental question is appeared in my mind that Is the rotational speed of front wheel resemble the rotational sped of rear wheel? Should it be the same or not?
When I choose four wheel drive, How ADVISOR could knew about the speed of my both axle...??
At last, how can I set a strategy for ADVISOR to manage the use of electric motor? For example, I need to set the speed of 50 km/h to switch between electric mode to engine mode. I want to set the speed of switching between there two propellant.

Thanks Michael. I appreciate it.

Regard,
Ali Tahoori.

MagicPie 48V curve 1000W.Jpeg

Michael P O'Keefe

unread,
Sep 6, 2015, 10:15:46 AM9/6/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Glad that helped.

Power = Torque x Speed

so both speed scale and torque scale should multiply in the above equation to change power (that is, Power = (Torque x Torque Scale) x (Speed x Speed Scale)). Normally you would only set one to change peak power although you may want to change speed scale to get the gearing to better match.

I would think rotational speed of all wheels would be the same unless they are slipping and I don't think advisor is that sophisticated. I don't recall how ADVISOR's 4-wheel drive is implemented -- you might want to do a search through the code base to see if you can figure it out (check this list and search for "GREP").

ali tahoori

unread,
Sep 7, 2015, 5:12:19 AM9/7/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael.
I did what you recommend me. I monitor some of my data with scope and plot some of variables. I found fc_trq_out_a and fc_trq_out_r variables are not reasonable. (Like what you said there are funny!) Logicaly, fd_trq_in_a , fd_trq_out_a ,and so on are not pleasant at all. Please take a look at image I attached. I couldn't understand why this figure of torque is shown. I've just changed the scale of torque and speed in ICE. Have you got any idea about why this kind of torque is produced...????
Thanks. 

Regard.
Ali Tahoori.
2015-09-07_13-23-46.jpg

Michael P O'Keefe

unread,
Sep 7, 2015, 8:55:24 PM9/7/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Something is definitely off there. fc_trq_out_r is the requested torque to be output from the internal combustion engine (i.e., fc = fuel converter). fc_trq_out_a is the achieved torque that is output. So basically, the powertrain is requesting torque on the order of magnitude of 10 - 100 but the engine is delivering torque an order of magnitude higher in some instances.

I would recommend a "debugging" exercise at this point: go through all the pieces of your code from inputs to simulation runs to outputs and try to eliminate parts of the code that are working correctly. Did you expect torque to be between 0 and 100 Newton-meters? If so, then that part is probably OK. That means something is happening in the calculation of the achieved values. You might have to dig into the simulink block and place more scopes or examine more variables to chase down the error.

Since the achieved torque seems to be roughly in range and then "spike", I'm wondering if it's some kind of derivative / division issue?

Regards,

Michael

ali tahoori

unread,
Sep 9, 2015, 3:49:30 AM9/9/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
The fc_max_trq * fc_trq_scale of mine is shown below:

11.2379   13.6470   14.2392   14.4007   14.3334   14.3334   14.3334   13.7950  12.5972   11.6955   10.7938

That's a bit weird that my achieved torque exceeds max torque which is about 14 N.m(according above numbers!) .....

I couldn't catch what you mean by :  "Since the achieved torque seems to be roughly in range and then "spike", I'm wondering if it's some kind of derivative / division issue?"

I ran two simulations and figure out somethings strange happen. One, mine hybrid motorcycle. Two, a default parallel hybrid for simple sedan vehicle.

The variable " tractive force and speed required of tire and wheel " ,which is came out from vehicle, is attached in attachments. There is no such logical reason for being too difference between two image. Because I set ECE_EUDC_LOW for them. I attached the results of second simulation.

Thanks for your guidance.
First Simulation.jpg
Second simulation result.jpg
Second simulation.jpg

Michael P O'Keefe

unread,
Sep 9, 2015, 7:27:03 PM9/9/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
I meant that you are drastically exceeding your stated max torque but it seemed to be like at the start of your acceleration event. You may want to check timing and division OR just filter torque to be no greater than max torque.

Start with trying to debug anything custom you've built.

- Michael
Message has been deleted

Michael P O'Keefe

unread,
Sep 10, 2015, 7:54:40 PM9/10/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Good day.

I do all free support through this forum as a volunteer effort in my spare time -- that way, everyone can benefit from the questions and answers.

I don't take ADVISOR questions through closed e-mail (unless as part of a paid consulting arrangement).

You must select the control strategy you want to use from the vehicle from the pull-down. It's probably best to look in the data files for the powertrain control (PTC) and see what can be configured and changed. Also be sure to check the "variable list" drop down to see what PTC (powertrian control) and VC (vehicle control) options are available. It's easiest and quickest to play around with the variables and see what happens.

Running ADVISOR through the GUI is fairly straight-forward. However, if you want to do something that cannot be expressed directly through the ADVISOR GUI, there are some batch scripting options through "adv_no_gui" but otherwise you'll need to do a lot of custom work and dig into the files to understand how to go about it. That can be time consuming and may not be the best use of your time. As easily accessible through the GUI, ADVSOR is limited to only one energy storage system at a time and only has a finite number of energy storage options. Modifying/customizing the ADVISOR simulink models can be a lot of work.

However, you might be able to use ADVISOR to gain insights into the merit of the strategy you are proposing by running something that is "close" and post-processing the data from the run. That is a very good use case for ADVISOR.

Hope that helps,

Michael

 

Chukwunonso Anyaoku

unread,
Sep 11, 2015, 6:33:22 AM9/11/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Thanks Michael, I really do appreciate.

Michael P O'Keefe

unread,
Sep 11, 2015, 9:50:00 AM9/11/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Best of luck!

ali tahoori

unread,
Sep 21, 2015, 11:14:25 AM9/21/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
I have see a little problem in my simulation. When I run acceleration test from TEST_PROCEDURE and run acceleration test from check box during running driving cycle, the number of acceleration and maximum speed are not identical. Is there any problem with these to way of getting 0 to 60 acceleration time.??

Thanks.

Michael P O'Keefe

unread,
Sep 21, 2015, 8:51:19 PM9/21/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
They should be the same so I'm at a loss to explain why they are different. Note that the "test procedure" does follow an actual test procedure so there is more going on. I would tend to use the acceleration procedure as it only runs the acceleration test with the current vehicle. You should be able to get 0 to 60 mph acceleration time from that. It would be nice to know why they are different, though... Starting battery SOC assumptions differ perhaps?

Regards,

Michael

ali tahoori

unread,
Sep 22, 2015, 3:38:49 AM9/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Thanks Michael.
I couldn't understand the reason of this issue. If you take a closer look you'll find out that the setting GUI window comes up for both way of acceleration testing.!! (I mean that the setting of test is the same...)

Here's a problem with torque scale and mass scale of transmission. What's different between them? I need to reduce automatic transmission's mass because of my basic model (my model is motorcycle). The weight of transmission is 114 kg now and I have to reduce it between 10 to 15 kg. I have to way, set the torque scale or mass scale.
Because of scaling motorcycle engine to 7 kW, Should I change toque scale of my transmission instead of mass scale....???? 

Thanks.

Chukwunonso Anyaoku

unread,
Sep 22, 2015, 5:01:23 AM9/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Good day Michael,

Please I wish to know the version of ADVISOR that contains the plot output variable 'fc_mech_out_pwr' as described in the appendices of the ADVISOR manual. My ADVISOR version is '2004-00-r0116' and it does not contain this variable in its list of graph plot variables.

Thanks sir.

Michael P O'Keefe

unread,
Sep 22, 2015, 7:31:19 PM9/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Torque scale scales the power of the component (torque x speed = power)
Mass scale scales the mass (weight) of the component (assuming you aren't overriding the entire vehicle's mass)

If you change the torque scale, you will change your power. I believe the mass is on a power per unit mass basis but check me on that (look in the data files and read the comments to confirm).

-Michael

Michael P O'Keefe

unread,
Sep 22, 2015, 7:33:17 PM9/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Good day,

Not every variable is available for every powertrain and some variables may have changed since writing the appendix. The best thing to do is look at the matlab workspace and browse it to see what variables are defined. You can then search the ADVISOR docs, the simulink block diagrams, or the ADVSOR m files for a better definition of the variables. Sorry it is not more straight forward.

You have the latest version of ADVISOR.

Cheers,

Michael

little John

unread,
Sep 24, 2015, 12:10:48 AM9/24/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Helllo Michael,

I want to know that if advisor software can be used to establish a distributed drive electric vehicle model,.Can you give me  some advice?

Thanks.

With respect,

Little John


Michael P O'Keefe

unread,
Sep 24, 2015, 12:39:46 AM9/24/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
ADVISOR can model an electric vehicle and you have some flexibility in defining the component characteristics including aspects such as weight and such. There are some fairly basic power management strategies as well. ADVISOR is designed to give an estimate of energy usage for a given technology over a given vehicle duty cycle. In that sense, you may be able to get the basic characteristics of an electric vehicle configured to mimic some specific architecture.

At this point, probably one of the bigger drawbacks for ADVISOR are that it is difficult to simulate new detailed powertrain topologies and also that the provided component data is getting fairly old: last updated prior to 2004. That said, if the basic EV topology can mimic what you're interested in, you can get a first pass result in a very quick turn-around and that is perhaps ADVISOR's biggest strength.

Hope that helps,

Michael

ali tahoori

unread,
Oct 31, 2015, 3:52:01 AM10/31/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
Hope every things going great for you...
I have a question about battery choosing. Suppose that I select this kind of battery with information which mentioned. (http://www.batteryspace.com/lifepo4-prismatic-battery-and-charger-package-48v-choose-from-20-ah-40ah-60ah-or-100ah-un-38-3-passed-dgr.aspx)

What parameters should I have to change in order to provide appropriate information of battery for ADVISOR.??
Please name the parameters and the quantity base on the battery that I mention above.

Thnaks

Michael P O'Keefe

unread,
Oct 31, 2015, 10:35:28 AM10/31/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Batteries are a bit of a pain to set up because the information from manufacturers is not in the format you need to input to ADVISOR.

First the relevant docs:

The Rint model is shown on page 2 above
There's also an RC model

It's probably easier to set up the RC model.

Batteries are modeled as having various modules in series. You could just choose 1 module to allow you to match the data from the website. Open an existing datafile such as ESS_PB25.m and change the ess_max_ah_cap (Energy Storage System Maximum AmpHour Capacity) to match the data you want to match. This is a matrix indexed by SOC horizontally (i.e., by column) and temperature vertically. It could be a single 1x1 matrix if you don't have better information. Do the same to match the ess_voc (Voltage Open-Circuit). The tricky part is to figure out what resistance to use for ess_r_dis and ess_r_chg and I'm not sure how to counsel you here. The proper way to do it would be to look at the Rint model above and choose an R that best matches the actual battery performance but you may not have that information. I suppose you could use the values from ESS_LI7_temp.m but I can't speak to how accurate that is...

Hope that helps.

Michael

ali tahoori

unread,
Oct 31, 2015, 1:42:14 PM10/31/15
to adv-veh...@googlegroups.com
Hi Michael,
Thanks for your great tips. But I should select lithium battery in advisor not pb battery. In addition, I couldn't find  ess_max_ah_cap variable in lithium battery m-file.
Suppose that I just want to enter total voltage and capacity of battery in term of AH... (Please ignore internal resistance and thermal issue and other factor...)
Please see attached file which I upload a photo of battery pack of lithium battery provide 48V voltage and 20 AH capacity.
Which of parameters should be modified????
aa.jpg

Michael P O'Keefe

unread,
Nov 1, 2015, 1:12:40 AM11/1/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali:

The default lead acid batteries in ADVISOR use the internal resistance model which has less information to specify which is why I suggested it. The lithium ion file is a Resistance Capacitance model which requires you specify more information on your part. Please choose the one you like. Here's the poster that went with the last report I linked to that may make it more clear:


Here is also another paper:


As you can see, these models are "electric circuit equivalent" models of your battery and require details of the equivalent electrical resistance, open circuit voltage, etc. You'd have to read into the reports I linked to get the details on the mathematics and do some sort of "curve fitting".

As you can see in the last report, you generally need to run actual tests on the battery system of interest to fully characterize it. If you just want to use an existing battery and scale it, why don't you change the values from the GUI? You can select an existing Li Ion system and scale the number of modules and perhaps scale the capacity (ess_cap_scale) to more closely match your given battery. You might have a look at the energy storage files labeled "IDEAL" which give a hint at a minimal model that could be used to implement something based on efficiency only.

Hope some of this helps. I'll be honest and say I'm not a battery expert but hopefully this points you in the right direction.

Regards,

Michael O'Keefe

ali tahoori

unread,
Nov 17, 2015, 9:48:20 AM11/17/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
Thanks for your response, I'll appreciate it but there are still some problems. Due to importance role of battery to result it is critical to change the parameters in appropriate way.

Here's the parameters that I changed in Battery script: 
ess_module_num = 20
ess_cap_scale = 1
ess_module_mass = 1/20*15 (in order to designate 15 kg to total weight)
The nominal voltage is 213. Rint model of lithium ion battery type is selected. Please look at my results specifically Battery SOC. The electric motor charge the battery which is strange.!
Why do you think this condition happened ??? As you know, I am still trying to find kWh parameters to set but no straightforward way suggested unfortunately.I really attempt to set the parameters of battery which I selected in previous post. I'm confused a lot.

Yours respectfully.
Ali Tahoori
2015-11-17_17-43-02.jpg

Michael P O'Keefe

unread,
Nov 17, 2015, 8:28:24 PM11/17/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

I'll be honest with you and say that I'm not so familiar with the battery models that I can exactly tell you what you need to know off the top of my head. I would need to play with them within ADVISOR to refresh my memory.

However, let me suggest a strategy for you to play with them yourself:

1. Take the EV model
2. Run one of the constant speed cycles (CYC_const_65)
3. Use the "ideal" battery model (ESS_PB25_IDEAL -- look in the data file -- it is highly simplified)

Run the vehicle with different settings for the battery parameters and confirm what happens (you can change the battery parameters from the vehicle input screen at the bottom under "variable list"). For example, you can see how much energy is contained in the battery by running the battery until the vehicle stops and look at the "Energy Use Figure" on the Results screen to see the throughput.

I think "playing" with the models is the only real way to learn what is really going on.

Does that perhaps help? If you discover some things, that would be awesome if you could share your knowledge back on the list to help others out.

Regards,

Michael


ali tahoori

unread,
Nov 18, 2015, 2:01:25 AM11/18/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Thanks for your advises. Finally I could get an answer but I am not sure kWh of my battery is correct or not. 
Note that mc_min_volts in motor script must be lower than total nominal voltage of battery. The figure that I attached in previous post, shows that the aforementioned rule is not obey. I finally figure out this rule must be taken into account in every condition. However, I couldn't realize what nominal voltage means exactly. if I reduce it, it affected my performance a lot...

Any way thank you for being companion with me anytime anywhere. I still have one more question, Michael. Is auto-sizing section work in ADVISOR??? When I try to run it, lots of errors appear at first....

Michael P O'Keefe

unread,
Nov 18, 2015, 8:08:41 AM11/18/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Autosizing *should* be working. The "errors" are actually warnings, aren't they? That was caused by changes in what matlab considers to be "proper" between 2004 and today.

As an alternative, you can use adv_no_gui to run a sweep of points and determine if you're really getting an optimum size.

As with all things with computers and simulation, be sure to check any answer that the simulation gives you back to make sure it is reasonable for yourself.

The kWh you'll get from playing with the battery is going to change by how aggressively the battery is discharged. You could run the vehicle at a lower speed and then you'll get more energy, I believe -- this is the meaning behind the C-rate stuff. This is why it is not straightforward to give you a single answer. The battery is an equivalent electrical circuit with an "Amp-hour" reservoir where the open circuit voltage and the internal resistance are functions of the battery state. You'd have to integrate the total voltage x current during a discharge at different rates to find out how many kWh are in the battery.

Hope that helps,

Michael

ali tahoori

unread,
Nov 18, 2015, 1:07:30 PM11/18/15
to adv-veh...@googlegroups.com
Autosizing shows error not warning, actually. This message is appeared in Matlab command window.

Data loaded: INIT_CONDS - Standard initial conditions
Error: File: autosize.m Line: 125 Column: 4
A BREAK statement appeared outside of a loop. Use RETURN instead.

Error in autosize_setup (line 1009)
                     autosize(1,...
 
Error while evaluating DestroyedObject Callback

About kWh, I know that C-rate is a pivotal parameter in battery selection. 
When the parameters are set as below:
ess_module_num = 15 
ess_cap_scale = 0.25
nominal voltage of battery is 160 volts
ess_mass_scale_coef=[1.9 0 1.9 0]
total weight of battery is 15 kg
ess_pwr diagram is attached, as case 1.
The results of first case study: 
0-60 km/h = 5.7 s
60-90 km/h = 6.3 s
max speed = 103.9 km/h
Liter in 100km = 1.4 (during ECE driving cycle)

 
In other case, when the parameters are set as below :
ess_module_num = 5
ess_cap_scale = 1
nominal voltage of battery is 53 volts
ess_mass_scale_coef=[1.5 0 1.5 0]
total weight of battery is 13 kg
ess_pwr diagram is attached, as case 2.
The results of first case study: 
0-60 km/h = .4.2 s
60-90 km/h = 4.4 s
max speed = 103.8 km/h
Liter in 100km = 1.6 (during ECE driving cycle)

If you take a closer look to the attached picture, you'll see three different line which present C-rate are drawn. I couldn't realize that which C-rate is present the kWh which I expected. 

Thanks for your advices. Your advices are always inspiring for me and I appreciate it.

In addition, I am wondering if you know a solution to not showing warning message in command widow of MATLAB. Is there any way to disappear them?? 

Yours Sincerely.
Ali
2.jpg
1.jpg

ali tahoori

unread,
Nov 22, 2015, 9:39:57 AM11/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
I am still looking forward to hearing your response about my previous post.

I am trying to do optimization and I have lots of question about constrains. How can I add constrain in ADVISOR code.? 
I dig into optimization problem which is in ADVISOR source codes. I am trying to generate some code similar to that example. Because I am trying to use GA algorithm and I need to change the code. In that I rewrote the code which you can see in attached files. I ran the main code without the constrain, It looks perfect and works without any problem. But I cannot add constrains to the main code. When I saw the default example of ADVISOR I really couldn't understand what that code mean! I don't know how that code restrict the acceleration test constrain to 8 second for example. (I mean 0 to 60 mph should be below 8 sec.)
I am waiting for your response Michael and other friends who have any experience.

Thanks.

With Respect.
Ali Tahoori. 
Constrain Code.jpg
Main Code.jpg
Object Code.jpg

Michael P O'Keefe

unread,
Nov 22, 2015, 10:14:51 PM11/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Sorry for not replying to your original message. I thought I had already replied to it.

Please do note that ADVISOR is a volunteer activity for me. It is something I do after working a full day and after taking care of other obligations. There will be times when I can reply right away and other times when I'm unavailable. It's no problem to remind me if I forgot a message (it happens) but just please realize that this is something I do "when I can". I'm hoping as ADVISOR users of this mailing list gain more experience they will begin to jump in and answer questions as well.

Reply is inline below (I'll answer your second email separately):

On Wednesday, November 18, 2015 at 11:07:30 AM UTC-7, ali tahoori wrote:
Autosizing shows error not warning, actually. This message is appeared in Matlab command window.


I just ran autosize myself and wasn't able to recreate this error. Can you provide steps that re-create this error with any of the standard ADVISOR vehicles? If so, I'll log it in the bug tracker.

I'm not sure immediately what is wrong from the error message.
This basically makes sense: in case one you have 15 batteries at 1/4 capacity = 15/4 = 3.75 modules ; case two has 5 modules (5 at 1 capacity) so that makes sense that case 2 has the better acceleration performance.
 
If you take a closer look to the attached picture, you'll see three different line which present C-rate are drawn. I couldn't realize that which C-rate is present the kWh which I expected. 


Please note that the "C" you see in the photographs is temperature ("Celsius"). To determine the energy available at a given C-rate, you would need to know the discharge rate and compare that to the rated discharge rate (= C rate) and see how much energy you could draw out. Unfortunately, none of the ADVISOR graphs show you exactly the battery capacity in kWh but I was suggesting you could get an actual capacity measurement by running a vehicle at different constant speeds to simulate different current draws on the battery and looking at the energy use figure.
 
Thanks for your advices. Your advices are always inspiring for me and I appreciate it.

In addition, I am wondering if you know a solution to not showing warning message in command widow of MATLAB. Is there any way to disappear them?? 


I don't but you might search in the matlab/simulink mailing lists to see if there is any advice or warning levels available. If you find an answer to that, please let us know.
 
Yours Sincerely.
Ali

Michael P O'Keefe

unread,
Nov 22, 2015, 10:28:19 PM11/22/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Replies in-line below:


On Sunday, November 22, 2015 at 7:39:57 AM UTC-7, ali tahoori wrote:
Hi Michael,
I am still looking forward to hearing your response about my previous post.

I am trying to do optimization and I have lots of question about constrains. How can I add constrain in ADVISOR code.? 

The optimization capabilities using adv_no_gui are definitely more powerful than autosize so that's probably a good choice to explore them. That said, they can be difficult to set up. There are some messages on this Google Group that deal with setting up adv_no_gui -- please do be sure to look at those.

One thing you definitely need to do with adv_no_gui is to take an incremental approach: you need to test your objective and constraint functions in isolation before you wire them up for running in your search algorithm. It's hard to tell just looking over your screen shots but line 9 of Main.m looks suspicious: I would have expected a cell of two items with the second corresponding to mc_trq_scale. It's good to run the objective and constraint functions with known inputs and then confirm that the actual variables you requested have been changed on the workspace.
 
I dig into optimization problem which is in ADVISOR source codes. I am trying to generate some code similar to that example. Because I am trying to use GA algorithm and I need to change the code. In that I rewrote the code which you can see in attached files. I ran the main code without the constrain, It looks perfect and works without any problem. But I cannot add constrains to the main code. When I saw the default example of ADVISOR I really couldn't understand what that code mean! I don't know how that code restrict the acceleration test constrain to 8 second for example. (I mean 0 to 60 mph should be below 8 sec.)

For your constraint function, you need to communicate to the GA whether a given point should be valid or not. If you have a search algorithm that explicitly handles constraints, then you can feed it the constraint information. If you don't you might consider adding (or subtracting if you are maximizing) some penalty amount to your objective response variable when you detect your constraint has been violated. The literature on GA's should have examples of this.

Hope that helps,

Michael

ali tahoori

unread,
Nov 23, 2015, 9:40:55 AM11/23/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Dear Michael
I have to express my apologies if my question bothering you a lot.
For warning message in Matlab there is a code which switch off the warning but it does not work with ADVISOR warning message. 
The code is :
warning('off','all')
warning
In constrain code and the main code there are lots of vague point which I think you can help me understand them.
In the main codes why ADVISOR uses dv_names , resp_names and con_names ??? 
My another question is what is the role of con=evalin('base','con'); in the first line of constrain code??? when I run it, MATLAB says undefined parameter con !!!!

Thanks anyway.

Regards.
Ali 


Michael P O'Keefe

unread,
Nov 23, 2015, 9:56:14 AM11/23/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Ali,

Thank you for looking into the warnings. The ADVISOR errors originate from Simulink blocks -- perhaps there is another command that applies to Simulink itself?

I can tell you what the full variable names mean if that helps:

dv_names = design variable names; these are the setting values you will change via your search engine

resp_names = response names; these are the responses you will measure on evaluation of a case or design point. You will probably have to turn this value into a single number for your GA.

con_names = constraint names; these are the names of your constraints. You will probably have to artificially weight the response values when you break a constraint if you don't have an optimization algorithm that explicitly handles constraints

The reason these were given names is probably for error reporting or printing out during running or to more easily identify values within a cell array. You don't have to do it this way. The objective function only needs to shoot back a number that measures the objective.

The role of con=evalin('base','con') is to get the variable "con" which is defined in Matlab's base workspace (that is, the normal global workspace). You are getting an error because con has not been initialized. This is round-about way of creating a static variable who's value doesn't change between function invocations. There may be better ways to do this in matlab now (remember, ADVISOR was first written around 1994).

Cheers,

Michael

ali tahoori

unread,
Nov 30, 2015, 4:01:04 AM11/30/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Thanks Michael for your advises. I finally could run optimization with GA algorithm. I did it by put the constrains to my objectives and creating mutliObjective optimization problem. 

I have another question which refer to SOC correction in ADVISOR ??? What does this variable mean exactly?
I want to illustrate my thoughts and wish that will be correct. Please correct me if I'll something wrong.
For comparing Fuel Consumption of two proposed vehicle which is converted to hybrid vehicle. I mean one vehicle with conventional power-train and another vehicle with hybrid vehicle. When you run an standard cycle to SOC of batteries are depleted or reduced at the end of driving cycle, however, you had  full charged batteries at the starting point of cycle. Because of that, we will run engine to use fuel to bring back the primary SOC of batteries. In this case the fuel consumption of hybrid vehicle increased a bit but we had an fair judgement in comparison of two vehicle. In other word, by running SOC correction the fuel consumption of vehicle increased to compare with situation that we do not run SOC correction.
Am I right ??? 

Thanks...

Michael P O'Keefe

unread,
Nov 30, 2015, 8:11:38 AM11/30/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Yes, I believe what you say is correct but let me say it a different way.

Having a different ending SOC than starting SOC means you have either stored more (electrical) potential energy or have depleted more electrical potential energy than would a conventional vehicle. The SOC correction mechanism is a computational short-cut: the algorithm tries to guess a starting SOC that will match the ending SOC. Another way you could get the same effect is to just keep running the same driving cycle back-to-back until you've used so much fuel energy that the changes in starting and ending SOC are negligible. It's usually more computationally efficient to let the algorithm iterate on starting SOC than to run multiple back to back cycles but if you have a small battery, it may not necessarily be the case.

Another way to think of it is if you ran a driving cycle but ended at a point higher or lower in elevation than your starting point. For example, if you measured the fuel economy driving up a hill or down a hill. If you ran 100 meters but ended at a point 10 meters higher than you began, you might rightly be skeptical of the fuel economy you measure. However, if you ran 1000 kilometers and the ending point was only 10 meters different than the beginning point, you could be confident that you are getting a good fuel economy measurement because the difference in gravitational potential energy for 10 meters is negligible compared to the energy to drive 1000 kilometers. The SOC correction is like iterating on the starting elevation so that the starting and ending elevations are the same.

Run a simulation with SOC correction on and then run with multiple cycles back to back and you will see the effect I am talking about.

Best,

Michael O'Keefe

ali tahoori

unread,
Dec 13, 2015, 7:53:51 AM12/13/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Michael,
I have a question about electric only mode in ADVISOR.. How can I enable engine only mode.??? I know that there is a check box in acceleration test but I need electric mode on cycle not only on Speed test or acceleration test. Even when I try fc_trq_scale =0 , I confronted an error....
Thanks.  

Michael P O'Keefe

unread,
Dec 13, 2015, 10:08:55 AM12/13/15
to ADVISOR and adv-vehicle-sim Software Discussion Forum
Hi Ali,

Setting fc_trq_scale would physically size the internal combustion engine to have zero torque which I'm not sure what that would do.

The variable you want is "fc_on" which is 1 for allowing the engine to be on and 0 to turn it off for all time.

Michael

It is loading more messages.
0 new messages