mmcdara

7891 Reputation

22 Badges

9 years, 62 days

MaplePrimes Activity


These are replies submitted by mmcdara

@acer 

So do I have to consider these questions as a kind of "Maple challenge" ?
For if @yangtheary is only concerned by this I'm not going to keep losing my time explaining how a solution can be found by hand.

@Kitonum 

Even if I prefer to get the result by reasoning, I am interested in the Maple solutions you propose.
BTW mmcdara and sand15 are one and the same person.

Do you think that the OP will keep asking us to do his homework?


Have you plot M?
 



M.mw

# critical points

solve([diff(M, A)=0, diff(M, B)=0]):
C := map(op, [allvalues([%])]):
print~(C):
                     /    1           1   \ 
                    { A = - Pi, B = - - Pi }
                     \    3           3   / 
                     /      1         1   \ 
                    { A = - - Pi, B = - Pi }
                     \      3         3   / 
                        {A = Pi, B = 0}
                         {A = 0, B = 0}
                      /    5         1   \ 
                     { A = - Pi, B = - Pi }
                      \    3         3   / 
                    /      5           1   \ 
                   { A = - - Pi, B = - - Pi }
                    \      3           3   / 
                        {A = Pi, B = 0}
                         {A = 0, B = 0}

# Admissible critical points
# *** I use A > B instead of A >= B for a maximum exists at
#     A = B = Pi/2 but this gives a degenerated triangle (C=0)

cond := `and`(B > 0, A > B, A <= Pi/2):
AC   := map(c -> if is(eval(cond, c)) then c end if, C);
                                         
                               []

 

@Jalale 

I don't have a crystal ball, so again, can you upload the worksheet which doesn't work ?

I don't have Maple 2022 right now but I suspect that the structure of RiemannSum could have evolved from my version to yours.
In order to check that, execute this file Run_Me.mw and download it in order I can see what "p" is made of.

@Axel Vogt 

Goog point Axel

@Jalale 

What is the worksheet which generates the error?
I use Maple 2015, what is the version you use ?
Can you download the suspicious worksheet ?

Sorry, I've just realized I didn't download the worksheet corresponding to the last image
Here it is Composition_Of_Ideas.mw
Please test it and tell me if it runs correctly.

If you want only rotating prisms replace the procedure T by

T := proc(theta)
  display(
    plottools:-rotate(P1, theta, 0, 0)
  )
end proc:

If you want only the growing blue sectors, use this one

T := proc(theta)
  display(
    sect(theta)
  )
end proc:

@Jalale

Rotating disks (too large an image, can't be loaded).
Here I create a set of plottools:-extrude(d) plottools:-sector whose angle is the plots:-animate parameter.

Here is a screen capture for an arbitrary value of theta.
Run the code to see the full animation.

Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/image.mw .
 

Another_Idea.mw

This idea and the previous one combined

@Ahmed111 

Unless complex programming it's IMPOSSIBLE to obtain the type of figure you want for any function y1 and any "altitudes".
You will always have to do things by hand.

Here is an example

 

restart;

with(plots):

y1:=-1*v^2+1/4*v^4;
plot(y1, v=-4..4)

-v^2+(1/4)*v^4

 

 

hx, hy := 0.05, 0.05:

mima := [min, max]([solve(diff(y1, v))]);

pg := plot([[mima[2], eval(y1, v=mima[2])]], style=point, symbol=solidcircle, symbolsize=20, color=blue),
      textplot([mima[2], eval(y1, v=mima[2])-hy, "G"], align={'below'})
      :

[-2^(1/2), 2^(1/2)]

(1)

X := 2.5:
p := plot(
  y1,
  v = -X .. X,
  #tickmarks=[0,0],
  color="Niagara Blue",
  labels= ["x", ""],
  labelfont = [TIMES, ITALIC, 16],
  size=[600,600],
  scaling=unconstrained,
  view=[default, eval(y1, v=mima[1])*1.1..eval(y1, v=X)*1.1]
):

Error, (in plot) unexpected option: size = [600, 600]

 

sort(evalf(remove(has, [solve(y1=Y)], I)))

[{Y = -1.*v^2+.2500000000*v^4, v = v}]

(2)

# I'm not sure, unless complex programming, that it is possible to obtain the desired
# figure WITHOUT doing a few things "by hand".
#
# For Y=-1, first look what the zeros of y1=-1 are, next adjust the command consequently
Y := -1:
solve(y1=Y);
# remove imaginary solutions
remove(has, [solve(y1=Y)], I);
# sort them in ascending order
sort(evalf(remove(has, [solve(y1=Y)], I)));

# This will work, but the points E and F are confounded and located at the
# left minimum.
# So it would be stupid do draw  blach E-F line.

2^(1/2), -2^(1/2), 2^(1/2), -2^(1/2)

 

[2^(1/2), -2^(1/2), 2^(1/2), -2^(1/2)]

 

[-1.414213562, -1.414213562, 1.414213562, 1.414213562]

(3)

# What I propose is to change Y=-1 into Y=-0.8
Y := -0.8:
EF := sort(evalf([{solve(y1=Y)}[]]))[3..4], ["E", "F"];
pef  := seq(
          textplot([EF[1][n]+hx*(2*n-3), Y, EF[2][n]], align={'above', `if`(n=1, 'left', 'right')}),
          n=1..2
        ),
        seq(
          plot([[EF[1][n], Y]], style=point, symbol=solidcircle, symbolsize=20, color=black),
          n=1..2
        ),
        plot([[EF[1][1], Y], [EF[1][2], Y]], thickness=2, color=black),
        textplot([(EF[1][1]+EF[1][2])/2, Y, typeset(w = Y)], align={'above'})
        :

[1.051462224, 1.701301617], ["E", "F"]

(4)

Y    := 0:
CMD  := sort(evalf([{solve(y1=Y)}[]])), ["C", "M", "D"];
pcmd := seq(
          textplot([CMD[1][n]+hx*`if`(n=1, -1, +1), Y, CMD[2][n]], align={'above', `if`(n=1, 'left', 'right')}),
          n=1..3
        ),
        seq(
          plot([[CMD[1][n], Y]], style=point, symbol=solidcircle, symbolsize=20, color=red),
          n=1..3
        ),
        plot([[CMD[1][1], Y], [CMD[1][3], Y]], thickness=2, color=red),
        textplot([(EF[1][1]+EF[1][2])/2, Y, typeset(w = Y)], align={'above'})
        :

[-2., 0., 2.], ["C", "M", "D"]

(5)

Y   := +1:
AB  := select(is, sort(evalf([{solve(y1=Y)}[]])), real), ["A", "B"];
pab :=  seq(
          textplot([AB[1][n]+hx*`if`(n=1, +1, -1), Y, AB[2][n]], align={'above', `if`(n=1, 'right', 'left')}),
          n=1..2
        ),
        seq(
          plot([[AB[1][n], Y]], style=point, symbol=solidcircle, symbolsize=20, color=green),
          n=1..2
        ),
        plot([[AB[1][1], Y], [AB[1][2], Y]], thickness=2, color=green),
        textplot([(EF[1][1]+EF[1][2])/2, Y, typeset(w = Y)], align={'above'})
        :
L:=18:
display(pg, pab, pef, pcmd, p, gridlines=false,size=[400,400],labels= ["x", cat("V(x)", `\n`$L)]);

[-2.197368227, 2.197368227], ["A", "B"]

 

 
 

 

Download pot_mmcdara2.mw


Observe the poor rendering close to the right miminum.
Try to understand my worksheet and adjust hx, hy, the font size, ..., consequently to improve the rendering.
An idea here pot_mmcdara3.mw

 

 

``

 

@zenterix 

I do not judge the "interest" of a question for 'interest" is often a personal value.



For what I understand dataplot seems more suited (?)

L := [$1..5]:
dataplot(L)

 

@MapleUser2017 

Is this clearer?

restart
with(Statistics):
A := Sample(Uniform(0, 1), 10^4):
Quantile(A, 0.025)..Quantile(A, 0.975)
  0.02624771184983057 .. 0.9722123504625361

A := Sample(Normal(0, 1), 10^4):
Quantile(A, 0.025)..Quantile(A, 0.975)
   -1.927126937133716 .. 1.915581041610854


Quantile works for any collection of numbers:

A := [ seq(ithprime(i), i=1..10^4) ]:
Quantile(A, 0.025)..Quantile(A, 0.975)
    1587.7833333333338 .. 101835.63333333333

Look for the Quantile(s)' help page to see the different way to assess them

@AHSAN 

It's not very pleasant to see one's answer thrown away by the recipient.
I think there are ways to proceed that are more polite and respectful of others.

A typo maybe ?
Did you mean to write pdsolve or dsolve ?

When you say "I'd like to run psolve multiple time...", what do you mean ?
In the case psolve=dsolve, let t the independent variable, U(t) the vector of dependent variables and L some differential operator.
Let L(U(t))=0 the differential system to solve (equiped with ad hoc  ICs or Bcs).
If you want to solve L(U(t))=0 many times, Is suspect that L depends on a set P of parameters? So "run [dsolve] multiple time could mean "solve L(U(t))=0 for different instances of P": is it this that you want?

You need to clarify your answer if you expect someone without a crystal ball to give you a useful answer :-)

@Rouben Rostamian  

Thanks Rouben.

@Rouben Rostamian  

Great Rouben ! 
This is indeed the correct way to tackle the problem.

By the way, such a function  φ(x,y)  is named "relèvement" in french and I never saw what the English term for it was

First 62 63 64 65 66 67 68 Last Page 64 of 154