acer

32385 Reputation

29 Badges

19 years, 340 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

If all you want are results of numeric double-integration then you may not have to wait for a preliminary, partial and time-consuming symbolic integration.

Check that I re-entered the expressions correctly.

Note that I used inert Int instead of active int. You can tell because the integral symbol is gray not black, on the 2D Input. I entered it using command-completion, not the palettes. (I type Int and then the Escape key to get the template popup.)

It computed very quickly.

restart

NULL

Rm := 25*10^(-4)

1/400

Lm := 10^(-3)

1/1000

Ms := 107*10^4

1070000

ICMR := Ms*(Int((z(t)-Z)*((Rm^2+r(t)^2+(z(t)-Z)^2)*(Int(sqrt(1-4*r(t)*Rm*sin(phi)^2/((Rm+r(t))^2+(z(t)-Z)^2)), phi = 0 .. (1/2)*Pi))/((Rm-r(t))^2+(z(t)-Z)^2)-(Int(1/sqrt(1-4*r(t)*Rm*sin(phi)^2/((Rm+r(t))^2+(z(t)-Z)^2)), phi = 0 .. (1/2)*Pi)))/(sqrt((Rm+r(t))^2+(z(t)-Z)^2)*r(t)), Z = -Lm .. 0))/(2*Pi)

evalf(eval(ICMR, [r(t) = 0.24e-2, z(t) = 0.1e-2]))

93045.25340

ICMZ := Ms*(Int((Rm^2-r(t)^2-(z(t)-Z)^2)*(Int(sqrt(1-4*r(t)*Rm*sin(phi)^2/((Rm+r(t))^2+(z(t)-Z)^2)), phi = 0 .. (1/2)*Pi)+Int(1/sqrt(1-4*r(t)*Rm*sin(phi)^2/((Rm+r(t))^2+(z(t)-Z)^2)), phi = 0 .. (1/2)*Pi))/(sqrt((Rm+r(t))^2+(z(t)-Z)^2)*((Rm-r(t))^2+(z(t)-Z)^2)), Z = -Lm .. 0))/(2*Pi)

evalf(eval(ICMZ, [r(t) = 0.24e-2, z(t) = 0.1e-2]))

-93230.69510

 

Download integral_doubt_ac.mw

Here is some experiment on the smaller 12x12 system, with some simplification.

It might give you some ideas.

Problem_2_ac.mw

An important matter is what you intend on doing with the results. It's not clear why you need the large symbolic answers.

When working with such large expressions it's often a good idea to suppress ouput by terminating commands with a full colon. Checking expressions for a moderate size before displaying in the GUI is often a good idea in such situations.

There are other ways.

ps. What might help, if you have other such expressions or sums or products of such and you want a systematic and programmatic approach, is to provide more complicated examples.

restart;

eq1:= (-k*I + 2*I + m)*sqrt(3) - 3*I*m - 3*k;

(-I*k+2*I+m)*3^(1/2)-(3*I)*m-3*k

eq2:=eq1 / 2;

(1/2)*(-I*k+2*I+m)*3^(1/2)-((3/2)*I)*m-(3/2)*k

eq_given:= (-sqrt(3)*I/2 - 3/2)*(k + I*m) + sqrt(3)*I;

(-((1/2)*I)*3^(1/2)-3/2)*(k+I*m)+I*3^(1/2)

# one way, since eq2 is of type `+`

a,o:=selectremove(type,frontend(expand,[eq2]),constant):
`+`(a,`if`(not factor(o)::`*`, o,
           `*`(selectremove(type,factor(o),constant))));

(-((1/2)*I)*3^(1/2)-3/2)*(k+I*m)+I*3^(1/2)

 

Download manip3.mw

I don't think that you've made it clear how you want to characterize your rearrangement of the expression, which makes it tricky to supply an operation that will work for other (as yet unstated) examples.

restart;

eq := W__1 + W__2 = -sin(-beta + alpha)*((H^2 - h^2)*gamma
                    + h^2*psi)/(2*sin(beta)*sin(alpha))

W__1+W__2 = -(1/2)*sin(-beta+alpha)*((H^2-h^2)*gamma+h^2*psi)/(sin(beta)*sin(alpha))

W__1 + W__2 = -H^2*sin(-beta + alpha)*((1 - h^2/H^2)*gamma
              + h^2*psi/H^2)/(2*sin(beta)*sin(alpha));

W__1+W__2 = -(1/2)*H^2*sin(-beta+alpha)*((1-h^2/H^2)*gamma+h^2*psi/H^2)/(sin(beta)*sin(alpha))

lhs(eq)=collect(numer(rhs(eq)),[sin,gamma],
                u->expand(-u/H^2))/(-denom(rhs(eq))/H^2);

W__1+W__2 = -(1/2)*H^2*sin(-beta+alpha)*((1-h^2/H^2)*gamma+h^2*psi/H^2)/(sin(beta)*sin(alpha))

dg := degree(coeff(rhs(eq),gamma),H):
lhs(eq)=collect(numer(rhs(eq)),[sin,gamma],
                u->expand(-u/H^dg))/(-denom(rhs(eq))/H^dg);

W__1+W__2 = -(1/2)*H^2*sin(-beta+alpha)*((1-h^2/H^2)*gamma+h^2*psi/H^2)/(sin(beta)*sin(alpha))

 

Download manipulation.mw

You also need the option,

   adaptive =false

There are several other ways to get the same effect -- using Vectors of the desired length and plotting the data, etc. But you specifically asked about what you needed with the numpoints option for the plot command.

 

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];

[m[1] = HFloat(0.0), m[2] = HFloat(0.0), m[3] = HFloat(8.587105682768538), m[4] = HFloat(0.0), m[5] = HFloat(0.0), m[6] = HFloat(0.0), m[7] = HFloat(0.4741422999028716), m[8] = HFloat(1.5038445620830123), m[9] = HFloat(11.133936308498138), m[10] = HFloat(7.931857925134723), m[11] = HFloat(0.0), m[12] = HFloat(13.955184500144961), m[13] = HFloat(0.0), m[14] = HFloat(0.0), m[15] = HFloat(0.0), m[16] = HFloat(0.0), m[17] = HFloat(0.0), m[18] = HFloat(0.0), m[19] = HFloat(0.0), m[20] = HFloat(1.3740260402828706), m[21] = HFloat(0.0), m[22] = HFloat(0.0), m[23] = HFloat(0.0), m[24] = HFloat(0.0), m[25] = HFloat(0.0), m[26] = HFloat(0.0), m[27] = HFloat(0.0), m[28] = HFloat(0.0), m[29] = HFloat(0.0), m[30] = HFloat(0.0), m[31] = HFloat(0.0)]

map(fnormal@abs@evalf[15],map(lhs-rhs,eval(L,S)));

{0.}

 

Download LPSolve_ex.mw

OpProp is a procedure. Procedures have last-name-eval, so when you invoke just,
   lastexception;
you just get the expression sequence containing the literal name OrProp. But when you do
   print(lastexception);
you are requesting more (depending on the value of interface(verboseproc) at the time).

You could also compare the behaviour for,
   lastexception[1];
versus,
   eval(lastexception[1]);
and,
   print(OrProp);
It is unusual, that the last example immediately above also shows the issue.

In the CommandLine interface your code results in the body of OrProp being printed to the terminal. It's not that long.

I don't know yet why the Java GUI thinks that it has to elide altogether the printing of OrProp as a procedure. But I notice a discrepency between the results from,
   printf("%P",eval(OrProp));
and that of,
   showstat(OrProp);
around the code line numbers 52 and 53. It might be related.

But it's stranger because the behavior you've mentioned doesn't seem to depend on the setting of interface(verboseproc) .

I know that you are interested in using timelimit. You could try something like this, instead,

   print(sprintf("%a",lastexception[1]),
            StringTools:-FormatMessage(lastexception[2..-1]));

I mentioned that last bit as I suspect you might not be fully satisfied with the results from your suggestion,
   StringTools:-FormatMessage(lastexception)

Other useful tools include stopat, trace, and showstat.

For example, using trace (after using stopat and showstat to discover the computation path),

restart;

infolevel[dsolve]:=6;

6

ode:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)+(x^2-1/4)*y(x)=0;

x^2*(diff(diff(y(x), x), x))+x*(diff(y(x), x))+(x^2-1/4)*y(x) = 0

#trace(`ODEtools/odsolve`):
#trace(`odsolve/2nd_order`);
#trace(`odsolve/2nd_order/class`);
#trace(`odsolve/2nd_order/linear_homogeneous`);

##trace(`odsolve/2nd_order/quadrature`);
##trace(`odsolve/2nd_order/const_coeffs`);
##trace(`odsolve/2nd_order/Euler`);
##trace(`odsolve/2nd_order/linear_1`);
##trace(`odsolve/2nd_order/linear/missing_y`);

#trace(`odsolve/2nd_order/Kovacic`);
#trace(`odeadv/2nd_order/Kovacic`);
#trace(`DEtools/kovacicsols`);
trace(`DEtools/kovacicsols/order2`);

`DEtools/kovacicsols/order2`

dsolve(ode);

Methods for second order ODEs:

--- Trying classification methods ---

trying a quadrature

checking if the LODE has constant coefficients

checking if the LODE is of Euler type

trying a symmetry of the form [xi=0, eta=F(x)]

   testing BRANCH 1 ->

   testing BRANCH 2 ->

   testing BRANCH 3 ->

   testing BRANCH 4 ->

   testing BRANCH 5 ->

   testing BRANCH 6 ->

checking if the LODE is missing 'y'

-> Trying a Liouvillian solution using Kovacic's algorithm

{--> enter \`DEtools/kovacicsols/order2\`, args = [4*x^2-1, 4*x, 4*x^2], x

{--> enter \`DEtools/kovacicsols/order2\`, args = [4*x^2-1, 4*x, 4*x^2], x, {}

{}, {}, {}, {}

[1, 2, [4, {1, 2}], [4, {1, 2, 3}], [6, {1, 2, 3}], [6, {1, 2, 3, 4}], [12, {1, 2, 3, 5}]]

{1, 2, [4, {1, 2}], [4, {1, 2, 3}], [6, {1, 2, 3}], [6, {1, 2, 3, 4}], [12, {1, 2, 3, 5}]}

[infinity, x]

{}

infinity

infinity

table( [ ] )

1

infinity

{}

normal

table( [ ] )

[RootOf(_Z^2+1)/x+1/2, x = x]

{2}

1

{x}

table( [ ] )

0

table( [ ] )

{1}

table( [ ] )

1/2

x

0

1

infinity, 0

{}

normal

[1/2, -1/2, x = x]

0

table( [ ] )

{-1/2, 1/2}

{0}

1

-1/2

1

{1, x}

{-1/2}

{-1}

table( [ ] )

{-2}

table( [ ] )

{-3}

{2}

0

0

{2}

[infinity, 0]

0

[[2, [[[infinity, 1, 1], [0, 1, -1], 0]]]]

2

[]

[2, [[[infinity, 1, 1], [0, 1, -1], 0]]]

[[infinity, 1, 1], [0, 1, -1], 0]

[0, -1/x]

-(1/2)/x

[1, 0, 1]

[0, 4, 0, 1]

[1]

   A Liouvillian solution exists

[4*x^2-1, 4*x, 4*x^2], x, {}, [1], -(1/2)/x, [1, 0, 1], 2, {}, {}, {}, {}, {1, x}

   Group is reducible or imprimitive

[sin(x)/x^(1/2), cos(x)/x^(1/2)]

[sin(x)/x^(1/2), cos(x)/x^(1/2)]

<-- exit \`DEtools/kovacicsols/order2\` (now in \`DEtools/kovacicsols/order2\`) = [sin(x)/x^(1/2), cos(x)/x^(1/2)]}

<-- exit \`DEtools/kovacicsols/order2\` (now in \`DEtools/kovacicsols\`) = [sin(x)/x^(1/2), cos(x)/x^(1/2)]}

<- Kovacic's algorithm successful

y(x) = _C1*sin(x)/x^(1/2)+_C2*cos(x)/x^(1/2)

 

Download dsolve_traced.mw

I suspect that it happens because of the following.

restart;

trace(`simpl/simpl/Re/is`):
#stopat(`simpl/simpl/Re/is`):

Re(x) assuming {};

{--> enter \`simpl/simpl/Re/is\`, args = \`x~\`
                x2 := x

<-- exit \`simpl/simpl/Re/is\` (now in \`simpl/simpl/Re\`) = 0}
                   0

Note that when you enter
    ... assuming {}
the assuming facility temporarily places that property on dependent names. So your call amounts to supplying the property x::{} . So the result is the same as this,

Re(x) assuming x::{};
{--> enter \`simpl/simpl/Re/is\`, args = \`x~\`
                x2 := x

<-- exit \`simpl/simpl/Re/is\` (now in \`simpl/simpl/Re\`) = 0}
                   0

If you follow that procedure in the debugger you can see these checks (which I compare against the case of the unassumed name):

restart;
is(x2,'real');
                 false

restart;
is(x2,'real') assuming x2::{};
                  true

# the previous true induces this test
(not type(x2,'complexcons')
     or `property/ProbablyNonZero`(x2) <> true)
and traperror(is(x2,0)) assuming x2::{};
                  true

# perhaps of particular interest
is(x2,0) assuming x2::{};
                  true

is(x2,0);
                false

You can run it through and see what happens (ie. at lines 4 and 5, say),

showstat(`simpl/simpl/Re/is`);

`simpl/simpl/Re/is` := proc(x)
local x2;
   1   if hastype(x,'float') and not type(x,'complex(numeric)') and type(
         x,'complexcons') then
   2       x2 := `simpl/simpl/ReIm/is/float`(x)
       else
   3       x2 := x
       end if;
   4   if (not type(x2,'complexcons') or has(x2,'RootOf') or 
         `property/ProbablyNonZero`(('Im')(x2)) <> true) and traperror
         (is(x2,'real')) then
   5       if (not type(x2,'complexcons') or has(x2,'RootOf') or 
             `property/ProbablyNonZero`(x2) <> true) and traperror(is(
             x2,0)) then
   6           return 0
           else
   7           return x
           end if
       elif (not type(x2,'complexcons') or has(x2,'RootOf') or 
         `property/ProbablyNonZero`(('Re')(x2)) <> true) and 
         traperror(is(-I*x2,'real')) then
   8       return 0
       end if;
   9   return ('Re')(x)
end proc

Invoking your procedure with the command   wrong();   will only display the one plot that happens to be the return value, since the returned value will be displayed as output.

You could also do this,
   proc() print(plot(x)); printf("z"); print(plot(x)); end proc;
which displays both plots.  (It also returns NULL, since that is the result of the last statement which is a print statement.)

And you can vary it. You could have it forcibly print the first plot and return (and thus incidentally display) the second plot.

Here are some comments, and ways. (I'm sure there are others... possibly simpler).

I chose to use a Vector rather than a vector, and to map the `?[]` indexing command.

vector_of_lists_example_ac.mw

Enter a period (lower dot) for Matrix-Vector and Matrix-Matrix multplication, not a star (which displays as a center-dot in 2D Input).

with(LinearAlgebra):

(Matrix(7, 7, {(1, 1) = -mu, (1, 2) = a[1]*beta[x]*k[1]*PI[h]/mu, (1, 3) = omega[o]*beta[x]*a[1]*PI[h]/mu, (1, 4) = sigma, (1, 5) = -beta[2]*PI[h]/mu, (1, 6) = 0, (1, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (2, 1) = 0, (2, 2) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (2, 6) = 0, (2, 7) = a[1]*beta[x]*k[2]*PI[h]/mu, (3, 1) = 0, (3, 2) = 0, (3, 3) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]/mu, (3, 4) = 0, (3, 5) = 0, (3, 6) = 0, (3, 7) = omega[o]*beta[x]*a[1]*k[2]*PI[h]/mu, (4, 1) = 0, (4, 2) = r[o], (4, 3) = r[1], (4, 4) = -mu-sigma, (4, 5) = 0, (4, 6) = 0, (4, 7) = 0, (5, 1) = 0, (5, 2) = alpha[o], (5, 3) = alpha[1], (5, 4) = 0, (5, 5) = -e[o], (5, 6) = 0, (5, 7) = 0, (6, 1) = 0, (6, 2) = -a[2]*beta[y]*k[1]*PI[m]/mu[b], (6, 3) = -a[2]*beta[y]*k[2]*PI[m]/mu[b], (6, 4) = 0, (6, 5) = -a[2]*beta[y]*PI[m]/mu[b], (6, 6) = -mu[b], (6, 7) = 0, (7, 1) = 0, (7, 2) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 3) = a[2]*beta[y]*k[2]*PI[m]/mu[b], (7, 4) = m[7, 4], (7, 5) = a[2]*beta[y]*PI[m]/mu[b], (7, 6) = 0, (7, 7) = -mu[b]})).(Matrix(7, 1, {(1, 1) = omega[1], (2, 1) = omega[2], (3, 1) = omega[3], (4, 1) = omega[4], (5, 1) = omega[5], (6, 1) = omega[6], (7, 1) = omega[7]})) = (Matrix(7, 1, {(1, 1) = 0, (2, 1) = 0, (3, 1) = 0, (4, 1) = 0, (5, 1) = 0, (6, 1) = 0, (7, 1) = 0}))

(Matrix(7, 1, {(1, 1) = -mu*omega[1]+a[1]*beta[x]*k[1]*PI[h]*omega[2]/mu+omega[o]*beta[x]*a[1]*PI[h]*omega[3]/mu+sigma*omega[4]-beta[2]*PI[h]*omega[5]/mu+a[1]*beta[x]*k[2]*PI[h]*omega[7]/mu, (2, 1) = -(mu+r[o]+alpha[o])*a[1]*beta[x]*k[1]*PI[h]*omega[2]/mu+a[1]*beta[x]*k[2]*PI[h]*omega[7]/mu, (3, 1) = -(mu+r[1]+alpha[1]+k[o])*a[1]*beta[x]*k[1]*PI[h]*omega[3]/mu+omega[o]*beta[x]*a[1]*k[2]*PI[h]*omega[7]/mu, (4, 1) = r[o]*omega[2]+r[1]*omega[3]+(-mu-sigma)*omega[4], (5, 1) = alpha[1]*omega[3]+alpha[o]*omega[2]-e[o]*omega[5], (6, 1) = -a[2]*beta[y]*k[1]*PI[m]*omega[2]/mu[b]-a[2]*beta[y]*k[2]*PI[m]*omega[3]/mu[b]-a[2]*beta[y]*PI[m]*omega[5]/mu[b]-mu[b]*omega[6], (7, 1) = a[2]*beta[y]*k[2]*PI[m]*omega[2]/mu[b]+a[2]*beta[y]*k[2]*PI[m]*omega[3]/mu[b]+m[7, 4]*omega[4]+a[2]*beta[y]*PI[m]*omega[5]/mu[b]-mu[b]*omega[7]})) = (Matrix(7, 1, {(1, 1) = 0, (2, 1) = 0, (3, 1) = 0, (4, 1) = 0, (5, 1) = 0, (6, 1) = 0, (7, 1) = 0}))

NULL


 

Download trc_ac.mw

I found that using solve might depend on whether the changed equation was expanded, and upon the working precision (Digits).

You can also adjust Digits to see effect on residual (forward) error.

There are other ways to compute this (eg. using procedures which each raise working precision ie. Digits locally while keep fsolve's notion of accuracy (dependent on inbound Digits) coarser. I haven't done that. Similar effects can be had by treating it as an optimization problem (eg. by using DirectSearch, or setting it up that way).

restart;

with(LinearAlgebra):

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

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

 

evalf(TrainLoad, 7);

-7660444.-6427876.*I

f1n2 := (0.03 + I*0.1515)*Ix[c1] - (0.03 + I*0.1515)*Ix[c2] + 2 * V[at1] - 55*10^3 = 0;

(0.3e-1+.1515*I)*Ix[c1]+(-0.3e-1-.1515*I)*Ix[c2]+2*V[at1]-55000 = 0

f3n4 := (1.6 + I*6.24)*Ix[c1] + (1.12 + I*2.64)*Ix[c2] + V[t] - V[at1] = 0;

(1.6+6.24*I)*Ix[c1]+(1.12+2.64*I)*Ix[c2]+V[t]-V[at1] = 0

f5n6 := (1.36 + I*4.44)*Ix[c2] + V[at2] - V[t] = 0;

(1.36+4.44*I)*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;

(-1.12-2.64*I)*Ix[c1]+(-3.92-12.00*I)*Ix[c2]+V[at2]-V[at1] = 0

f9n10 := V[t] * (Ix[c1] - Ix[c2]) + TrainLoad = 0;

V[t]*(Ix[c1]-Ix[c2])-10000000*cos((2/9)*Pi)-(10000000*I)*sin((2/9)*Pi) = 0

polynomials := {f1n2, f3n4, f5n6, f7n8, f9n10};

{(1.36+4.44*I)*Ix[c2]+V[at2]-V[t] = 0, V[t]*(Ix[c1]-Ix[c2])-10000000*cos((2/9)*Pi)-(10000000*I)*sin((2/9)*Pi) = 0, (-1.12-2.64*I)*Ix[c1]+(-3.92-12.00*I)*Ix[c2]+V[at2]-V[at1] = 0, (0.3e-1+.1515*I)*Ix[c1]+(-0.3e-1-.1515*I)*Ix[c2]+2*V[at1]-55000 = 0, (1.6+6.24*I)*Ix[c1]+(1.12+2.64*I)*Ix[c2]+V[t]-V[at1] = 0}

variables := {Ix[c1], Ix[c2], V[at1], V[at2], V[t]};

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

fsolve(polynomials, variables, complex);

{Ix[c1] = 955.2297105-5281.491898*I, Ix[c2] = -505.0156845+2424.830843*I, V[at1] = 26894.34238+4.981252431*I, V[at2] = 10829.70666+56.66545127*I, V[t] = -623.3636109+1112.165758*I}

f9n10 := V[t] * conjugate(Ix[c1] - Ix[c2]) + TrainLoad = 0;

V[t]*conjugate(Ix[c1]-Ix[c2])-10000000*cos((2/9)*Pi)-(10000000*I)*sin((2/9)*Pi) = 0

Digits:=20:

sol1:=solve({f1n2, f3n4, f5n6, f7n8, f9n10}, variables);

Warning, solutions may have been lost

sol1:=solve({f1n2, f3n4, f5n6, f7n8, expand(f9n10)}, variables);

{Ix[c1] = 1236.8820951263380105-4880.5299795094608907*I, Ix[c2] = -630.06302807299903300+2236.4267367463552561*I, V[at1] = 26932.886351895631871-34.66674233851253885*I, V[at2] = 11895.825533339687912-1029.4551170858521807*I, V[t] = 1109.205104006591891-785.3945997549247388*I}

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

{Ix[c1] = 1236.8820951263380105-4880.5299795094608906*I, Ix[c2] = -630.06302807299903300+2236.4267367463552561*I, V[at1] = 26932.886351895631871-34.666742338512538846*I, V[at2] = 11895.825533339687912-1029.4551170858521808*I, V[t] = 1109.2051040065918903-785.39459975492473915*I}

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

0.56912801178645213474e-11

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

0.16209122737779487861e-12

 

Download no_conjugate_ac.mw

You can also use the command-completion facility, or the palettes, or the Ctl-Shift-G keyboard shortcut to easily construct compound names in 2D Input mode.

This also allows the names to appear in their nice typeset form as 2D Input, and not just as 2D Output.

See Help pages for command-completion and the entry palettes.

restart;

 

For the following 2D Input I typed in the keystrokes D e l t a and

then I pressed the Escape key to activate command-completion .

 

That changed it to the typeset Greek Delta, and then I finished

entering rest of the name.

 

`&Delta;x`

`&Delta;x`

 

You can see the underlying structure of the name by using the

lprint command.

 

lprint(%);

`&Delta;x`

 

Below, I entered the first portion using the Greek entry palette

(from the GUI's left-panel).

 

`&Delta;x`

`&Delta;x`

lprint(%);

`&Delta;x`

 

Download cmd_completion.mw

As Carl mentioned, you can also enter the compound names using its 1D equivalent notation (which -- as you can see above -- involves a name containing HTML-style entity, here). But for some kinds of typeset name you may not find that easy to guess, eg. names with a caret over them, etc.

In 2D Input mode, you can also use the keyboard acceleration Ctl-Shift-G to temporarily place the GUI into Greek-entry-mode. For your example, the same result for typeset 2D Input can also be had using the keystrokes,
   Ctl-Shift-G D x
There, the "D" makes it enter a Greek uppercase Delta. See the Help page.

In a previous Question you were shown in an Answer that the simplify command accepts the assume=[...] option.

That does not mean that option assume=[...] works for all commands. It does not.

The odetest command does not throw an error if you pass it some extra arguments.

If you want to construct your call (to utilize the assuming facility) from a precomputed list or collection of inputs then you can call using its prefix form:

sol:=y(x)^(1/2)=-1+2*exp(x):
ode:=diff(y(x),x)-2*y(x)=2*y(x)^(1/2):
`assuming`([odetest(sol,ode)], [x::real, x>0]);
                     0
First 113 114 115 116 117 118 119 Last Page 115 of 336