# seven roots of an equation

1 view (last 30 days)
Eemil Sakki on 15 Nov 2021
Commented: Eemil Sakki on 15 Nov 2021
Hi,
I need to find the seven roots of omega of this equation (picture), but I don't know how to get the summation tool to work with both beta and lambda having six values. The rhoo (reactivity) is input from user and capital lambda is a known value.
code:
s = 10^-4;
reactivity = 'What is the step reactivity in pcm? ';
x = input(reactivity)*10^-5;
b = [24 123 117 262 108 45];
l = [0.0127 0.031 0.116 0.3106 1.4006 3.876];
o=0;
syms k
a = vpasolve(x==o*(s+symsum(b(k)/(o+l(k)),k,1:6)),o)

John D'Errico on 15 Nov 2021
Edited: John D'Errico on 15 Nov 2021
What you have done in code is terribly confusing. There is no need to use symsum.
Can we assume that b is beta?
Can we assume that l is the subscripted lambda?
I will guess the variable you called o, which you then set to ZERO? is that your unknown, thus omega?
Is s the value of capital Lambda?
Let me see.in the picture of the equation, we see a capital Lambda, and then a subscripted Lambda.
And of course, you don't tell us what is the reactivity that you would use.
Next, you should learn that 10^-5 is most easily written as 1e-5 and likewise, 10^-4 is just 1e-4.
So let me guess this is what you need to do. But it is a completely wild guess.
reactivity = 17; % I just picked an arbitrary number here
Rho = reactivity*1e-5;
CapLambda = 1e-4;
Beta = [24 123 117 262 108 45];
Lambda = [0.0127 0.031 0.116 0.3106 1.4006 3.876];
Now, your unknown variable is apparently Omega.
syms Omega
Define the equation using Omega, and all of the other values. You should see that symsum was not used. sum is sufficient, as these are just vectors.
EQ = Rho == Omega*(CapLambda + sum(Beta./(Omega + Lambda)))
EQ =
Note that the symbolic toolbox decided to display those floating point numbers as the ratios of integers. It will do that.
Finally, solve for Omega. Since we know this equation is equivalent to a 7th degree polynomial, we will just use vpasolve, as such a polynomial cannot be factored in algebraic form to find its roots.
OmegaSol = vpasolve(EQ,Omega)
OmegaSol =
There are the 7 distinct roots of that equation. Only one of them is a positive value.
Eemil Sakki on 15 Nov 2021
Hi,
Thanks! You understood the assigment perfectly. One can probably see that I haven't used matlab in a while :) and suddenly had a mandatory homework in quite short notice which required a matlab code as answer. Didn't remember even the easiest commands... Will have to start learning again.
Thanks again!