Numerical solution to a complicated ODE

  • Context: Graduate 
  • Thread starter Thread starter Satchmo
  • Start date Start date
  • Tags Tags
    Numerical Ode
Click For Summary
SUMMARY

This discussion focuses on numerically solving a complicated ordinary differential equation (ODE) related to the vertical motion of an underwater airfoil in a tidal generator. The forces acting on the airfoil include lift (FL), drag (FD), and the force from an electrical generator (FT), with the equations defined using coefficients of lift (CL) and drag (CD) derived from the angle of attack. The user seeks advice on software alternatives to MATLAB's ODE solvers (ode45 and ode113), which require a specific format for inputting differential equations. Suggestions include using a system of two coupled ODEs to facilitate the solution process.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with MATLAB functions, particularly ode45 and ode113
  • Knowledge of fluid dynamics concepts, specifically lift and drag forces
  • Basic programming skills in MATLAB for function definition
NEXT STEPS
  • Explore numerical methods for solving coupled ODEs, such as Runge-Kutta methods
  • Research alternative software options for ODE solving, including Python's SciPy library
  • Learn about Maple and Mathematica for advanced ODE solutions
  • Investigate smoothing spline functions in MATLAB for aerodynamic coefficient modeling
USEFUL FOR

Engineers, researchers, and students involved in fluid dynamics, computational modeling, and numerical analysis of differential equations, particularly those working with underwater vehicles or tidal energy systems.

Satchmo
Messages
6
Reaction score
0
Background: For an oscillating wing that will be used in a tidal generator I am trying to model the position (as function of time) of an underwater airfoil whose movement is limited to vertical motion. The free body diagram is very simple. When the airfoil is positioned for upward travel, the only upward force is lift, and the downwards forces are drag and the force from an electrical generator. Assuming the airfoil to be neutrally buoyant, we have

FL - FD - FT = (m+vm)*[tex]\ddot{y}[/tex]

(vm is virtual mass or added mass, an effect of accelerating a body through fluid)
with y(0)=0 and [tex]\dot{y}[/tex](0) = 0
However, when the airfoil is in motion its vertical velocity changes the effective angle of attack and effective velocity seen by the airfoil, so that

FL = A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (CL[ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * cos(atan([tex]\frac{\dot{y}}{Vs}[/tex]))

FD = A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (CD[ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * sin(atan([tex]\frac{\dot{y}}{Vs}[/tex]))

where A is a constant that has to do with airfoil geometry, CL[...] and CD[...] are the coefficient of lift and drag for the instantaneous angle of attack (angle of attack given by [[tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])])
For CL and CD I have in MATLAB a smoothing spline functions so that I can input an angle and have the coefficient returned.

I would prefer to be able to use that MATLAB function to return the drag and lift coefficients, but a rough approximation can be given by

CL = 2 * pi * ([tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])
and CD = 0.013 * ([tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])


With these approximations, the lift and drag forces become

FL = A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (2*pi*[ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * cos(atan([tex]\frac{\dot{y}}{Vs}[/tex]))


FD = A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (0.013 * [ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * sin(atan([tex]\frac{\dot{y}}{Vs}[/tex]))

and the entire equation is:
A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (2*pi*[ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * cos(atan([tex]\frac{\dot{y}}{Vs}[/tex])) - A * sqrt(Vs2 + ([tex]\dot{y}[/tex])2) * (0.013 * [ [tex]\alpha[/tex] - atan([tex]\frac{\dot{y}}{Vs}[/tex])] * sin(atan([tex]\frac{\dot{y}}{Vs}[/tex])) - FT = (m+vm)*[tex]\ddot{y}[/tex]

This is the first time I've tried to numerically solve a DE. I've looked into Matlab's ODE solvers (ode45 and ode113), but they require having the differential equations given as
y=..., [tex]\dot{y}[/tex]= ..., [tex]\ddot{y}[/tex]..., which I cannot do for this problem. I've never used Maple or Mathematica before, but web searches seem to show that they require the same format for solving ODEs. Therefore, I'm stuck.

Can anyone point me in the direction of a program that could possibly solve this ODE? That or ANY other advice would be greatly appreciated!
 

Attachments

  • paint.jpg
    paint.jpg
    3.6 KB · Views: 564
Physics news on Phys.org
Dividing the entire equation by (m+vm) gets you [tex]\ddot{y} = f(y, \dot{y})[/tex]. You know that [tex]dy/dt} = \dot{y}[/tex] and [tex]d\dot{y}/dt = \ddot{y} = f(y, \dot{y})[/tex] So now you got a system of two (coupled) ODEs that you can try to solve, one for [tex]y[/tex] and the other for [tex]\dot{y}[/tex]. I've never used Matlab, but from the reference it seems you can do something like
Code:
function dy = airfoil(t,y)
  dy = zeros(2,1);    % a column vector
  dy(1) = y(2); % dy/dt = \dot{y}
  dy(2) = f(y(1), y(2)); % d\dot{y}/dt = \ddot{y} = f(y, \dot{y})

It's a bit late here so I might have missed something or messed it up :)
 

Similar threads

  • · Replies 24 ·
Replies
24
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
12
Views
3K
  • · Replies 76 ·
3
Replies
76
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
7
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K