Only seven lines of code, the program runs continuously without any results when solving the equation
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
wei zeng
il 12 Mag 2023
Commentato: Walter Roberson
il 13 Mag 2023
This is my code
syms I A
B = 0.02;%blocking probability
N = 800;%number of channels
FN = factorial(N);
ACell = solve((A^N)/FN == B*symsum(A^I/factorial(I),I,0,N),A);
A = double(ACell);
A = A(end)
6 Commenti
VBBV
il 13 Mag 2023
The sym method did not solve your actual problem equation, Walter modified the equation by applying log on both sides and then solved it. That's simplified the problem
Walter Roberson
il 13 Mag 2023
The log makes it much much much faster !
Just one of those "tricks of the trade"
Risposta accettata
Walter Roberson
il 12 Mag 2023
syms I A
B = sym(0.02);%blocking probability
N = sym(800);%number of channels very huge
FN = factorial(N);
eqn = (A^N)/FN == B*symsum(A^I/factorial(I),I,0,N);
ACell = vpasolve(log(lhs(eqn))==log(rhs(eqn)),A);
A = double(ACell)
2 Commenti
Walter Roberson
il 13 Mag 2023
factorial(sym(800))
When you use factorial() of a symbolic number, you can get a full precision answer up to about 999; and functions can reason about the value of factorial() of larger integers even if larger values have delayed calculation.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Calculus in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!