Hello,(adsbygoogle = window.adsbygoogle || []).push({});

I am new to mathematica, and I am having trouble using the solve/nsolve to solve my system of three equations.

Attached is my code so far. Any help would be greatly appreciated. It gets stuck in the loop section of the code. I have also pasted the code below.

Thanks!

Alicia

Defining reference conditions

In[3]:= l0 = Sqrt[0.375];

s0 = 0.5 ;

k = 1;

Using prestress to define

In[6]:= \[Xi] = 1 - lR/l0;

In[7]:=

lR[\[Xi]val_] := l0 (1 - \[Xi]val);

In[10]:=

lRvalues = Table[lR[\[Xi]range], {\[Xi]range, {0.0, 0.1, 0.5, 0.9, 1.0}}];

Defining cable lengths

In[11]:= 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];

In[15]:=

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[F1[lr], {lr, lRvalues}];

F3values = Table[F1[lr], {lr, lRvalues}];

In[59]:= F1values[[1]] /. sx -> 0.5

Out[59]= -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[] /. sx -> sxval[[j]]) (1 - sy)/l1[sxval[[j]]] ==

F2values[] sy/l2,

F2values[] (1 - sz)/l2 == (F3values[] /. sx -> sxval[[j]]) sz/

l3[sxval[[j]]],

T == 2 ((F1values[] /. sx -> sxval[[j]]) sxval[[j]]/

l1[sxval[[j]]] + (F3values[] /. sx -> sxval[[j]]) (

sxval[[j]] - 1)/l3[sxval[[j]]])}, {T, sy, sz}]

(*sy1=NSolve[(F1values[]/.sx ->sxval[[j]]) (1-sy)/l1[sxval[[j]]]==

F2values[] sy/l2,sy,Reals]//FullSimplify;*)

(*Print[sy1]*)

]

]

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Mathematica: Solving system of three equations

**Physics Forums | Science Articles, Homework Help, Discussion**