acer

32647 Reputation

29 Badges

20 years, 57 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

In a related way that happens to work quickly for this particular example (but without reliance on identify),

restart;

L := {m[4]+4*m[7]+m[10]+m[13]+m[16]+m[19]+m[22] = 2*sqrt(2)+7,
 m[15]+3*m[18]+11*m[21]+m[6]+9*m[12]+2*m[3]-2*sqrt(2)*m[18]+6*sqrt(2)*m[21]
 -4*sqrt(2)*m[12]+m[24] = 2*sqrt(2)+61, -4*sqrt(2)*m[14]+6*m[14]+m[17]
 +11*m[20]+m[2]+4*m[5]+18*m[8]+6*sqrt(2)*m[20]-8*sqrt(2)*m[8]+m[23]
 = 2*sqrt(2)+34, m[27]-2*sqrt(2)*m[19]+4*sqrt(2)*m[7]+2*sqrt(2)*m[13]
 -2*m[16]+m[17]-6*m[19]-4*m[4]+m[5]+m[20]-16*m[7]+4*m[8]+m[11]-4*m[13]
 +m[14] = 6*sqrt(2)-6, m[28]+2*sqrt(2)*m[19]-4*sqrt(2)*m[10]-2*sqrt(2)*m[16]
 +m[15]+2*m[16]+m[18]+2*m[4]+m[6]+6*m[19]+m[21]+4*m[9]+2*m[10]+m[12]-2*m[13]
  = 6*sqrt(2)+21, m[25]+6*sqrt(2)*m[19]-2*sqrt(2)*m[20]-8*sqrt(2)*m[7]
 +4*sqrt(2)*m[8]-4*sqrt(2)*m[13]+2*sqrt(2)*m[14]+6*m[13]-4*m[14]+m[16]
 -2*m[17]+m[1]+4*m[4]+11*m[19]-6*m[20]-4*m[5]+18*m[7]-16*m[8] = 6*sqrt(2)-33,
 m[26]+6*sqrt(2)*m[19]+2*sqrt(2)*m[21]-4*sqrt(2)*m[10]-4*sqrt(2)*m[12]
 -2*sqrt(2)*m[16]-2*sqrt(2)*m[18]+m[13]-2*m[15]+3*m[16]+2*m[18]+2*m[1]
 +11*m[19]+6*m[21]+m[4]+2*m[6]+9*m[10]+2*m[12] = 6*sqrt(2)-33, m[29]
 +2*sqrt(2)*m[18]+6*sqrt(2)*m[20]-12*sqrt(2)*m[21]-2*sqrt(2)*m[3]
 -4*sqrt(2)*m[11]-2*sqrt(2)*m[15]-2*sqrt(2)*m[17]+m[14]+4*m[15]+3*m[17]
 -2*m[18]+2*m[2]+11*m[20]-22*m[21]+m[5]-4*m[6]+9*m[11] = 6*sqrt(2)-6, m[30]
 -12*sqrt(2)*m[20]+6*sqrt(2)*m[21]-2*sqrt(2)*m[2]-8*sqrt(2)*m[9]
 -2*sqrt(2)*m[14]-4*sqrt(2)*m[15]+2*sqrt(2)*m[17]+4*m[14]+6*m[15]-2*m[17]
 +m[18]+m[3]-22*m[20]+11*m[21]-4*m[5]+4*m[6]+18*m[9] = 6*sqrt(2)+21,
 -4*m[4]+2*m[5]+2*m[17]-2*m[18]-22*m[19]+6*m[20]-6*m[21]-2*m[16]-4*m[15]
 +m[31]-4*m[6]-16*m[9]+2*m[11]+4*m[13]-2*m[14]-2*sqrt(2)*m[1]+4*sqrt(2)*m[9]
 -2*sqrt(2)*m[17]-4*sqrt(2)*m[11]+2*sqrt(2)*m[15]+2*sqrt(2)*m[16]
 -12*sqrt(2)*m[19]-2*sqrt(2)*m[13]+2*sqrt(2)*m[20]-2*sqrt(2)*m[21]
 = 12*sqrt(2)-120}:

S:=Optimization:-LPSolve(1,L,map(u->u=0..infinity,
                                 indets(L,And(name,Not(constant))))[])[2]:

C2:=solve(eval(L,lhs~(select(type,S,name=0.0))=~0))
    union (lhs~(select(type,{S[]},name=0.0))=~0);

{m[1] = 0, m[2] = 0, m[3] = (261/7)*2^(1/2)-309/7, m[4] = 0, m[5] = 0, m[6] = 0, m[7] = 219/98-(61/49)*2^(1/2), m[8] = -22/7+(23/7)*2^(1/2), m[9] = -(51/14)*2^(1/2)+114/7, m[10] = -95/49+(342/49)*2^(1/2), m[11] = 0, m[12] = -(8/7)*2^(1/2)+109/7, m[13] = 0, m[14] = 0, m[15] = 0, m[16] = 0, m[17] = 0, m[18] = 0, m[19] = 0, m[20] = 366/7-36*2^(1/2), m[21] = 0, m[22] = 0, m[23] = 0, m[24] = 0, m[25] = 0, m[26] = 0, m[27] = 0, m[28] = 0, m[29] = 0, m[30] = 0, m[31] = 0}

normal(eval(map(lhs-rhs,L),C2));

{0}

 

Download LPSolve_ex2e.mw

@abdulganiy There are many more ways than this. Here are a few of them.

restart;
plot(ln(1+sin(Pi*x)), x = 0 .. 1, legend = numerical,
     style = point, symbol = box, color = blue,
     symbolsize = 15, numpoints = 8, adaptive=false);

restart;
f:=unapply(ln(1+sin(Pi*x)),x):
V:=Vector(8,i->0+(i-1)*(1-0)/(8-1)):
plot(<V|f~(V)>, legend = numerical, symbolsize = 15,
     style = point, symbol = box, color = blue);

restart;
f:=unapply(ln(1+sin(Pi*x)),x):
N,a,b := 8,0,1:
V:=Vector(N,i->a+(i-1)*(b-a)/(N-1)):
plot(<V|f~(V)>, legend = numerical, symbolsize = 15,
     style = point, symbol = box, color = blue);

restart;
f:=unapply(ln(1+sin(Pi*x)),x):
V:=<[seq(0..1,(1-0)/(8-1))]>:
plot(<V|f~(V)>, legend = numerical, symbolsize = 15,
     style = point, symbol = box, color = blue);

restart;
N,a,b := 8,0,1:
f:=unapply(ln(1+sin(Pi*x)),x):
V:=<[seq(a..b,(b-a)/(N-1))]>:
plots:-pointplot(<V|f~(V)>, legend = numerical, symbolsize = 15,
                 symbol = box, color = blue);

 

Download ptplot_misc.mw

 

@nguyenhuyenag 

restart;

L := {m[4]+4*m[7]+m[10]+m[13]+m[16]+m[19]+m[22] = 2*sqrt(2)+7,
 m[15]+3*m[18]+11*m[21]+m[6]+9*m[12]+2*m[3]-2*sqrt(2)*m[18]+6*sqrt(2)*m[21]
 -4*sqrt(2)*m[12]+m[24] = 2*sqrt(2)+61, -4*sqrt(2)*m[14]+6*m[14]+m[17]
 +11*m[20]+m[2]+4*m[5]+18*m[8]+6*sqrt(2)*m[20]-8*sqrt(2)*m[8]+m[23]
 = 2*sqrt(2)+34, m[27]-2*sqrt(2)*m[19]+4*sqrt(2)*m[7]+2*sqrt(2)*m[13]
 -2*m[16]+m[17]-6*m[19]-4*m[4]+m[5]+m[20]-16*m[7]+4*m[8]+m[11]-4*m[13]
 +m[14] = 6*sqrt(2)-6, m[28]+2*sqrt(2)*m[19]-4*sqrt(2)*m[10]-2*sqrt(2)*m[16]
 +m[15]+2*m[16]+m[18]+2*m[4]+m[6]+6*m[19]+m[21]+4*m[9]+2*m[10]+m[12]-2*m[13]
  = 6*sqrt(2)+21, m[25]+6*sqrt(2)*m[19]-2*sqrt(2)*m[20]-8*sqrt(2)*m[7]
 +4*sqrt(2)*m[8]-4*sqrt(2)*m[13]+2*sqrt(2)*m[14]+6*m[13]-4*m[14]+m[16]
 -2*m[17]+m[1]+4*m[4]+11*m[19]-6*m[20]-4*m[5]+18*m[7]-16*m[8] = 6*sqrt(2)-33,
 m[26]+6*sqrt(2)*m[19]+2*sqrt(2)*m[21]-4*sqrt(2)*m[10]-4*sqrt(2)*m[12]
 -2*sqrt(2)*m[16]-2*sqrt(2)*m[18]+m[13]-2*m[15]+3*m[16]+2*m[18]+2*m[1]
 +11*m[19]+6*m[21]+m[4]+2*m[6]+9*m[10]+2*m[12] = 6*sqrt(2)-33, m[29]
 +2*sqrt(2)*m[18]+6*sqrt(2)*m[20]-12*sqrt(2)*m[21]-2*sqrt(2)*m[3]
 -4*sqrt(2)*m[11]-2*sqrt(2)*m[15]-2*sqrt(2)*m[17]+m[14]+4*m[15]+3*m[17]
 -2*m[18]+2*m[2]+11*m[20]-22*m[21]+m[5]-4*m[6]+9*m[11] = 6*sqrt(2)-6, m[30]
 -12*sqrt(2)*m[20]+6*sqrt(2)*m[21]-2*sqrt(2)*m[2]-8*sqrt(2)*m[9]
 -2*sqrt(2)*m[14]-4*sqrt(2)*m[15]+2*sqrt(2)*m[17]+4*m[14]+6*m[15]-2*m[17]
 +m[18]+m[3]-22*m[20]+11*m[21]-4*m[5]+4*m[6]+18*m[9] = 6*sqrt(2)+21,
 -4*m[4]+2*m[5]+2*m[17]-2*m[18]-22*m[19]+6*m[20]-6*m[21]-2*m[16]-4*m[15]
 +m[31]-4*m[6]-16*m[9]+2*m[11]+4*m[13]-2*m[14]-2*sqrt(2)*m[1]+4*sqrt(2)*m[9]
 -2*sqrt(2)*m[17]-4*sqrt(2)*m[11]+2*sqrt(2)*m[15]+2*sqrt(2)*m[16]
 -12*sqrt(2)*m[19]-2*sqrt(2)*m[13]+2*sqrt(2)*m[20]-2*sqrt(2)*m[21]
 = 12*sqrt(2)-120}:

Digits:=60:
S:=Optimization:-LPSolve(1,L,map(u->u=0..infinity,
                                 indets(L,And(name,Not(constant))))[])[2]:
Digits:=15:

C:=identify(S);

[m[1] = 0, m[2] = 0, m[3] = -309/7+(261/7)*2^(1/2), m[4] = 0, m[5] = 0, m[6] = 0, m[7] = 219/98-(61/49)*2^(1/2), m[8] = -22/7+(23/7)*2^(1/2), m[9] = 114/7-(51/14)*2^(1/2), m[10] = -95/49+(342/49)*2^(1/2), m[11] = 0, m[12] = 109/7-(8/7)*2^(1/2), m[13] = 0, m[14] = 0, m[15] = 0, m[16] = 0, m[17] = 0, m[18] = 0, m[19] = 0, m[20] = 366/7-36*2^(1/2), m[21] = 0, m[22] = 0, m[23] = 0, m[24] = 0, m[25] = 0, m[26] = 0, m[27] = 0, m[28] = 0, m[29] = 0, m[30] = 0, m[31] = 0]

normal(eval(map(lhs-rhs,L),C));

{0}

 

Download LPSolve_ex2.mw

@Carl Love That is very unfortunate programming of the Java GUI.

(I spend so much time in the commandline interface that I reflexively think of its sane behaviour as "the normal manner".)

I will submit a bug report.

@Carl Love I agree with what you've written, except that I don't see it respecting interface(verboseproc) in the usual manner.

@pik1432 FYI, two solutions for the new system can also be found (quickly) as follows:

RootFinding:-Isolate(evalf[100]((lhs-rhs)~([f1,f2,f3,f4,f5,f6,f7,f8,f9,f10])),
                     [vars[]],maxroots=3,digits=20);

Q_ac_20200811_ac2.mw

You could start by providing us with details of what you did to obtain this.

You can upload and attach a Worksheet to a Comment or Question here. Use the green up-arrow in the Mapleprimes editor.

@Reshu Gupta 

G:=x -> -1.50000000000*x - 0.0170454545454*(x^4 + 17.6721666667*x^2
 - 5.11042142857)*x - 0.0197950153310*exp(-4.47213595500*x)
 + 0.0197950153310*exp(4.47213595500*x)
 + 6.62030572935*10^(-13)*(-92400.*x^4 - 82645.0724484*x^3 + 526680.*x^2
  + 241736.836912*x + 27027.)*exp(-4.47213595500*x + 4.47213595500)
  + 6.62030572935*10^(-13)*(92400.*x^4 - 82645.0724484*x^3 - 526680.*x^2
  + 241736.836912*x - 27027.)*exp(4.47213595500*x + 4.47213595500):
V:=Vector([seq(G(x),x=[seq(-1..1,0.1)])]):
P1:=plot(<<[seq(-1..1,0.1)]>|V>,style=point):
P2:=plot(G,-1..1):
plots:-display(P1,P2);
ExcelTools:-Export(V, "foo.xls");

@nm Debugging your example is easier at first, since one can trace or stopat the signum command, starting with argument  1/sin(x).

That  leads to Re(x) under the assumption. But Re is a kernel builtin, so showstat and stopat appear to be a dead end. However, some kernel builtins will also call back out to Library commands. By setting printlevel:=999: you can tell how the kernel calls back into the Library, for this example, and continue on with Library-side debugging techniques.

It gets a little awkward, as you have to also dispel the chaff after setting printlevel:=1: again. But it's workable.

So, I traced signum to find that Re(x) assuming x::{} returned 0. Then I used higher printlevel to see (fortunately) where the kernel happened to call back into the Library.

Your original question was about why the (accidental) use of assuming {} produced the division by zero error, since you had already corrected your syntax for using `assuming` in prefix form.

But for fun, a few other ways to get the more compact tan form result,

restart;

u1 := -ln(csc(x)-cot(x));

                   u1 := -ln(csc(x) - cot(x))

subs(X=x/2,convert(simplify(convert(subs(x=2*X,u1),tan)),tan));

                            /   /1  \\
                         -ln|tan|- x||
                            \   \2  //

[sin(x)=trigsubs(sin(x),trigidentity="Double Angle")[1]]:
convert(simplify(subs(%,simplify(u1))),tan);


                            /   /1  \\
                         -ln|tan|- x||
                            \   \2  //

[csc(x)=trigsubs(csc(x),trigidentity="Double Angle")[1],
 cot(x)=trigsubs(cot(x),trigidentity="Double Angle")[1]]:
convert(simplify(subs(%,u1)),tan);

                            /   /1  \\
                         -ln|tan|- x||
                            \   \2  //

@DoingMath2018 You are welcome.

I'm not sure whether there is an example of this in the documentation. I know that Robert Israel has an old note on it here.

I will submit a bug report, suggesting a clarifying example under the plotting Help pages.

@pik1432 I am not sure how you obtained your versions of f9 and f10, but below I have adjusted them. Then I obtain solutions using both the new and the old equations (and check against both for residuals).

I also show how procedures may be constructed from the equations, which each locally raise Digits for their own calculations, which I mentioned earlier.

I also compute an apparant second solution. (One of the solutions is picky about the supplied ranges.)

I don't know precisely why solve is not finding the solution for this reformulation, but I'm not sure that it matters so much as fsolve can be used.

restart;

TrainLoad := -10*10^6*(cos(convert(40*degrees, radians))+I*sin(convert(40*degrees, radians)));
#evalf(TrainLoad, 7);

-10000000*cos((2/9)*Pi)-(10000000*I)*sin((2/9)*Pi)

f10 := imV[t]*(reIx[c1] - reIx[c2]) + reV[t]*(imIx[c1] - imIx[c2]) - 10000000*sin((2*Pi)/9) = 0;

imV[t]*(reIx[c1]-reIx[c2])+reV[t]*(imIx[c1]-imIx[c2])-10000000*sin((2/9)*Pi) = 0

expand(f10);

imV[t]*reIx[c1]-imV[t]*reIx[c2]+reV[t]*imIx[c1]-reV[t]*imIx[c2]-10000000*sin((2/9)*Pi) = 0

f9 := -10000000*cos((2*Pi)/9) + reV[t]*(reIx[c1] - reIx[c2]) - imV[t]*(imIx[c1] - imIx[c2]) = 0;

-10000000*cos((2/9)*Pi)+reV[t]*(reIx[c1]-reIx[c2])-imV[t]*(imIx[c1]-imIx[c2]) = 0

f5 := 1.36*reIx[c2] - 4.44*imIx[c2] + reV[at2] - reV[t] = 0;

1.36*reIx[c2]-4.44*imIx[c2]+reV[at2]-reV[t] = 0

f6 := 4.44*reIx[c2] + 1.36*imIx[c2] + imV[at2] - imV[t] = 0;

4.44*reIx[c2]+1.36*imIx[c2]+imV[at2]-imV[t] = 0

f2 := 0.1515*reIx[c1] + 0.03*imIx[c1] - 0.1515*reIx[c2] - 0.03*imIx[c2] + 2*imV[at1] = 0;

.1515*reIx[c1]+0.3e-1*imIx[c1]-.1515*reIx[c2]-0.3e-1*imIx[c2]+2*imV[at1] = 0

f1 := -55000 + 0.03*reIx[c1] - 0.1515*imIx[c1] - 0.03*reIx[c2] + 0.1515*imIx[c2] + 2*reV[at1] = 0;

-55000+0.3e-1*reIx[c1]-.1515*imIx[c1]-0.3e-1*reIx[c2]+.1515*imIx[c2]+2*reV[at1] = 0

f8 := -2.64*reIx[c1] - 1.12*imIx[c1] - 12.00*reIx[c2] - 3.92*imIx[c2] + imV[at2] - imV[at1] = 0;

-2.64*reIx[c1]-1.12*imIx[c1]-12.00*reIx[c2]-3.92*imIx[c2]+imV[at2]-imV[at1] = 0

f7 := -1.12*reIx[c1] + 2.64*imIx[c1] - 3.92*reIx[c2] + 12.00*imIx[c2] + reV[at2] - reV[at1] = 0;

-1.12*reIx[c1]+2.64*imIx[c1]-3.92*reIx[c2]+12.00*imIx[c2]+reV[at2]-reV[at1] = 0

f3 := 1.6*reIx[c1] - 6.24*imIx[c1] + 1.12*reIx[c2] - 2.64*imIx[c2] + reV[t] - reV[at1] = 0;

1.6*reIx[c1]-6.24*imIx[c1]+1.12*reIx[c2]-2.64*imIx[c2]+reV[t]-reV[at1] = 0

f4 := 6.24*reIx[c1] + 1.6*imIx[c1] + 2.64*reIx[c2] + 1.12*imIx[c2] + imV[t] - imV[at1] = 0;

6.24*reIx[c1]+1.6*imIx[c1]+2.64*reIx[c2]+1.12*imIx[c2]+imV[t]-imV[at1] = 0

vars := {reIx[c1], imIx[c1], reIx[c2], imIx[c2], reV[at1], imV[at1], reV[at2], imV[at2], reV[t], imV[t]};

{imIx[c1], imIx[c2], imV[at1], imV[at2], imV[t], reIx[c1], reIx[c2], reV[at1], reV[at2], reV[t]}

# Digits seems to need to be at least 18 in order
# to find a second solution (and also gives a better first solution).
Digits := 20;

20

# Even correcting defn of f9 and f10 (and expanding them) doesn't
# seem to help `solve`. But `fsolve` can still be used, see below.

sol1:=solve(({f1, f2, f3, f4, f5, f6, f7, f8, f9, f10}), vars);

Warning, solutions may have been lost

f1n2 := (0.03 + I*0.1515)*Ix[c1] - (0.03 + I*0.1515)*Ix[c2] + 2 * V[at1] - 55*10^3 = 0:
f3n4 := (1.6 + I*6.24)*Ix[c1] + (1.12 + I*2.64)*Ix[c2] + V[t] - V[at1] = 0:
f5n6 := (1.36 + I*4.44)*Ix[c2] + V[at2] - V[t] = 0:
f7n8 := (-1.12 - I*2.64)*Ix[c1] + (-3.92 - I*12.00)*Ix[c2] + V[at2] - V[at1] = 0:
f9n10 := V[t] * (Ix[c1] - Ix[c2]) + TrainLoad = 0:

oldvars := {Ix[c1], Ix[c2], V[at1], V[at2], V[t]};
K:=map(var->var=cat(re,var)+I*cat(im,var),oldvars):
evalc(eval(map(eq->[Re(eq),Im(eq)][],{f1n2, f3n4, f5n6, f7n8, f9n10}),K)):
sol2:=eval(K,simplify(fnormal(fsolve(%,complex)),zero));

{Ix[c1], Ix[c2], V[at1], V[at2], V[t]}

{Ix[c1] = 181.28189005805791743+162.01046250921478591*I, Ix[c2] = -81.655484607695036328-76.947655535280817396*I, V[at1] = 27514.157016821884248-23.501877901598220297*I, V[at2] = 27892.767479423787347-644.96659512864599818*I, V[t] = 28123.363610933968927-1112.1657583147938711*I}

evalf[100](eval((lhs-rhs)~({f1n2, f3n4, f5n6, f7n8, f9n10}), sol2)):
max(abs~(evalf[5](%)));

0.21823907687671335089e-12

S[1]:=fsolve([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10],vars,complex);

{imIx[c1] = 162.01046250921478591, imIx[c2] = -76.947655535280817396, imV[at1] = -23.501877901598220297, imV[at2] = -644.96659512864599818, imV[t] = -1112.1657583147938711, reIx[c1] = 181.28189005805791743, reIx[c2] = -81.655484607695036328, reV[at1] = 27514.157016821884248, reV[at2] = 27892.767479423787347, reV[t] = 28123.363610933968927}

evalf[100](eval((lhs-rhs)~({f1, f2, f3, f4, f5, f6, f7, f8, f9, f10}), S[1])):
max(evalf[5](abs~(%)));

0.21757e-12

eval(K,simplify(fnormal(S[1]),zero)):
evalf[100](eval((lhs-rhs)~({f1n2, f3n4, f5n6, f7n8, f9n10}), %)):
max(evalf[5](abs~(%)));

0.21824e-12

S[2]:=fsolve([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10],vars,complex,avoid={S[1]});
evalf[100](eval((lhs-rhs)~({f1, f2, f3, f4, f5, f6, f7, f8, f9, f10}), S[2])):
max(evalf[5](abs~(%)));

{imIx[c1] = -5281.4918969451713544, imIx[c2] = 2424.8308425628567005, imV[at1] = 4.9812524290496869171, imV[at2] = 56.665451734948995089, imV[t] = 1112.1657583147938711, reIx[c1] = 955.22971037032619932-0.46908608509430945230e-33*I, reIx[c2] = -505.01568452829735058+0.21662280789933333333e-33*I, reV[at1] = 26894.342371558787522, reV[at2] = 10829.706661003599220, reV[t] = -623.36361093396892656}

0.22944e-12

# no result (takes long)
#S[3]:=fsolve([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10],vars,complex,avoid={S[1],S[2]}):
#if op(0,eval(S[3],1))=fsolve then print("no additional solution found"); end if;

#
# For fun, use the abs of the lhs-rhs of the new equations.
#
SS[1]:=fsolve(abs~((lhs-rhs)~([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10])));
evalf[100](eval((lhs-rhs)~({f1, f2, f3, f4, f5, f6, f7, f8, f9, f10}), SS[1])):
max(evalf[5](abs~(%)));
SS[2]:=fsolve(abs~((lhs-rhs)~([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10])),vars,avoid={SS[1]});
evalf[100](eval((lhs-rhs)~({f1, f2, f3, f4, f5, f6, f7, f8, f9, f10}), SS[2])):
max(evalf[5](abs~(%)));

{imIx[c1] = 162.01046250921478591, imIx[c2] = -76.947655535280817396, imV[at1] = -23.501877901598220297, imV[at2] = -644.96659512864599818, imV[t] = -1112.1657583147938711, reIx[c1] = 181.28189005805791743, reIx[c2] = -81.655484607695036328, reV[at1] = 27514.157016821884248, reV[at2] = 27892.767479423787347, reV[t] = 28123.363610933968927}

0.21757e-12

{imIx[c1] = -5281.4918969451713544, imIx[c2] = 2424.8308425628567005, imV[at1] = 4.9812524290496869171, imV[at2] = 56.665451734948995089, imV[t] = 1112.1657583147938711, reIx[c1] = 955.22971037032619932, reIx[c2] = -505.01568452829735058, reV[at1] = 26894.342371558787522, reV[at2] = 10829.706661003599220, reV[t] = -623.36361093396892656}

0.22944e-12

# no result
SS[3]:=fsolve(abs~((lhs-rhs)~([f1, f2, f3, f4, f5, f6, f7, f8, f9, f10])),vars,avoid={SS[1],SS[2]}):
if op(0,eval(SS[3],1))=fsolve then print("no additional solution found"); end if;

"no additional solution found"

# Now let's attempt making procedures which (only locally) increase Digits.
#
# Since the procedure raise Digits for the functional evaluations we can
# keep top-level Digits lower (which is used by fsolve for its accuracy
# requirement.

Digits:=10;

10

oldnames:=nprintf~("%a",oldvars);

{`Ix[c1]`, `Ix[c2]`, `V[at1]`, `V[at2]`, `V[t]`}

funcs:=[seq(subs(__dummy=eval((lhs-rhs)(__eq),Equate([oldvars[]],[oldnames[]])),
            proc(`Ix[c1]`,`Ix[c2]`,`V[at1]`,`V[at2]`,`V[t]`)
              Digits:=2*Digits;
              __dummy;
            end proc),
            __eq={f1n2, f3n4, f5n6, f7n8, f9n10})]:

#infolevel[fsolve]:=0;
_EnvTry:=hard:

FS[1]:=fsolve(funcs,[180+I*160..182+I*164, -82-77*I..-80-76*I, 27510-24*I..27520-22*I,
                     27890-650*I..27900-640*I, 28120-1120*I..28130-1110*I],complex):
Equate([oldvars[]], FS[1]);
evalf[100](eval((lhs-rhs)~({f1n2, f3n4, f5n6, f7n8, f9n10}), %)):
max(evalf[5](abs~(%)));

[Ix[c1] = 181.28189005805930+162.01046250921644*I, Ix[c2] = -81.655484607695652-76.947655535281597*I, V[at1] = 27514.157016821884-23.501877901598408*I, V[at2] = 27892.767479423792-644.96659512865114*I, V[t] = 28123.363610933976-1112.1657583148028*I]

0.90855e-7

FS[2]:=fsolve(funcs,complex,avoid={FS[1]});

[955.22971037032620-5281.4918969451714*I, -505.01568452829735+2424.8308425628567*I, 26894.342371558788+4.9812524290496869*I, 10829.706661003599+56.665451734948996*I, -623.36361093396893+1112.1657583147939*I]

# no result (takes long)
#FS[3]:=fsolve(funcs,[(-infinity-infinity*I..infinity+infinity*I)$5],complex,avoid={FS[1],FS[2]}):
#if op(0,eval(FS[3],1))=fsolve then print("no additional solution found"); end if;

#
# This has 20 decimal digits in the result, but is more accurate than the
# than the S[1],SS[1] and S[2],SS[2] results obtained above at Digits=20.

Digits := 20:
AFS[1]:=fsolve(funcs,[180+I*160..182+I*164, -82-77*I..-80-76*I, 27510-24*I..27520-22*I,
              27890-650*I..27900-640*I, 28120-1120*I..28130-1110*I],complex):
Equate([oldvars[]], AFS[1]);
evalf[100](eval((lhs-rhs)~({f1n2, f3n4, f5n6, f7n8, f9n10}), %)):
max(evalf[5](abs~(%)));

AFS[2] := fsolve(funcs,complex,avoid={AFS[1]}):
Equate([oldvars[]], AFS[2]);
evalf[100](eval((lhs-rhs)~({f1n2, f3n4, f5n6, f7n8, f9n10}), %)):
max(evalf[5](abs~(%)));

[Ix[c1] = 181.281890058057917433399027+162.010462509214785906005715*I, Ix[c2] = -81.6554846076950363278550316-76.9476555352808173964757651*I, V[at1] = 27514.1570168218842476437442-23.5018779015982202969522171*I, V[at2] = 27892.7674794237873467298134-644.966595128645998186497765*I, V[t] = 28123.3636109339689265642830-1112.16575831479387114138115*I]

0.13186e-19

[Ix[c1] = 955.229710370326199319138724-5281.49189694517135435254499*I, Ix[c2] = -505.015684528297350584549199+2424.83084256285670047471394*I, V[at1] = 26894.3423715587875215982798+4.98125242904968691720452388*I, V[at2] = 10829.7066610035992203384338+56.6654517349489950911686282*I, V[t] = -623.363610933968926564282995+1112.16575831479387114138115*I]

0.22890e-19

 

Download Q_ac_20200811_ac.mw

Upload and attach your worksheet using the green up-arrow in the Mapleprimes editor.

@Scot Gould He has Maple 18, in which version your call to rand is not supported.

I have changed the "Product" label on your Question from Maple 2018 to Maple 18, since the latter is the version in which your attachments were last saved.

Maple 18 was released in the year 2014, and is four major releases old than Maple 2018.

First 166 167 168 169 170 171 172 Last Page 168 of 597