sand15

1107 Reputation

15 Badges

10 years, 322 days

MaplePrimes Activity


These are replies submitted by sand15

UPDATED

Bars.mw

Head of the drawing procedure:

F := proc(
       data::Matrix,                             
       rownames::{Vector, list},                 
       colnames::{Vector, list, Matrix}, 
       colors::{Vector, list},
       #--------- optional parameters
       {
           h::positive:=1/4                       # half of the side length of bar bases
         , Xexpand::positive:=1                   # dilation factor along X
         , Yexpand::positive:=1                   # dilation factor along Y
         , Zexpand::positive:=1                   # dilation factor along Z
         , Transparency::nonnegative:=0           # bar transparency    
         , TickFont::list:=[Tahoma, bold, 12]     # tickmark font             
         , HeightFont::list:=[Tahoma, bold, 9]    # font of the values written above the top of the bars            
         , BaseLines::boolean:=false              # draw or not the base lines on plane Z=0          
         , LevelLines::boolean:=false             # draw or not the level lines (should be used with Transparency=0)
         , Skeleton::boolean:=false               # display the skeleton of tha bars
         , CapsAbove::boolean:=false              # display top caps for each bar
         , CapsBelow::boolean:=false              # display the base (Z=0) caps for each bar
         #
         #------- complete this set of optional parameters as you want
       }
     )

I repeat I don't have time to read and understand your worksheet. Procedure F is quite generic provided the informations are represented by 3 specific structures (Matrix, Vector/list).

So it is on you to organize the informations you want to plot according to these 3 structures.
This should be quite simple. Next copy -paste the procedure F into your worksheet and execute it as done in my worksheet.

@AHSAN 

Provide:

  1. A 4 by 3 matrix containing the heights of each bar.
  2. A vector of length 4 containing the titles of the rows.
  3. A vector of length 3 containing the titles of the columns

Normally you should have these informations and I'm not going to spend time generating them from your Group_bar_graphs_help.mw code.

Next I'll send you a code to generate quite a same plot

@janhardo

Neither PMF nor ProbabilityMassFunctions are Maple buit-in functions, contrary to ProbabilityFunction

Could something like this suit you (look to the ColumnGraph examples).

If yes, gather the informations to display in a Matrix or Array (or better use a DataFrame): the rest is just aesthetic adjustments.

Can you be more detaoled about what you want to do exactly?

Is it just a matter of display?
If it is so you can use this code  percentage_1.mw

Do you want to do algebra with percentages?
Something like this percentage_2.mw maybe?

Do you want to us percentages within a plot?
Look here percentage_3.mwpercentage_3.mw

@raj2018 

restart;

local gamma:

f3:=-1/(((-qh-1)*Tch+qc+1)*deltac+(qh+1)*Tch)*(6*alpha^2*(alpha-1)*(alpha+1)*(((-qh-1)*Tch+qc+1)^2*deltac^2+((-7/3*(qh^2)-10/3*qh-1)*Tch^2+(2*(qh+1))*(qc+1)*Tch+(1/3)*qc^2-2*qc*(1/3)-1)*deltac+4*qh*Tch^2*(qh+1)*(1/3)))=0:
params:=[qh=64/100, deltac=1/2, deltah=1/2, alpha=4/5, gamma=1/10, M=3241/2000]:
 

Eq1:=eval(f3, params):

sol := solve({Eq1, Tch > 0, qc > 0});

{Tch = -15*qc-15+(10/41)*(3526*qc^2+7462*qc+3936)^(1/2), 0 < qc, qc < 3/5}

(1)

factor(sol);

{Tch = -15*qc-15+(10/41)*82^(1/2)*((43*qc+48)*(qc+1))^(1/2), 0 < qc, qc < 3/5}

(2)

{ Tch = add(map(Student:-Precalculus:-CompleteSquare, [op(rhs(sol[1]))], qc)), sol[2], sol[3] }

{Tch = -15-15*qc+(10/41)*(3526*(qc+91/86)^2-1025/86)^(1/2), 0 < qc, qc < 3/5}

(3)
 

 

Download Tch_vs_qc.mw   (contains a few more informations)

As you did not explicitely says what your problem is I guess it could be the poor explore(ation) due to the fact that your parameters only take integer values, couldn't it?

Explore(
  uvE(e0, e1, e2, e3, u1, u2, u3, v1, v2, v3)
  , parameters=[
      e0 = 1.0 .. 3.0
      , seq(e||i=0.0 .. 9.0, i=1..3)
      , seq([u||i=0.0 .. 9.0], i=1..3)
      , seq([v||i=0.0 .. 9.0], i=1..3)
    ]
    , placement = right
):

Once done it works well with Maple 2015.2

@Alfred_F 

Let A some irrational number and R(A, 𝛆) a rational approximation of A with accuracy 𝛆 ( | A - R(A, 𝛆) | < 𝛆).
Let 𝛈 > 0 a "small" number.
Assumming there exists a number X(𝛆, 𝛈) > 0 such that for each x < X(𝛆, 𝛈)  then ∥ 𝑓(x, A) - 𝑓(x, R(A, 𝛆)) ∥ < 𝛈.

So your question: What is the value of X(𝛆, 𝛈) ?

For the function 𝑓 you give (𝑓(x, A) = cos(A x) +cos(x)) and A=𝛑, the attached file provides estimations of f X(𝛆, 𝛈).

Let us take for instance 𝛈 = 0.0001 as the threshold for visual detection of a discrepancy between the plots of 𝑓(x, A) and 𝑓(x, R(A, 𝛆)).
As𝑓(x, R(A, 𝛆)) is a periodic function this means that you will not be capable to detect visually the non periodicity of 𝑓(x, A)  while  x < X(𝛆, 0.0001).

For this function 𝑓 and A=𝛑, the results in the attached file shows that X(𝛆, 𝛈) is about 0.03 𝛈 / 𝛆 .

Example: X(10-46, 10-4) = 2.1040.

Note: 10-46 is about the accuracy of the 40th rational approximation of 𝛑 in its continued fraction representation.

How_long_do_we_have_to_wait.mw

I've just posted a comment to this ancient Post of yours

But unfortunately just yet another proof that ChatGPT often talks nonsense (I wonder about what it says in Politics, History and so on).

Anyway  I forwarded your post to one of my daughters who teaches math in French high-schools (equivalent to US 11th and 12th grades).
She sent me a mail containing what ChatGPT answered to the question "I don't understand the calculus 5.9-5.11"... and this answer definitely worths a read.

Here it is (in French) but I provide you a litteral translation


ChatGPT acknowledges that is indeed a good question (Bonne question!).
Next line: "Let's see why this seems confusing"  (ChapGPT is about to prove us it was right, I am delighted in advance.)

Step 1 (Etape 1): Write the numbers with the seme number digits right to the comma (hum...)
Next line: To ease the comparison or to substract, one can write 5,90 instead of 5,9 (Yep...)

Step 2 (Etape 2) realize the substraction
                          5,90 - 5,11 = ...  = 0.79 (Good, ChatGPT really is a champion)
Next line: But be careful (Mais attention)

Next line: It's done the wrong way around! (C'est fait dans le mauvais sens)  (what the Hell ChatGPT has in its artificial mind ???)

Let's ChatGPT explains itself
Next line: What you wabt do do is: (Tu veux faire:)

                          5,9 - 5,11 = 5,90 - 5,11  = -0,21 (WT...!!!)
Last line: ChaptGPT ends its explanation saying "Because you substract a larger number (5,11) to a smaller (5, 9)"
(Car tu soustrais...).

I am confused, does ChatGPt thinks 5,11 is larger than 5,9 because the former has decimal digits than the latter?

BTW: I adore this pure mathematical claim "It's done the wrong way around!"

@Alfred_F 

You will find in the attached file several plots which should help you understand why your latler command is a dead end.

To illustrate my purpose I defined the function

f := a -> x -> cos(a*x)+cos(x)

ad looked to what happens when `a` is equal to Pi or to approximations of Pi obtained by continued fractions.

Let Cn the nth approximation of Pi got this way.
The period of f(Cn) increases with `n` and plotting f(Cn) over a perior will show absolutly nothing.

So I have thought plotting f(Cn) over limited ranges R(m) of length 4*Pi defined this way:

R := m -> 4*Pi*(m-1) .. 4*Pi*m

Plots compare f(Cn) to f(Pi) over different ranges corresponding to increasing values of m.

The two last plots show that up to m = 109  (that is x ~ 1.2x1010) there is practically no difference between f(C10) and f(Pi) but that differences appear for m ~ 3x109 .  (For the record |C10 - Pi| is about 10-12.)

What does that mean? That if you want to see differences (I'm not even talking here of periodicity) between f(a) where `a` is an irrational number and some accute rational repentations of `a` you will have to look very far... in fact at the infinity when the rational representations become more and more accute.

So, to your question
At what "closeness" of a(n) to e does it become apparent that for irrational a, i.e., a = e, the function y(x) is not periodic.
I will answer: it never becomes apparent that ...

Indeed, given some irrational number A, we know that f(R(A, e)) is periodic for any rational approximation R(A, e) of A with accuracy `e`.
The plots in the attached file show that you fave to look beyond some threshold T(e) to see differences between f(A) and f(R(A, e)). Can you conclude from this that f(A) is non perioric?
Of course not because f(R(A, e' > e)) is almost indistinguishable from f(A) up to T(e') > T(e): the farther you look your can always use a more accute rational representation of A such that no difference between the plots may be visible.

Empirical observations suggest that f(Pi) and f(R(Pi, e)) are almost indistinguishable up to x ~ 1/e

periodicity.mw

@nm 

Let's do this

# With u(x) = v(x)^2

usys := {(1/2)*diff(u(x), x)=g, u(x__0) = v__0^2}:
usol := dsolve(usys);
vsol := solve(v(x)^2 = rhs(usol), v(x))


vsol makes you think there are two solutions, which is wrong, the first one corresponds to v__0 > 0 and the second one to v__0 < 0.

In the excerpt you give problem 30 has some untold implicit hypotheses (for instance x__0 > 0, v__0 > 0, g > 0, V > V__0, x > x__0).
Let's do this:

sys := {v(x)*diff(v(x),x) = g, v(x__0) = v__0};
SOL := (x0, v0) -> dsolve(eval(sys, {x__0=x0, v__0=v0})):
print():

`<|>`(
  `<,>`([` `, x__0=-1, x__0=+1])
  ,
  Matrix(3, 2, (i, j) -> `if`(i=1, v__0=(-1)^j, SOL((-1)^(i-1), (-1)^j)))
)


The ANSwer of problem 30 is quite restrictive as it does not enable finding those four solutions above (in fact ANSwer provides spurious solutions)

ANSwer := (x__0, v__0) -> v^2-v__0^2 = 2*g*(x-x__0);
`<|>`(
  `<,>`([` `, x__0=-1, x__0=+1])
  ,
  Matrix(3, 2, (i, j) -> `if`(i=1, v__0=(-1)^j, allvalues(isolate(ANSwer((-1)^(i-1), (-1)^j), v))))
)

@acer 

Not yet, but it's a good idea.
The main barrier is that it takes quite a bit of time if you want to do it properly: explanations, references, documentation. Probably the worksheet has to be written differently and 2D mode used to make the stuff attractive.

Nevertheless, I will think about it.

@acer 

That's much better, thanks a lot.

@acer 

indeed works weel with Maple 2015 indeed works well with Maple 2015.
The real definition of Dist was something like

Dist := proc(N::{posint, name}, alpha::{Vector, list})

and thus aimed to work with different alpha types.
So I just have to remove the Vector type and your code will be perfect.
Nevertheless the need to put L between quotes in X2 := RandomVariable(Dist(N, 'L')) is quite

For information: your codes 1 and 2 generate this error in Maple 2015

Error, (in Statistics:-PDF) bad index into Vector

I have 3 questions concerning your last code

  1. The need to put L between quotes in X2 := RandomVariable(Dist(N, 'L')) doesn't feel quite natural or comfortable.
    I assume there is no other way to proceed with Maple 2015, is there?
     
  2. You write value(eval(res2,1)) whereas value(eval(res2)) does the same thing: what is the need to specify the evaluation level here?
     
  3. As this question is related to a post I'm about to deliver, would indeed works weel with Maple 2015 work with, let us say, Maple 2025?

In any case, thank you very much for your contribution.

By the way: in your Maple 2025 codes you write alpha::evaln in the parameter sequence. I had always thought in this sequence N::T refered to to expected type T of name N... but evaln is not a type, so "How can  alpha::evaln be authorized?"

2 3 4 5 6 7 8 Last Page 4 of 32