I have a set of 15 equations in state space form, and I'm just trying to program a way to substitute all variables representing the time derivates as for example x__s_dot (t) as diff(x__s (t), t) and diff( x__s_dot (t),t) as diff(x__s (t), t,t) so I can manipulate my equations easier.
The last half of the list xx has the variables that I want to substitute, the x,y and u (with respective diff(x__s (t), t) ) variables are always constant, but in the case of zeta, eta and u I might have indexes from 1 to n , in this case just 1 and 2.
I tried a bunch of methods including creating vectors with the seq, op commands and substituting them into my original equations with subs, algsubs but none of the things I programmed worked the way I wanted, I ended up with a very inefficient way , doing it manually, but the point is that I wanted to automate this bit. I've been doing maple for about 2 weeks and I still struggle a lot with it, I would greatly appreciate any guidence/advice.
My original equations are actually much bigger and my original code too, I tried to shorten it a bit just for making my problem simpler to understand but the equations still look really big here, If there is another way to format this question please do advice so.
EDIT : I think my last code was hard to understand because my equations were too big and it looked all messy and horrible, I edited to show just one vector of variables, I think that if it works here, it should work on the rest of my code:
I tried to make a for loop that substitutes each variable one by one, but it only seems to work for the last term, I don't know why, please help or suggest another method? I also have diff(x__s,t,t) terms in my equations, not just diff(x__s,t), but I guess only by specifying the first derivate it should work?