Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi All, Any tips on how to conve

Status
Not open for further replies.

MosesTebatso

Programmer
Apr 28, 2021
1
ZA
Hi All,

Any tips on how to convert or write the following matlab code into python code?
The main goal is to implement DDE in python as implemented in matlab on the example below.

% This file shows how EES and MATLAB can be coupled through file transfer

%% First start a DDE conversation between MATLAB and EES

chan = ddeinit('EES','DDE');

% Now let EES load the EES file

rc = ddeexec(chan,'[Open EES_MATLab.ees]'); % Alternative rc = ddeexec(chan,'Play EES_MATLab.emf');

% Create a File in MATLAB such that it can be read by EES with the $Import directive

var1 = 1;

var2 = 2;

var3 = 3;

var4 = 4;

var5 = 5;

t = 0;

for i = 1:10

t = t + 1

save MatLabInput.txt var1 var2 var3 var4 var5 t -ascii

% Ask EES solve the previously loaded program

rc = ddeexec(chan,'[Solve]');

% Read a file created by EES through the $EXPORT command into MATLAB

erg = csvread('EESOutput.csv')

end



% Terminate the DDE conversation between MATLAB and EES

ddeterm(chan);

________________



Thanks
 
For those who don't know matlab

DDE = Delay Differential Equations
EES = Engineering Equation Solver

There is no point in doing DDE to EES pipe in python. These are matlab specific.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top