Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "Weap automating with Matlab"
Log in to post new messages or reply to existing messages.
 
Author Message
Mr. Mostafa Khorsandi

Subject: Weap automating with Matlab   
Posted: 4/20/2012 Viewed: 37562 times
Does anyone know how can I automate weap with Matlab without problem?
It works very well with VB but have problems with matlab
thanks
Mr. Jack Sieber

Subject: Re: Weap automating with Matlab   
Posted: 4/20/2012 Viewed: 37559 times
I do not have any experience with Matlab and WEAP. Do you want to write a Matlab script to control WEAP, or write a script in WEAP to control Matlab?
Mr. Mostafa Khorsandi

Subject: Re: Weap automating with Matlab   
Posted: 4/20/2012 Viewed: 37556 times
I want to write a Matlab script to control WEAP
Dr. Mehdi Mirzaee

Subject: Re: Weap automating with Matlab   
Posted: 4/27/2012 Viewed: 37501 times
Hi Mostafa,

It is possible. when you can write VB and interact it with WEAP, means that you can connect MATLAB with WEAP, but there is a small problem! Are you trying to make an .exe file? So, are you sure that your MATLAB is not hacked one?
Honestly, some hacked MATLAB versions can not make execution files and sometimes shows a non sense error or message.

Eng. Alberto Vivas Narváez

Subject: Re: Weap automating with Matlab   
Posted: 5/31/2012 Viewed: 37202 times
Hi Mostafa:

In programming (VB) there are many things you can do but you should never forget the goal. What questions need to answer through link-WEAP MatLab?

You can use MATLAB in a wide range of Applications, Including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology

Regards

Mr. Mostafa Khorsandi

Subject: Re: Weap automating with Matlab   
Posted: 5/31/2012 Viewed: 37192 times
I want to optimize some parameters in weap by genetic algorithm (GA) or NSGA that exist in MATLAB, ...
and I'm not trying to write an .exe file to do this

writing an .exe file for this is a new idea that I didn't think about it
but maybe it can work.
if possible say me what is your way to link by means of an .exe file?

best regards
Dr. Mehdi Mirzaee

Subject: Re: Weap automating with Matlab   
Posted: 5/31/2012 Viewed: 37187 times
Mostafa:

Well... Honestly I am not a Pro. programmer!just have a little things about MATLAB.

Anyway, I think that you have two or three ways. The first one is writing a .dll file, then call them in WEAP by "Enter Expression". It is the easiest way.

The second way is that you prepare a platform for everything which it can be a VBA platform (like Excel). you can run and call everything that you want by VBA expressions, like .dll or .exe file.
in this manner, if you are a software pro or you have some one to have "HEADACHE" for writing software, you can check this website:

http://www.openmi.org/

you can write and then run a plat form of different software and link them each other. This is in a part of Deltares (Former Delft Hydraulics) website. Unfortunately, as I told you, I am not a programmer and old for learning it! :)

Have fun!
Eng. Ioannis Tsoukalas

Subject: Re: Weap automating with Matlab   
Posted: 11/30/2012 Viewed: 36207 times
i try to couple weap and matlab via COM and i have a similar problem.. here is 2 lines of matlab scritping

W=actxserver('WEAP.WEAPApplication') %%to make the coupling

W.Branch('\Demand Sites\South City').Variable('Consumption').Expression=30 %%to define the consumption

but in weap i get the logical value "True" does anyone know how can i make it work?
Mr. Mostafa Khorsandi

Subject: Re: Weap automating with Matlab   
Posted: 11/30/2012 Viewed: 36199 times
Hi Ioannis:
Unfortunately we couldn't solve this problem and our plan has been changed
but, if there is no obligation to do by Matlab, it is better to do by visual basic

Regards
Mr. behzad jamali

Subject: Re: Weap automating with Matlab   
Posted: 6/12/2013 Viewed: 33956 times
Hi Ioannis
did you solve the logical value "True" problem in data expression? I have te same problem, too.
i wonder if you can tell me about your experiences in weap automating With Matlab and its optimization algorithms.
Mr. Jack Sieber

Subject: Re: Weap automating with Matlab   
Posted: 9/9/2015 Viewed: 25011 times
Ioannis,

Congratulations on your recent conference paper, "Hydrosystem Optimization on a Budget: Investigating the Potential of Surrogate Based Optimization Techniques", http://cest.gnest.org/cest15proceedings/public_html/papers/cest2015_00162_oral_paper.pdf . It appears that you were able to couple WEAP and MATLAB. Could you please explain briefly how you did it, so that others could benefit?

Jack
Miss Hadis Moghadam

Subject: Re: Weap automating with Matlab   
Posted: 7/15/2018 Viewed: 12730 times
Hi, i have this problem too.
I want to link weap with matlab(iwo algorithm). Did you found how can you solve this problem?
Regards
Mr. Mido Wakeel

Subject: Re: Weap automating with Matlab   
Posted: 1/18/2020 Viewed: 10169 times
Hi everyone,

Did you found how can you solve this problem?

Regards
Dr. Jessica Lovering

Subject: Re: Weap automating with Matlab   
Posted: 3/4/2021 Viewed: 8477 times
Hi. I am also very interested in this and am getting the issue of WEAP setting my expression to true or false instead of a string or value.

Has anyone made progress on this?

Thanks!
Topic "Weap automating with Matlab"