acer

32333 Reputation

29 Badges

19 years, 319 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@DJJerome1976 In the attachment in my Reply I showed both.

@DJJerome1976 I'm not sure whether you meant the intersection of the complement of A along with B, or the intersection of the complement of both.

You can use Not along with And and Or.

(Mapleprimes doesn't want to inline this sheet right now, sorry.)
Download solve_RR_2.mw

 

@DanFromDK 

restart

kernelopts(version)

`Maple 2020.1, X86 64 LINUX, Jun 8 2020, Build ID 1474533`

with(Units:-Simple); Units:-UseUnit(J/(kg*K))
 

m := .25*Unit('kg'); Q := 22.5*Unit('kJ'); `ΔT` := 100*Unit('K')

100*Units:-Unit(K)

combine(isolate(Q = m*c*`ΔT`, c), units)

c = 900.0000000*Units:-Unit(J/(kg*K))

NULL

Download Unit_problem_version_1_ac.mw

note: I only used simplify in an example in my Answer because you had it in your Question. I prefer to use combine(.., units) to get the base units in the current system, combined.

@rlopez Thank you, Robert. thats a good point. Perhaps the OP wants something like this:

restart;

with(VectorCalculus):

 

F := exp(x*y^3*z^2):

 

# returns a vector field
VFG := Gradient(F,[x,y,z]);

Vector(3, {(1) = y^3*z^2*exp(x*y^3*z^2), (2) = 3*x*y^2*z^2*exp(x*y^3*z^2), (3) = 2*x*y^3*z*exp(x*y^3*z^2)})

 

# returns a rooted vector
evalVF(VFG, <[1,-1,2]>);

Vector(3, {(1) = -4*exp(-4), (2) = 12*exp(-4), (3) = -4*exp(-4)})

 

Download VC_Gradient_v.mw

@janhardo Note that it's better to re-use the general form if you want to find the gradient at many numeric points.

Suppose you want to compute the gradient at many numeric points. Don't use any method that calls the Gradient command each time, as that could be needlessly inefficient. Instead, compute the general form and then evaluate that at each of the numeric points. In other words, do the above asseparate tasks:

   gen_grad := Gradient(F,[x,y,z]):
   eval(gen_grad, Equate([x,y,z],[1,-1,2]));

The second of those can be done at multiple numeric points, but the first doesn't have to be recomputed.

@afernande1008 Stop adding duplicates of the preceding Comment as new Answers here.

@Preben Alsholm Yes, setting kernelopts(floatPi=false) avoids the issue because the instantiation doesn't induce an evalf right away. But the problem would still occur if the expression is evalf'd up front.

That is, this too crashes:

restart;
ee:=exp(-1.047197551*t)^8*
    JacobiTheta3(6.283185310*I*t+1.570796327,exp(-37.69911185*t))^8
    /exp(-.5235987758*t)^4
    /JacobiTheta3(3.141592654*I*t+1.570796327,exp(-18.84955592*t))^4:
plot(ee,t=0..4);

as does this, (which is what plotting attempts, unless the HFloat values for t are avoided via Digits or UseHardwareFloats settings)

restart;
ee:=exp(-1.047197551*t)^8*
    JacobiTheta3(6.283185310*I*t+1.570796327,exp(-37.69911185*t))^8
    /exp(-.5235987758*t)^4
    /JacobiTheta3(3.141592654*I*t+1.570796327,exp(-18.84955592*t))^4:
eval(ee,t=HFloat(.000657200628125));

[edit] I submitted a bug report.

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

   

First 159 160 161 162 163 164 165 Last Page 161 of 591