<

Question: Translating a set of ODEs from Maple to FORTRAN and Optimized.

Hi,

I would like to translate a set of ODEs from Maple to FORTRAN and optimize them. The problem is that even I have all the equations in one file the maple uses some names in optimizations same as what it has used before. How can I fixed it?

for Example:

with(codegen, optimize, makeproc, cost, prep2trans):

Fortran(eq_dP_5, optimize, resultname = fp1);
      t2 = int(z5 ** 2)
      t3 = int(t2 ** 2)
      t5 = int(z4 ** 2)
      t6 = int(x ** 2)
      t8 = x - 1
      t9 = t8 ** 2
      t10 = 1 / t9
      t11 = t10 * t6 * t5
      t13 = int(mTh ** 2)
      t23 = 2 * z2 * x + z4 * x - 2 * z2
      t26 = 1 / z4
      t32 = Az5 ** 2
      t38 = int(z6 ** 2)
      fp1 = -dble(z4) / dble(t23) / dble(t8) * (dble(t11 * t3 * LmdSF) +
     # dble(2 * t11 * t13 * t2) + dble(2 * t26 / Az5 * t23 * Bz5 * z6 *
     #t8) - 0.16D2 * dble(t10) * t32 * z1 * dble(t6) * dble(t5) * 0.3141
     #592654D1 - dble(2 * t26 * t38 * t23 * t9 * x) + dble(4 / x * t26 *
     # t8 * z2)) * (z1 + valrho) / 0.4D1

Fortran(eq_dmu_5, optimize, resultname = fmu2);
      t1 = z6 ** 2
      t2 = z4 / 0.2D1
      t5 = x ** 2
      t6 = t5 ** 2
      t28 = z5 ** 2
      t29 = t28 ** 2
      t32 = Az5 ** 2
      t35 = mTh ** 2
      t39 = z4 ** 2
      t49 = (x - 1) ** 2
      t50 = t49 ** 2
      fmu2 = (t1 * (z2 + t2) * t6 * dble(x) - 0.5D1 * t1 * (z2 + 0.2D1 /
     # 0.5D1 * z4) * t6 + 0.10D2 * (z2 + 0.3D1 / 0.10D2 * z4) * t1 * t5
     #* dble(x) - 0.10D2 * (z2 + z4 / 0.5D1) * t1 * t5 + ((0.5D1 * z2 +
     #t2) * t1 + 0.4D1 * (LmdSF * t29 / 0.16D2 + t32 * 0.3141592654D1 *
     #valrho + t35 * t28 / 0.8D1) * t39 * z4) * dble(x) - z2 * t1) * dbl
     #e(x) / dble(t50)

 

 

Please Wait...