How can i solve this equation ?

2 visualizaciones (últimos 30 días)
Mallouli Marwa
Mallouli Marwa el 18 de En. de 2017
Hi
How ca i solve the attached equation to find lamda ?
When all the other terms are known.

Respuesta aceptada

Jorge Mario Guerra González
Jorge Mario Guerra González el 20 de En. de 2017
If you want to get multiple answers use vpasolve function. Set the number of answers you want yo get and the code will pick some then in a random way.
syms lambda
Mt=1; % The value of your variables
m=1;
L=1;
lt=1;
eqn= 1+(cos(lambda)*cosh(lambda))+((lambda*Mt/(m*L))*(cos(lambda)*sinh(lambda)-sin(lambda)*cosh(lambda)))-((lt*lambda^3)/m*L^3)*(cosh(lambda)*sin(lambda)+sinh(lambda)*cos(lambda))+ ((Mt*lt*lambda^4)/m^2*L^4)*(1-cosh(lambda)*cos(lambda)) ==0;
for n = 1:50
vpasolve(eqn,lambda,'random',true)
end
this example gives you 50 answers. The answer before gives the first it finds.
  3 comentarios
Mallouli Marwa
Mallouli Marwa el 20 de En. de 2017
How can i display this result in a vector
for n = 1:50 vpasolve (eqn,lambda,'random',true) end
Jorge Mario Guerra González
Jorge Mario Guerra González el 20 de En. de 2017
syms lambda
Mt=1; % The value of your variables
m=1;
L=1;
lt=1;
eqn= 1+(cos(lambda)*cosh(lambda))+((lambda*Mt/(m*L))*(cos(lambda)*sinh(lambda)-sin(lambda)*cosh(lambda)))-((lt*lambda^3)/m*L^3)*(cosh(lambda)*sin(lambda)+sinh(lambda)*cos(lambda))+ ((Mt*lt*lambda^4)/m^2*L^4)*(1-cosh(lambda)*cos(lambda)) ==0;
k=zeros(1,50);
for n = 1:50
k(i)=vpasolve(eqn,lambda,'random',true)
end
that should create the vector

Iniciar sesión para comentar.

Más respuestas (1)

Jorge Mario Guerra González
Jorge Mario Guerra González el 19 de En. de 2017
Just use the function solve, which uses numerical techniques to find variables.
try this.
syms lambda
Mt=1; % The value of your variables
m=1;
L=1;
lt=1;
%check if I wrote this correctly
eqn= 1+(cos(lambda)*cosh(lambda))+((lambda*Mt/(m*L))*(cos(lambda)*sinh(lambda)-sin(lambda)*cosh(lambda)))-((lt*lambda^3)/m*L^3)*(cosh(lambda)*sin(lambda)+sinh(lambda)*cos(lambda))+ ((Mt*lt*lambda^4)/m^2*L^4)*(1-cosh(lambda)*cos(lambda)) ==0;
value=solve(eqn,lambda) %solution for lamda
  2 comentarios
Mallouli Marwa
Mallouli Marwa el 19 de En. de 2017
This equation must have an infinite solutions but this method show only one solution.
John D'Errico
John D'Errico el 19 de En. de 2017
You cannot find an infinite number of solutions. If you tried to write them all down, it would take infinitely long.

Iniciar sesión para comentar.

Categorías

Más información sobre Numbers and Precision en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by