Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interfacing MATLAB and CO2MPAS #23

Open
GokulMaharaj opened this issue Oct 26, 2017 · 3 comments
Open

Interfacing MATLAB and CO2MPAS #23

GokulMaharaj opened this issue Oct 26, 2017 · 3 comments

Comments

@GokulMaharaj
Copy link

I am new to CO2MPAS and I have a task in hand to optimize an hybrid vehicle for its fuel economy. I want to run the optimization using NSGA II with minimizing fuel economy and acceleration time and maximizing the vehicle speed as the objectives. The design parameters would be engine power, motor power and battery energy capacity. I want to find the values of the objective functions using CO2MPAS for each generation of solutions obtained from NSGA. Is it possible to do that? I can also run the NSGA in MATLAB but in that case I would like to know how to interface MATLAB and CO2MPAS. Please guide me.

@dimitriskomnos
Copy link
Contributor

Dear @GokulMaharaj,

The present CO2MPAS Release doesn't support hybrids. So, you first need to consider if CO2MPAS is the right tool for you.
If it is, then, in order to try and solve your problem, here are some notes for you:

  1. Matlab/ Python API:
    First you need a way to invoke Python from Matlab. MathWorks suggested way of doing this should be fine:
    http://www.mathworks.com/help/matlab/matlab_external/call-python-from-matlab.html
    Of course you have to properly install CO2MPAS in the python-environment that Matlab would be calling out.

  2. CO2MPAS DataStructures for Input
    You need to plug into CO2MPAS's internal data-structures. We have an IPython script, (simVehicle.ipynb) that did exactly this for previous versions:
    http://co2mpas.io/usage.html#launch-co2mpas-from-jupyter-aka-ipython
    It is a nice starting-point and a good guideline on how you could handle the data communication.
    This requires some good knowledge of python and the respective packages but if you are an experienced matlab user it shouldn't take very much time to orientate yourself.

  3. Read Output into MATLAB
    Handling the output is much more complex if you don't have experience with python. We suggest that you try to use the out-template function, define an excel template that fits your requirements and use that one for detailed time series comparison. For comparing simple CO2 values, the summary file produced after any batch run should work fine and it is fairly easy to read also with Matlab.

We hope this helps.

@GokulMaharaj
Copy link
Author

Thanks a lot for the information. Is there any version coming soon which could possibly simulate hybrid vehicles?

@dimitriskomnos
Copy link
Contributor

It is hard to estimate, but not earlier than September 2018.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants