sand15

1137 Reputation

15 Badges

10 years, 331 days

MaplePrimes Activity


These are replies submitted by sand15

@AHSAN 

If it is a matter of values: compare the data matrix in my worksheet with yours, maybe the initial random seed different.

If it is a matter of display: click on the image, enlarge it, use the '+' button on the plot menu bar (sorry I use Maple 2015 and things might be different with your version) to zoom in.

@dharr 

(at least for your example, but I'm sure you were already aware of that, see pursuit3_from_Dharr.mw)

One question is "Does it exist starting points such that the Wolf can eat the Goat?"

Another one is, "How would an AI answer this problem "Let a Goat moving at constant speed along the unit circle and a Wolf located ourside the unit disk. What strategy should the Wolf, moving at the same speed than the Goat, adopt to catch the Goat?"

I guess an AI knowing about this problem could propose the "chase in the direction od the goat" strategy...
But this not a correct one because the Wolf will never (I'm pretty sure about that) catch the Goat.
Does a RIAI (Really intelligent AI) will propose a strategy like the one I evoke at the end of the attached file? (Not that I am Really Intelligent but I use to observe my cants and their potential preys).

A funny thing is that if the Wolf is slower than the Goat it will end eating the Goat (in fact I believe that the Goat will hurt its back).

@AHSAN 

Don't you think ot would be better to fix the convergence error before trying to plot someyhong:

      catch:
        printf(
          "(%d, %d, %d) M = %1.2f, Br = %1.2f, We = %1.2f\: %a\n", 
           i, j, k, MVals[i], BrVals[j], WeVals[k], lasterror()
        );
        Nu_cube[i,j,k] := Float(undefined);
      end try;
    end do;
  end do;
end do:
(1, 1, 2) M = 0.50, Br = 0.10, We = 0.50: "initial Newton iteration is not converging"()
(1, 1, 3) M = 0.50, Br = 0.10, We = 0.90: "initial Newton iteration is not converging"()
(2, 1, 2) M = 1.50, Br = 0.10, We = 0.50: "initial Newton iteration is not converging"()
(2, 1, 3) M = 1.50, Br = 0.10, We = 0.90: "initial Newton iteration is not converging"()
(3, 1, 2) M = 2.50, Br = 0.10, We = 0.50: "initial Newton iteration is not converging"()
(3, 1, 3) M = 2.50, Br = 0.10, We = 0.90: "initial Newton iteration is not converging"()
(4, 1, 2) M = 3.50, Br = 0.10, We = 0.50: "initial Newton iteration is not converging"()
(4, 1, 3) M = 3.50, Br = 0.10, We = 0.90: "initial Newton iteration is not converging"()

If you don't know how to fix these errors do this

pars := [M = MVals[1], Br = BrVals[1], We = WeVals[2], op(paramSet)]:
        dsol := dsolve(eval(sys, pars), numeric,
                       method=bvp[midrich], maxmesh=256, initmesh=64, abserr=1e-4);
Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

You will find explications and cures in the help pages or HERE.

You can also write 'converging' in the MaplePrimes search engine and find answers members gave on similar problems:
  (click in 'Search')

@AHSAN 

You provided an image and asked for a Maple code to produce something similar.
So I tried to help you and spent a lot of time writing and tunning the (relatively generic) procedure included in file Bars.mw.

And for what?
Just to find out that you haven't even used it and are asking for something completely different.
I find this very disrespectful, so do it out yourself!

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

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