Please ans this....how to write the equation into Matlab Code

5 件のコメント

VBBV
VBBV 2021 年 4 月 26 日
Read about integral or cumtrapz functions
Jan
Jan 2021 年 4 月 26 日
Do you want to solve this symbolically or numerically?
Kunwar Pal Singh
Kunwar Pal Singh 2021 年 4 月 26 日
i want to implement this equation in PSO algorithm by Maximizing the above equation
Kunwar Pal Singh
Kunwar Pal Singh 2021 年 4 月 26 日
how to write this equation in matlab code for PSO algorithm
Walter Roberson
Walter Roberson 2021 年 4 月 26 日
To search for a maximum, minimize the negative of the result equation that I posted.
You can use lower bound and upper bound to apply those constraints. I suspect that t_1 should have a lower bound of 0.

サインインしてコメントする。

 採用された回答

Walter Roberson
Walter Roberson 2021 年 4 月 26 日
編集済み: Walter Roberson 2021 年 4 月 27 日

1 投票

%these variables must be defined in a way appropriate for your situation
S_N = rand() * 10
S_N = 5.6100
theta = randn() * 2 * pi
theta = -9.9489
l = randi([2 10])
l = 4
b_1 = rand()
b_1 = 0.4189
c_11 = rand()
c_11 = 0.7008
t_year = randi([1950 2049])
t_year = 1960
d_11 = rand()
d_11 = 0.3502
t_1 = rand()
t_1 = 0.1989
t_x = t_1 + rand()
t_x = 0.5704
lambda_a = randi([500 579])
lambda_a = 551
LOTF_a = rand()
LOTF_a = 0.1140
P = rand()
P = 0.7418
K_l = rand()
K_l = 0.7342
k_0 = rand()
k_0 = 0.2623
t_tau = randi(10)
t_tau = 7
overhaulcost_a = 1000 + rand()*100
overhaulcost_a = 1.0864e+03
%the work
syms t
part1 = int(S_N .* cos(theta) .* l .* b_1 .* t_year .* d_11, t, t_1, t_x);
part2 = int(lambda_a .* LOTF_a, t, t_1, t_x);
part3 = int(P*K_l .* t_year + P .* k_0 .* l .* l .* t_tau, t, t_1, t_x);
part4 = overhaulcost_a ;
result = part1 - part2 - part3 - part4;
result
result = 

4 件のコメント

Walter Roberson
Walter Roberson 2021 年 4 月 26 日
I think it likely that your equations are wrong. All three integrals that you are doing are integrals over t, but all three of the expressions to be integrated are independent of t . Two of them are dependent on t_year and one is dependent on t_tau but neither t_year nor t_tau are the variables of integration.
Kunwar Pal Singh
Kunwar Pal Singh 2021 年 4 月 26 日
Im not getting the output of the "result". i'm getting the output till the overhaulcost_a, after that not getting fully ans cant getting why it is so..
Walter Roberson
Walter Roberson 2021 年 4 月 27 日
Remove the semi-colons if you want the partial results to be displayed.
Kunwar Pal Singh
Kunwar Pal Singh 2021 年 4 月 27 日
ok thanx

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by