elango8

146 Reputation

4 Badges

12 years, 6 days

MaplePrimes Activity


These are answers submitted by elango8

View 10874_fsolve loop.mw on MapleNet or Download 10874_fsolve loop.mw
View file details Is it possible to use fsolve in a loop/sequence just as solve command.I tried using the following > wvals := [0.2, 0.4, .6, .8, 1, 1.2, 1.4, 1.6, 1.8, 2]; > S := {seq({w = wvals[i]}, i = 1 .. 10)}; sys :={my 7 eqns,with variable w underlined for easy access}: sols := {seq(seq([op(i),op(j)], j=fsolve(subs(i,sys)),i=S)}; but im getting errors,is it something that i am doing wrong or is it not possible to use fsolve in loops.I have attached my mw file for better understanding.
I am really grateful for the time and effort u put in to hep solve my problem.I never thought giving input in 2d mode would cause such trouble,coz in most of the study materials that was the case. anyways,i wud do as u said from now on.Since fsolve gives me only one solution for the set of equations,does that mean is that the only solution available for these equations or its just giving me one. or is there a way wer i can find all possible soltuions of the set of equations.
View 10874_Variables used.mw on MapleNet or Download 10874_Variables used.mw
View file details I did use the exp command for mentioning the exponential term....as u can see the 'e' term in the equations is not in italics...so it is the exponential function.If i have used the normal e^(something) then the 'e' in my equations woud have been in italics.You could verify it in the files attached. So with now that being sorted out,could you find any other mistakes in my equations. thank you.
View 10874_fsolver.mw on MapleNet or Download 10874_fsolver.mw
View file details i have attached the .mw file that i used to solve for the equations so ,that anyone can look at my set of equations and the error message.hope i will be able to resolve it before my due date.
I rectified those errors and now when i try to solve the equations i am getting the following error ,message Error, Got internal error in Typesetting:-Parse:-Postprocess : "internal error: invalid object *a2*a4)−" i have the set of eqns as below,where i have huge expressions for K1,K2,K3,hC,hCO,....in terms of t and (a1,a2,a3,a4,a5,a6,a7,t) are my unknowns {a2+a3+a5+a6-1, 2*a1+2*a4+4*a5-1.6-2*.8, a2+2*a3+a4-.8-1.2, a1*a3, K3*a4*a6-a1*a2, (1/4)*K1*(a1+a2+a3+a4+a5+a6)^2*a5*a6-a1^3*a2, -202.86-.8*215.2218-a1*hH2-a2*hCO-a3*hCO2-a4*hH2O-a5*hCH4-a6*hC} Is ther anyway to attach my .mw file so that others can chk out my equations
> K1vals := Vector[row](6, {(1) = 0.76969e-2, (2) = .53977, (3) = 14.411, (4) = 201.61, (5) = 1773.9, (6) = 11019}); K2vals := Vector[row](6, {(1) = 3.651001629437963, (2) = 2.150235214522246, (3) = 1.388233867818559, (4) = .970050248371344, (5) = .722160791622956, (6) = .565166373520117}); K3vals := Vector[row](6, {(1) = 0.12757637666935e-1, (2) = .161540521091345, (3) = 1.171756533878198, (4) = 5.768716213681884, (5) = 21.39755055966452, (6) = 64.07321539377426}); > A1vals := Vector[row](6, {(1) = 5.99269152425138, (2) = 9.082685459026708, (3) = 12.086376790494208, (4) = 15.064420306515624, (5) = 18.049003523479044, (6) = 21.057984076063697}); > A2vals:=[[[-103.25850888963173,-100.72238168266564,-97.88206959552728,-94.84631951379374,-91.67635724846036,-88.4093507184502]:]]; > A3vals := Vector[row](6, {(1) = -383.1800382842139, (2) = -379.27920692463204, (3) = -374.78023536900065, (4) = -369.8968267296264, (5) = -364.74934664728437, (6) = -359.4109043604188}); > A5vals := Vector[row](6, {(1) = -56.60844247131931, (2) = -55.87540761185849, (3) = -52.69133101167566, (4) = -47.932284691781675, (5) = -42.09183889485382, (6) = -35.469910907129005}); > A6vals := Vector[row](6, {(1) = 4.468490947554415, (2) = 6.549581118704168, (3) = 8.628724291125764, (4) = 10.706212969049716, (5) = 12.782503347892998, (6) = 14.858121662512872}); > A7vals := Vector[row](6, {(1) = -215.2217704166667, (2) = -207.12928489706667, (3) = -198.2875464885905, (4) = -188.91367261706668, (5) = -179.13528606751112, (6) = -169.03479133333335}); > A4vals := Vector[row](6, {(1) = -227.83489734448483, (2) = -226.75374949209015, (3) = -224.6059039220604, (4) = -221.76236658540216, (5) = -218.43259572269457, (6) = -214.74424943891745}); > S := {seq({A1 = A1vals[i], A2 = A2vals[i], A3 = A3vals[i], A4 = A4vals[i], A5 = A5vals[i], A6 = A6vals[i], A7 = A7vals[i], K1 = K1vals[i], K2 = K2vals[i], K3 = K3vals[i]}, i = 1 .. 6)}; > sys := {K2*a2*a4-a1*a3, K3*a4*a6-a1*a2, (1/4)*K1*(a1+a2+a3+a4+a5+a6)^2*a5*a6-a1^3*a2, 2*a1+2*a4+4*a5-1.6-2*a7, a2+a3+a5+a6-1, a2+2*a3+a4-.77-a7, a1*A1+a2*A2+a3*A3+a4*A4+a5*A5+a6*A6+202.86-a7*A7}; > sols := {seq(seq([op(i), op(j)], j = RootFinding:-Isolate(subs(i, sys), [a1, a2, a3, a4, a5, a6, a7])), i = S)}; Error, invalid input: subs received S, which is not valid for its 1st argument I am getting the above error if i try to solve it.....can anyone tell wat the problem is? thank you in advance.
Try using fsolve since it uses numerical techniques to solve non linearity fsolve({eq1,eq2},{u,b},{u=4..8,v=0..10}) u can also try mentioning the range for u and b values to make life easy or u can omit the third section mentioning the range wher the values of u and b might lie. I am very new to maple so if u find any errors in wat i have said pls let me knw so i cud improve.
Thankyou. I also need some advice on the following e1='a2+a3+a5+a6-1=0'; e2='2*a1+2*a4+4*a5-1.6-2*w=0'; e3='a2+2*a3+a4-0.77-w=0'; e4='(K1*((a1+a2+a3+a4+a5+a6)^2/p^2)*(a5*a6))-(a1^3*a2)=0'; e5='K2*a2*a4-(a1*a3)=0'; e6='K3*a4*a6-(a1*a2)=0'; If u look closely in e2,e3 i have an additional term 'w' and in e4 'p'....so now i have to solve the equations 35 times for each value of w and each value of p but the problem is no longer solving for corresponding values of K1,K2,K3 but solving them correspondingly for each w(20 no of values)and for each p(10 no of values) so shud i modify the code like for example, K1vals := [1,2,3,4,5]: K2vals := [6,7,8,9,10]: K3vals := [11,12,13,14,15]: wvals:=[0.2,0.3,0.4]: pvals:=[1,2,3,4,5,6,7,8] S := {seq({K1=K1vals[i], K2=K2vals[i], K3=K3vals[i],w=wvals[j],p=pvals[k]}, i=1..5,j=1..3,k=1..8)}; sys := {a2+a3+a5+a6-1, 2*a1+2*a4+4*a5-1.6-2*w, a2+2*a3+a4-0.77-w, K2*a2*a4-(a1*a3), K3*a4*a6-(a1*a2), (K1*((a1+a2+a3+a4+a5+a6)^2/p^2)*(a5*a6))-(a1^3*a2)}: sols := {seq( seq([op(i),op(j)], j=RootFinding:-Isolate(subs(i,sys),[a1,a2,a3,a4,a5,a6])), i=S)};
pearce, thanks a lot for ur code.But it is solving in the set of equations like in a for loop as follows for K1=[1 2 3 4 5] for k2=[6 7 8 9 10] for k3=[11 12 13 14 15] solve (set of eqns) end end end The loop executes like For K1=1,K2=6,K3=[11 12 13 14 15](5 times) and then K1=1,K2=7,K3=[11 12 13 14 15]...and so on but i wud like to solve the set of equations only for the corresponding values...first solve for K1(1),k2(1),k3(1)..then k1(2),K2(2),K3(2)...and so on. If you could suggest me a way to do this it would be really helpful.Coz i have 35 values each for K1,K2,k3 and i need to run it exactly 35 times using the set of values.I tried this method for the same set of values as u typed n it consumes quite a lot of memory and im sure if i run the same code with my values ,it wud take a long time.
e1='a2+a3+a5+a6-1=0'; e2='2*a1+2*a4+4*a5-1.6-2*0.2=0'; e3='a2+2*a3+a4-0.77-0.2=0'; e4='(K1*((a1+a2+a3+a4+a5+a6)^2/4)*(a5*a6))-(a1^3*a2)=0'; e5='K2*a2*a4-(a1*a3)=0'; e6='K3*a4*a6-(a1*a2)=0'; Sorry for the typo f=a6. i need to evaluate a1,a2,a3,a4,a5,a6 for the different set of values of K1,K2,K3
1 2 Page 2 of 2