Hello, I am seeking to Automate a code by populating subscript k in my equation of Motion. I define phi as a summation being u0+pu1+p^2u2+p^3u3.... and so on. I then define the conditional statement for phi being of value 0 when k is less than or equal to 1 and 1 if k is greater than 1. I then proceed to define the equation of motion for a simple duffing system evaluated with the Homotopy Analysis Method. The governing equation is dependent upon the value of k. k is the order of the Homotopy Analysis Method (HAM). I wanted to tell mathematica to symbolically evaluate the equation for a specific value of k, say 2 or 3. However when i did this the error message "Incomplete expression; more input is needed." came up. Please advise. Thank You
HAM Automated Duffing Symbolic
Defining Phi
\[CurlyTheta] = \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(k = 0\), \(10\)]\(\((
\(\*SubscriptBox[\(u\), \(k\)]\)[\[Tau]])\)*\((
\*SuperscriptBox[\(p\), \(k\)])\)\)\);
Defining Chi
\[Chi][k_] := If[k <= 1, 0*k, k/k];
Defining HAM Equation for kth Order
Subscript[u, k][\[Tau]]'' + \[CapitalOmega]^2*
Subscript[u, k][\[Tau]] == \[Chi][
k]*(Subscript[u, k - 1][\[Tau]]'' + \[CapitalOmega]^2*
Subscript[u, k - 1][\[Tau]]) +
Subscript[c,
0]*(1/(k -
1)!*((\[PartialD]/\[PartialD]\[Tau])((\[PartialD]/\[PartialD]\
\[Tau])(D[\[CurlyTheta], {p, k - 1}] /. p \[RightArrow] 0)) +
2*c*((\[PartialD]/\[PartialD]\[Tau])(D[\[CurlyTheta], {p,
k - 1}] /.
p \[RightArrow] 0)) + \[Omega]^2*(D[\[CurlyTheta], {p,
k - 1}] /.
p \[RightArrow]
0) + \[Mu]*(D[\[CurlyTheta]^3, {p, k - 1}] /.
p \[RightArrow] 0) -
F*(D[Cos[\[CapitalOmega]*\[Tau]], p, k - 1] /.
p\[LongRightArrow]0)));
% /. {k\[LongRightArrow]1}