How To: Run XFoil from MATLAB

Поделиться
HTML-код
  • Опубликовано: 8 янв 2025

Комментарии • 62

  • @tkdboy0182
    @tkdboy0182 4 года назад +5

    Just saved me a lot of time on my thesis dude. Well done

  • @OliverKhan-p2e
    @OliverKhan-p2e Год назад

    These videos on panel methods have been fabulous. They helped me a lot with my projects. Thank you.

  • @JavArButt
    @JavArButt 4 года назад +1

    For all the people who use Linux - this also works for Linux. One thing, which does not depend on your operating system: In my xfoil version, I had to modify the matlab code. The output I got, had different numbers of heading and also in the cp calculation file, I did not have the y-values. So just small modifications. However, with these small adjustments, the Matlab code works really well. JoshTheEngineer, thank you for your effort.

  • @rahuljoban5571
    @rahuljoban5571 5 лет назад +5

    Josh your videos are very helpful, thank you very much for all your videos. Please keep posting, you are a great teacher and an engineer :)

  • @gustavojorgeresende4252
    @gustavojorgeresende4252 3 года назад +2

    Thank you so much for this video!!!
    Really helpful

  • @kouider76
    @kouider76 4 года назад +1

    Great Job Man you deserve a million like for that

    • @JoshTheEngineer
      @JoshTheEngineer  4 года назад

      Thanks!

    • @kouider76
      @kouider76 4 года назад

      @@JoshTheEngineer I have went throw the python code in your website for running xfoile and it is working fine and was able to change it to much the analysis i want to carry. but, when i usedin for loop it calculate only the first step then stop calculation i have no clue why can you please take alook to my code and tell me if i did somethg wrong:
      Ps
      def Xfoil(Xloc,Yloc,Degree):
      # %% CREATE LOADING FILE
      # Knowns
      NACA = '4418'
      Renolds ='1000000'
      AoA = '5'
      iteration ='200'
      # Create the airfoil
      fid = open(xfoilFlnm,"w")
      fid.write("NACA " + NACA + "
      ")
      fid.write("GDES
      ")
      fid.write("flap
      ")
      fid.write(Xloc +"
      ")
      fid.write('999' +"
      ")
      fid.write(Yloc +"
      ")
      fid.write(Degree +"
      ")
      fid.write("exec
      ")
      fid.write("

      ")
      fid.write("PPAR
      ")
      fid.write("

      ")
      fid.write("PSAV " + saveFlnmAF + "
      ")
      fid.write("OPER
      ")
      fid.write("iter
      ")
      fid.write(iteration +"
      ")
      fid.write("v
      ")
      fid.write(Renolds +"
      ")
      fid.write("ALFA " + AoA + "
      ")
      fid.write("CPWR " + saveFlnmCp + "
      ")
      fid.write("pacc
      ")
      fid.write(saveFlnmCL+"
      ")
      fid.write("
      ")
      fid.write("ALFA " + AoA + "
      ")
      fid.write("
      ")
      fid.write("quit")
      fid.close()
      for Xloc in Xl:
      for Yloc in Yl:
      for Degree in Degr:
      Xfoil(Xloc,Yloc,Degree)
      os.system("xfoil.exe < xfoil_input.txt")
      if os.path.exists(xfoilFlnm):
      os.remove(xfoilFlnm)
      if os.path.exists(saveFlnmCL):
      os.remove(saveFlnmCL)

  • @1992Nereida
    @1992Nereida 4 года назад +2

    This is great! You are saving me so much time of work. Thank you very much.

  • @babakRanjbaran
    @babakRanjbaran 5 лет назад +3

    you Sir just saved me! amazing tutorial

  • @MeleseLegamo
    @MeleseLegamo 11 месяцев назад

    Josh your videos are very helpful, thank you very much for all your videos. Please keep posting, you are a great teacher and an engineer. i want to run XFoil from Python......is there any tutorial on it?

  • @dilshadxahmad
    @dilshadxahmad 6 лет назад +3

    Just here to like your video. cuz I liked your Linear Interpolation video the most.

  • @SamandRie
    @SamandRie 6 лет назад +4

    dude wtf, i was just talking to a friend about how i wanted to learn how to do this ( it was mentioned briefly in my aero class). i literally told my friend about your channel yesterday too. are you watching me???

    • @JoshTheEngineer
      @JoshTheEngineer  5 лет назад +3

      You're precisely the reason why I made this video. Don't be creeped out though.

    • @300483rahul
      @300483rahul 5 лет назад

      @@JoshTheEngineer haha same with me Josh, can you please help me, I have made equations for airfoil geometry generation. I want to optimize airfoil with my equation using genetic algorithm in matlab, I will be very glad if you can help me.

  • @edu3798
    @edu3798 4 года назад +1

    You rock Josh! thanks for this video

  • @asce4999
    @asce4999 5 лет назад +2

    hey josh
    how your cp_text file has 3 column x, y, and cp while here i got only 2 columns x and cp. I use the command cpwr to save.

  • @qqn4531
    @qqn4531 Год назад

    So if I understand it well, it is only useful to load data from NACA airfoil? It cannot be used to load data from other types of airfoil?

  • @ferasalgafary9063
    @ferasalgafary9063 4 года назад +1

    What an Amazing Video
    Thank you for this great job.

  • @mrmateoable
    @mrmateoable 4 года назад +1

    great tutorial. any tips on running XFOIL in parallel to test several airfoils at once?

    • @JoshTheEngineer
      @JoshTheEngineer  4 года назад

      Thanks! Unfortunately I can't help you with your question though, since I haven't attempted anything like that.

  • @Afghan47
    @Afghan47 2 года назад

    Can i have multiple plots on the same axis? like have different naca aerofoils

  • @yodefia1998
    @yodefia1998 5 лет назад

    Hi, have you ever encountered a problem where XFOIL converged and generated results for the pressure distribution data (XCp and Cp) and other results from the foil struct as well but not for the polar data (CL,CD,Cm)? When I input a particular coordinates to my XFOIL (which is a solution from an optimization problem im currently doing) it generated all the foil struct just fine including the XCp and Cp, but the CL came out as NaN and other polar struct datas such as CD and Cm came out an empty cell. Can you help me with this? Thanks in advance

  • @mohamedjundi1572
    @mohamedjundi1572 4 года назад

    How would you alter the code to also extract different polars? Like CL vs alpha

  • @khalildeghoum
    @khalildeghoum 3 года назад

    Thank you so much. I have a request, can you modify the program Matlab to display the CL and Cd Vs AOA?

  • @toygunkip7598
    @toygunkip7598 12 дней назад

    ı have trouble getting naca63-209 on xfoil why is this happening

  • @bethel6850
    @bethel6850 5 месяцев назад +1

    I saw your video repeatedly, and thank you for this Gold Mine, I have a question when I go to the steps on making that loaded file to be deleted on the Matlab code the comment "% Delete files if they exist" and "delete(saveFlnmAF); " parts, when I uncomment it and click RUN it is saying to error "Warning: File 'Save_Airfoil.txt' not found. > In MATLAB_XFOIL (line 52)
    Undefined variable 'dataBuffer'.
    Error in MATLAB_XFOIL (line 55)
    XB = dataBuffer{1}(:,1); % Boundary point X-coordinate
    >> What should I do, I watched your video for the 5th time today and I can't see any difference that I am making to get this kind of error, and anyone who can help, Please

  • @JARC99_
    @JARC99_ 3 года назад +1

    Hello, I am using a similar script in Python to optimize some airfoils for a wing I'm designing, but I am having some trouble with Xfoil not converging in some cases and ruining the code run, have you ran into a similar obstacle and if you have, do you have any tips on how to handle these unconverge cases from MATLAB/Python?

    • @JoshTheEngineer
      @JoshTheEngineer  3 года назад +1

      Honestly, I only use it for these super simple cases (in my panel methods video playlist), and I've never had any convergence issues. Unfortunately I won't be able to help you here, but I seem to recall some really good tutorials online (not necessarily videos).

    • @JARC99_
      @JARC99_ 3 года назад

      @@JoshTheEngineer I actually managed to make it work, the main issue is that I was initially only telling it the one CL I needed and that usually implied a pretty high AoA to begin with, leading to xfoil not converging. By running an AoA sequence and then interpolating or extrapolating the required CL, I managed to get a somewhat slower but functioning optimization algorithm

  • @simadavoodi
    @simadavoodi Год назад

    Thx for ur video , for me when I save cp.txt I have just two columns X and cp but no Y column!

  • @alpergozen5231
    @alpergozen5231 4 года назад

    Hi, how can I adjust this code for macOS? I run Xfoil using the terminal.

  • @ozansagir5786
    @ozansagir5786 Год назад

    Hello Josh where can I download this script, would appreciate it a lot !

  • @gaurangvasava6631
    @gaurangvasava6631 5 лет назад +2

    can we do the same for other airfoils like E423?

    • @JoshTheEngineer
      @JoshTheEngineer  5 лет назад

      Yep, you should be able to just load the airfoil data into XFoil instead of creating the NACA airfoil internally. I'll need to do this for some future videos, so I'll probably update this video to show how to load airfoils as well.

  • @bakrybsata3114
    @bakrybsata3114 5 лет назад +2

    Amazzzzing
    Thanks you for great job.
    Always To The Best :)

  • @karimsayed4889
    @karimsayed4889 5 лет назад +1

    I am really running through a very weird problem. I am working on Airfoil optimization for wind turbines and I am using XFOIL coupled with a MATLAB code using genetic algorithm for the optimization process. Your code really helped me a lot in the coupling process but sometimes the XFOIL gives wrong results for some certain solutions, and when I try to solve these solutions independently from the optimization code, I get the right results although I use the exact same XFOIL settings in both cases, and I even tried to solve these airfoils using another code having the same lines which call the XFOIL and it also gave the correct results. Can anyone help me with this problem please?

    • @mrmateoable
      @mrmateoable 4 года назад

      Hi, I'm am working on the same thing for the next few months basically. A GA that calls XFOIL and optimizes high endurance airfoils for turbines. i would love to ask you some questions about how you went about it. Please email me at matthew.s.ravenscroft@gmail.com

    • @karimsayed4889
      @karimsayed4889 4 года назад

      I sent an email to you one week ago.

    • @fatimapervaiz3314
      @fatimapervaiz3314 4 года назад

      Hi! I will also be working on a similar project for my dissertation, 'multi-objective optimisation of 4-digit NACA aerofoils using GA'. It would be very helpful to know how you went about interfacing XFOIL with MATLAB for the optimisation process. It would be great if you could email me at imfatima8@gmail.com

  • @pratikpanchal9866
    @pratikpanchal9866 5 лет назад

    How to get result(cl and cd) from Xfoil in Matlab without window of Xfoil being opened ?

  • @echenique12
    @echenique12 2 года назад

    Hi everyone, I have been searching for the Xfoil 6.96 version. Sadly I have not been able to find It. So if someone has one or now were to find It I would be greatful.

  • @alexisfaivrechalon1178
    @alexisfaivrechalon1178 4 года назад

    Is it possible to use xfoil for slender body ? axisymmetrical bodies

    • @JoshTheEngineer
      @JoshTheEngineer  4 года назад

      I don't see why you wouldn't be able to load in a profile of your body, but it depends on what information you're trying to get from the analysis.

  • @mhajit
    @mhajit 3 года назад +1

    This is so useful and instructive. Thank you very much Josh!

  • @arezoonajafian797
    @arezoonajafian797 Год назад

    Hi, I cant download the script. Can Anyone?

  • @MostafaTawfeek--
    @MostafaTawfeek-- 4 года назад +1

    thank you

  • @whatiselephants
    @whatiselephants 3 года назад

    this is basically deceiving people.
    title says: Run XFoil from MATLAB
    what he does: read XFoil data within MATLAB
    i was looking for a way to iterate 50 different mach numbers for the same angle of attack in XFoil, but here he explains in eleven minutes, what a simple search query ("reading text data matlab or something similar) and 5 minute reading would do.

    • @JoshTheEngineer
      @JoshTheEngineer  Год назад +1

      This is running the XFoil executable from MATLAB. Not sure what else you were expecting. You can literally see it opening XFoil, executing the commands, and then returning the data.

  • @daniellawless2246
    @daniellawless2246 Год назад

    I am very new to matlab and havent used Xfoil yet. I have downloaded the xfoil.m and Cl from Matlab file exchange, but my code looks very different from what is being review in this video, am i missing something?

    • @daniellawless2246
      @daniellawless2246 Год назад

      Noticed maybe this is the script mentioned in the desc. but the weblink is not active anymore?