Page 3 of 8 FirstFirst 12345 ... LastLast
Results 21 to 30 of 80

Thread: XFOIL with MATLAB

  1. #21
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    hello azredwing,
    First of all: yes i 'm using windows.
    Secondly, i would be very interested in the scripts you told so when you finish them let us know...
    Finally what you said before isn't clear to me...How can i supply input arguments to the function ? and one more...
    what is the file " coeffs.txt " in the end of the .m file? is automatically created or should i create it ?if i have to create it what should i write in ?

  2. #22
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by kazz81 View Post
    Hey azredwing,

    I"m running Matlab 7.0 on window xp. and since i don't know Perl at all,
    I also have ActivePerl 5.9.9 build 519 installed, but when i copied your
    Perl code, i did it in notepad and save it as .pl

    Do I need to update my matlab or anything?

    Thanks in advance.
    In a MATLAB prompt, run:

    Code:
    !perl -v
    What is the output?

    Since you've got ActivePerl installed, you could change MATLAB's PATH to use that Perl interpreter instead of the one built-in. Upgrade to ActivePerl 5.10, then follow the directions here:

    http://home.online.no/~pjacklam/matlab/doc/perl/

  3. #23
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    hello azredwing,
    First of all: yes i 'm using windows.
    Secondly, i would be very interested in the scripts you told so when you finish them let us know...
    Finally what you said before isn't clear to me...How can i supply input arguments to the function ? and one more...
    what is the file " coeffs.txt " in the end of the .m file? is automatically created or should i create it ?if i have to create it what should i write in ?
    The code should be run like:

    Code:
    [CL, CD] = get_coeffs(alfa, Re, Ma, [NACA])
    so say I want to analyze a NACA 0021 airfoil at 3.5 degrees AoA, with a Mach number of 0.05 and a Reynolds number of 500,000:

    Code:
    [CL, CD] = get_coeffs(3.5, 500000, 0.05, '0021')
    (Note that you can figure this out if you read the comments in the m-file code!)

    As for coeffs.txt: don't create it. The Perl script generates this file, but for some reason the interpreter that ships with MATLAB doesn't clean it up. I end up doing it in MATLAB instead of Perl (which isn't the nicest way to do it - and I'll be cleaning this up in my next version of the code.)

  4. #24
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    it's me again...
    i have changed it :
    function [CL,CD] = get_coeffs(1, 10000, 0.3, '0012')
    but the line which incudes this gets red and it says:
    invalid syntax at '1'.Possibly, a),}, or] is missing
    parse error at ')':usage might be invalid MATLAB syntax
    so when i run it appears: un expected matlab expression... do you know what have i done wrong (again)? the values 1,10000 etc only in this line need to replace alfa,Re etc... am i wrong ?

  5. #25
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    it's me again...
    i have changed it :
    function [CL,CD] = get_coeffs(1, 10000, 0.3, '0012')
    but the line which incudes this gets red and it says:
    invalid syntax at '1'.Possibly, a),}, or] is missing
    parse error at ')':usage might be invalid MATLAB syntax
    so when i run it appears: un expected matlab expression... do you know what have i done wrong (again)? the values 1,10000 etc only in this line need to replace alfa,Re etc... am i wrong ?
    No no, do NOT adjust the code itself! You should be calling the function from MATLAB, like any other function (fsolve(), ode45(), etc)

  6. #26
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    hi,
    so i have the .m file unchanged (exactly the same with what you had attached in the first page) and i write in matlab command window :
    [CL, CD] = get_coeffs(1.0, 40000, 0.2, '0012')but then appears the following message :
    Undefined function or method 'get_coeffs' for input arguments of type 'double'.

    please help... thnx

  7. #27
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    hi,
    so i have the .m file unchanged (exactly the same with what you had attached in the first page) and i write in matlab command window :
    [CL, CD] = get_coeffs(1.0, 40000, 0.2, '0012')but then appears the following message :
    Undefined function or method 'get_coeffs' for input arguments of type 'double'.

    please help... thnx
    Make sure you're currently in the same folder as get_coeffs() in MATLAB, or add the folder to your PATH.

  8. #28
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    i have put in the same folder the .m file and the pl file.i have xfoil in the same path which is referred in the .pl file.what else should i do ? it appears the same message:

    >> [CL, CD] = get_coeffs(1.0, 40000, 0.3, '0012')
    ??? Undefined function or method 'get_coeffs' for input arguments of type 'double'.

  9. #29
    Join Date
    Apr 2008
    Beans
    135

    Re: XFOIL with MATLAB

    Quote Originally Posted by nikolhs View Post
    i have put in the same folder the .m file and the pl file.i have xfoil in the same path which is referred in the .pl file.what else should i do ? it appears the same message:

    >> [CL, CD] = get_coeffs(1.0, 40000, 0.3, '0012')
    ??? Undefined function or method 'get_coeffs' for input arguments of type 'double'.
    You're SURE that the MATLAB shell is in the same directory as get_coeffs.m ? Because that's what this error message is saying... if get_coeffs.m isn't in the current folder (default view is on the left side of the screen), it won't work. If it IS, then I'm kind of stuck...

  10. #30
    Join Date
    May 2010
    Beans
    14

    Re: XFOIL with MATLAB

    what do you mean matlab shell ? how can i be sure for this ?

Page 3 of 8 FirstFirst 12345 ... 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
  •