-1
$\begingroup$
Y = 2*10^11;
Iyy = 8.333*10^-6;
L = 4;
ζ = L/2;
K = 100*(Y*Iyy)/L^3;
a = (2*β^3*Sin[β*L]*Sinh[β*L]);

(*This is my main equation*)
eq1 = 
  (1 - K/(Y*Iyy) *
    ((Sin[β*(L - ζ)]*Sin[β*ζ]*Sinh[β*L] - Sinh[β*(L - ζ)]*Sinh[β*ζ]* Sin[β*L])*1/a));

P = FullSimplify[eq1];
T = P;,
Plot[T, {β, -10, 10}]

S = FindRoot[T == 0, {β, 3}] (* finding the root at 3*)
β /. % (* printing that value*)

I first plotted that equation and later, wherever it crosses the x-axis, in that neighborhood I was trying to find the root. I used FindRoot command. This program is about finding the root of the equation P.

$\endgroup$
  • 2
    $\begingroup$ Paste your code not Image PLEASE! $\endgroup$ – zhk Aug 25 '17 at 6:30
  • $\begingroup$ Here its considered helpful to show your own efforts and share your code in a well formatted form instead of images or links to external files, so we can quickly Copy&Paste your code, test it, and see the problem you are facing. Please help us to help you and edit your question accordingly. This question in Meta could be useful. $\endgroup$ – rhermans Aug 25 '17 at 9:42
  • 1
    $\begingroup$ The code works and there's no question asked -- what do you want? If you want a particular root, try bracketing it: FindRoot[eq1 == 0, {\[Beta], 3, 3, 4}] $\endgroup$ – Michael E2 Aug 29 '17 at 11:07
  • $\begingroup$ Related/duplicate: mathematica.stackexchange.com/questions/134106/… $\endgroup$ – Michael E2 Aug 29 '17 at 12:49
  • $\begingroup$ But when I plot my equation I did not find that function cross X axis $\endgroup$ – Vijay Kumar S Aug 29 '17 at 16:13
3
$\begingroup$

If you want all roots in a given domain, you can use

NSolve[T == 0 && 0 < β < 10]

Clearing the trig. denominators with

NSolve[Expand[T*Cos[2 β] Sinh[4 β]] == 0 && 0 < β < 10]

is faster.

Even faster for this example is a direct search with FindRoot, bracketing the search domain to subintervals in a partition of the domain into intervals of length less than half the smallest period of the trig. functions:

Table[Check[FindRoot[T == 0, {β, n, n, n + 1}], Nothing], {n, 9}]
(* ignore errors *)

They all return

{{β -> 2.34143}, {β -> 3.92378}, {β -> 5.49661}, {β -> 7.06803}, {β -> 8.63908}}
$\endgroup$
  • 1
    $\begingroup$ You can use Quiet[] to suppress the printing of the FindRoot errors, but I feel on this educational forum that unless the question is about suppressing them, it is better for the users to see them and think about whether they are serious or can be ignored. $\endgroup$ – Michael E2 Aug 30 '17 at 11:48
  • $\begingroup$ Thanks, MichaelE2 (best answer) and also m_goldberg. $\endgroup$ – Vijay Kumar S Aug 31 '17 at 15:41
  • $\begingroup$ @VijayKumarS It is a good practice to accept the most helpful answer, you know... $\endgroup$ – Henrik Schumacher Jan 8 '18 at 16:20

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.