acer

32405 Reputation

29 Badges

19 years, 351 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Are you saying the your fsolve call already works, and produces results like, say, this:

   SOL1 := fsolve({ODE11, ODE12}, {N, t__2});
                 SOL1 := {N=3, t__2=5.6666}

In that case you can do the following to access the values:

   eval(N, SOL1);
                               3
   eval(t__2,SOL1);
                          5.6666

And you can use those wherever you need the values, or you can assign each to temporary variables, etc.

If your situation is different then please explain in more detail what you need.

restart;

x:=proc(j)

option remember;

x(j-1) + 1;

end proc:

 

x(1):=2;

2

x(2), x(3), x(4);

3, 4, 5

x(2):=7;

7

forget(x, 3); forget(x, 4);

x(3), x(4);

8, 9

x(2):=13

13

map[2](forget, x, [3,4]):

x(3), x(4);

14, 15

x(2):=10

10

forget~(x, [3,4]):

x(3), x(4);

11, 12

 

Download EXAMPLES_ac.mw

If I understand you, here is one way to contruct it. (I expect that there are slicker ways.)

restart;

F:=(N::posint)->ArrayTools:-FlipDimension(Matrix(N,N,
  [seq([seq(j+i*(i-1)/2,
    j=`if`(i::odd,1..i,i..1),(-1)^(i+1))],i=1..N),
   seq([seq(N^2+1-(j+i*(i-1)/2),
    j=`if`(i::even,1..i,i..1),(-1)^(i))],i=N-1..1,-1)],
  scan=band[N-1,N-1]),1):

F(2);

Matrix(2, 2, {(1, 1) = 1, (1, 2) = 2, (2, 1) = 3, (2, 2) = 4})

F(3);

Matrix(3, 3, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 6, (2, 1) = 3, (2, 2) = 5, (2, 3) = 7, (3, 1) = 4, (3, 2) = 8, (3, 3) = 9})

F(4);

Matrix(4, 4, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 6, (1, 4) = 7, (2, 1) = 3, (2, 2) = 5, (2, 3) = 8, (2, 4) = 13, (3, 1) = 4, (3, 2) = 9, (3, 3) = 12, (3, 4) = 14, (4, 1) = 10, (4, 2) = 11, (4, 3) = 15, (4, 4) = 16})

F(5);

Matrix(5, 5, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 6, (1, 4) = 7, (1, 5) = 15, (2, 1) = 3, (2, 2) = 5, (2, 3) = 8, (2, 4) = 14, (2, 5) = 16, (3, 1) = 4, (3, 2) = 9, (3, 3) = 13, (3, 4) = 17, (3, 5) = 22, (4, 1) = 10, (4, 2) = 12, (4, 3) = 18, (4, 4) = 21, (4, 5) = 23, (5, 1) = 11, (5, 2) = 19, (5, 3) = 20, (5, 4) = 24, (5, 5) = 25})

F(6);

Matrix(6, 6, {(1, 1) = 1, (1, 2) = 2, (1, 3) = 6, (1, 4) = 7, (1, 5) = 15, (1, 6) = 16, (2, 1) = 3, (2, 2) = 5, (2, 3) = 8, (2, 4) = 14, (2, 5) = 17, (2, 6) = 26, (3, 1) = 4, (3, 2) = 9, (3, 3) = 13, (3, 4) = 18, (3, 5) = 25, (3, 6) = 27, (4, 1) = 10, (4, 2) = 12, (4, 3) = 19, (4, 4) = 24, (4, 5) = 28, (4, 6) = 33, (5, 1) = 11, (5, 2) = 20, (5, 3) = 23, (5, 4) = 29, (5, 5) = 32, (5, 6) = 34, (6, 1) = 21, (6, 2) = 22, (6, 3) = 30, (6, 4) = 31, (6, 5) = 35, (6, 6) = 36})

 

Download mattrav.mw

Here is one way to treat your example symbolically (exactly).

restart;

obj:=(x-2*y)/(5*x^2-2*x*y+2*y^2);

(x-2*y)/(5*x^2-2*x*y+2*y^2)

cond:=isolate(2*x^2-y^2+x*y=1,x);

x = -(1/4)*y-(1/4)*(9*y^2+8)^(1/2)

sol:=simplify([maximize(eval(obj,cond),location)]);

[(1/4)*2^(1/2), {[{y = -(1/6)*2^(1/2)*(3+3^(1/2))}, (1/4)*2^(1/2)]}]

pt:=[simplify(eval(cond,sol[2,1,1])), sol[2,1,1,1]];

[x = -(1/3)*6^(1/2), y = -(1/6)*2^(1/2)*(3+3^(1/2))]

simplify(eval(obj,pt));

(1/4)*2^(1/2)

 

Download maximize_exact.mw

Is this the kind of thing that you had in mind?

The grey region denotes eq1<eq2, and the red curve denotes eq1=0 and the blue curve denotes eq2=0.

So their linestyle depends on whether the portion lie within the grey region, or not.

You may wish to adjust, as I used strict inequalities (which are also subject to roundoff). So results may vary if where the curves lie right along the border of the grey region. (But it may be "OK", with the curve dashed along the edge of the grey region which is also dashed -- ie. the strict inequality may not hold there.)

I did not both to figure out what value of working precision (Digits) would be fastest while accurate, and so on.

restart;

r:=0.927: K:=1.8182*10^8:d[v]:=0.0038:d[u]:=2: delta:=1: p[m]:=2.5:
M:=10^4: p[e]:=0.4: d[e]:=0.1: d[t]:=5*10^(-9): omega:=2.042: b:=1000:
h[e]:=1000:h[u]:=1:h[v]:=10^4:

eq1 := r*d[t]*h[e]*x[u]^3+(r*h[e]*(-K*d[t]+d[t]*h[v]+d[e])
+r*p[e]*x[m])*x[u]^2+(r*h[e]*(-K*d[t]*h[v]-K*d[e]+d[e]*h[v])
+K*p[e]*(d[u]-r)*x[m])*x[u]-r*K*h[e]*d[e]*h[v]:

eq2 := (d[t]*x[u]+d[e])*(2*r*x[u]/K+d[u]*p[e]*x[m]*x[u]/((h[v]+x[u])
*(d[t]*x[u]+d[e])*(h[e]+p[e]*x[m]*x[u]/((h[v]+x[u])*(d[t]*x[u]+d[e]))))-r)
+d[u]*h[e]*x[u]*(p[e]*h[v]*x[m]/(h[v]+x[u])^2-d[t]*p[e]*x[m]*x[u]/((h[v]+x[u])
*(d[t]*x[u]+d[e])))/(h[e]+p[e]*x[m]*x[u]/((h[v]+x[u])*(d[t]*x[u]+d[e])))^2:

Digits:=40:

TL:=plottools:-transform(
     proc(a,b)
      Digits:=40:
      `if`(evalf(eval(eq1<eq2,[x[m]=a,x[u]=b])),[a,b],[undefined,undefined])
     end proc):
TU:=plottools:-transform(
     proc(a,b)
      Digits:=40:
      `if`(evalf(eval(eq1>=eq2,[x[m]=a,x[u]=b])),[a,b],[undefined,undefined])
     end proc):

PR:=plots:-inequal(eq1<eq2, x[m]=-1e3..1e3, x[u]=-3e8..3e8, color=gray):

P1:=plots:-implicitplot(eq1=0, x[m]=-1e3..1e3, x[u]=-3e8..3e8, color=red, thickness=3,
                        grid=[51,51], gridrefine=0, crossingrefine=0):
P2:=plots:-implicitplot(eq2=0, x[m]=-1e3..1e3, x[u]=-3e8..3e8, color=blue, thickness=3,
                        grid=[151,151], gridrefine=0, crossingrefine=0):

PC:=plots:-display(
  plots:-display(TL(P1),overrideoption,linestyle=dash),
  plots:-display(TU(P1)),
  plots:-display(TL(P2),overrideoption,linestyle=dash),
  plots:-display(TU(P2))
);

plots:-display(PC,PR,view=[-1e3..1e3, -3e8..3e8]);

 


 

Download eq1eq2.mw

Here's an explanation of what's going wrong. 

The MQ procedure (in source local Studienblatt_1_8) calls UseUnit several time, every time it is called. For example, it calls UseUnit('m') each time it is used. This gets into trouble when a call to a command such as Units:-Simple:-`*` produces a result with a new local name m upon each invocation. (I am going to submit a bug report with the details.)

Your GeneralStartup source attachment calls with(Units), which has the effect of rebinding UseUnit so that its calls in the read source will resolve to Units:-UseUnit. It also has the effect of loading the Units:-Simple package, so that calls to `*` in the parsed (read) MQ source resolve to Units:-Simple:-`*`, etc.

I expect that you want the Units:-Simple effects of combining units. (I suggest utilizing uses Units:-Simple in the procedures like MQ rather than the utilizing with, but the problem would occur either way.)

The easiest and probably best fix would be to only call UseUnit with the same input name once per restart. I'll leave it to you to decide where you'd like to place it, say at the top-level in your Studienblatt_1_8 source, say.

An alternative but crude workaround might be for computation routines (such as your seqMQ, say) to execute combine(...,units) or simplify. I am not sure that would always suffice easily.

restart;

lg := Units:-Unit('m');

Units:-Unit(m)

[indets(lg,name), map(addressof,indets(lg,name))];

[{m}, {18446884599300013950}]

F:=proc(len)
  local fuzz;
  Units:-UseUnit('m');
  fuzz := Units:-Simple:-`*`(3, len);
  [indets(fuzz,name), map(addressof,indets(fuzz,name))];
end proc:

 

F(lg);

[{m}, {18446884599192877630}]

F(lg);

[{m}, {18446884599192866750}]

F(lg);

[{m}, {18446884599192847646}]

restart;

lg := Units:-Unit('m');

Units:-Unit(m)

[indets(lg,name), map(addressof,indets(lg,name))];

[{m}, {18446884599300013950}]

tot := 0:
for i from 1 to 3 do
  Units:-UseUnit('m');
  fuzz := Units:-Simple:-`*`(3, lg);
  [indets(fuzz,name), map(addressof,indets(fuzz,name))];
  tot := tot + fuzz;
end do;

false

3*Units:-Unit(m)

[{m}, {18446884599192874270}]

3*Units:-Unit(m)

true

3*Units:-Unit(m)

[{m}, {18446884599192165854}]

3*Units:-Unit(m)+3*Units:-Unit(m)

true

3*Units:-Unit(m)

[{m}, {18446884599191917950}]

3*Units:-Unit(m)+3*Units:-Unit(m)+3*Units:-Unit(m)

simplify(tot);

9*Units:-Unit(m)

combine(tot, units);

9*Units:-Unit(m)

 

Download UseUnit_Simple_oddness.mw

(I'm still looking at revising the procedures to utilize uses instead of relying on the top-level with calls, and to use a parant module locals instead of the declared globals in the procedures.)

Here is the simple move of the three calls to UseUnit outside of the MQ procedure -- now at the top level, inside the Studientblatt_1_8 source.
Koyaanisqatsi_acc.zip

There are other things you could do with this.

Since the height simplifies to just 1 for your example, and 2D densityplot might be another reasonable choice.

(I don't know whether this is your actual problem, or just a toy example to illustrate. If you have a more complicated example then it might be useful to show it.)

restart;

f := (x, w) -> exp(w*x*I);

proc (x, w) options operator, arrow; exp(I*w*x) end proc

evalc(f(x,w));

cos(w*x)+I*sin(w*x)

evalc(abs(f(x,w)));

1

evalc(argument(f(x,w)));

arctan(sin(w*x), cos(w*x))

plot3d(evalc(abs(f(x,w))), x=-2*Pi..2*Pi, w=-2*Pi..2*Pi,
       style=surface,
       color=evalc(argument(f(x,w))));

plots:-densityplot(evalc(argument(f(x,w))),
                   x=-2*Pi..2*Pi, w=-2*Pi..2*Pi,
                   colorstyle=HUE, style=surface, grid=[301,301]);

 

Download plot_cmplx.mw

A 1-dimensional Array has no orientation. It is not a row Array. It pretty-prints in a row for convenience, as do lists and a few other structures.

If you want to make it pretty-print vertically then you could cast it to a Vector[column]., or you could extract it with 2 dimensions as,  b[1 .. 2, 1 .. 1].

You could utilize some variant on the following:

try
  a:=ModularSquareRoot(10,11);
  b:=b+1;
catch "":
  c:=c+1;
end try;

A (deprecated), older mechanism is something like this:

a:=traperror(ModularSquareRoot(10,11));
if a<>lasterror then b:=b+1 else c:=c+1 end if;

Here is one way to plot your data.

I am presuming that you know whether your numerical method (which produces the data) makes sense and is accurate in some sense that is acceptable to you.

(I don't know why portions of your worksheet don't inline well on this forum. It looks better in the actual GUI. I used Maple 18 to match the version in which your attachment was last saved.)

restart

lambda := 3.64*10^10

0.3640000000e11

mu := 5.46*10^10

0.5460000000e11

rho := 2330

2330

tau := 5*10^(-5)

1/20000

T[0] := 800

800

d[n] := -9*10^(-31)

-9/10000000000000000000000000000000

d[e] := 2.5*10^(-3)

0.2500000000e-2

E[g] := 1.11

1.11

C[e] := 695

695

alpha[T] := 4.14*10^(-6)

0.4140000000e-5

delta := (3*lambda+2*mu)*alpha[T];

904176.0000

r := 2

2

omega[0] := -.3

-.3

NULL

epsilon[0] := 8.85*10^(-12)

0.8850000000e-11

k := 800

800

C[T] := sqrt((2*mu+lambda)/rho)

7905.015521

mu[0] := (4*3.17)*10^(-7)

0.1268000000e-5

t[1] := k/(rho*C[e]*C[T]^2)

0.7905763302e-11

q[2] := k*t[1]/(d[e]*rho*tau*C[e])

0.3124518178e-7

q[1] := k/(d[e]*rho*C[e])

.1976101522

a := .5

.5

mu := 5.46*10^10

0.5460000000e11

NULL

q[3] := a/C[T]^2

0.8001373626e-8

epsilon[1] := delta^2*T[0]*t[1]/(k*rho)

0.2773919393e-2

epsilon[2] := alpha[T]*E[g]*t[1]/(d[n]*rho*tau*C[e])

-0.4985559321e12

kappa := 386

386

epsilon[3] := d[n]*k*kappa*t[1]/(alpha[T]*rho*C[e]*d[e])

-0.1310939149e-33

``

``

delta[n] := (3*lambda+2*mu)*d[n]

-0.1965600000e-18

H0 := 10^5

100000

R[H] := 1+epsilon[0]*((4*3.17)*10^(-7))^2*H0^2/rho

1.

alpha[0] := 1+(4*3.17)*10^(-7)*H0^2

12681.00000

nu := 2

2

for y from 0 to 300 do x := 0+0.1e-1*y; t := .8; s := 4.7/t; A[1] := -(-s^4*R[H]-s^3*R[H]*q[3]-s^3*alpha[0]*q[1]-s^2*alpha[0]*q[1]*q[3]+s^2*epsilon[2]*q[1]*q[3]-s^3*alpha[0]+s^3*epsilon[2]-s^2*alpha[0]*q[2]-s*alpha[0]*q[2]*q[3]+s*epsilon[2]*epsilon[3]*q[3]+s*epsilon[2]*q[2]*q[3]+alpha[0]*epsilon[1]*epsilon[3]*q[3])/(s^2*alpha[0]+s*alpha[0]*q[3]-s*epsilon[2]*q[3]); A[2] := (s^5*R[H]*q[1]+s^4*R[H]*q[1]*q[3]+s^5*R[H]+s^4*R[H]*q[2]+s^4*alpha[0]*q[1]-s^4*epsilon[2]*q[1]+s^3*R[H]*q[2]*q[3]-s^2*R[H]*epsilon[1]*epsilon[3]*q[3]+s^3*alpha[0]*q[2]-s^3*epsilon[2]*epsilon[3]-s^3*epsilon[2]*q[2]-s^2*alpha[0]*epsilon[1]*epsilon[3])/(s^2*alpha[0]+s*alpha[0]*q[3]-s*epsilon[2]*q[3]); A[3] := (-s^6*R[H]*q[1]-s^5*R[H]*q[2]+s^4*R[H]*epsilon[1]*epsilon[3])/(-s^2*alpha[0]-s*alpha[0]*q[3]+s*epsilon[2]*q[3]); M[1] := (1/6)*sqrt(6)*sqrt((8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1]*A[2]*A[3]+12*A[2]^3+81*A[3]^2))^(1/3)*((8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1]*A[2]*A[3]+12*A[2]^3+81*A[3]^2))^(2/3)+2*A[1]*(8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1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]^3+81*A[3]^2))^(2/3)-(4*I)*sqrt(3)*A[1]^2+(12*I)*sqrt(3)*A[2]+(8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1]*A[2]*A[3]+12*A[2]^3+81*A[3]^2))^(2/3)-4*A[1]*(8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1]*A[2]*A[3]+12*A[2]^3+81*A[3]^2))^(1/3)+4*A[1]^2-12*A[2]))/(8*A[1]^3-36*A[1]*A[2]+108*A[3]+12*sqrt(12*A[1]^3*A[3]-3*A[1]^2*A[2]^2-54*A[1]*A[2]*A[3]+12*A[2]^3+81*A[3]^2))^(1/3); m[1, 1] := -(M[1]^2*q[3]-s^2)/s^2; m[1, 2] := -(M[2]^2*q[3]-s^2)/s^2; m[1, 3] := -(M[3]^2*q[3]-s^2)/s^2; m[2, 1] := epsilon[3]*(M[1]^2*q[3]-s^2)/(s^2*(-s*q[1]+M[1]^2-q[2])); m[2, 2] := epsilon[3]*(M[2]^2*q[3]-s^2)/(s^2*(-s*q[1]+M[2]^2-q[2])); m[2, 3] := epsilon[3]*(M[3]^2*q[3]-s^2)/(s^2*(-s*q[1]+M[3]^2-q[2])); m[3, 1] := (-M[1]*(M[1]^2*q[3]-s^2)*(-s*q[1]+M[1]^2-epsilon[3]-q[2])/(s^2*(-s*q[1]+M[1]^2-q[2])*(-s^2*R[H]+M[1]^2*alpha[0]))-epsilon[3]*(M[1]^2*q[3]-s^2)/(s^2*(-s*q[1]+M[1]^2-q[2]))+(M[1]^2*q[3]-s^2)/s^2)/mu; m[3, 2] := (-M[2]*(M[2]^2*q[3]-s^2)*(-s*q[1]+M[2]^2-epsilon[3]-q[2])/(s^2*(-s*q[1]+M[2]^2-q[2])*(-s^2*R[H]+M[2]^2*alpha[0]))-epsilon[3]*(M[2]^2*q[3]-s^2)/(s^2*(-s*q[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m[3, 1])*T[0]/((m[1, 1]*m[2, 2]*m[3, 3]-m[1, 1]*m[2, 3]*m[3, 2]-m[1, 2]*m[2, 1]*m[3, 3]+m[1, 2]*m[2, 3]*m[3, 1]+m[1, 3]*m[2, 1]*m[3, 2]-m[1, 3]*m[2, 2]*m[3, 1])*r)-(m[1, 1]*m[3, 2]-m[1, 2]*m[3, 1])*nu/((m[1, 1]*m[2, 2]*m[3, 3]-m[1, 1]*m[2, 3]*m[3, 2]-m[1, 2]*m[2, 1]*m[3, 3]+m[1, 2]*m[2, 3]*m[3, 1]+m[1, 3]*m[2, 1]*m[3, 2]-m[1, 3]*m[2, 2]*m[3, 1])*r*d[e]); F[k] := sum(exp(-M[i]*x)*V[i], i = 1 .. 3); s := (4.7+I*m*Pi)/(.8); G[k] := sum((sum(exp(-M[i]*x)*V[i], i = 1 .. 3))(-1)^(4.7/t), m = 1 .. 1000); B[k] := exp(4.7)*Re((1/2)*F[k]+G[k])/t; X[y] := x; Bk[y] := B[k]/10^213 end do:

plot(`<|>`(`<,>`(convert(X, list)), `<,>`(convert(Bk, list))));

 

``

Download x_phi_ac.mw

You should use the Grid package to parallelize a long sequence of integration or differential equations computations.

Threads:-Seq requires the computations to be thread-safe, and that is not true for computations that leverage int, limit, dsolve.

But the Grid package will allow each computation to run in wholly separate kernels. (Since many such computations are not "small" or very, very quick then the coarse granularity is less of an overhead penalty.)

If you don't want a floating-point number then don't use evalf here.

But keep in mind that applying the exp command an integer won't result in a "whole number". So for general (eg. exact rational) inputs you might find yourself in the position of your previous Question. Ie. you may have to choose between receiving a single float result or receiving an exp call as answer.

Of course we do not yet know what kinds of input you intend on passing (via the text entry), because you haven't told us.

If your issue is that you would prefer another notation for the floating-point result (eg. 4560.0 instead of .456e4 , etc) then please say so. Or even if you would like the closest (rounded) integer, etc. Please explain precisely what kinds of input and output you want.

This is so similar to your previous question that it is unhelpful and unproductive to post as two separate Question threads,  since it splits the detsils and the answer content. In future please add such close followup examples as Reply/Comment on the original, instead.

If you always want Maple to attempt floating-point evaluation then wrap it in a call to the evalf command. 

Eg,

    Do( %Result = evalf( ln(2)/Do(%Text)  )  );

For your particular example you could also simply replace ln(2) with ln(2.0).

Which of these ways you chose depends on how general you want it.

(There are also some cases --likely rare -- where keeping the ln(2) and using evalf might incur less chance of numeric roundoff error. I doubt it will make much difference to you here.)

Part of your question is about whether fsolve will be able to handle the large expression (so large that it won't prettyprint in full).

Are you trying to compute eigenvalues, by doing numeric rootfinding on the characteristic equation?

If so, then why are you not doing a straight eigenvalue computation using the Eigenvalues command (possibly after applying evalf, if the Matrix has no floats or is not yet of type numeric)?

The active lowercase sum command is outright the wrong command for this example (as given). As given, it can attempt a symbolic summation, which is generally not a good idea in the presence of the floating-point number in the exponent.

It would be relevant to see whether one needs both the floating-point exponent as well as sum (not add), to get the crash.

Using float exponents is actually not a great idea more generally. It certainly shouldn't be used as an easy way to get floating-point evaluation. Better would be use of evalf, or perhaps even a float coefficient.

Of course it is some kind of bug if Maple locks up and crashes on the very same example in 2D Input but not 1D plaintext code.(I will submit a bug report.)

You might also try with the right context-panel closed. It might possibly be related.

 

First 116 117 118 119 120 121 122 Last Page 118 of 336