필터 지우기
필터 지우기

How to find L from the given code?

조회 수: 2 (최근 30일)
Akhtar Jan
Akhtar Jan 2022년 7월 30일
편집: Torsten 2022년 7월 30일
clc
close all
lags = 0.6;
k1 = 3;
k_1 = 1;
k2 = 2.5;
k3 = 1;
k_3 = 1;
k4 = 2;
k5 = 1;
E1 = 1;
E2 = 2;
K1 = (k_1+k2)/k1;
K2 = (k_3+k4)/k3;
k3*E2*(L^2+L*(k1*K1+k4+k1*E1)+(E1+K1)*k1*k4+k1*k2*E1)+(L+k3*K2)*(k1*k2*E1+(L+k1*K1+k1*E1)*(L-k5*E1*e^(-L*lags))) = 0;

채택된 답변

Torsten
Torsten 2022년 7월 30일
편집: Torsten 2022년 7월 30일
lags = 0.6;
k1 = 3;
k_1 = 1;
k2 = 2.5;
k3 = 1;
k_3 = 1;
k4 = 2;
k5 = 1;
E1 = 1;
E2 = 2;
K1 = (k_1+k2)/k1;
K2 = (k_3+k4)/k3;
fun = @(L) k3*E2*(L.^2+L.*(k1*K1+k4+k1*E1)+(E1+K1)*k1*k4+k1*k2*E1)+(L+k3*K2).*(k1*k2*E1+(L+k1*K1+k1*E1).*(L-k5*E1*exp(-L*lags)));
L0 = -1.5;
L1 = fsolve(fun,L0)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
L1 = -1.6620
L0 = -2.5;
L2 = fsolve(fun,L0)
Equation solved. fsolve completed because the vector of function values is near zero as measured by the value of the function tolerance, and the problem appears regular as measured by the gradient.
L2 = -2.4088
plot((-2.5:0.1:-1),fun(-2.5:0.1:-1))

추가 답변 (1개)

Walter Roberson
Walter Roberson 2022년 7월 30일
편집: Torsten 2022년 7월 30일
syms L
e = exp(sym(1))
e = 
e
lags = 0.6;
k1 = 3;
k_1 = 1;
k2 = 2.5;
k3 = 1;
k_3 = 1;
k4 = 2;
k5 = 1;
E1 = 1;
E2 = 2;
K1 = (k_1+k2)/k1;
K2 = (k_3+k4)/k3;
eqn = k3*E2*(L^2+L*(k1*K1+k4+k1*E1)+(E1+K1)*k1*k4+k1*k2*E1)+(L+k3*K2)*(k1*k2*E1+(L+k1*K1+k1*E1)*(L-k5*E1*e^(-L*lags)))
eqn = 
vpasolve(eqn)
ans = 
There is a second solution near -2.3
  댓글 수: 2
Akhtar Jan
Akhtar Jan 2022년 7월 30일
thank you sir
Akhtar Jan
Akhtar Jan 2022년 7월 30일
this one is also helpfull

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by