How to solve an equation which includes iteration/summation and with a mixed unknown variable ?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
KIRAN noor
am 12 Apr. 2022
Kommentiert: Rik
am 24 Jan. 2023
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1273080/image.png)
I am trying to solve equation for "Epe(OC)" the first term in exponential, i am using "solve()" to write it in unknown variable form, and it gives me result, however I am not getting a way to solve it in the form of summation, anyone if guide how to solve this type of equation will be great favor.
1 Kommentar
Rik
am 24 Jan. 2023
I recovered the removed content from the Google cache (something which anyone can do). Editing away (part of) your question is very rude. Someone spent time reading your question, understanding your issue, figuring out the solution, and writing an answer. Now you repay that kindness by ensuring that the next person with a similar question can't benefit from this answer.
Akzeptierte Antwort
Walter Roberson
am 12 Apr. 2022
Do not try to solve it in terms of a summation. Instead, construct a ./ ratio of vectors (the terms with all the varying i values) and sum() those to get a definite sum. Or just write out the definite sum, it should not be long.
So you will get something of the approximate form A1/B1 + A2/B2 + A3/B3 + A4/B4.
Now you can try to solve() that. You might get lucky enough for there to be a solution involving Wright Omega function... but I suspect not. solve() will probably give up if the coefficients are symbolic; if the target variable is the only variable then solve will probably use vpasolve()
2 Kommentare
Walter Roberson
am 12 Apr. 2022
Guessing that
is ![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/962685/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/962680/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/962685/image.png)
N = 4;
syms E__OC_PE e k T chi_PE Delta
syms alpha_PE_ [1 N]
syms x_PE_ [1 N]
syms E_0_PE_ [1 N]
numer = Delta*x_PE_
denom = 1 + exp((E__OC_PE - E_0_PE_) .* alpha_PE_ .* e ./ (k .* T))
eqn = chi_PE == sum( numer ./ denom)
sol = solve(eqn, E__OC_PE)
Whereas if you had specific numeric values for the variables then you would probably be able to vpasolve()
Weitere Antworten (1)
Sam Chak
am 12 Apr. 2022
Hi @IQRA KIRAN
Not exactly sure how your summation look like. Maybe the LaTeX code is incorrectly entered.
Anyhow, if you looking to find the root of the equation, for example
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/961645/image.png)
then you can try something like this:
n = 1 : 4;
f = @(x) sum(n./(1 + exp(x - n))) - 5; % function to be solved
x0 = 2; % initial guess
x = fzero(f, x0) % root-finding solver
x =
3.0399
Hope this is helpful to give you some insights on how to enter the summation that you desire.
0 Kommentare
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!