sand15

957 Reputation

15 Badges

10 years, 300 days

MaplePrimes Activity


These are replies submitted by sand15

@AHSAN 

Reply to your COMMENT.

You wrote "How do we obtain these values? Are these values dummy or generated from my problem? ":
Answer: my data are just illustrative and produced by LinearAlgebra:-RandomMatrix (read carefuly my worksheet)

Remark: You provided several images where bars are placed at the nodes of plane regular grid (the first on is in your initial question). There is no group here: the data can be represented by a numeric matrix and what my procedure F (worksheet Bars.mw) does is nothing by representing graphically this matrix in order that the image is close to the one you provide in your QUESTION and in this COMMENT. Note that you also produce a similar image in THIS COMMENT

But your problem does not correspond to these images because the quantity to plot as bars does not depend on 2 variables but on 3 variables.
In fact you lured me from the beginning by providing images that have no sense here.

As I said above my procedure F is aimed at displaying data of Matrix type.
Yours correspond to a  3d-array (Array(1..4, 1..3, 1..3)) meaning F cannot handle them.

A possibility could be, for instance to apply F to a 2D subarray, for instance Array(1, .., ..).

@AHSAN

Here is a procedure named bars which enables a bargraoh representation of Nu_cube either as

  1. groups of 3 bars in the [M, Br] plane
  2. groups of 3 bars in the [M, We] plane
  3. groups of 4 bars in the [Brn We] plane

Given what I saw in you last file you seem perfectly capable, using optional parameter, to modify the rendering in order to get the image ou desire.

I also solved (at least for the data you use) the 

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

issue.

Bar_view_help_sand15.mw


.

@Suryakanth 

begin uploading yourworksheet using the bid greenarrow in the menubar

@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

1 2 3 4 5 6 7 Last Page 2 of 30