0

I'm working on a very long list of Differential Equations that I will eventually need to fit to experimental data but I'm having an issue getting NDSolve to accept my subscripted variables. Since the equations are incredibly long, I've simply given a sample below, but can anyone direct me to further help? I've already found that I need to use Symbolize and Patten - are there more steps? Also, I apologize for the poor form, copy and paste takes the input form rather than the nice looking one. If a screen shot would be more helpful, let me know. Thanks!

<< Notation`

Symbolize[ParsedBoxWrapper[SubscriptBox["h", "_"]]]
Symbolize[ParsedBoxWrapper[SubscriptBox["R", "_"]]]
Symbolize[ParsedBoxWrapper[SubscriptBox["T", "_"]]]
Symbolize[ParsedBoxWrapper[SubscriptBox["\[Lambda]", "_"]]] 

Pattern[Subscript[h, \[Placeholder]], _]
Pattern[Subscript[R, \[Placeholder]], _]
Pattern[Subscript[T, \[Placeholder]], _]
Pattern[Subscript[\[Lambda], \[Placeholder]], _]

model[Subscript[h, 1] _?NumericQ, ...] :=

NDSolve[{Derivative[1][g1][t] == 
Subscript[R, 1]/(
 1 + E^(Subscript[h, 1] + g13[t] Subscript[T, 1, 13] + 
   g15[t] Subscript[T, 1, 15] + g16[t] Subscript[T, 1, 16] + 
   g22[t] Subscript[T, 1, 22] + g24[t] Subscript[T, 1, 24] + 
   g25[t] Subscript[T, 1, 25])) - g1[t] Subscript[\[Lambda], 1], ...,

g1[0] == 532.031,...}, {g1, g2, g3, g4, g5, g6, g7,
g8, g9, g10, g11, g12, g13, g14, g15, g16, g17, g18, g19, g20, 
g21, g22, g23, g24, g25, g26, g27, g28, g29}, {t, 0, 4}]
  • 1
    short answer don't use `Subscript`, It causes no end of headaches. Instead us plain symbols such as `Tsub1sub15` etc – agentp Aug 20 '14 at 21:26
  • I agree with your sentiment; however, I'm using code written by another lab member that automatically generates the equations based on experimental data so I don't have much say in the variable names. – Kerrigan Blake Aug 20 '14 at 22:03
  • Write one program, probably not in Mathematica, that translates the variable names you are required to accept into names Mathematica will happily accept, then run the Mathematica, then write another program, probably not in Mathematica, that will translate the output back into the variable names that you are required to return. Doing this will almost certainly mean you will be done much sooner and with a lot less stomach acid and having to ask for help. – Bill Aug 20 '14 at 22:33

0 Answers0