FastFieldSolvers Forum
FastFieldSolvers Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
 All Forums
 FastFieldSolvers
 FastHenry2
 Automation with Matlab
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wenlong ma

China
11 Posts

Posted - Dec 04 2017 :  15:24:49  Show Profile  Reply with Quote
Hi,Enrico#65292;
I am comming again, i got a new Problem, when i am using Automation with Matlab, i want to get the Frequency, then i can plot diffrerent Frequency with resistance and Inductance. but i don't know how? could you a little help me ?
The code like this :
path_to_input='C:\Users\MAWLO\Desktop\wenlong.ma\MATLAB stl.fle\';
ax=actxserver('FastHenry2.Document');
ax.invoke('Run',['"' path_to_input 'testgui1.inp"']);
while(ax.invoke('Isrunning'))
pause(0.1);
end
L=cell2mat(ax.invoke('GetInductance'));
R=cell2mat(ax.invoke('GetResistance'));
Frequency=cell2mat(ax.invoke('GetFreq'));
ax.invoke('Quit');
ax=[];
i can get Resistance and Inductance ,but the Frequency is error.

Best Regards
wenlong ma
Karlsruhe Institute of Technology

Enrico

530 Posts

Posted - Dec 05 2017 :  15:19:54  Show Profile  Reply with Quote
Hi Wenlong,

welcome back.

The only error I see in the input file ist hat you should invoke the "GetFrequencies" method, not "GetFreq", as per FastHenry2 online embedded help, Automation reference section.

Please let me know if the issue is simply this typo.

Best Regards,
Enrico



Go to Top of Page

wenlong ma

China
11 Posts

Posted - Dec 06 2017 :  13:57:05  Show Profile  Reply with Quote
Thanks a lot, i have got it. u r so nice. but i get three another questions:
1,if i have 2 busbars in DC case, could i simulated like this ?
**** DC Busbars***
.Unit mm
*** copper the default conductivity
*** dfault units are milemeters
.Default sigma=58000
**nodes of busbars
N1 x=0 y=0 z=0
N2 x=50 y=0 z=0
N3 x=50 y=10 z=0
N4 x=0 y=10 z=0
***
E1 N1 N2 w=6 h=2 nwinc=5 nhinc=2
E2 N3 N4 w=6 h=2 nwinc=5 nhinc=2
****
.equiv N2 N3
.external N1 N4
.freq fmin=0 fmax=1e-10 ndec=1
.end
i can get only the resistance. is it right ?
2. if this is not DC-Case,can i use the same code to do it ? only change the frequencies? for example: .freq fmin=10 fmax=1e5 ndec=1.
3.if i have three busbars,that connect with a Synchronous motor ,can i do this like my example ? and is there method to consider the phase in Fasthenry?
that's all. Thanks a lot!!



quote:
Originally posted by Enrico

Hi Wenlong,

welcome back.

The only error I see in the input file ist hat you should invoke the "GetFrequencies" method, not "GetFreq", as per FastHenry2 online embedded help, Automation reference section.

Please let me know if the issue is simply this typo.

Best Regards,
Enrico







Best Regards
wenlong ma
Karlsruhe Institute of Technology
Go to Top of Page

Enrico

530 Posts

Posted - Dec 06 2017 :  19:23:53  Show Profile  Reply with Quote
In the .freq statement, as explained in the FastHenry guide

.Freq fmin=value fmax=value


if the 'fmin' value is zero, FastHenry will run only the DC case regardless of the value of 'fmax'. And, yes you'll get also the inductance value, not only resistance. Please review the concept of inductance here.

You can anyway use the same input file for different frequencies, as long as the discretization is fine enough to capture the high-frequency skin and proximity effects. Again, please read thoroughly the FastHenry user's guide (it is available either from the "Literature->Documentation" page of our web site, or from the first page of the embedded online help of FastHenry2 for Windows).

Your question about the phase, instead, is not well posed. You can simulate the three bus bars, no issue; but the phase, if I guess right what you would like to do, depends on the input stimuli you apply vs. the reactance of your load, i.e. the busbar model plus the motor model, in a Spice (or similar circuit solver) simulation.

Best Regards,
Enrico


Go to Top of Page

wenlong ma

China
11 Posts

Posted - Jan 11 2018 :  08:54:12  Show Profile  Reply with Quote
Hi, Enrico,
i have a small question, i use Matlab to Automation Fasthenry, can i use :
ax.invoke('Run',['"' path_to_input 'xxxx.inp"']);
while(ax.invoke('Isrunning'))
pause(0.1);
end
like this to creat a Spice file ? like to change the Order for reduced order model(-r) equate 1? how can i use Matlab to do this?

Best Regards
Wenlong
quote:
Originally posted by Enrico

In the .freq statement, as explained in the FastHenry guide

.Freq fmin=value fmax=value


if the 'fmin' value is zero, FastHenry will run only the DC case regardless of the value of 'fmax'. And, yes you'll get also the inductance value, not only resistance. Please review the concept of inductance here.

You can anyway use the same input file for different frequencies, as long as the discretization is fine enough to capture the high-frequency skin and proximity effects. Again, please read thoroughly the FastHenry user's guide (it is available either from the "Literature->Documentation" page of our web site, or from the first page of the embedded online help of FastHenry2 for Windows).

Your question about the phase, instead, is not well posed. You can simulate the three bus bars, no issue; but the phase, if I guess right what you would like to do, depends on the input stimuli you apply vs. the reactance of your load, i.e. the busbar model plus the motor model, in a Spice (or similar circuit solver) simulation.

Best Regards,
Enrico






Best Regards
wenlong ma
Karlsruhe Institute of Technology
Go to Top of Page

Enrico

530 Posts

Posted - Jan 11 2018 :  14:39:16  Show Profile  Reply with Quote
Please see the embedded online help:
quote:


FastHenry2Object.Run
boolean FastHenry2Object.Run(BSTR commandLine)
Return Value
True if FastHenry2 was able to start a simulation, false otherwise.

Notes:
A reason why FastHenry2 could not be able to start a simulation is that a simulation is already running. You can try to stop FastHenry2 before retrying and / or poll FastHenry2 status.
Parameters
commandLine

A string containing a FastHenry2 command line, as would be given from a shell console.

Example:

FastHenry2Object.Run("broken.inp -O")



You can see that all standard command line options can be given together with the file name in the 'Run' method string.

The valid parameters are described in the original FastHenry user's manual, again accessible from the first page of the embedded online help.
So for instance to generate a ROM of order 10 you should be able to use:

ax.invoke('Run', ['"myinput.inp -r 10 -M"']);


Best Regards,
Enrico

Go to Top of Page

mona

3 Posts

Posted - Jun 14 2018 :  15:56:38  Show Profile  Reply with Quote
Dear Wenlong Ma
excuse me ,after reading the content ,i have some problems want to consult with you ,can you leave an email for me ,thank you very much!!

Edited by - mona on Jun 14 2018 15:57:26
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
FastFieldSolvers Forum © 2020 FastFieldSolvers S.R.L. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.06