Runge Kutta Visual Basic

Páginas: 4 (876 palabras) Publicado: 6 de noviembre de 2012
EXAMPLE OF THE RUNGE KUTTA METHOD USING EXCEL
Problem: Solve [pic]
Analytical solution.....This is a first order separable ordinary differential equation. The exact solution is [pic].
Numericalsolution..... We wish to make the EXCEL worksheet flexible enough to allow us to use any function or any step size. In our problem, let’s use a step size of h = .1.
STEP 1:***********************************************************************
If you are using version 97 or 2000:
First,choose tools, macro, security, medium, tools, macro, visual basic, insert , module.To reuse thefunction, security must be set to medium…not high.
On the blank screen that appears, enter the function f(x,y) as follows:
function f(x,y)
f=y*x^2-y
end function************************************************************************
If you are using version 2007:
!!!!!!!WHEN YOU SAVE THIS FILE, CHOOSE SAVE AS AND THEN CHOOSE MACRO-ENABLED WORKBOOK. !!!!!! If you justsave as usual, you will not be able to reuse the macro.
You will need to add a Developer tab to the top of the Excel page. Click on the Microsoft Office button in the upper left corner of theExcel worksheet. A drop down menu will appear. At the bottom of it, you will see Excel Options tab. Select the Show Developer Tab by checking the box and then click OK.
From now on, unless you areworking in the campus labs, you should have that tab available. Click on it and press the Macro Security button. The security level should be set as Disable all macros with notifications. Then clickOK.
Now that we have taken care of the preliminaries, let’s create a user defined function. To do this, Click on Visual Basic under the Developer tab. Click on Insert. Click on Module.On the blank screen that appears, enter the function f(x,y) as follows:
function f(x,y)
f=y*x^2-y
end function
************************************************************************
STEP 2:...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • RUNGE-KUTTA
  • Runge Kutta
  • runge kutta
  • Runge-Kutta
  • runge kutta
  • Método de Runge-Kutta
  • Método de Runge-Kutta
  • metodo de Runge Kutta

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS