0
$\begingroup$

I attached below the system of 5 equations that I am not able to solve using FindRoot. I also tried without defining the equations as functions but It didn't work. `

eq1[Hb_, Db_] := Hb/Db == K;
eq2[Ks_, kb_, Db_, Gb_] := Ks == Sqrt[(Coth[kb Db])/(1 + Gb)];
eq3[Gb_, kb_, Db_] := Gb == (2 kb Db)/(Sinh[2 kb Db]);
eq4[Hb_, Ks_] := Hb/Ho == Ks;
eq5[Hb_, Gb_, kb_, Db_] := (Ho)^2 == Hb^2 (1 + Gb) Tanh[kb Db];

FindRoot[{eq1, eq2, eq3, eq4, 
  eq5}, {{Hb, 6}, {Db, 8}, {kb, 0.01}, {Ks, 1}, {Gb, 10}}]`
$\endgroup$
2
  • 1
    $\begingroup$ A function needs arguments to evaluate: E.g.:eq1 is not a function call. Further, Ho has no value, therefore you can not use a numerical routine. $\endgroup$ – Daniel Huber Oct 22 '20 at 14:11
  • 1
    $\begingroup$ We need the values of Hoand K $\endgroup$ – Ulrich Neumann Oct 22 '20 at 14:39
1
$\begingroup$

The equations depend on the variables Hb , Db , kb , Ks , Gb and two parameters K,Ho

For given parameters (examplary {K -> 1, Ho -> 1}) NMinimize might solve your problem:

eqn = {Hb/Db == K,Ks == Sqrt[(Coth[kb Db])/(1 + Gb)],Gb == (2 kb Db)/(Sinh[2 kb Db]) Hb/Ho == Ks (Ho)^2 == Hb^2 (1 + Gb) Tanh[kb Db]}

NMinimize[{1, eqn} /. {K -> 1, Ho -> 1}, {Hb  , Db  , kb , Ks , Gb }]
(*{1., {Hb -> 0.987152, Db -> 0.987152, kb -> 3.00016, Ks -> 0.987152, Gb -> 0.0317076}}*)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.