I am trying to solve a system of three nonlinear equations using Mathematica. Solve
takes forever to run and never solves my system of equations. Is my system too complicated?
I have looked through the suggestions on using Solve
in the Mathematica help, but none of these seem to work. I am wondering if I am going about solving the problem the wrong way.
Any help would be greatly appreciated! I have attached my code below.
Solving the Tensegrity Model
Defining reference conditions
l0 = Sqrt[0.375];
s0 = 0.5 ;
k = 1;
Using prestress to define
ξ = 1 - lR/l0;
lR[ξval_] := l0 (1 - ξval);
lRvalues = Table[lR[ξrange], {ξrange, {0.0, 0.1, 0.5, 0.9, 1.0}}];
Defining cable lengths
Clear[sx, sy, sz]
l1[sx_] := 0.5 Sqrt[sx^2 + sy^2 - 2 sy + 2];
l2 := 0.5 Sqrt[sy^2 + sz^2 - 2 sz + 2];
l3[sx_] := 0.5 Sqrt[sz^2 + sx^2 - 2 sx + 2];
F1[lR_] = k (l1[sx] - lR);
F2[lR_] = k (l2 - lR);
F3[lR_] = k (l3[sx] - lR);
F1values = Table[F1[lr], {lr, lRvalues}];
F2values = Table[F2[lr], {lr, lRvalues}];
F3values = Table[F3[lr], {lr, lRvalues}];
F1values[[1]] /. sx -> 0.5
(*-0.612372 + 0.5 Sqrt[2.25 - 2 sy + sy^2]*)
sxval = Range[0.5, 2, 0.5];
For[j = 1, j < Length[sxval] + 1, j++,
For[i = 1, i < Length[F1values] + 1, i++,
Solve[{(F1values[[i]] /. sx -> sxval[[j]]) (1 - sy)/l1[sxval[[j]]] ==
F2values[[i]] sy/l2,
F2values[[i]] (1 - sz)/l2 == (F3values[[i]] /. sx -> sxval[[j]]) sz/
l3[sxval[[j]]],
T == 2 ((F1values[[i]] /. sx -> sxval[[j]]) sxval[[j]]/
l1[sxval[[j]]] + (F3values[[i]] /. sx -> sxval[[j]]) (
sxval[[j]] - 1)/l3[sxval[[j]]])}, {T, sy, sz}]
(*sy1 = NSolve[(F1values[[i]] /. sx -> sxval[[j]]) (1 - sy)/l1[sxval[[j]]] ==
F2values[[i]] sy/l2, sy, Reals] // FullSimplify;*)
(*Print[sy1]*)
]
]`