# Numerical solution to a complicated ODE

• Satchmo
In summary, the conversation discusses the modeling of an underwater airfoil for use in a tidal generator. The free body diagram and equations of motion for the airfoil are described, taking into account the effects of virtual mass and changes in angle of attack. The use of smoothing spline functions for coefficient of lift and drag is mentioned, as well as the use of Matlab's ODE solvers. The conversation concludes with a suggestion to divide the equation by the added mass and solve for the system of two coupled ODEs.
Satchmo
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)*$$\ddot{y}$$

(vm is virtual mass or added mass, an effect of accelerating a body through fluid)
with y(0)=0 and $$\dot{y}$$(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 + ($$\dot{y}$$)2) * (CL[ $$\alpha$$ - atan($$\frac{\dot{y}}{Vs}$$)] * cos(atan($$\frac{\dot{y}}{Vs}$$))

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

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 [$$\alpha$$ - atan($$\frac{\dot{y}}{Vs}$$)])
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 * ($$\alpha$$ - atan($$\frac{\dot{y}}{Vs}$$)
and CD = 0.013 * ($$\alpha$$ - atan($$\frac{\dot{y}}{Vs}$$)

With these approximations, the lift and drag forces become

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

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

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

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=..., $$\dot{y}$$= ..., $$\ddot{y}$$..., 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
3.6 KB · Views: 506
Dividing the entire equation by (m+vm) gets you $$\ddot{y} = f(y, \dot{y})$$. You know that $$dy/dt} = \dot{y}$$ and $$d\dot{y}/dt = \ddot{y} = f(y, \dot{y})$$ So now you got a system of two (coupled) ODEs that you can try to solve, one for $$y$$ and the other for $$\dot{y}$$. 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 :)

## 1. What is a numerical solution to a complicated ODE?

A numerical solution to a complicated ODE (ordinary differential equation) is an approximation of the exact solution to the equation using computational methods. This is necessary when the equation cannot be solved analytically.

## 2. Why is a numerical solution needed for complicated ODEs?

Many real-world problems, such as those in physics and engineering, can be described by complicated ODEs. These equations often have no exact solution, so a numerical solution is needed to approximate the behavior of the system.

## 3. What are some common methods for finding numerical solutions to ODEs?

Some common methods include Euler's method, Runge-Kutta methods, and the finite difference method. Each of these methods involves breaking the ODE into smaller, simpler equations and using iterative calculations to approximate the solution.

## 4. How accurate are numerical solutions to ODEs?

The accuracy of a numerical solution depends on the method used and the size of the time or space intervals used in the calculation. Generally, the smaller the intervals, the more accurate the solution will be. However, too small of intervals can lead to computational errors.

## 5. Can numerical solutions to ODEs be used for real-world applications?

Yes, numerical solutions to ODEs are commonly used in a wide range of fields, such as physics, engineering, and economics. They allow for the prediction of system behavior and can inform decision making in various applications.

### Similar threads

• Differential Equations
Replies
24
Views
3K
• Differential Equations
Replies
8
Views
2K
• Differential Equations
Replies
3
Views
2K
• Mechanics
Replies
76
Views
4K
• Introductory Physics Homework Help
Replies
6
Views
421
• Differential Equations
Replies
12
Views
3K
• Engineering and Comp Sci Homework Help
Replies
1
Views
1K
• Calculus and Beyond Homework Help
Replies
12
Views
2K
• Advanced Physics Homework Help
Replies
7
Views
4K
• Programming and Computer Science
Replies
3
Views
3K