Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Problem with linking between Matlab, CST and applying Genetic Algorithm(GA)

Status
Not open for further replies.

trinhvanson

Junior Member level 1
Joined
May 18, 2010
Messages
15
Helped
0
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Vietnam
Activity points
1,390
Hi everybody,

I got a problem when I try to use matlab connecting with CST 2010 and applying GA for simulation antenna. I setup for maximum of iterations (maxit) 100. But my simulation always stopped at the iteration of 26th. And a message appeared as "Server threw an exception". Matlab can not call CST to keep run simulation. I also attack my code (simple code: just open CST and save and close, the same problem occurred at iteration of 25th). I think that because of limiting the number of simulation processes, which continuously open, in CST. But I don't know how to fix this.

Does anyone know about it? and can help me solve my problem.
Thank you so much!
Best regards,
TrinhVanSon
 

Attachments

  • MatlabCST_GA.txt
    541 bytes · Views: 75

zeekhan

Newbie level 2
Joined
Oct 15, 2010
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
Hallo.. Trinhvanso.

Hope you will be fine..
Actually I'm also working on linking CST MWS with Matlab for my Waveguide cavity..
plzz if you know about how to link the CST with Matlab..plzz let me know..I'm doing Master in Electrical engineering from University Rostock Germany.
thanks
Umar

- - - Updated - - -

Hallo.. Trinhvanso.

Hope you will be fine..
Actually I'm also working on linking CST MWS with Matlab for my Waveguide cavity..
plzz if you know about how to link the CST with Matlab..plzz let me know..I'm doing Master in Electrical engineering from University Rostock Germany.
thanks
Umar
 

rf_uwave

Newbie level 3
Joined
May 11, 2012
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,301
>> cst2 = actxserver('MWStudio.Solver');
cst2.invoke('Start');
??? Error using ==> actxserver at 91
Server creation failed. Invalid ProgID 'MWStudio.Solver'
Why this error is coming ; plz explain and guide
 

trinhvanson

Junior Member level 1
Joined
May 18, 2010
Messages
15
Helped
0
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Vietnam
Activity points
1,390
The following syntax is used to directly open a new CST MWS window within Maltab environment:

cst = actxserver('CSTStudio.application');
mws = invoke(cst, 'NewMWS');


Translate CST-specific VBA commands to Matlab commands, refer to below example for creating a brick

VBA:
With Brick
.Reset
.Name ("brick1")
.Component ("component1")
.Material ("PEC")
.Xrange (0, 2)
.Yrange (0, 3)
.Zrange (0, "a+3")
.Create
End With

Translate to Matlab commands
brick=invoke(mws,'Brick');
invoke(brick, 'Reset');
invoke(brick, 'Name', 'brick1');
invoke(brick, 'Component','component1');
invoke(brick, 'Material', 'PEC');
invoke(brick, 'Xrange', '0', '2');
invoke(brick, 'Yrange', '0', '3');
invoke(brick, 'Zrange', '0', 'a+3');
invoke(brick, 'Create');
release(brick);

Hallo.. Trinhvanso.

Hope you will be fine..
Actually I'm also working on linking CST MWS with Matlab for my Waveguide cavity..
plzz if you know about how to link the CST with Matlab..plzz let me know..I'm doing Master in Electrical engineering from University Rostock Germany.
thanks
Umar

- - - Updated - - -

Hallo.. Trinhvanso.

Hope you will be fine..
Actually I'm also working on linking CST MWS with Matlab for my Waveguide cavity..
plzz if you know about how to link the CST with Matlab..plzz let me know..I'm doing Master in Electrical engineering from University Rostock Germany.
thanks
Umar
 

lostinsocorro

Member level 2
Joined
Oct 13, 2008
Messages
43
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,288
Activity points
1,514
Does anyone know how to run a CST macro from Matlab? Also, how do you get the results from the result tree using Matlab?
 

y.ettefagh

Junior Member level 2
Joined
Jul 17, 2012
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,423
Hi everyone
I hope someone can help me cause i really need help now!
i need to run cst for about 200 times and i have to change some parameters each time. i've designed the model and im having problem with changing parameters in matlab as far as i know we can define bricks... and form a new model in cst using matlab but i want to know whether or not we can change parameters of a pre defined model in cst with matlab or not. and does anyone know how can we export the data more rapidly than manually exporting? is there anyway ???
thank you :)
 

trinhvanson

Junior Member level 1
Joined
May 18, 2010
Messages
15
Helped
0
Reputation
2
Reaction score
0
Trophy points
1,281
Location
Vietnam
Activity points
1,390
Hi everyone
I hope someone can help me cause i really need help now!
i need to run cst for about 200 times and i have to change some parameters each time. i've designed the model and im having problem with changing parameters in matlab as far as i know we can define bricks... and form a new model in cst using matlab but i want to know whether or not we can change parameters of a pre defined model in cst with matlab or not. and does anyone know how can we export the data more rapidly than manually exporting? is there anyway ???
thank you :)

Hi y.ettefagh,

Actually, I already got the same problem when I try to call and run CST from Matlab many times. But it seems impossible.

Therefore, in my case, I built the model with parameters in CST firstly. Then I use Matlab to call this CST file and update my parameters by matlab commands.
Using the following syntax

HTML:
invoke(mws,'StoreParameter','name_parameters',value_parameter);
invoke(mws,'Rebuild');

"name_parameter" is name of parameter in CST file
"value_parameter" is value of parameter that you want to change to

By using this way, you can call and run CST as many times as you want.

I hope this will be helpful for you.
Rgs,
 

y.ettefagh

Junior Member level 2
Joined
Jul 17, 2012
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,423
Hi trinhvanson.
thanks for your attention
i used the syntax winopen to open my cst model, as far as i undrestood the commands:
"cst = actxserver('CSTStudio.application');
mws = invoke(cst, 'NewMWS'); "
cant open a pre-defined model. so how can i define 'mws' as you said?
thank you kindly
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top