Visual Basic para Aplicaciones - Busco programador para realizar ecuación diferencial en visual basic aplicando runge-kutta

Life is soft - evento anual de software empresarial
 
Vista:
sin imagen de perfil

Busco programador para realizar ecuación diferencial en visual basic aplicando runge-kutta

Publicado por daniel (2 intervenciones) el 31/01/2014 18:54:32
Se busca programador de visual basic para resolver una ecuación diferencial de segundo orden aplicando el método de runge-kutta, para más detalles ponerse en contacto.

Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de JuanC

Busco programador para realizar ecuación diferencial en visual basic aplicando runge-kutta

Publicado por JuanC (565 intervenciones) el 31/01/2014 20:36:42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
'********************************************************************
'*             Differential equations of order N                    *
'*             by Runge-Kutta method of order 4                     *
'* ---------------------------------------------------------------- *
'* Reference: "Analyse en Turbo Pascal versions 5.5 et 6.0 By Marc  *
'*             DUCAMP et Alain REVERCHON - Eyrolles, Paris 1991"    *
'*             [BIBLI 03].                                          *
'*                                                                  *
'*                           Basic version by J-P Moreau, Paris     *
'*                                    (www.jpmoreau.fr)             *
'* ---------------------------------------------------------------- *
'* SAMPLE RUN:                                                      *
'*                                                                  *
'* Example: integrate y"=(2y'y'+yy)/y from x=4 to x=6               *
'*          with initial conditions: y(4)=2 and y'(4)=-2tan(1)      *
'*                                                                  *
'* Exact solution is:   y = 2cos(1)/cos(x-5)                        *
'*                                                                  *
'*        DIFFERENTIAL EQUATION WITH 1 VARIABLE OF ORDER N          *
'*              of type y(n) = f(y(n-1),...,y',y,x)                 *
'*                                                                  *
'*   order of equation: ? 2                                         *
'*   begin value x    : ? 4                                         *
'*   end value x      : ? 6                                         *
'*   y0 value at x0   : ? 2                                         *
'*   y1 value at x0   : ? -3.114815                                 *
'*   number of points : ? 11                                        *
'*   finesse          : ? 20                                        *
'*                                                                  *
'*       X            Y                                             *
'* ---------------------------                                      *
'*   4.000000     2.000000                                          *
'*   4.200000     1.551018                                          *
'*   4.400000     1.309291                                          *
'*   4.600000     1.173217                                          *
'*   4.800000     1.102583                                          *
'*   5.000000     1.080605                                          *
'*   5.200000     1.102583                                          *
'*   5.400000     1.173217                                          *
'*   5.600000     1.309291                                          *
'*   5.800000     1.551018                                          *
'*   6.000000     2.000000                                          *
'*                                                                  *
'********************************************************************
defint i-n
defdbl a-h,o-z

'ifi,i,ndata,iordre: INTEGER
dim yi(10), t(50)
dim ta(10),tb(10),tc(10),td(10),y(10),z(10)

  Cls
  print
  print "    DIFFERENTIAL EQUATION WITH 1 VARIABLE OF ORDER N"
  print "          of type y(n) = f(y(n-1),...,y',y,x)"
  print
  print "    order of equation: "; : input iordre
  print
  print "    begin value x    : "; : input xi
  print "    end value x      : "; : input xf
  for i=0 to iordre-1
    print "    y";i;" value at x0   : "; : input yi(i)
  next i
  print "    number of points : "; : input m
  print "    finesse          : "; : input ifi
 
  'call subroutine equadiffn
  gosub 2000
 
END
 
'Example: y"=(2y'y'+yy)/y
1000 'FUNCTION fp(x,y())
  if abs(y(0))<1e-12 then y(0)=1e-12
  fp=(2*y(1)*y(1)+y(0)*y(0))/y(0)
return

'***************************************************************************
'*        SOLVING DIFFERENTIAL EQUATIONS WITH 1 VARIABLE OF ORDER N        *
'*                of type y(n) = f(y(n-1),y(n-2),...,y',y,x)               *
'* ----------------------------------------------------------------------- *
'*  INPUTS:                                                                *
'*    fp        Equation to integrate                                      *
'*    xi, xf    Begin, end values of variable x                            *
'*    Yi        Begin values at xi (of f and derivatives)                  *
'*    m         Number of points to calculate                              *
'*    n         Order of differential equation                             *
'*    fi        finesse (number of intermediate points)                    *
'*                                                                         *
'*  OUTPUTS:                                                               *
'*    t         real vector storing m results for function y               *
'* ----------------------------------------------------------------------- *
'*  EXAMPLE:    y" = (2 y'y' + yy) / y with y(4) = 2, y'(4) = -2*tan(1)    *
'*              Exact solution:  y = (2 cos(1))/cos(x-5)                   *
'***************************************************************************
2000 'Subroutine Equadiffn
'h,x,a,b,c,d : double
'ta,tb,tc,td,y,z : Table;
'i,j,k,ni,n1,n2 : integer

   n=iordre
   if ifi<1 then return
   h = (xf - xi) / ifi / (m-1)
   n1=n-1 : n2=n-2
   t(1)=Yi(0)
   for k=0 to n1
     y(k)=Yi(k) : z(k)=Yi(k)
   next k
   for i=1 to m
     ni=(i-1)*ifi-1
     for j=1 to ifi
       x=xi+h*(ni+j)
       for k=0 to n1
         y(k)=z(k)
       next k
       gosub 1000
       a=h*fp
       for k=0 to n2
         ta(k)=h*y(k+1) : y(k)=z(k)+ta(k)/2#
       next k
       y(n1)=z(n1)+a/2#
       x=x+h/2
       gosub 1000
       b=h*fp
       for k=0 to n2
         tb(k)=h*y(k+1) : y(k)=z(k)+tb(k)/2#
       next k
       y(n1)=z(n1)+b/2#
       gosub 1000
       c=h*fp
       for k=0 to n2
         tc(k)=h*y(k+1) : y(k)=z(k)+tc(k)
       next k
       y(n1)=z(n1)+c
       x=x+h/2
       gosub 1000
       d=h*fp
       for k=0 to n2
         z(k)=z(k)+(ta(k)+2#*tb(k)+2#*tc(k)+h*y(k+1))/6#
       next k
       z(n1)=z(n1)+(a+b+b+c+c+d)/6#
     next j
     t(i+1)=z(0)
   next i
   'call subroutine Affiche
   gosub 3000
Return

3000 'Subroutine Affiche
  h=(xf-xi)/(m-1)
  x=xi-h
  Cls
  print
  print "      X         Y     "
  print "----------------------"
  for i=1 to m
    x=x+h
    print using " ##.######  ##.######"; x; t(i)
  next i
return
 
'End of file teqdifn.bas

Saludos, desde Baires, JuanC
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Busco programador para realizar ecuación diferencial en visual basic aplicando runge-kutta

Publicado por daniel (2 intervenciones) el 01/02/2014 10:59:58
Gracias por el aporte, le escribo un email
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar