Page 6 of 8 FirstFirst ... 45678 LastLast
Results 51 to 60 of 80

Thread: XFOIL with MATLAB

  1. #51
    Join Date
    Sep 2010
    Beans
    6

    Re: XFOIL with MATLAB

    Thanks azredwing,

    I didn't notice the post, because it wasn't there on Friday when I started this. I downloaded the packages and did everything in the readme file, but it doesn't work. This is the message I get in MATLAB:

    ??? Error using ==> runperl at 67
    Perl binary not found. Install Cygwin with Perl, then add <parent folder>\\cygwin\\bin to your PATH.

    Error in ==> mpxfoil at 127
    runperl('xfw.pl', airfoil, isnaca, Re, Ma, alfa_start, alfa_end, alfa_step, maxit, input_file, timeout);

    Error in ==> test at 12
    mpxfoil(airfoil, Re, Ma, alfa_start, alfa_end, alfa_step, maxit, timeout)
    The steps I performed:
    Installed Cygwin, and enabled complete perl libary, all of the packages starting with gcc and two packages started with make. I added the paths in the windows environment settings.

    The command:
    # perl -MCPAN -e "install IO: Pty; install IPC::Run"

    does not run in the unix shell. That's the thing that looks like a DOS prompt, right? Sorry I'm an absolute noob with unix, ubuntu. I just want to get the matlab/xfoil interaction working and got here by using google.

    Could you give me advice, I would really appreciate it. Thanks a lot already.
    Last edited by Schuifpui2; September 19th, 2010 at 01:34 PM.

  2. #52
    Join Date
    Sep 2010
    Beans
    6

    Re: XFOIL with MATLAB

    Alright, I reinstalled everything, including all packages this time. I still get the same error message. Any ideas?

    Edit: Forget previous message, I got a bit further. Now I get an error while running the matlab file in black text:

    XFOIL error: Command 'xfoil' not found in /cygdrive/c/Program Files/MATLAB/R2008b/bin/win32, /cygdrive/c/watcom-1.3/binnt, /cygdrive/c/watcom-1.3/binw, /cygdrive/c/Program Files/MiKTeX 2.8/miktex/bin, %CommonProgramFiles%/Microsoft Shared/Windows Live, /cygdrive/c/Windows/system32, /cygdrive/c/Windows, /cygdrive/c/Windows/System32/Wbem, /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/, /cygdrive/c/Program Files/MATLAB/R2008b/bin, /cygdrive/c/Program Files/MATLAB/R2008b/bin/win32, /cygdrive/c/Program Files/Common Files/DivX Shared/, /cygdrive/c/Program Files/QuickTime/QTSystem/, /cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live, /usr/bin, /cygdrive/c/XFOIL/bin at xfw.pl line 81
    Any ideas on this? I first thought that it would have something to do with the path thing, but when I change that I always get the message from my previous post. So I think my path thingy in windows is right. This is what I have there:

    %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\cygwin\bin;C:\XFOIL\bin
    Last edited by Schuifpui2; September 19th, 2010 at 05:59 PM.

  3. #53
    Join Date
    Sep 2010
    Beans
    1

    Re: XFOIL with MATLAB

    Quick question. Does this perl shell run Xfoil without the plots automatically popping up? I am trying to figure out a way to run MatLAB and Xfoil together without the plots automatically creating and coming to the front of the desktop. Currently since this is going on, I cannot run it on any type of server or parallel clusters. I am trying to pull Cd, Cl, and Cm values from user created airfoils.

    For all of you using windows. A short-cut to get Xfoil and Matlab running together is actually one simple command:

    dos(xfoil.exe < commands.txt)

    This assumes that xfoil.exe is in the same folder as where your m file is. In addition the commands.txt file should contain all of your xfoil commands that you need to run. This runs perfectly with no problems. Make sure to start every command on a new line.

  4. #54
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by Schuifpui2 View Post
    Alright, I reinstalled everything, including all packages this time. I still get the same error message. Any ideas?

    Edit: Forget previous message, I got a bit further. Now I get an error while running the matlab file in black text:
    XFOIL error: Command 'xfoil' not found in /cygdrive/c/Program Files/MATLAB/R2008b/bin/win32, /cygdrive/c/watcom-1.3/binnt, /cygdrive/c/watcom-1.3/binw, /cygdrive/c/Program Files/MiKTeX 2.8/miktex/bin, %CommonProgramFiles%/Microsoft Shared/Windows Live, /cygdrive/c/Windows/system32, /cygdrive/c/Windows, /cygdrive/c/Windows/System32/Wbem, /cygdrive/c/Windows/System32/WindowsPowerShell/v1.0/, /cygdrive/c/Program Files/MATLAB/R2008b/bin, /cygdrive/c/Program Files/MATLAB/R2008b/bin/win32, /cygdrive/c/Program Files/Common Files/DivX Shared/, /cygdrive/c/Program Files/QuickTime/QTSystem/, /cygdrive/c/Program Files/Common Files/Microsoft Shared/Windows Live, /usr/bin, /cygdrive/c/XFOIL/bin at xfw.pl line 81


    Any ideas on this? I first thought that it would have something to do with the path thing, but when I change that I always get the message from my previous post. So I think my path thingy in windows is right. This is what I have there:

    %CommonProgramFiles%\Microsoft Shared\Windows Live;C:\cygwin\bin;C:\XFOIL\bin
    Hi Schuifpui2,

    You mentioned that you're running "xfoilp4.exe" instead of "xfoil.exe", yes? Try opening up mpxfoil.m and change XFOIL_EXE to "xfoilp4" maybe? Where did you install Cygwin to, and where did you install XFOIL to?

    I've been busy the past couple days, sorry for the late replies. Did you get the Perl modules set up okay?

    (This is my first time developing for Windows - so I'm sure the process isn't nearly as smooth as I'd like it to be. Thanks for being my guinea pig...)
    Last edited by azredwing; September 22nd, 2010 at 07:27 AM.

  5. #55
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by swimsfast99 View Post
    Quick question. Does this perl shell run Xfoil without the plots automatically popping up? I am trying to figure out a way to run MatLAB and Xfoil together without the plots automatically creating and coming to the front of the desktop. Currently since this is going on, I cannot run it on any type of server or parallel clusters. I am trying to pull Cd, Cl, and Cm values from user created airfoils.

    For all of you using windows. A short-cut to get Xfoil and Matlab running together is actually one simple command:

    dos(xfoil.exe < commands.txt)

    This assumes that xfoil.exe is in the same folder as where your m file is. In addition the commands.txt file should contain all of your xfoil commands that you need to run. This runs perfectly with no problems. Make sure to start every command on a new line.
    Hi swimsfast99,

    My Perl backend disables graphical plotting - I had the same issues you're mentioning: I wanted a way to rapidly iterate over and over on a quad-core computer. If you're running Linux, I can almost guarantee that MPXF will work for you. If you're a Windows user, I can almost guarantee that once everything is set up, MPXF will work for you - since I've never developed for Windows before (and especially since I've never had anyone set up Cygwin before) I'm sure there's a fundamental disconnect between installing things for Windows vs Linux (i.e., you need gcc, perl, make, all of which are available with Linux but take a lot of work in Windows/Cygwin) that I haven't even thought of. If you're a Windows user, I'd very much appreciate if you tried out my script and gave me some feedback.

    As for the dos() command: This is essentially what I used to do in my original script in some posts above. I found that this method is not particularly robust for funky AoA or flow regimes - you can hit "!" to continue iterating if the system doesn't converge, but you can't predict that ahead of time. This is what I found with the original version of my script. The pty + Cygwin workaround is so I can make it just as robust as I could with Linux - Windows doesn't support pty natively, so there's no way to interactively watch the STDIN and STDOUT for when the "user" (i.e., parent process) should input a "!" and continue iteration.
    Last edited by azredwing; September 22nd, 2010 at 07:26 AM.

  6. #56
    Join Date
    Sep 2010
    Beans
    6

    Re: XFOIL with MATLAB

    Quote Originally Posted by azredwing View Post
    Hi Schuifpui2,

    You mentioned that you're running "xfoilp4.exe" instead of "xfoil.exe", yes? Try opening up mpxfoil.m and change XFOIL_EXE to "xfoilp4" maybe? Where did you install Cygwin to, and where did you install XFOIL to?

    I've been busy the past couple days, sorry for the late replies. Did you get the Perl modules set up okay?

    (This is my first time developing for Windows - so I'm sure the process isn't nearly as smooth as I'd like it to be. Thanks for being my guinea pig...)
    I renamed XfoilP4 to Xfoil so I assumed that wouldn't be necessary. My xfoil is installed at c:\xfoil, while the readme told me to add C:\xfoil\bin to the path. I think this is the problem. Added c:\xfoil to the path instead of the \bin folder solves this.

    As always with computer stuff, when you solve one problem, you are awarded with a new one. I have no clue what this is about, since it probably goes much deeper into the code:

    XFOIL error: alarm

    Warning: File 'C:\Users\<USERNAME>\AppData\Local\Temp\tpaa44bbf7 _733e_4c1b_a91d_b21bc25dffe3' not found.
    > In mpxfoil at 137
    In test at 12

    ans =

    NaN

  7. #57
    Join Date
    Sep 2010
    Beans
    1

    Re: XFOIL with MATLAB

    @ swimsfast99: if you're running xfoil 9.96 or higher you can disable graphics from in the xfoil menu as follows: type

    PLOP (for plotting options);
    G (for Graphics enable flag -> the value changes to False, type G again and to enable Graphics again);
    enter to return to previous menu

    or just put

    'PLOP'
    'G'
    ' '

    at the beginning of your 'Filename.txt'.

    Hope that helps!

  8. #58
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by Schuifpui2 View Post
    I renamed XfoilP4 to Xfoil so I assumed that wouldn't be necessary. My xfoil is installed at c:\xfoil, while the readme told me to add C:\xfoil\bin to the path. I think this is the problem. Added c:\xfoil to the path instead of the \bin folder solves this.
    Good to know - thanks. I think my Windows setup uses C:\XFOIL\bin, which is weird. I'll look into this more.

    As always with computer stuff, when you solve one problem, you are awarded with a new one. I have no clue what this is about, since it probably goes much deeper into the code:

    XFOIL error: alarm

    Warning: File 'C:\Users\<USERNAME>\AppData\Local\Temp\tpaa44bbf7 _733e_4c1b_a91d_b21bc25dffe3' not found.
    > In mpxfoil at 137
    In test at 12

    ans =

    NaN
    Could you provide me the parameters you tried to run on? The alarm error is supposed to be a timeout after 5 minutes, in case XFOIL gets stuck iterating over and over again. All the data is written to a temporary file which is parsed in Perl and sent to MATLAB. I haven't run enough test cases to cover when a timeout occurs, so I'm kind of glad that you ran into this. I had a similar timeout setup on a personal script I wrote to use all 4 cores of my quad-core processor, but I never used it on Windows and my airfoil/settings were relatively sane.

    Again, thanks for being my guinea pig. If you ever get sick of it, you could always adapt the scripts in the original post...

  9. #59
    Join Date
    Sep 2010
    Beans
    6

    Re: XFOIL with MATLAB

    I don't mind being you guinea pig. If we get it working, you have helped me big time.

    I ran a simple test file:
    airfoil = '0012';
    Re = 1200000;
    Ma = 0;
    alfa_start = 1;
    alfa_end = 1;
    alfa_step = 1;
    maxit = 200;
    timeout = 60;

    mpxfoil(airfoil, Re, Ma, alfa_start, alfa_end, alfa_step, maxit, timeout)
    Also tried different alpha's, but no luck. I also noticed there aren't any files created in the folder itself, is that right? If I remember correctly the code on the first page generated a txt file with the commands, this one doesn't seem to do that. Or is it created in another location? If I have a list of commands that is being send to xfoil, I can check if it works by running them manually.

    Xfoil is started correctly, since it shows in the task manager.

  10. #60
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by Schuifpui2 View Post
    I don't mind being you guinea pig. If we get it working, you have helped me big time.

    I ran a simple test file:

    Also tried different alpha's, but no luck. I also noticed there aren't any files created in the folder itself, is that right? If I remember correctly the code on the first page generated a txt file with the commands, this one doesn't seem to do that. Or is it created in another location? If I have a list of commands that is being send to xfoil, I can check if it works by running them manually.

    Xfoil is started correctly, since it shows in the task manager.
    Try using alfa_end and alfa_step = [] - it looks like you're trying to do a singleton analysis (only one angle of attack, as opposed to a range.) Let me know if that worked at all - for singleton alfa I just omitted these things entirely..

    Also, no commands file is generated now. I am piping commands directly into XFOIL - this lets me robustly detect when non-convergence occurs, so the program can tell XFOIL to keep iterating.

Page 6 of 8 FirstFirst ... 45678 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •