ClearAll
(*befor finding the root for a lower stiffness use NSlove to find , \
then put that value back on the Rootfind and find the beta for \
varying stiffness *)
Y = 2*10^11;
Iyy = 8.333*10^-6;
L = 4;
z = Array[# &, 50, {0.01, 0.5}];
T = Length[z];
k = 10^12;(*1*10^b;*)
a = 1/(4*b^3*(1 - Cosh[b]*Cos[b]));
phi1 = ConstantArray[0, {T, 1}];
phi2 = ConstantArray[0, {T, 1}];
phi3 = ConstantArray[0, {T, 1}];
phi4 = ConstantArray[0, {T, 1}];
eq = ConstantArray[0, {T, 1}];
eq1 = ConstantArray[0, {T, 1}];
S = ConstantArray[0, {T, 1}];
om = ConstantArray[0, {T, 1}];
fn = ConstantArray[0, {T, 1}];
a1 = (Cos[b*x] - Cosh[b*x]);
a2 = (Sin[b*x] - Sinh[b*x]);
For[i = 2, i < T + 1, i++,
phi1[[i]] = (Cos[b] - Cosh[b])*(Sin[b*(1 - z[[i]])] -
Sinh[b*(1 - z[[i]])]);
phi2[[i]] = (Sin[b] - Sinh[b])*(Cos[b*(1 - z[[i]])] -
Cosh[b*(1 - z[[i]])]);
phi3[[i]] = (Sin[b] + Sinh[b])*(Sin[b*(1 - z[[i]])] -
Sinh[b*(1 - z[[i]])]);
phi4[[i]] = (Cos[b] - Cosh[b])*(Cos[b*(1 - z[[i]])] -
Cosh[b*(1 - z[[i]])]);
eq[[i]] =
a ((phi1[[i]] - phi2[[i]])*(a1 /. x -> z[[i]]) + (phi3[[i]] +
phi4[[i]])*(a2 /. x -> z[[i]])); eq1[[i]] = 1 + (k*eq[[i]])];
f[x_] := eq1[[2]] /. b -> x;
p = Plot[f[x], {x, 0, 30}, Mesh -> {{0}}, MeshFunctions -> (f[#] &)]
seeds = Cases[Normal[p], Point[r_] : -> r[[1]], \[Infinity]]
roots = Tabel[
x /. FindRoot[f[x], {x, s}], {s,
seeds}] \[Union] (SameTest -> (Abs[#1 - #2] < 1/10^-6 &))
tried to extract the first four roots (all the roots at a time ) of the transcendental equation but not working. It is throwing some error. find root, nsolve, find roots with the interval is also not working.
seeds
replace: ->
with:>
In the definition ofroots
. you misspelledTable
. In theSameTest
change1/10^-6
(i.e.,10^6
) with10^-6
$\endgroup$