Items tagged with fsolve

Feed

Hi,

I have three simultaneous equations  with three unknown variables (E, W, T). When I solve these  simultaneous equations with fsolve command without specifying any range for variables, I don't get desirable root ( equation sol4 in maple worksheet- {E = 0.1007672475e-2, T = .7969434549, W = 0.1937272759e-2}). For this problem, I know the correct root {E = 2843.916504, T = .2782913990, W = 5344.844134} beforehand which maximize the objective function TP (equation sol8 in maple worksheet) and when I specify the narrow range of variables around the already known correct root in the fsolve command, then I get correct root ( equation sol5 in maple worksheet). If I don't know the actual answer (correct roots of the simultaneous equation) beforehand, How  could I get the correct root with fsolve command because it is very tedious work to specify different range in fsolve command repetitively to solve it by trial and error.

I also tried Direct Search method as suggested in this forum  but DirectSearch is also not able to provide the correct root (equation sol6 in maple worksheet). If I specify the narrow range around known root in direct search method ( equation sol6a in maple worksheet), then it would provide close to optimal root but if I don't know the correct root beforehand, then I couldn't specify the narrow range of variables, then how can I get correct root through direct search command.

Equation sol10 in maple worksheet  (objective function value at correct root) confirms that {E = 2843.916504, T = .2782913990, W = 5344.844134} is the correct root because it provide the value of objective function (TP) equal to 78285.85621 as opposed to negative value (TP value -12.53348074 in equation sol9)  produced by incorrect root  {E = 0.1007672475e-2, T = .7969434549, W = 0.1937272759e-2}).

Is there any method which would provide all the roots of these simultaneous equations which also include correct root. Maple worksheet is attached.

I am trying fsolve and direct search method with known root so that I could get the proper procedure to get the correct root which I can apply to another problem (set of similar simultaneous equations) for which I don't know correct root beforehand.

Thanks for your anticipated help.fsolve_question.mw

Ok, so i have this functions

where f(x) represent urban population and g(x) represent the rural population.

And i have to implement an algortihm in Maple to find out after what period of time x the rural population will be with 20% bigger than urban population.

I'm new in Maple and is a little bit hard for me to implement algorithms in this program.If you can help me with any idea, i will really apreciate.Thank you :). 

Hi, 

I need to solve system of 6 non linear equations. 

Down here you can see the code I wrote and at the end used to fsolve function, and it is not running. I get an error about the const 'V': Error, (in fsolve) V is in the equation, and is not solved for.

What is the right way to solve this system?

Thank you very much!

 

 

omega1 := 1.562;
omega2 := 2.449;
omega3 := 3.325;
y1 := c1*sin(omega1*t+phi1)+c2*sin(omega2*t+phi2)+c3*sin(omega3*t+phi3);

 

 

y2 := .1019*c1*sin(omega1*t+phi1)+.75*c2*sin(omega2*t+phi2)+.4608*c3*sin(omega3*t+phi3);

 

 

y3 := .407*c1*sin(omega1*t+phi1)+(0*c2)*sin(omega2*t+phi2)+1.844*c3*sin(omega3*t+phi3);
 
eq1 := subs(t = 0, y1) = 0;
 
eq2 := subs(t = 0, y2) = 0;
 
eq3 := subs(t = 0, y3) = 0;
 
eq4 := subs(t = 0, diff(y1, t)) = V;
eq5 := subs(t = 0, diff(y2, t)) = 0;
eq6 := subs(t = 0, diff(y3, t)) = 0;

 

 

eqs := [eq1, eq2, eq3, eq4, eq5, eq6];
 
vars := [c1, c2, c3, phi1, phi2, phi3];
 
fsolve({eq1, eq2, eq3, eq4, eq5, eq6}, {c1, c2, c3, phi1, phi2, phi3});
 

 

i have set of equations and variable that i want to solve them using fsolve, but after about 20mintues of computations, fsolve retrun these set unevaluated, could anyone help?


 

 restart:with(linalg):with(LinearAlgebra):with(orthopoly):Digits:=40:
M:=3:
N:=2:
l:=2:
for m from 0 to M-1 do
L[m]:=unapply(P(m,t),t);
end do:
for n from 1 to N do;
for m from 0 to M-1 do;
BB[n,m]:=unapply(piecewise((n-1)/N<=t and t<n/N, sqrt(N*(2*m+1))*L[m](2*N*t-2*n+1)),t);
end do:
end do:
##############################################
B:=Vector(N*M,1,[seq(seq(BB[n,m](t),m=0..M-1),n=1..N)]):
BS:=Vector(N*M,1,[seq(seq(BB[n,m](s),m=0..M-1),n=1..N)]):
f[1]:=unapply((23/35)*t,t):
f[2]:=unapply((11/12)*t,t):
P[1]:=evalf(Vector(N*M,1,[seq(seq(int((23/35)*t*BB[n,m](t),t=0..1,t=0..1),m=0..M-1),n=1..N)])):
P[2]:=evalf(Vector(N*M,1,[seq(seq(int((11/12)*t*BB[n,m](t),t=0..1,t=0..1),m=0..M-1),n=1..N)])):
p[1]:=Transpose(P[1]):P[1]^+:
p[2]:=Transpose(P[2]):P[2]^+:

 

#############################################
k:=Matrix(2,2,[[t*s^2,t*s^2],[s*t^2,s*t^2]]):

 

 

 

 

 

 

 

 

 

######################################

for i from 1 to 2 do;
for j from 1 to 2 do;
T[i,j]:=Matrix(N*M,N*M):

for n from 1 to M*N do;
for m from 1 to M*N do;
T[i,j](n,m):=evalf(int(int(B[n]*k(i,j)*BS[m],t=0..1),s=0..1)):
end do:
end do:
od:
od:
evalm(T[1,1]):
evalm(T[1,2]):
evalm(T[2,1]):
evalm(T[2,2]):

 

 

##########################################

X[1]:=Matrix(M*N,1):
for n from 1 to M*N do;
X[1](n,1):=Y[n,1]:
od:
evalm(X[1]):
#### yadet bashe k dar in mesal majhulat y1,y2
####ba bordarhaye X1, X2 neshun dadi...darvaghe
####dar mesale avale maghale 2ta y dashti k bayad moadele ash ro hal mikardi...
 

 

X[2]:=Matrix(M*N,1):
for n from 1 to M*N do;
X[2](n,1):=yY[n,1]:
od:
evalm(X[2]):

U[1,1]:=Matrix(M*N,1):
for n from 1 to M*N do;
U[1,1](n,1):=u[n,1]:
od:
evalm(U[1,1]):

U[1,2]:=Matrix(M*N,1):
for n from 1 to M*N do;
U[1,2](n,1):=uU[n,1]:
od:

evalm(U[1,2]):
Transpose(U[1,2]):

U[2,1]:=Matrix(N*M,1):
for n from 1 to M*N do;
U[2,1](n,1):=w[n,1]:
od:
evalm(U[2,1]):

U[2,2]:=Matrix(M*N,1):
for n from 1 to M*N do;
U[2,2](n,1):=wW[n,1]:
od:
evalm(U[2,2]):





 


A:=add(X[j], j=1..2):

z[1]:=Matrix(1,M*N):
z[2]:=Matrix(1,M*N):
for i from 1 to 2 do;
Z[i]:=Transpose(A)-add(Transpose(U[i,j]).T[i,j], j=1..2);
evalm(Z[i]):
z[i]:=Z[i]-convert(p[i],Matrix):
od:
evalm(z[1]):
##############
z[1](1,2):


##########################################
for s from 1 to M*N do;
t:=((2*s)-1)/(2*M*N);
ff[1,1]:=eval(VectorMatrixMultiply(Transpose(X[1]),eval(B,t=((2*s)-1)/(2*M*N))));
F[1,s]:=multiply(ff[1,1],ff[1,1]);
expand(%):
H[1,s]:=VectorMatrixMultiply(Transpose(U[1,1]),eval(B,t=((2*s)-1)/(2*M*N)));
hh[1,s]:=F[1,s]-H[1,s][1];
od:

 

ff[1,1]:


 

F[1,1]:

H[1,1]:

hh[1,2]:

 

for s from 1 to M*N do;
t:=((2*s)-1)/(2*M*N);
ff[2,1]:=eval(VectorMatrixMultiply(Transpose(X[1]),eval(B,t=((2*s)-1)/(2*M*N))));
G[1,s]:=multiply(ff[2,1],ff[2,1]);
expand(%):
J[1,s]:=VectorMatrixMultiply(Transpose(U[2,1]),eval(B,t=((2*s)-1)/(2*M*N)));
JJ[1,s]:=G[1,s]-J[1,s][1];
od:
JJ[1,1]:
JJ[1,2]:

for s from 1 to M*N do;
t:=((2*s)-1)/(2*M*N);
ff[1,2]:=eval(VectorMatrixMultiply(Transpose(X[2]),eval(B,t=((2*s)-1)/(2*M*N))));
GG[1,s]:=multiply(ff[1,2],ff[1,2]);
expand(%):
g[1,s]:=VectorMatrixMultiply(Transpose(U[1,2]),eval(B,t=((2*s)-1)/(2*M*N)));
gg[1,s]:=GG[1,s]-g[1,s][1];
od:
gg[1,1]:
gg[1,2]:

for s from 1 to M*N do;
t:=((2*s)-1)/(2*M*N);
ff[2,2]:=eval(VectorMatrixMultiply(Transpose(X[2]),eval(B,t=((2*s)-1)/(2*M*N))));
DD[1,s]:=multiply(ff[2,2],ff[2,2]);
expand(%):
d[1,s]:=VectorMatrixMultiply(Transpose(U[2,2]),eval(B,t=((2*s)-1)/(2*M*N)));
dd[1,s]:=DD[1,s]-d[1,s][1];
od:
dd[1,1]:
dd[1,2]:


eqq[1]:=seq(hh[1,s],s=1..M*N):

eqq[2]:=seq(gg[1,s],s=1..M*N):

 

eqq[3]:=seq(JJ[1,s],s=1..M*N):

eqq[4]:=seq(dd[1,s],s=1..M*N):
eqq[5]:=seq(z[1](1,s),s=1..M*N):
eqq[6]:=seq(z[2](1,s),s=1..M*N):

eq:=seq(eqq[s],s=1..M*N):

var[1]:=seq(X[1](s,1),s=1..M*N):
var[2]:=seq(X[2](s,1),s=1..M*N):
var[3]:=seq(U[1,1](s,1),s=1..M*N):
var[4]:=seq(U[1,2](s,1),s=1..M*N):
var[5]:=seq(U[2,1](s,1),s=1..M*N):
var[6]:=seq(U[2,2](s,1),s=1..M*N):

EQ:=Matrix(36,1):

for i to 6 do
EQ(6*i-5,1):=hh[1,i];
EQ(6*i-4,1):=gg[1,i];
EQ(6*i-3,1):=JJ[1,i];
EQ(6*i-2,1):=dd[1,i];
EQ(6*i-1,1):=z[1](1,i);
EQ(6*i,1):=z[2](1,i);
od:

 

indets(EQ);

{Y[1, 1], Y[2, 1], Y[3, 1], Y[4, 1], Y[5, 1], Y[6, 1], u[1, 1], u[2, 1], u[3, 1], u[4, 1], u[5, 1], u[6, 1], uU[1, 1], uU[2, 1], uU[3, 1], uU[4, 1], uU[5, 1], uU[6, 1], w[1, 1], w[2, 1], w[3, 1], w[4, 1], w[5, 1], w[6, 1], wW[1, 1], wW[2, 1], wW[3, 1], wW[4, 1], wW[5, 1], wW[6, 1], yY[1, 1], yY[2, 1], yY[3, 1], yY[4, 1], yY[5, 1], yY[6, 1]}

(1)

``

``

Var:=[seq](var[s],s=1..M*N);

[Y[1, 1], Y[2, 1], Y[3, 1], Y[4, 1], Y[5, 1], Y[6, 1], yY[1, 1], yY[2, 1], yY[3, 1], yY[4, 1], yY[5, 1], yY[6, 1], u[1, 1], u[2, 1], u[3, 1], u[4, 1], u[5, 1], u[6, 1], uU[1, 1], uU[2, 1], uU[3, 1], uU[4, 1], uU[5, 1], uU[6, 1], w[1, 1], w[2, 1], w[3, 1], w[4, 1], w[5, 1], w[6, 1], wW[1, 1], wW[2, 1], wW[3, 1], wW[4, 1], wW[5, 1], wW[6, 1]]

(2)

seq(indets(EQ[i][1]), i = 1 .. 36):

``

``

 

for i to 36 do
EQQ[i]:=simplify(expand(subs([seq](indets(EQ)[i]=AA[i],i=1..36),EQ[i][1])=0));
od;

(1/18)*(12*AA[8]*3^(1/2)-3*AA[9]*5^(1/2)-18*AA[7])*2^(1/2)-(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0

 

(1/18)*(12*AA[14]*3^(1/2)-3*AA[15]*5^(1/2)-18*AA[13])*2^(1/2)-(8/3)*((1/6)*AA[33]*5^(1/2)+AA[31])*AA[32]*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0

 

(1/18)*(12*AA[20]*3^(1/2)-3*AA[21]*5^(1/2)-18*AA[19])*2^(1/2)-(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0

 

(1/18)*(12*AA[26]*3^(1/2)-3*AA[27]*5^(1/2)-18*AA[25])*2^(1/2)-(8/3)*((1/6)*AA[33]*5^(1/2)+AA[31])*AA[32]*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0

 

AA[1]+AA[31]-0.1041666666666666666666666666666666666667e-1*AA[7]-0.6014065304058601713636966463562056829663e-2*AA[8]-0.3125000000000000000000000000000000000000e-1*AA[10]-0.6014065304058601713636966463562056829663e-2*AA[11]-0.1041666666666666666666666666666666666667e-1*AA[13]-0.6014065304058601713636966463562056829663e-2*AA[14]-0.3125000000000000000000000000000000000000e-1*AA[16]-0.6014065304058601713636966463562056829663e-2*AA[17]-.1161675426235042361515672880600823421682 = 0

 

AA[1]+AA[31]-0.1041666666666666666666666666666666666667e-1*AA[19]-0.9021097956087902570455449695343085244494e-2*AA[20]-0.2329237476562280933759555904928412745252e-2*AA[21]-0.7291666666666666666666666666666666666667e-1*AA[22]-0.2706329386826370771136634908602925573348e-1*AA[23]-0.2329237476562280933759555904928412745252e-2*AA[24]-0.1041666666666666666666666666666666666667e-1*AA[25]-0.9021097956087902570455449695343085244494e-2*AA[26]-0.2329237476562280933759555904928412745252e-2*AA[27]-0.7291666666666666666666666666666666666667e-1*AA[28]-0.2706329386826370771136634908602925573348e-1*AA[29]-0.2329237476562280933759555904928412745252e-2*AA[30]-.1620453040219171410085268329823612381694 = 0

 

(1/2)*(AA[9]*5^(1/2)-2*AA[7])*2^(1/2)-2*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(5/2)*AA[3]^2 = 0

 

(1/2)*(AA[15]*5^(1/2)-2*AA[13])*2^(1/2)-2*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(5/2)*AA[33]^2 = 0

 

(1/2)*(AA[21]*5^(1/2)-2*AA[19])*2^(1/2)-2*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(5/2)*AA[3]^2 = 0

 

(1/2)*(AA[27]*5^(1/2)-2*AA[25])*2^(1/2)-2*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(5/2)*AA[33]^2 = 0

 

AA[2]+AA[32]-0.9021097956087902570455449695343085244494e-2*AA[7]-0.5208333333333333333333333333333333333333e-2*AA[8]-0.2706329386826370771136634908602925573348e-1*AA[10]-0.5208333333333333333333333333333333333333e-2*AA[11]-0.9021097956087902570455449695343085244494e-2*AA[13]-0.5208333333333333333333333333333333333333e-2*AA[14]-0.2706329386826370771136634908602925573348e-1*AA[16]-0.5208333333333333333333333333333333333333e-2*AA[17]-0.6706936200477749554587801633123274049430e-1 = 0

 

AA[2]+AA[32]-0.6014065304058601713636966463562056829663e-2*AA[19]-0.5208333333333333333333333333333333333333e-2*AA[20]-0.1344785884099797529576133819368888753762e-2*AA[21]-0.4209845712841021199545876524493439780765e-1*AA[22]-0.1562500000000000000000000000000000000000e-1*AA[23]-0.1344785884099797529576133819368888753762e-2*AA[24]-0.6014065304058601713636966463562056829663e-2*AA[25]-0.5208333333333333333333333333333333333333e-2*AA[26]-0.1344785884099797529576133819368888753762e-2*AA[27]-0.4209845712841021199545876524493439780765e-1*AA[28]-0.1562500000000000000000000000000000000000e-1*AA[29]-0.1344785884099797529576133819368888753762e-2*AA[30]-0.9355689989796860791725737785335001844313e-1 = 0

 

(1/18)*(-12*AA[8]*3^(1/2)-3*AA[9]*5^(1/2)-18*AA[7])*2^(1/2)+(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0

 

(1/18)*(-12*AA[14]*3^(1/2)-3*AA[15]*5^(1/2)-18*AA[13])*2^(1/2)+(8/3)*((1/6)*AA[33]*5^(1/2)+AA[31])*AA[32]*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0

 

(1/18)*(-12*AA[20]*3^(1/2)-3*AA[21]*5^(1/2)-18*AA[19])*2^(1/2)+(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0

 

(1/18)*(-12*AA[26]*3^(1/2)-3*AA[27]*5^(1/2)-18*AA[25])*2^(1/2)+(8/3)*((1/6)*AA[33]*5^(1/2)+AA[31])*AA[32]*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0

 

AA[3]+AA[33]-0.2329237476562280933759555904928412745252e-2*AA[7]-0.1344785884099797529576133819368888753762e-2*AA[8]-0.6987712429686842801278667714785238235753e-2*AA[10]-0.1344785884099797529576133819368888753762e-2*AA[11]-0.2329237476562280933759555904928412745252e-2*AA[13]-0.1344785884099797529576133819368888753762e-2*AA[14]-0.6987712429686842801278667714785238235753e-2*AA[16]-0.1344785884099797529576133819368888753762e-2*AA[17] = 0

 

AA[3]+AA[33] = 0

 

(1/18)*(12*AA[11]*3^(1/2)-3*AA[12]*5^(1/2)-18*AA[10])*2^(1/2)-(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0

 

(1/18)*(12*AA[17]*3^(1/2)-3*AA[18]*5^(1/2)-18*AA[16])*2^(1/2)-(8/3)*((1/6)*AA[36]*5^(1/2)+AA[34])*AA[35]*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0

 

(1/18)*(12*AA[23]*3^(1/2)-3*AA[24]*5^(1/2)-18*AA[22])*2^(1/2)-(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0

 

(1/18)*(12*AA[29]*3^(1/2)-3*AA[30]*5^(1/2)-18*AA[28])*2^(1/2)-(8/3)*((1/6)*AA[36]*5^(1/2)+AA[34])*AA[35]*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0

 

AA[4]+AA[34]-0.7291666666666666666666666666666666666667e-1*AA[7]-0.4209845712841021199545876524493439780765e-1*AA[8]-.2187500000000000000000000000000000000000*AA[10]-0.4209845712841021199545876524493439780765e-1*AA[11]-0.7291666666666666666666666666666666666667e-1*AA[13]-0.4209845712841021199545876524493439780765e-1*AA[14]-.2187500000000000000000000000000000000000*AA[16]-0.4209845712841021199545876524493439780765e-1*AA[17]-.3485026278705127084547018641802470265047 = 0

 

AA[4]+AA[34]-0.3125000000000000000000000000000000000000e-1*AA[19]-0.2706329386826370771136634908602925573348e-1*AA[20]-0.6987712429686842801278667714785238235753e-2*AA[21]-.2187500000000000000000000000000000000000*AA[22]-0.8118988160479112313409904725808776720045e-1*AA[23]-0.6987712429686842801278667714785238235753e-2*AA[24]-0.3125000000000000000000000000000000000000e-1*AA[25]-0.2706329386826370771136634908602925573348e-1*AA[26]-0.6987712429686842801278667714785238235753e-2*AA[27]-.2187500000000000000000000000000000000000*AA[28]-0.8118988160479112313409904725808776720045e-1*AA[29]-0.6987712429686842801278667714785238235753e-2*AA[30]-.4861359120657514230255804989470837145084 = 0

 

(1/2)*(AA[12]*5^(1/2)-2*AA[10])*2^(1/2)-2*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(5/2)*AA[6]^2 = 0

 

(1/2)*(AA[18]*5^(1/2)-2*AA[16])*2^(1/2)-2*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(5/2)*AA[36]^2 = 0

 

(1/2)*(AA[24]*5^(1/2)-2*AA[22])*2^(1/2)-2*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(5/2)*AA[6]^2 = 0

 

(1/2)*(AA[30]*5^(1/2)-2*AA[28])*2^(1/2)-2*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(5/2)*AA[36]^2 = 0

 

AA[5]+AA[35]-0.2706329386826370771136634908602925573348e-1*AA[7]-0.1562500000000000000000000000000000000000e-1*AA[8]-0.8118988160479112313409904725808776720045e-1*AA[10]-0.1562500000000000000000000000000000000000e-1*AA[11]-0.2706329386826370771136634908602925573348e-1*AA[13]-0.1562500000000000000000000000000000000000e-1*AA[14]-0.8118988160479112313409904725808776720045e-1*AA[16]-0.1562500000000000000000000000000000000000e-1*AA[17]-0.6706936200477749554587801633123274049430e-1 = 0

 

AA[5]+AA[35]-0.6014065304058601713636966463562056829663e-2*AA[19]-0.5208333333333333333333333333333333333333e-2*AA[20]-0.1344785884099797529576133819368888753762e-2*AA[21]-0.4209845712841021199545876524493439780765e-1*AA[22]-0.1562500000000000000000000000000000000000e-1*AA[23]-0.1344785884099797529576133819368888753762e-2*AA[24]-0.6014065304058601713636966463562056829663e-2*AA[25]-0.5208333333333333333333333333333333333333e-2*AA[26]-0.1344785884099797529576133819368888753762e-2*AA[27]-0.4209845712841021199545876524493439780765e-1*AA[28]-0.1562500000000000000000000000000000000000e-1*AA[29]-0.1344785884099797529576133819368888753762e-2*AA[30]-0.9355689989796860791725737785335001844313e-1 = 0

 

(1/18)*(-12*AA[11]*3^(1/2)-3*AA[12]*5^(1/2)-18*AA[10])*2^(1/2)+(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0

 

(1/18)*(-12*AA[17]*3^(1/2)-3*AA[18]*5^(1/2)-18*AA[16])*2^(1/2)+(8/3)*((1/6)*AA[36]*5^(1/2)+AA[34])*AA[35]*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0

 

(1/18)*(-12*AA[23]*3^(1/2)-3*AA[24]*5^(1/2)-18*AA[22])*2^(1/2)+(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0

 

(1/18)*(-12*AA[29]*3^(1/2)-3*AA[30]*5^(1/2)-18*AA[28])*2^(1/2)+(8/3)*((1/6)*AA[36]*5^(1/2)+AA[34])*AA[35]*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0

 

AA[6]+AA[36]-0.2329237476562280933759555904928412745252e-2*AA[7]-0.1344785884099797529576133819368888753762e-2*AA[8]-0.6987712429686842801278667714785238235753e-2*AA[10]-0.1344785884099797529576133819368888753762e-2*AA[11]-0.2329237476562280933759555904928412745252e-2*AA[13]-0.1344785884099797529576133819368888753762e-2*AA[14]-0.6987712429686842801278667714785238235753e-2*AA[16]-0.1344785884099797529576133819368888753762e-2*AA[17] = 0

 

AA[6]+AA[36] = 0

(3)

fsolve({seq}(EQQ[i],i=1..36),{seq}(AA[i],i=1..36));

fsolve({AA[3]+AA[33] = 0, AA[6]+AA[36] = 0, (1/2)*(AA[9]*5^(1/2)-2*AA[7])*2^(1/2)-2*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(5/2)*AA[3]^2 = 0, (1/2)*(AA[12]*5^(1/2)-2*AA[10])*2^(1/2)-2*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(5/2)*AA[6]^2 = 0, (1/2)*(AA[15]*5^(1/2)-2*AA[13])*2^(1/2)-2*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(5/2)*AA[33]^2 = 0, (1/2)*(AA[18]*5^(1/2)-2*AA[16])*2^(1/2)-2*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(5/2)*AA[36]^2 = 0, (1/2)*(AA[21]*5^(1/2)-2*AA[19])*2^(1/2)-2*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(5/2)*AA[3]^2 = 0, (1/2)*(AA[24]*5^(1/2)-2*AA[22])*2^(1/2)-2*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(5/2)*AA[6]^2 = 0, (1/2)*(AA[27]*5^(1/2)-2*AA[25])*2^(1/2)-2*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(5/2)*AA[33]^2 = 0, (1/2)*(AA[30]*5^(1/2)-2*AA[28])*2^(1/2)-2*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(5/2)*AA[36]^2 = 0, (1/18)*(-12*AA[8]*3^(1/2)-3*AA[9]*5^(1/2)-18*AA[7])*2^(1/2)+(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0, (1/18)*(12*AA[8]*3^(1/2)-3*AA[9]*5^(1/2)-18*AA[7])*2^(1/2)-(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0, (1/18)*(-12*AA[11]*3^(1/2)-3*AA[12]*5^(1/2)-18*AA[10])*2^(1/2)+(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0, (1/18)*(12*AA[11]*3^(1/2)-3*AA[12]*5^(1/2)-18*AA[10])*2^(1/2)-(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0, (1/18)*(-12*AA[14]*3^(1/2)-3*AA[15]*5^(1/2)-18*AA[13])*2^(1/2)+(8/3)*AA[32]*((1/6)*AA[33]*5^(1/2)+AA[31])*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0, (1/18)*(12*AA[14]*3^(1/2)-3*AA[15]*5^(1/2)-18*AA[13])*2^(1/2)-(8/3)*AA[32]*((1/6)*AA[33]*5^(1/2)+AA[31])*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0, (1/18)*(-12*AA[17]*3^(1/2)-3*AA[18]*5^(1/2)-18*AA[16])*2^(1/2)+(8/3)*AA[35]*((1/6)*AA[36]*5^(1/2)+AA[34])*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0, (1/18)*(12*AA[17]*3^(1/2)-3*AA[18]*5^(1/2)-18*AA[16])*2^(1/2)-(8/3)*AA[35]*((1/6)*AA[36]*5^(1/2)+AA[34])*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0, (1/18)*(-12*AA[20]*3^(1/2)-3*AA[21]*5^(1/2)-18*AA[19])*2^(1/2)+(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0, (1/18)*(12*AA[20]*3^(1/2)-3*AA[21]*5^(1/2)-18*AA[19])*2^(1/2)-(8/3)*((1/6)*AA[3]*5^(1/2)+AA[1])*AA[2]*3^(1/2)+(2/3)*AA[1]*AA[3]*5^(1/2)+2*AA[1]^2+(8/3)*AA[2]^2+(5/18)*AA[3]^2 = 0, (1/18)*(-12*AA[23]*3^(1/2)-3*AA[24]*5^(1/2)-18*AA[22])*2^(1/2)+(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0, (1/18)*(12*AA[23]*3^(1/2)-3*AA[24]*5^(1/2)-18*AA[22])*2^(1/2)-(8/3)*((1/6)*AA[6]*5^(1/2)+AA[4])*AA[5]*3^(1/2)+(2/3)*AA[4]*AA[6]*5^(1/2)+2*AA[4]^2+(8/3)*AA[5]^2+(5/18)*AA[6]^2 = 0, (1/18)*(-12*AA[26]*3^(1/2)-3*AA[27]*5^(1/2)-18*AA[25])*2^(1/2)+(8/3)*AA[32]*((1/6)*AA[33]*5^(1/2)+AA[31])*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0, (1/18)*(12*AA[26]*3^(1/2)-3*AA[27]*5^(1/2)-18*AA[25])*2^(1/2)-(8/3)*AA[32]*((1/6)*AA[33]*5^(1/2)+AA[31])*3^(1/2)+(2/3)*AA[31]*AA[33]*5^(1/2)+2*AA[31]^2+(8/3)*AA[32]^2+(5/18)*AA[33]^2 = 0, (1/18)*(-12*AA[29]*3^(1/2)-3*AA[30]*5^(1/2)-18*AA[28])*2^(1/2)+(8/3)*AA[35]*((1/6)*AA[36]*5^(1/2)+AA[34])*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0, (1/18)*(12*AA[29]*3^(1/2)-3*AA[30]*5^(1/2)-18*AA[28])*2^(1/2)-(8/3)*AA[35]*((1/6)*AA[36]*5^(1/2)+AA[34])*3^(1/2)+(2/3)*AA[34]*AA[36]*5^(1/2)+2*AA[34]^2+(8/3)*AA[35]^2+(5/18)*AA[36]^2 = 0, AA[3]+AA[33]-0.2329237476562280933759555904928412745252e-2*AA[7]-0.1344785884099797529576133819368888753762e-2*AA[8]-0.6987712429686842801278667714785238235753e-2*AA[10]-0.1344785884099797529576133819368888753762e-2*AA[11]-0.2329237476562280933759555904928412745252e-2*AA[13]-0.1344785884099797529576133819368888753762e-2*AA[14]-0.6987712429686842801278667714785238235753e-2*AA[16]-0.1344785884099797529576133819368888753762e-2*AA[17] = 0, AA[6]+AA[36]-0.2329237476562280933759555904928412745252e-2*AA[7]-0.1344785884099797529576133819368888753762e-2*AA[8]-0.6987712429686842801278667714785238235753e-2*AA[10]-0.1344785884099797529576133819368888753762e-2*AA[11]-0.2329237476562280933759555904928412745252e-2*AA[13]-0.1344785884099797529576133819368888753762e-2*AA[14]-0.6987712429686842801278667714785238235753e-2*AA[16]-0.1344785884099797529576133819368888753762e-2*AA[17] = 0, AA[1]+AA[31]-0.1041666666666666666666666666666666666667e-1*AA[7]-0.6014065304058601713636966463562056829663e-2*AA[8]-0.3125000000000000000000000000000000000000e-1*AA[10]-0.6014065304058601713636966463562056829663e-2*AA[11]-0.1041666666666666666666666666666666666667e-1*AA[13]-0.6014065304058601713636966463562056829663e-2*AA[14]-0.3125000000000000000000000000000000000000e-1*AA[16]-0.6014065304058601713636966463562056829663e-2*AA[17]-.1161675426235042361515672880600823421682 = 0, AA[2]+AA[32]-0.9021097956087902570455449695343085244494e-2*AA[7]-0.5208333333333333333333333333333333333333e-2*AA[8]-0.2706329386826370771136634908602925573348e-1*AA[10]-0.5208333333333333333333333333333333333333e-2*AA[11]-0.9021097956087902570455449695343085244494e-2*AA[13]-0.5208333333333333333333333333333333333333e-2*AA[14]-0.2706329386826370771136634908602925573348e-1*AA[16]-0.5208333333333333333333333333333333333333e-2*AA[17]-0.6706936200477749554587801633123274049430e-1 = 0, AA[4]+AA[34]-0.7291666666666666666666666666666666666667e-1*AA[7]-0.4209845712841021199545876524493439780765e-1*AA[8]-.2187500000000000000000000000000000000000*AA[10]-0.4209845712841021199545876524493439780765e-1*AA[11]-0.7291666666666666666666666666666666666667e-1*AA[13]-0.4209845712841021199545876524493439780765e-1*AA[14]-.2187500000000000000000000000000000000000*AA[16]-0.4209845712841021199545876524493439780765e-1*AA[17]-.3485026278705127084547018641802470265047 = 0, AA[5]+AA[35]-0.2706329386826370771136634908602925573348e-1*AA[7]-0.1562500000000000000000000000000000000000e-1*AA[8]-0.8118988160479112313409904725808776720045e-1*AA[10]-0.1562500000000000000000000000000000000000e-1*AA[11]-0.2706329386826370771136634908602925573348e-1*AA[13]-0.1562500000000000000000000000000000000000e-1*AA[14]-0.8118988160479112313409904725808776720045e-1*AA[16]-0.1562500000000000000000000000000000000000e-1*AA[17]-0.6706936200477749554587801633123274049430e-1 = 0, AA[1]+AA[31]-0.1041666666666666666666666666666666666667e-1*AA[19]-0.9021097956087902570455449695343085244494e-2*AA[20]-0.2329237476562280933759555904928412745252e-2*AA[21]-0.7291666666666666666666666666666666666667e-1*AA[22]-0.2706329386826370771136634908602925573348e-1*AA[23]-0.2329237476562280933759555904928412745252e-2*AA[24]-0.1041666666666666666666666666666666666667e-1*AA[25]-0.9021097956087902570455449695343085244494e-2*AA[26]-0.2329237476562280933759555904928412745252e-2*AA[27]-0.7291666666666666666666666666666666666667e-1*AA[28]-0.2706329386826370771136634908602925573348e-1*AA[29]-0.2329237476562280933759555904928412745252e-2*AA[30]-.1620453040219171410085268329823612381694 = 0, AA[2]+AA[32]-0.6014065304058601713636966463562056829663e-2*AA[19]-0.5208333333333333333333333333333333333333e-2*AA[20]-0.1344785884099797529576133819368888753762e-2*AA[21]-0.4209845712841021199545876524493439780765e-1*AA[22]-0.1562500000000000000000000000000000000000e-1*AA[23]-0.1344785884099797529576133819368888753762e-2*AA[24]-0.6014065304058601713636966463562056829663e-2*AA[25]-0.5208333333333333333333333333333333333333e-2*AA[26]-0.1344785884099797529576133819368888753762e-2*AA[27]-0.4209845712841021199545876524493439780765e-1*AA[28]-0.1562500000000000000000000000000000000000e-1*AA[29]-0.1344785884099797529576133819368888753762e-2*AA[30]-0.9355689989796860791725737785335001844313e-1 = 0, AA[4]+AA[34]-0.3125000000000000000000000000000000000000e-1*AA[19]-0.2706329386826370771136634908602925573348e-1*AA[20]-0.6987712429686842801278667714785238235753e-2*AA[21]-.2187500000000000000000000000000000000000*AA[22]-0.8118988160479112313409904725808776720045e-1*AA[23]-0.6987712429686842801278667714785238235753e-2*AA[24]-0.3125000000000000000000000000000000000000e-1*AA[25]-0.2706329386826370771136634908602925573348e-1*AA[26]-0.6987712429686842801278667714785238235753e-2*AA[27]-.2187500000000000000000000000000000000000*AA[28]-0.8118988160479112313409904725808776720045e-1*AA[29]-0.6987712429686842801278667714785238235753e-2*AA[30]-.4861359120657514230255804989470837145084 = 0, AA[5]+AA[35]-0.6014065304058601713636966463562056829663e-2*AA[19]-0.5208333333333333333333333333333333333333e-2*AA[20]-0.1344785884099797529576133819368888753762e-2*AA[21]-0.4209845712841021199545876524493439780765e-1*AA[22]-0.1562500000000000000000000000000000000000e-1*AA[23]-0.1344785884099797529576133819368888753762e-2*AA[24]-0.6014065304058601713636966463562056829663e-2*AA[25]-0.5208333333333333333333333333333333333333e-2*AA[26]-0.1344785884099797529576133819368888753762e-2*AA[27]-0.4209845712841021199545876524493439780765e-1*AA[28]-0.1562500000000000000000000000000000000000e-1*AA[29]-0.1344785884099797529576133819368888753762e-2*AA[30]-0.9355689989796860791725737785335001844313e-1 = 0}, {AA[1], AA[2], AA[3], AA[4], AA[5], AA[6], AA[7], AA[8], AA[9], AA[10], AA[11], AA[12], AA[13], AA[14], AA[15], AA[16], AA[17], AA[18], AA[19], AA[20], AA[21], AA[22], AA[23], AA[24], AA[25], AA[26], AA[27], AA[28], AA[29], AA[30], AA[31], AA[32], AA[33], AA[34], AA[35], AA[36]})

(4)

``


 

Download ttttt33.mw

I am trying to do fsolve in a range (-7..14), however, it gives no solution.

But when I solve the same equations with solve (after removing all the Imaginary solutions), I get two results, one of them is in the range (-7..14). 

I even expanded the range of fsolve, say (-10..20), but still got no solution...

This is just getting weirder and weirder. Attached kindly find the Maple file, note that the first solve takes about 1 minute (on my laptop: CPU i7 + MEM 8G + SSD).

fsolve_In_Range.mw

Hi everybody,

I have to solve a system  of 3 equations in 3 unknowns.
One equation is linear while the others are not because of some  sinh(cste*unknown) term.
More of this the unknowns must verify some constraints of inequality type (but always very simple ; for instance “unknown <= value”).

solve fails because of the sinh terms
fsolve fails due to the inequalities


What Maple procedure do you advise me to use to solve this system ?
(at this stage I think advices could be sufficient ; if I keep coming up against the problem I will submit you a more detailed question)


Thanks in advance

 

With the following command I can plot two spheres and plot them.

f1 := x^2+y^2+z^2 = 1

f2 := x+y+z = 1

with(plottools);

with(plots);

S1 := implicitplot3d(f1, x = -1 .. 1, y = -1 .. 1, z = -1 .. 1, style = patchnogrid, color = blue, scaling = constrained, axes = boxed)

S2 := implicitplot3d(f2, x = -1 .. 1, y = -1 .. 1, z = -1 .. 1, style = patchnogrid, color = gold, scaling = constrained, axes = boxed)

dispaly(S1,S2)

My questions are:

1- How can I display (highlight) the circle which is the intersection between these two sphere on the same figure?

2- How can I find the equation of this circle?

Thank you.

Hi

 

I have a system of equations (4) which I would like to plot in regards to a fifth variable. Is there a good way to do this. Some of the solutions would end up as negative values, which is not an option I am interested in having.

 

C__A is my variable, and the other variables I would like to solve are tau,C__B,C__C,C__D. Im specifically interested in tau with regards to C__A. I hope this makes sense :)

regards

 

C__A := .75;
                              0.75


a := tau = (C__A0-C__A)/(-r__A);
                                  0.75                      
    tau = - ------------------------------------------------
                                              2             
            -0.00900 C__B + 0.03500000000 C__C  - 0.075 C__C
b := tau = (C__B0-C__B)/(-r__B);
                               2 - C__B              
          tau = - -----------------------------------
                                                    2
                  -0.00900 C__B + 0.03500000000 C__C 
c := tau = (C__C0-C__C)/(-r__C);
                                C__C                  
         tau = ---------------------------------------
                                        2             
               0.01800 C__B - 0.070 C__C  - 0.075 C__C
d := tau = (C__D0-C__D)/(-r__D);
                           13.33333333 C__D
                     tau = ----------------
                                 C__C      
sol := fsolve([a, b, c, d], {C__B = 1, C__C = .2, C__D = .2, tau = 50});

{C__B = 1.673672109, C__C = 0.2289836744, C__D = 0.4236721086, 

  tau = 24.66971264}

 

I've encountered a very strange issue with Maple.

The result returns differently with solve and fsolve after/before a variable is given a certain value. See attachment.

The result comes from solve (with variable epsilon) returns value of the same variable with imaginary part while the fsolve returns the correct answer.

Now how can I achieve the same result as fsolve via solve?

Thanks!

Maple_Question_Solve_Fsolve.mw

Maple_Question_Solve_Fsolve.pdf  (exported PDF from Maple)

I have trouble solving this equation

 

fsolve(5000 = int(1/(0.1060444429e-1-0.2120888857e-1*X+0.1033933318e-1*X^2), X = 0 .. x), x)

It has a few points where the solution will go towards infinite, but that is not something that is an issue normally. I have no problems what so ever to solve this using my trusty TI-89, so Im wondering what needs to be done to actually solve this. I have tried giving an initial guess, and I have tried using solve, but it doesnt seem to do the trick.

 

Regards

 

Hello everyone,

I have 5 equations (fa,fb,fc,fk,fv) and 5 variables (V0,A0,A1,A2,k1) and I want to solve them numerically. Problem is my inability to set properly intervals and starting values. 

Here is my command: fsolve({fa,fb,fc,fk,fv},{V0,A0,A1,A2,k1});

If I run it just like this, I get some values, lets say V0=0.00045 etc.But when I set range for V0 like this:

fsolve({fa,fb,fc,fk,fv},{V0=0.0004..0.0005,A0,A1,A2,k1});

I get this:

Error, (in fsolve) fsolve cannot solve on V0 = 0.4e-3 .. 0.5e-3

I used interval 0.0004..0.0005 only to prove that there must be the wrong syntax, because obviously 0.0004<0.00045<0.0005. In reality i need interval 0.0001..0.0002 and it is also necessary.to set some initial values (A0=0.0023) but first I need to solve my problem with syntax.

Any advice ?

I solve a set of equations in this way and I have three set of answers ,but I don`t know wich one is true.

and I have another question ,how can I assume v[0] like a constant?

 

alpha[2]:= 2.727272728*10^5: alpha[4]:= 3738.685337: alpha[6]:= -30.18675539: alpha[7] := -4.116375735*10^6: alpha[8] := 1.859504132*10^10: alpha[9]:= 2.489142857*10^(-12):

l10:=(alpha[7]*v[0]^2+1)*gamma[i*n]^4+(-alpha[4]*beta[n]^2+alpha[8]*v[0]^2-alpha[9])*gamma[i*n]^2+(2*I)*gamma[i*n]*alpha[2]*beta[n]*v[0]+(2*I)*gamma[i*n]^3*alpha[6]*beta[n]*v[0]-beta[n]^2 = 0:

l11 := subs(i = 1, l10);

l12 := subs(i = 2, l10);

l13 := subs(i = 3, l10);

l14 := subs(i = 4, l10);

l15 := (exp(I*(gamma[n]+gamma[2*n]))+exp(I*(gamma[3*n]+gamma[4*n])))*(gamma[3*n]^2-gamma[4*n]^2)*(gamma[n]^2-gamma[2*n]^2)+(exp(I*(gamma[n]+gamma[4*n]))+exp(I*(gamma[2*n]+gamma[3*n])))*(gamma[2*n]^2-gamma[3*n]^2)*(gamma[n]^2-gamma[4*n]^2)+(exp(I*(gamma[2*n]+gamma[4*n]))+exp(I*(gamma[n]+gamma[3*n])))*(gamma[2*n]^2-gamma[4*n]^2)*(-gamma[n]^2+gamma[3*n]^2) = 0;

l1 := combine(expand(evalc(l15)), trig):

l2 := combine(expand(evalc(Re(l15))), trig):

l3 := combine(expand(evalc(Im(l15))), trig): v[0] := 1; 1

fsolve({l1, l11, l12, l13, l14}, {beta[n], gamma[n], gamma[2*n], gamma[3*n], gamma[4*n]}):

fsolve({l11, l12, l13, l14, l2}):

solve({l11, l12, l13, l14, l3}):

thanks

Reyhaneh

Here is one that the students generated which caused confusion. 

a := 0.76;
eq1 := 2*cot(a*sqrt(2*E)) = (2*E-5.4)/(sqrt(E*(5.4-E));
solve(eq1, E)

And the results are: 0., 4.411954070, 2.423743792

The problem is with the second answer because it does not exist. If we plot the LHS and the RHS of eq1 vs E where E=0..5.4

plot([2*cot(0.76*sqrt(2*E)), (2*E-5.4)/sqrt(E*(5.4-E))], E=0..5.4, -3..3)

And it gets more interesting, if we calculate:

solve(evalf(eq1), E)

The answers are: 0., 2.423743793, 14.33807304+27.39159712*I

where the 3rd answer is again incorrect.

Finally, if a = 0.8 or larger, the incorrect answers disappear. 

Note - fsolve does handle this problem correctly. And despite my attempts to remind them to use fsolve, they see the solve command as the universal truth. Apparently this will be another teaching moment for next year.

So any thoughts about why this happens and why there is a difference in the outcomes between 0.76 and 0.8 for the value of a?

 

hi .how i can fsolve 8 equations, in which obtained from

for k from 2 to m do eq1[k_] end do

AND

for k from 2 to m do eq2[k_] end do  and so on........

And gain unknown functions as f3[2], f4[4],....

thanks?

fdm-maple.mw
 

 

 ############################Define some parameters

 

 
restart; Digits := 15; n := 1; m := 3; len := 1; h := len/m; nn := m+1
 ############################Define some equation

eq1[k_] := -3.0*h*(-f2[k]*f1[k-1]+f2[k]*f1[k+1]+f1[k]*(-f2[k+1]+f2[k-1]))*f4[k]^2+((-8.0*f1[k]+4.0*f1[k-1]+4.0*f1[k+1])*f3[k]+(-f1[k+1]+f1[k-1])*(-f3[k+1]+f3[k-1]))*f4[k]-f3[k]*(-f1[k+1]+f1[k-1])*(-f4[k+1]+f4[k-1]):

 

 

 

 

                                     ######################################  APPLY BOUNDARY CONDITIONS


f2[0] := f2[2];

1.0

(1)


``for k from 2 to m do eq1[k_] end do

-1.00000000000000*(-f1[2]*f2[3]+f1[3]*(-f2[4]+f2[2]))*f4[3]^2+((-8.0*f1[3]+4.0*f1[2])*f3[3]+f1[2]*(-f3[4]+f3[2]))*f4[3]-f3[3]*f1[2]*(-f4[4]+f4[2])

(2)

for k from 2 to m do eq2[k_] end do

(-4.16666666666667*f2[2]^2+(50.0000000000000*f2[3]+8.33333333333333*f2[4])*f2[2]-100.000000000000*f2[3]^2+50.0000000000000*f2[3]*f2[4]-4.16666666666667*f2[4]^2+1/27)*f4[3]^2+((f2[2]-1.*f2[4]-.5*f2[3])*f3[3]+(-50.*f3[2]+50.*f3[4])*f2[2]+(-50.*f3[2]+50.*f3[4])*f2[4]+(100.*f3[2]-100.*f3[4])*f2[3])*f4[3]+((50.*f4[2]-50.*f4[4])*f2[2]+(50.*f4[2]-50.0*f4[4])*f2[4]+(-100.0*f4[2]+100.*f4[4])*f2[3])*f3[3]

(3)

for k from 2 to m do eq3[k_] end do

-0.123456790123457e-1*f4[3]^3*f3[3]+((1/27)*(.5*f2[2]-.5*f2[4])*f3[3]-0.277777777777778e-1*f2[3]*f3[2]+0.277777777777778e-1*f2[3]*f3[4])*f4[3]^2+(-.222222222222222*f3[3]^2+((1/9)*f3[2]+(1/9)*f3[4]+4.*f2[3]^2+(-4.*f2[2]-4.*f2[4])*f2[3]+f2[2]^2+2.*f2[4]*f2[2]+f2[4]^2)*f3[3]+0.277777777777778e-1*f3[2]^2-0.555555555555556e-1*f3[2]*f3[4]+0.277777777777778e-1*f3[4]^2)*f4[3]+(1/9)*((-.25*f4[2]+.25*f4[4])*f3[2]+(.25*f4[2]-.25*f4[4])*f3[4])*f3[3]

(4)

for k from 2 to m do eq4[k_] end do

-0.493827160493827e-1*f4[3]^4-(1/27)*(-f2[4]+f2[2])*f4[3]^3+(.111111111111111*f2[3]*(f4[4]-f4[2])-.888888888888889*f3[3]+16.0*(f2[3]-.500000000000000*f2[2]-.500000000000000*f2[4])^2)*f4[3]^2+.444444444444444*((f3[3]+.250000000000000*f3[2]-.250000000000000*f3[4])*f4[2]+f4[4]*(f3[3]-.250000000000000*f3[2]+.250000000000000*f3[4]))*f4[3]-(1/9)*f3[3]*(f4[4]-f4[2])^2

(5)

``


 

Download fdm-maple.mw

 

hi.how i can solve or fsolve this equations?

i can not with fsolve?

thanks alot

SOLVE.mw


Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/SOLVE.mw .
 

Download SOLVE.mw

 

1 2 3 4 5 6 7 Last Page 1 of 13