i have 3 equations with 3 variables and two constants(to be substituted repeatedly). the value of the variables we got by applying nsolve on the system of 3 equations assuming some initial value for contants. after getting these unknown we evaluate the value of constants with the help of two equations. Then substituting these recent value of constants in the equations and calculate the new set of values for the unknown.i have to do this repeteadly . Equations are like
x[i + 1] - x[i] - Cos[z[i]] - Cos[z[i + 1]] - ax[i] == 0 && (*1*)
y[i + 1] - y[i] - Sin[z[i]] - Sin[z[i + 1]] - ay[i] == 0 && (*2*)
x[i + 1]^2 + y[i + 1]^2 - 1 == 0 (*3*)
We solve for {x[i + 1], y[i + 1], z[i + 1]}
if know the initial values for x,y,z,ax
and ay
then we have another set of equations to calculate ax
and ay i.e
ax[i + 1] = Cos[z[i + 1]] - Cos[z[i]] + ax[i] (*4*)
ay[i + 1] = Sin[z[i + 1]] - Sin[z[i]] + ay[i] (*5*)
and resubstitute these new value of ax and ay in equation 1,2,3 and solve it again for x,y,z then again solve 4,5 and substitute new ax and ay like wise i have to do repeatedly. How to do this in mathematica. eqn 1,2,3 are solved by NSolve
.
Comments
Post a Comment