I cannot figure out how to solve for k1, k2, k3, k4 simultaneously using the values for the variable listed in the table.

27 vues (au cours des 30 derniers jours)
  7 commentaires
Lindsay Veltri
Lindsay Veltri le 12 Fév 2022
Modifié(e) : Walter Roberson le 11 Jan 2024
I am still struggling to solve this. here is my latest attempt; it is saying error, undefined 'k'
GnGn0 = 9.1; k(5) .* [5.4 3.5 2.4 1.8 1.6 1.8]; k(6) .* [2.9 4.2 4.8 4.8 4.6 4.3]; k(7).* [0.5 0.7 1.0 1.2 1.2 0.9]; k(8).* [0.2 0.6 1.0 1.3 1.7 2.1]; t = 10;
k(5) .* exp(-(k(1) + k(2)).*t);
k(6) .* ((k(1)*GnGn0)/(k(3)-(k(1)+k(2))))*((exp(-(k(1)+k(2))*t))-exp(-k(3)*t));
k(7) .* (k(2)*GnGn0/k(4)-(k(1)+k(2)))*(exp(-(k(1)+k(2))*t)-exp(-k(4)*t));
k(8) .* k(3)*k(1)*GnGn0/ k(3)-(k(1)+k(2))*(exp(-(k(1)+k(2))*t)/(-(k(1)+k(2)))+(exp(-k(3)*t))/(-(k(1)+k(2)))+(exp(-k(3)*t)/k(3))+(1/(k(1)+k(2)))-(1/k(3))+((k(4)*GnGn0)/(k(4)-(k(1)+k(2)))*(exp(-(k(1)+k(2))*t)/-(k(1)+k(2)))+(exp(-k(4)*t))/k(4))+1/(k(1)+k(2))-1/k(4));
Gzeroeqn = @(k,t) [k(5) .* exp(-(k(1) + k(2)).*t)]
GoneLeqn = @(k,t) [k(6).* ((k(1)*GnGn0)/(k(3)-(k(1)+k(2))))*((exp(-(k(1)+k(2))*t))-exp(-k(3)*t))]
GoneReqn = @(k,t) [k(7) .* (k(2)*GnGn0/k(4)-(k(1)+k(2)))*(exp(-(k(1)+k(2))*t)-exp(-k(4)*t))]
Gtwoeqn = @(k,t) [k(8) .* k(3)*k(1)*GnGn0/ k(3)-(k(1)+k(2))*(exp(-(k(1)+k(2))*t)/(-(k(1)+k(2)))+(exp(-k(3)*t))/(-(k(1)+k(2)))+(exp(-k(3)*t)/k(3))+(1/(k(1)+k(2)))-(1/k(3))+((k(4)*GnGn0)/((k(4))-(k(1)+k(2)))*(exp(-(k(1)+k(2))*t)/-(k(1)+k(2)))+(exp(-k(4)*t))/k(4))+1/(k(1)+k(2))-1/k(4))]
Yash
Yash le 11 Jan 2024
Hi Lindsay,
To assist you effectively, it would be helpful to know the specific problem that you're encountering. Your code is able to provide a set of solution when executed.
t = 10; GnGn0 = 9.1; GnGn = 5.4; GnG = 2.9; GGn = 0.5; GG = 0.2;
syms a b c d
eqns = [ GnGn == GnGn0 * (exp(-(a + b)*t)), GnG == ((a*GnGn0)/(c-(a+b)))*((exp(-(a+b)*t))-exp(-c*t)), GGn ==(b*GnGn0/d-(a+b))*(exp(-(a+b)*t)-exp(-d*t)), GG == c*a*GnGn0/ c-(a+b)*(exp(-(a+b)*t)/(-(a+b))+(exp(-c*t))/(-(a+b))+(exp(-c*t)/c)+(1/(a+b))-(1/c)+((d*GnGn0)/(d-(a+b))*(exp(-(a+b)*t)/-(a+b))+(exp(-d*t))/d)+1/(a+b)-1/d)];
S = solve (eqns, [a b c d] )
Warning: Unable to solve symbolically. Returning a numeric solution using vpasolve.
S = struct with fields:
a: 0.052718795965041138787084947058991 b: -0.00053124996978357303149771178071696 c: 0.048496912955408590423104924976659 d: 0.0037217687458454391313963030682866
There is only one warning that MATLAB is not able to provide solution sybolically, but it is providing a numerical solution.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Linear Algebra dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by