ratio using for loops

1 vue (au cours des 30 derniers jours)
Raushan
Raushan le 19 Oct 2023
Commenté : Walter Roberson le 20 Oct 2023
Dear All,
I would like to calculate this and find out s^*. How can I calculate it using loop. I think reindexing doesn't help, since boundaries are different.
Thank you very much,
I tried in this way, but it doesn't work.
sum_x_s_ast_2 = 0;
sum_y_s_ast_2 = 0;
for n=((s_asterisk+1):1:(T-1))
sum_x_s_asterisk_2=sum_x_s_ast_2+x_2^n;
sum_y_s_asterisk_2=sum_y_s_ast_2+y_2^n;
ratio_1(n+1)=(sum_x_s_ast_2/sum_y_s_ast_2)*epsilon_2^(s_asterisk);
end
sum_x_s_ast_1 = 0;
sum_y_s_ast_1 = 0;
for l=(0:1:s_asterisk)
sum_x_s_ast_1=sum_x_s_ast_1+x_1^l;
sum_y_s_ast_1=sum_y_s_ast_1+y_1^l;
ratio_2(l+1)=(sum_x_s_ast_1/(sum_y_s_ast_1+K^(1/gamma)*x_1^T))*epsilon_1^(s_asterisk);
end
z=ratio_1(n+1)/ratio_2(l+1);
  4 commentaires
Walter Roberson
Walter Roberson le 20 Oct 2023
syms s s__ast T integer
assumeAlso(s__ast >= 0)
assumeAlso(T - 1 >= s__ast + 1)
syms x_2 y_2 real
syms epsilon_2
part1 = symsum(y_2^s, s, s__ast + 1, T - 1)
part1 = 
part2 = symsum(x_2^s, s, s__ast + 1, T - 1)
part2 = 
part3 = simplify(part1 / part2 * epsilon_2^s__ast)
part3 = 
This shows you how to construct the numerator for the expression. You follow similar steps to create the denominator for the expression.
Then you consider the expression P/Q >= 1 and multiply both sides by Q to get P >= Q . Subtract Q from both sides and you get P - Q >= 0 . Now you can solve() or vpasolve()
Walter Roberson
Walter Roberson le 20 Oct 2023
Can you do better than that? Maybe. But it would requiire assumptions that we as outside observers are not permitted to make. As onlookers, we do not know whether the values involved are real-valued or complex-valued. If or are negative then we would want to know whether their absolute values are greater less than 1 . For that matter, we would also want to know about the absolute values of those variables even if the variables are positive in order to be able to reason about convergence.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by