Please ans this....how to write the equation into Matlab Code
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Kunwar Pal Singh
el 26 de Abr. de 2021
Comentada: Kunwar Pal Singh
el 27 de Abr. de 2021
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/596780/image.jpeg)
5 comentarios
Walter Roberson
el 26 de Abr. de 2021
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.
Respuesta aceptada
Walter Roberson
el 26 de Abr. de 2021
Editada: Walter Roberson
el 27 de Abr. de 2021
%these variables must be defined in a way appropriate for your situation
S_N = rand() * 10
theta = randn() * 2 * pi
l = randi([2 10])
b_1 = rand()
c_11 = rand()
t_year = randi([1950 2049])
d_11 = rand()
t_1 = rand()
t_x = t_1 + rand()
lambda_a = randi([500 579])
LOTF_a = rand()
P = rand()
K_l = rand()
k_0 = rand()
t_tau = randi(10)
overhaulcost_a = 1000 + rand()*100
%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
4 comentarios
Walter Roberson
el 27 de Abr. de 2021
Remove the semi-colons if you want the partial results to be displayed.
Más respuestas (0)
Ver también
Categorías
Más información sobre Calculus en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!