vensim link matlab
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
Thank you bob,
I could solve it.but now I have 2 questions.
when I link vensim and excel, I use another excel file for my variable in vensim and in vensim I used it's adress, now I want to close automatically the data excel window after run micro and run vensim.what can I do?
another question:when I use for loop in micro to run vensim several times,after each run vensim ask me a question and I have to answer it to go to the next step Otherwise it will not go to the next stage.I dont want to see this window.what Can I do?
it's question:dataset current already exist. do you want to overwrite it?
I could solve it.but now I have 2 questions.
when I link vensim and excel, I use another excel file for my variable in vensim and in vensim I used it's adress, now I want to close automatically the data excel window after run micro and run vensim.what can I do?
another question:when I use for loop in micro to run vensim several times,after each run vensim ask me a question and I have to answer it to go to the next step Otherwise it will not go to the next stage.I dont want to see this window.what Can I do?
it's question:dataset current already exist. do you want to overwrite it?
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
>> when I link vensim and excel, I use another excel file for
>> my variable in vensim and in vensim I used it's adress, now I
>> want to close automatically the data excel window after run micro
>> and run vensim.what can I do?
This is all in Matlab code isn't it? You will need to ask on a Matlab forum for the answer.
>> another question:when I use for loop in micro to run vensim several
>> times,after each run vensim ask me a question and I have to answer
>> it to go to the next step Otherwise it will not go to the next stage.
>> I dont want to see this window.what Can I do?
There is a function you can call in the same way as vensim_command called vensim_be_quiet. Call this in your code and the box will not appear. But see the next answer as well before you do this.
>> it's question:dataset current already exist. do you want to overwrite it?
What is the command you are using to run the model? Is it "MENU>RUN|"? If it is, try "MENU>RUN|o" instead.
[Edited on 27-10-2010 by Administrator]
>> my variable in vensim and in vensim I used it's adress, now I
>> want to close automatically the data excel window after run micro
>> and run vensim.what can I do?
This is all in Matlab code isn't it? You will need to ask on a Matlab forum for the answer.
>> another question:when I use for loop in micro to run vensim several
>> times,after each run vensim ask me a question and I have to answer
>> it to go to the next step Otherwise it will not go to the next stage.
>> I dont want to see this window.what Can I do?
There is a function you can call in the same way as vensim_command called vensim_be_quiet. Call this in your code and the box will not appear. But see the next answer as well before you do this.
>> it's question:dataset current already exist. do you want to overwrite it?
What is the command you are using to run the model? Is it "MENU>RUN|"? If it is, try "MENU>RUN|o" instead.
[Edited on 27-10-2010 by Administrator]
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
now I have another question:
when I run micro, when it reach to the step that should show the result in the place that I specified for it in excel,for some of them this apears:--
But only somtimes.Do you know what is the reason??
[Edited on 10-28-2010 by ahmadi2010]
[Edited on 10-28-2010 by ahmadi2010]
when I run micro, when it reach to the step that should show the result in the place that I specified for it in excel,for some of them this apears:--
But only somtimes.Do you know what is the reason??
[Edited on 10-28-2010 by ahmadi2010]
[Edited on 10-28-2010 by ahmadi2010]
- Attachments
-
[The extension ocx has been deactivated and can no longer be displayed.]
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
after run micro,vensim has calculated and I can see the results in vensim but in excel I can't see it????
Sub GetValue()
Dim returnList As Variant
For i = 1 To 10
varstr$ = Cells(5, .Text + "@" + Str(i)
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(4 + i, 10).Value = returnList(LBound(returnList))
Cells(4 + i, 9).Value = i
Next
varstr$ = Cells(5, 12).Text
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(5, 13).Value = returnList(LBound(returnList))
varstr$ = Cells(5, 15).Text + "@" + Cells(5, 16).Text
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(5, 17).Value = returnList(LBound(returnList))
End Sub
....................................
for the first time after run I can see all the value that calculated by the vensim, but for the second and ....... that sign apears!!!!
[Edited on 10-28-2010 by ahmadi2010]
Sub GetValue()
Dim returnList As Variant
For i = 1 To 10
varstr$ = Cells(5, .Text + "@" + Str(i)
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(4 + i, 10).Value = returnList(LBound(returnList))
Cells(4 + i, 9).Value = i
Next
varstr$ = Cells(5, 12).Text
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(5, 13).Value = returnList(LBound(returnList))
varstr$ = Cells(5, 15).Text + "@" + Cells(5, 16).Text
returnList = Application.DDERequest(DDE_channel, varstr$)
Cells(5, 17).Value = returnList(LBound(returnList))
End Sub
....................................
for the first time after run I can see all the value that calculated by the vensim, but for the second and ....... that sign apears!!!!
[Edited on 10-28-2010 by ahmadi2010]
- Attachments
-
[The extension ocx has been deactivated and can no longer be displayed.]
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
You will need to upload the model and spreadsheet for us to take a proper look. If you would prefer to email them to me direct I can take a look (tony@vensim.com).
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
I'm faced with a new event. I'm using micro like these:
sub load model()
.
.
end sub
..............
sub setconstant()
.
.
endsub
..............
sub simulate()
.
.
end
...........
and so
....................
when I run these micro by click on eachone steb by step,it works correctly.But when I record these micros and use one micro for running the program, I see (--) for some variable!!!!!!!!!!!!But I need to record and use one micro:(
sub load model()
.
.
end sub
..............
sub setconstant()
.
.
endsub
..............
sub simulate()
.
.
end
...........
and so
....................
when I run these micro by click on eachone steb by step,it works correctly.But when I record these micros and use one micro for running the program, I see (--) for some variable!!!!!!!!!!!!But I need to record and use one micro:(
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
You know you can call Vensim DSS by providing it with a .cmd script as an argument and have it do whatever you want, including exporting results to a txt file that Excel can read or pushing them to a database using ODBC that excel can also read. At the end of that a MENU>EXIT will cause the Vensim DSS process to exist and then you can start it again fresh the next time it is needed.
-
- Senior Member
- Posts: 77
- Joined: Thu Aug 19, 2010 3:34 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Junior Member
- Posts: 16
- Joined: Fri Jun 24, 2016 4:47 am
- Vensim version: DSS
Re:
ahmadi2010 wrote:Finaly I could load vendll32.
Now I load this model:
str=['SPECIAL>LOADMODEL|',test,'.vpm'];
lp=libpointer('voidPtr',[int8(str) 0]);
calllib('vendll32','vensim_command',lp);
How can I see the result of my model in matlab or the amount of variable thet I defined in vensim?
You mean by installing XP, you solved the problem?
Re: vensim link matlab
This thread is six years old, and all the software involved has changed - I think you're unlikely to get useful answers here. I'd suggest composing a new question.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/