acer

32465 Reputation

29 Badges

20 years, 4 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Inside the adaptive plotter it attempts the following under evalhf , using the HFloat value (and that gets caught with an error). Then it falls back to attempting it with evalf.

restart;
ee := exp(-Pi*t/3)^8*JacobiTheta3(Pi*(4*I*t+1)/2,
        exp(-12*Pi*t))^8/(exp(-Pi*t/6)^4*
      JacobiTheta3(Pi*(2*I*t + 1)/2, exp(-6*Pi*t))^4):

eval(ee,t=.000657200628125);

                                    -5
       36176.36077 - 0.9893163422 10   I

eval(ee,t=HFloat(.000657200628125));
Execution stopped: Stack limit reached.

I'll guess that you've already noticed that it can be avoided by simplifying to JacobiTheta4, or raising Digits above 15, or setting UseHardwareFloats to false.

I wiĺl submit a bug report.

[edit] I also notice that it can be avoided by setting kernelopts(floatPi=false). So this does not crash for me:

ee:=exp(-Pi*t/3)^8*JacobiTheta3(Pi*(4*I*t+1)/2,
exp(-12*Pi*t))^8/(exp(-Pi*t/6)^4*
JacobiTheta3(Pi*(2*I*t + 1)/2, exp(-6*Pi*t))^4);
kernelopts(floatPi=false):
plot(ee,t=0..4);

Curiously, that kernelopts setting survives restart, in the GUI or the CommandLine Interface (I don't understand why floatPi and display_zero_complex_part persist after restart while assertlevel and opaquemodules do not.)

@dharr I suspect that he already was able to create the posted plot, and wanted it to differ from that.

 

@Reshu Gupta That was not at all clear in your original question.

The following both display with literal Nu instead of the capital Greek letter, in upright roman, and the a appears as a subscript.

   labels=[eta,Typesetting:-mo("Nu")[a](eta)]

   labels=[eta,`#mo("Nu");`[a](eta)]

For example,

plot(axes=box,gridlines,size=[375,300],
     labelfont=["Tahoma",bold,14],
     labeldirections=[horizontal,vertical],
     labels=[eta,`#mo("Nu");`[a](eta)]);

If you want the Nu in italics then you could do it like this,

    labels=[eta,`#mrow(mi("N"),mi("u"));`[a](eta)]

For example,

plot(axes=box,gridlines,size=[375,300],
     labelfont=["Tahoma",bold,14],
     labeldirections=[horizontal,vertical],
     labels=[eta,`#mrow(mi("N"),mi("u"));`[a](eta)]);

@animeplot A good place to start is by reading the Help (documentation) that comes bundled inside Maple.

You could look at the Help page for topic,
   DocumentTools,Tabulate

Or you could look at Examples on the Embedded Components Help pages, and in particular,
   PlotComponent
   MathContainer
and you could even call you first worksheet and push the results into those components using,
   ButtonComponent

 

What is the rationale for specifying f(0) as 0?

Why that value, instead of, oh, say, 0.0031 or 0.003043455 or something else?

Is there something you expect to happen at f(1)? Some value such as, say, oh, 0.007 that f might approach?

I am just curious about the origin of the problem.

Why did you force method=ck45?

ps. It's not helpful to post only an image of the code. You can upload and attach your worksheet using the green up-arrow in the Mapleprimes editor.

I changed your query from a Post to a Question.

@petit loup How did you compute "the" condition number?

(What computations did you do, altogether, that is also to the point.)

Why does your Question (and followup Reply to vv) contain various blank portions? Are those supposed to contain missing details?

@mary120 Why did you not mention before that you are using Maple 11!  That was released thirteeen years ago, and is now 13 major releases out of date.

You could try one of these options:

   legend=('n[`0p`]'/'n[`0i`]'=0.1)

or,

   legend=`#mfrac(msub(mi("n"),mi("0p")),msub(mi("n"),mi("0i")))`

   

@mary120 You could use options such as,

  legend=typeset(n__0p/n__0n=0.1), legendstyle=[font=[Helvetica,10]]

where you adjust the font name as size as desired. Note that I used a double-underscore to get the subscripting.

@faizfrhn Please don't submit the question more than once.

You've incorrectly used square-brackets [...] instead of round-brackets (...) as delimiters in your expression for eq3.

Also, did you mean Pi/4 instead of 90? Maple's trig sommands work with radians.

Also, in the term sin(((beta + 90 + delta) - beta) + phi)) there is a +beta added to a -beta. Is that intentional, or did you mean something else?

 

[edited] Put your followup questions as Comments here, instead of in a separate Question thread.

Here is something more programmatic (ie. hopefully more systematic and less ad hoc). I'm trying to keep in mind the OP's mention of pulling out the H (akin to factoring in some sense).

I expect there is room for improvement. I tried to make it not expand terms. I didn't stress-test it.

The main idea is to not have to determine visually (and specifiy manually) which multiplicative term to adjust, or by what power of H.

At the end, for fun, it's also used to pull out other "factors".

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))

targ := 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))

F := proc(ee::`*`,T::name)
  local a,c,count,d,o,p,P,q;
  (a,o) := selectremove(type,[op(ee)],
                    And(`+`,polynom(anything,T),
                        satisfies(p->degree(p,T)>0)));
  count:=0; P:=1;
  if nops(a)>0 then
    for p in a do
      d := degree(p,T); count := count+d;
      (c,q) := selectremove(type,[op(p)],`*`);
      P := P*`+`(op(map(`/`,q,T^d)),map(u->F(u,T)/T^d,c)[]);
    end do;
  end if;
  `*`(P,T^count,op(o));
end proc:

 

answer := lhs(eq) = F(rhs(eq), H);

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))

evalb(simplify(answer-eq)), evalb(answer=targ);

true, true

# for fun...
lhs(eq) = F(rhs(eq), h); evalb(simplify(%-eq));
lhs(eq) = F(rhs(eq), gamma); evalb(simplify(%-eq));
lhs(eq) = F(rhs(eq), psi); evalb(simplify(%-eq));

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

true

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

true

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

true

 

Download manipulation.mw

 

@nguyenhuyenag I never claimed that it would work for every other problem you concocted. That's why I wrote particular in italics.

If you are trying to ask something else, something more general, then ask it clearly.

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

 

First 162 163 164 165 166 167 168 Last Page 164 of 594