sand15

1668 Reputation

16 Badges

11 years, 348 days

MaplePrimes Activity


These are replies submitted by sand15

@Alfred_F 

y=-1 then x=9^(1/3) is not rational

What does "there exist solutions (x;y)" mean? That there are ALWAYS rational solutions, whatever the values of B and D, for both equations?

A counter example:

B=2, D=1.
Then eq2 writes x^3 - y^3 = 7 and those are solutions: y = any value, x = (7+y^3)^(1/3).
Take y=1, then x=8^(1/3) is not rational.

Could you please clarify the question?

@dharr 

I'm like you, I generally prefer writting 'assumptions := ....:' and after 'something assuming assumptions:'.
Also, I never use 'assume' within a procedure... but this more because I'm not sure of what is done than because I know it's not the right thing to do.

@dharr

I had spent quite a bit of time trying to come up with a satisfying answer to @benlisp. In vain.
Here is where my thinking stood; perhaps you'll find it of some interest.
explanation_1.mw

@dharr 

We must write simplify(q-expand(q5)) to get 0... which is not very natural

@dharr 

A trick I often use would write here

q4 := convert(qrad, radical):
q5 := q3 + ``(q4)


Maybe @cm.ayache  could accept these parentheses?

@janhardo 

Sure, you can ask an AI to give you the answer, but don't you think that taking the time to figure out the solution on your own provides greater intellectual satisfaction?

For instance there are algorithms capable of solving any Sudoku puzzle: in my opinion, using them instead of racking your brain to find the solution is the same as using AI... unless the first motivation is to be the first in solving the grid

@C_R @Carl Love

Using plottools:-transform avoids searching optiùims along x and y directions:

> 

restart

> 

f := (x, y) -> exp(-x^2-y^2) + exp(-(x-1)^2-(y-1)^2)

proc (x, y) options operator, arrow; exp(-x^2-y^2)+exp(-(x-1)^2-(y-1)^2) end proc

(1)
> 

d := 2:
U := d + 0.25:  
L := -U:

MM := Optimization:-NLPSolve(f(x, y), x=-d..d, y=-d..d, maximize)[1];

Zs:= [seq](0..MM, MM/5):
Xs:= [$-2..2]:

GridLines:= plots:-display(
  CURVES(
    #horizontal gridlines:
    seq([[L, U, z],[U, U, z],[U, L, z]], z=Zs),
    #vertical gridlines:
    seq([[[x, U, 0],[x, U, MM]], [[U, x, 0],[U, x, MM]]][], x=Xs)
  )
  , color="LightGray", thickness= 1
):

1.21306131942526685

(2)
> 

p  := plot3d(f(x, y), (x,y)=~L..U, shading= zhue):

# An optimization-free construction of the upper boundary of the projection onto plane x=U

p0 := plot3d(f(x, y), (x,y)=~L..U, color="LightGray", style=surface):

x0 := plottools:-transform((x, y, z) -> [U, y, z])(p0):

x1 := op([1, 1], x0):
x2 := convert(map(i -> subsop(1=NULL, i), x1[1]), Matrix):
x2 := `<|>`( x2, seq( convert(map(i -> subsop(1=NULL, 2=NULL, i), x1[j]), Matrix), j=2..nops(x1)) ):
x3 := `<|>`( x2[..,1], < seq(max(x2[i, 2..nops(x1)+1]), i=1..nops(x1)) > ):
x4 := `<|>`( Vector(nops(x1), U), x3):

# An optimization-free construction of the upper boundary of the projection onto plane y=U

y0 := plottools:-transform((x, y, z) -> [x, U, z])(p0):

y1 := op([1, 1], y0):
y2 := convert(map(i -> subsop(1=NULL, i), x1[1]), Matrix):
y2 := `<|>`( y2, seq( convert(map(i -> subsop(1=NULL, 2=NULL, i), x1[j]), Matrix), j=2..nops(x1)) ):
y3 := `<|>`( y2[..,1], < seq(max(x2[i, 2..nops(x1)+1]), i=1..nops(x1)) > ):
y4 := `<|>`( x3[.., 1], Vector(nops(y1), U), x3[.., 2]):

# Result

plots:-display(
  p
  , GridLines
  , PLOT3D(CURVES(convert(x4, listlist), COLOR(RGB, 1, 0, 0)))
  , PLOT3D(CURVES(convert(y4, listlist), COLOR(RGB, 0, 0, 1)))
  , axes=frame
  , scaling= constrained
  , orientation= [-154, 49, 0]
  , tickmarks= [Xs$2, Zs]
  , labelfont= [HELVETICA, BOLD, 12], axesfont= [HELVETICA, BOLD, 8]
)


Download evolution_2.mw

@Carl Love 

Hi, 
The problem is that the figure the OP provides have two different interpretations.

  1. One is: draw f(x, y), f(0, x) and f(x, 0) (what you both you and @C_R  did)
  2. Another one is: draw f(x, y), the envelope of its projection onto the plane x=2, and the envelope of its projection onto the plane y=-2.

Here is a (likely non optimal) code to answer the second interpretation

Download evolution.mw

Comments are here with Maple 2015 but carriage returns are lost (easy reshaping when you have only 4 lines):

copy_comments_Maple_2015.mw

By the way, I added a comment after yours in this question

@Alfred_F 

Hi,
In the second part of the file the K := combinat:-randperm(J) line serves only to sweep the three indeterminates x, y, z in a random order. This to "demonstrate" that this order does not change the result.
With only three indeterminates I could have test all six permutations writting instead

for K in combinat:-permute([x, y, z]) do
  for j in K do
    ....
  end do:
  K, answer = eval(add(A||j*(j-B||j)^C||j, j in K) + R||(K[-1]), `union`(seq(p||j, j in K)))
end do:

The "||" concatenation helps building atomic variables. 
For instance, if j=1 p||j construts the variable p1. So, p||j := 1 is similar to p1 := 1.
You cannot write cat(p, 1) := 1.

If you are puzzled by the "||"notation you can use p[j] instead.

Here is the code under procedure form:  Procedure_form.mw
(you can replace all occurrences of "||j" by "[j]")

@C_R 

In case you are interested here is the Mapleprimes scraper that ChatGPT buit to gather data (question id, author, answerers, date, ...).
What I asked for was to collect those data to buid relevent satistics that could help measure the activity on Mapleprimes.
This scrapper is aimed to produce csv files containing raw data but things are not going as expected (I didn't ask ChatGPT  to proviide a corected scraper).

mapleprimes_scraper.zip

Content :
    •    mapleprimes_scraper.py — Python code
    •    README.md

After unziping,  launch it this way

Windows
cd mapleprimes_scraper
python -m venv .venv
.venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install requests beautifulsoup4

macOS / Linux
cd mapleprimes_scraper
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install requests beautifulsoup4


The scraper generates this structure

data/raw/
├── questions.csv
├── events.csv
├── users.csv
├── errors.csv
├── cache/
└── pages/


events.csv contents detected event:
    question
    answer
    reply
    and more specificaly
          date
          user
          type
          question_id
          title
          text
          url

users.csv is automaticaly constructed from these data  (40 to 60 minutes on my Mac)


The content of the csv files I got wasn't satisfactory and I put this question under the elbow.
If you want to go further once having launched the scraper, please let me know.
ChatGPT wasn't one hundred percent sure of what I would get and asked me to follow the thread (tell me if you want its reference).

Good luck
 

@Rouben Rostamian  

I didn't catch that, thanks for the remark.

BTW, I cannot find a way to solve this problem.
Maybe one should (the OP should in fact) discard some terms (for instance based on characterist values of eta) and try to solve this simplified system to get a "first order" solution, kind of.
This is what I vould try if I had some knowledge about the underlying physics of the problem.

My advice: If you’re not familiar with the Document + 2D input stuff, do it the old way and use the Worksheet + 1D input mode.

I just copied/pasted a term from your document into a worksheet with 1D input, look to what I got

# Observe the '.' symbol
a := (1+1/beta) . (diff(f(eta), eta, eta, eta))
          /     1  \   /  d   /  d   /  d         \\\
          |1 + ----| . |----- |----- |----- f(eta)|||
          \    beta/   \ deta \ deta \ deta       ///
whattype(a)
                            function

# Here a correct expression
a := (1+1/beta) * (diff(f(eta), eta, eta, eta))
           /     1  \ /  d   /  d   /  d         \\\
           |1 + ----| |----- |----- |----- f(eta)|||
           \    beta/ \ deta \ deta \ deta       ///
whattype(a)
                               *

So inputs are always more explicit and clearer in worksheet + 1D input mode.

Once written properly dsolve returns this error

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

A quite common one whose explanation and possible cures can be found typing help(dsolve,numeric_bvp,advanced).
But don’t be too optimistic: solving this problem can be a daunting task, at least for someone who doesn't know about the physics of the problem to solve. 
What I mean is that once you’ve been given a few tips (the ‘continue’ method described in the help pages), you’re probably best placed to work out which equation is causing the error. Generally dimensional analysis or characteristic ‘times’ (eta) can help to determine to which equation the continuation method should be applied.
However, this method will not necessarily correct the error.

Here is your corrected file (worksheet + 1D mode).

The continuation method is applied without success to the first ode. A leverage to act upon is the value of the 'penalizations' 1/10 : try to reduce it.
But maybe it wasn't the good ode to continue, so try another one 'continue' several odes.

Be careful in selecting the ode to 'continue': as the first one can be reasonably considered as an equation whose unknown if f(eta) because it only contains derivatives of f(eta), the 2nd and  3rd one cannot be considerer as ode wrt phi(eta) or theta(eta) because both of thems contain similar differation orders in both f, phi and theta.

I feel that a  first task could be to write the subsystem made of odes 2 and 3 in a more convenient form.
Which one: I don't know. So please don’t regard the attached file as a definitive answer, but rather as a first step – I don’t even know how to take it any further.

first_step.mw

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