I have a system with seven equations and three constrains. I tried to solve them using NSolve, but it takes forever without getting any result. Also, I tried it without any constraints, but again no luck.

I will appreciate if somebody can help me out.

eqns = {Subscript[c, 2] +

Subscript[a, 2] Cosh[(20048005 d)/80227844] == 5 &&

3000 Subscript[c, 3] == 7 &&

5 (127 – 10 d)^2 Subscript[a, 3] +

2 (-7 + (6350 – 500 d) Subscript[b, 3] +

1000 Subscript[c, 3]) == 0 &&

10627269662 Subscript[b, 3] ==

2478589 Subscript[a, 2] Sinh[(20048005 d)/80227844] &&

6400000 Subscript[a, 3] ==

373 Subscript[a, 2]

Cosh[(20048005 d)/80227844] && (127/10 – d) Subscript[a, 3] +

Subscript[b, 3] == (5 (1 + (2457 k)/800))/8128 &&

20048005 (6129 + 254 d (-5 + Subscript[c, 2])) +

20377872376 Subscript[a, 2] Sinh[(20048005 d)/80227844] == 0 &&

0 <= d <= 127/10 && 0 < k < 1};
qq = NSolve[
eqns, {Subscript[a, 2], Subscript[c, 2], Subscript[a, 3],
Subscript[b, 3], Subscript[c, 3], d, k}, Reals,
WorkingPrecision -> 10][[1]]

eqns /. qq

=================

Pls read Subscript vs. Brackets, Can we use letter with a subscript as a variable in Mathematica?, maybe you want to edit your question.

– Louis

Feb 14 at 6:51

=================

1 Answer

1

=================

I believe that you may have a problem with your constraints. In particular, numerical analysis suggests that your solutions have no solution for 0

I also like to work with lists of equations rather than logical combinations:

First@% /. And -> List;

Finally I am going to use FindRoot, which does not deal with mixtures of equations and inequalities, so I remove the constraints expressed as inequalities (I will reintroduce them in FindRoot though):

neweq = Select[%, Head[#] == Equal &]

{c[2]+a[2] Cosh[(20048005 d)/80227844]==5,3000 c[3]==7,5 (127-10 d)^2 a[3]+2 (-7+(6350-500 d) b[3]+1000 c[3])==0,10627269662 b[3]==2478589 a[2] Sinh[(20048005 d)/80227844],6400000 a[3]==373 a[2] Cosh[(20048005 d)/80227844],(127/10-d) a[3]+b[3]==(5 (1+(2457 k)/800))/8128,20048005 (6129+254 d (-5+c[2]))+20377872376 a[2] Sinh[(20048005 d)/80227844]==0}

I am going to use FindRoot repeatedly on this system of equations, with randomly chosen starting values for the variables; I impose conditions on ddd and kk in the corresponding FindRoot argument.

Reap@Do[

Sow@Check[FindRoot[%,

{{c[2], RandomReal[{-100, 100}]}, {c[3], RandomReal[{-100, 100}]},

{a[2], RandomReal[{-100, 100}]}, {a[3], RandomReal[{-100, 100}]},

{b[3], RandomReal[{-100, 100}]},

{d, RandomReal[{0, 127/10}], 0, 127/10},

{k, RandomReal[], 0, 1}},

WorkingPrecision -> 30, MaxIterations -> 1000

],

Nothing

],

{15000}

];

DeleteDuplicates[

%[[2, 1, All, All, 2]],

Round[#1, 0.0001] == Round[#2, 0.0001] &

]

During these calculations FindRoot repeatedly reports that the constraint on the value of kk cannot be satisfied:

FindRoot::reged: The point {<<>>} is at the edge of the search region {0,1.000000000000000000000000} in coordinate 7 and the computed search direction points outside the region.

On the other hand, if the requirement that 0