mmcdara

7891 Reputation

22 Badges

9 years, 64 days

MaplePrimes Activity


These are replies submitted by mmcdara

@acer 

Thank you acer !
overrideoption gives me entire satisfaction.

I only discover recently these "commands to alter or examine plot structures" in the plottools package and I'm really bluffed by what can be done graphically. Specially if one uses SurfaceOfRevolution and tubeplot too.

@tomleslie @ogunmiloro


Hi,

Well done.

Nevertheless something's bothering me. A priori I would have expected you to write
testRes:=add( (C__f[i]-rhs(res(times[])[3]))^2, i=1..numelems(times))
instead of 
testRes:=add( (C__f[i]-rhs(res(times[])[3]))^2, i=1..numelems(times))

It's probably a typo ...
... which happily avoids an error for there are only 20 time values for 110 C__f's.
The way the OP set the problem is not well posed. Two possibilities:

  1. time and C__f must have the same length
  2. time is shorter than C__f because "measurements" of C__f are done more than once at a given time (this is what the 10 "1" C--f values might suggest?
     

There remain for the OP a little more work to do to specify correctly what the objective function to minimize is.

 

You might also be interested in the excellent package Student[Calculus1], in particular by the procedure  NewtonsMethod:

 

restart:

with(Student[Calculus1]):

NewtonsMethod(x^2-1, x=2, iterations=5, output=plot);

 

 


 

Download NewtonsMethod.mw

@Carl Love 

Hi Carl, 

I had sent an answer that I just deleted for a simple reason: when I wrote it, the text of the question was not complete (the mention to RK4 did not appear) and your answer was invisible. It was only after I submitted my answer that the full text and your answer appeared. Have you ever noticed a similar phenomenon?

@Carl Love 

Great thanks Carl.
I'm still struggling with the singles or multiple quotes and I appreciate your explanation.

For the last point, it's just that i directly that I did not wrote T:= true or T:=false before EXPLORE(...) and wrote this in a hurry

Hi, 

Doing Monte Carlo (MC) integration in non cartesian coordinates (a thing that evalf(Int) doesn't do) is sometimes necessary.
Nevertheless you can do what you have done in a var more simple way.

In the attached file you will find:

  • some elements about 1D MC integration,
  • a discusison on your problem (whatintegration measure to use?),
  • a simple MC method in polar coordinates
  • information about MC's convergence rate,
  • and a generaldiscussion on faster "MC like" methods


 

restart


Text highlighted in yellow gives you a far more simple way to compute your integral by a Monte Carlo method

with(plots):
with(Statistics):

# 1st example
#
# It is a simple 1D example for the uniform measure seems the natural one

f := x -> exp(x):

N := 15000:
a := 0:
b := 1:

X := Statistics:-Sample(Uniform(a, b), N):
(b-a)*Mean(f~(X));

evalf(Int(f(x), x=0..1));

HFloat(1.7160101843426157)

 

1.718281828

(1)

# 2nd example (yours)
#
# It is a 2D example in (what seems) polar coordinates.
# A more complicated example that the first one wich forst implies defining what is the good probability measure to use.


f := (rho, phi) -> exp(rho*cos(phi));


T3D    := plottools:-transform((x, y, z) -> [x*cos(y), x*sin(y), z]):
cart3D := plot3d(exp(rho*cos(phi)), rho = 0 .. 1, phi = 0 .. 2*Pi, style=surface):

DocumentTools:-Tabulate([cart3D , T3D(cart3D)], width=60)

proc (rho, phi) options operator, arrow; exp(rho*cos(phi)) end proc

(2)

# Do we have to consider this "2D cartesian" cloud of points (left figure) which transforms
# in this "2D polar" cloud (right figure) ?

T := plottools:-transform((x, y) -> [x*cos(y), x*sin(y)]):

N := 1000:
X := Sample(Uniform(0, 1), N):
Y := Sample(Uniform(0, 2*Pi), N):

cart2D  := ScatterPlot(X, Y, labels=[typeset(rho), typeset(phi)]):

DocumentTools:-Tabulate([cart2D , display(T(cart2D), polarplot(1))], width=60)

# Or do we have to construct a "2D polar" cloud with an ad hoc uniformity spreading?
# for instance a distribution of points that preserve the mass (Pi) of the unit disc?


PHI := Sample(Uniform(0, 2*Pi), N):
RHO := sqrt~(Sample(Uniform(0, 1), N)):

X := RHO *~ cos~(PHI):
Y := RHO *~ sin~(PHI):
polar2D := ScatterPlot(X, Y):
display(polar2D, polarplot(1))
 

 

# Now let's integrate the finction f in polar coordinates
#
# Found by Maple's implicit integration method

evalf( Int(exp(rho*cos(phi))*rho, rho = 0 .. 1, phi = 0 .. 2*Pi) );

# Found by Maple with method=_MonteCarlo or Cuba variants, see here evalf/Int
# (cancelled after 30 seconds, but it's likely the result would have been around 5.4 because
# the methode operates on hyperrectangles)

# evalf( Int(exp(rho*cos(phi))*rho, rho = 0 .. 1, phi = 0 .. 2*Pi, method = _CubaDivonne) );

3.550999378

 

Warning,  computation interrupted

 

# 1st 2D measure based form a Bi-Uniform cartesian measure... which is probaly the wrong one

N   := 15000:
X   := Sample(Uniform(0, 1), N):
Y   := Sample(Uniform(0, 2*Pi), N):
RHO := sqrt~(X^~2 + Y^~2):
PHI := arctan~(Y/~X):

area := Pi:

FirstValue := area*Mean(f~(RHO, PHI));

3.550999378

 

HFloat(5.382558597093635)

(3)


Here is the simplest way to do what you did

# 2nd 2D measure based form a a uniform sampling of the unit disc... which is probaly the good one
# (at least the more natural) unless otherwise stated

N   := 15000:
PHI := Sample(Uniform(0, 2*Pi), N):
RHO := sqrt~(Sample(Uniform(0, 1), N)):

area       := Pi:
FirstValue := area*Mean(f~(RHO, PHI));

HFloat(3.5721050983852694)

(4)


Complement 1: "speed of convergence" of Monte Carlo integration

# As you probably know the speed of convergence of a Monte Carlo (MC) method is N^(-1/2).
# More precisely the variance of the error between the MC summation and the exact integration
# behaves as N^(-1).

MC := proc(R, N)
  local E, r, PHI, RHO:
  E := Vector(R):
  for r from 1 to R do
    PHI  := Sample(Uniform(0, 2*Pi), N):
    RHO  := sqrt~(Sample(Uniform(0, 1), N)):
    E[r] := area*Mean(f~(RHO, PHI));
  end do:

  Variance(E);
end proc:

CodeTools:-Usage( MC(1000, 100) );

memory used=46.60MiB, alloc change=0 bytes, cpu time=967.00ms, real time=3.42s, gc time=104.14ms

 

HFloat(0.029688915762705333)

(5)

CodeTools:-Usage( MC(1000, 1000) );

memory used=184.28MiB, alloc change=256.00MiB, cpu time=4.41s, real time=13.44s, gc time=1.99s

 

HFloat(0.003309980507832941)

(6)

CodeTools:-Usage( MC(1000, 10000) );

memory used=1.52GiB, alloc change=32.00MiB, cpu time=29.99s, real time=27.07s, gc time=13.94s

 

HFloat(3.074568948804323e-4)

(7)


Complement 2: faster Monte Carlo like methods

# There exist MC like methods with faster (asymptotic) convergence rate.
# For instance Quasi Monte Carlo (QMC) methods, but they "work" only for integration on hyperrectangles
# (not your case).
# Latin Hypercude Sampling (LHS) methods have a better behaviour than MC methods for they
# produce a more homogenous distribution of samples than the latter.
#
# It has been prooved that the integration error is of the form V(f)*D(X) (Koksma–Hlawka inequality)
# https://en.wikipedia.org/wiki/Low-discrepancy_sequence
# where V(f) is a term (Hardy-Krause's total variation) which depens only on the function f to integrate,
# and D(X) a term (called Discrepancy) that depends only on the summation sample X.
#
# Reducing the error implies reducing this discrepancy.
# QMC, Minimax, Maximin, CVT (Centroïdal Voronoï Tesselation)... and many others, are methods with a
# smaller asymptotic discrepancy (for a same number of points) than crude MC method.
#
# The term asymptotic is extremely important because all these methods, but MC, contain a
# multiplicative coefficient which grows exponentially with the multiplicity of the integral,
# making their theoritical advantage more questionable in high dimensions.


 

Download MONTE_CARLO_INTEGRATION_2.mw

 

@acer 

By the way, Minimize appears to be more versatile than NonlinearFit. For instance it handles constraints and supports bounds on the parameters. Don't you think this could be an improvement for future versions of NonlinearFit ?

@acer  @Viviane

Hi, sleep on it, it's said.

I finally understood how a slight modification of your own model can be used in order to fit the two "branches" in a single shot.
 

restart;

with(Statistics):

X := [-0.012, -0.010, -0.004, -0.002, -0.001, -0.0001, 0.0001, 0.001, 0.002, 0.004, 0.010, 0.012]:
Y := [-0.695, -0.7, -0.74, -0.825, -0.95, -1.0, 1.0, 0.95, 0.825, 0.74, 0.7, 0.695]:

MM := x -> (a+b*ln(c*abs(x)))*signum(x)

proc (x) options operator, arrow; (a+b*ln(c*abs(x)))*signum(x) end proc

(1)

Target := add((Y -~ MM~(X))^~2):
opt_M  := Optimization:-Minimize(Target, {c >= 0});

[0.170692723212774039e-1, [a = HFloat(0.40536200217214313), b = HFloat(-0.07010292040004852), c = HFloat(1.2918838591601691)]]

(2)

MF := unapply(eval(MM(x), opt_M[2]), x)

proc (x) options operator, arrow; (HFloat(0.40536200217214313)-HFloat(0.07010292040004852)*ln(HFloat(1.2918838591601691)*abs(x)))*signum(x) end proc

(3)

plots:-display(
        plot(MF(x), x=min(X)..max(X), thickness=3),
        plots:-pointplot(X,Y,symbol=solidcircle,symbolsize=12,color=blue),
        view=-2..2, size=[500,350]
);

 

 


 

Download finally.mw

 

@Carl Love 

Sure.
The only case where this could be done is the following: you do know the function is "odd", but the points are experimental  points with some measurement errors that make them not "odd".

@acer 

Hi, 

Strange that your Fn and Fp fits do not agree with the antisymmetry of the original data.
Some problem with Fit maybe.

So I did the things differently using Optimization:-Minimize with a hand made objective function (residual sum of squares).
The results are more "antisymmetry preserving" but still different.
I wasn't able to reduce the discrpancy between Fn and Fp (changing Digits, tolerances,.... but I did not used other minimization procedures).

Eventually I set the initial points to values that were supposed to preserve the antisymmetry in order (it was my hope) to force Minimization do search for Fn in some mirror the direction used for Fp.
You will find this ad hoc strategy preserves the antisymmetry  up to the tolerance used.

PS: in the first part of the worksheet I used Viviane's model, yours is in the second part (yellow highlighted comments)
 

restart;

with(Statistics):

X := [-0.012, -0.010, -0.004, -0.002, -0.001, -0.0001, 0.0001, 0.001, 0.002, 0.004, 0.010, 0.012]:
Y := [-0.695, -0.7, -0.74, -0.825, -0.95, -1.0, 1.0, 0.95, 0.825, 0.74, 0.7, 0.695]:

# from acer's reply

Xn,Xp := selectremove(`<=`,X,0):
T := table([seq(X[i]=Y[i],i=1..nops(X))]):
Yp,Yn := [seq(T[x], x=Xp)], [seq(T[x], x=Xn)]:

Mn := convert([Xn, Yn], Matrix)^+:
Mp := convert([Xp, Yp], Matrix)^+:

# Observe the symmetry of the data


Mn, Mp[sort(Mp[..,2], output= permutation)];

Matrix(6, 2, {(1, 1) = -0.12e-1, (1, 2) = -.695, (2, 1) = -0.10e-1, (2, 2) = -.7, (3, 1) = -0.4e-2, (3, 2) = -.74, (4, 1) = -0.2e-2, (4, 2) = -.825, (5, 1) = -0.1e-2, (5, 2) = -.95, (6, 1) = -0.1e-3, (6, 2) = -1.0}), Matrix(6, 2, {(1, 1) = 0.12e-1, (1, 2) = .695, (2, 1) = 0.10e-1, (2, 2) = .7, (3, 1) = 0.4e-2, (3, 2) = .74, (4, 1) = 0.2e-2, (4, 2) = .825, (5, 1) = 0.1e-2, (5, 2) = .95, (6, 1) = 0.1e-3, (6, 2) = 1.0})

(1)

# Viviane's model : y=c+exp(-b*x)


Fp := NonlinearFit(c+exp(-b*x), Mp, x):
Fp := unapply(Fp, x);

proc (x) options operator, arrow; -HFloat(0.06200335508067378)+exp(-HFloat(27.89253436556808)*x) end proc

(2)

# Fn respects the symmetry of the data

Fn := x -> -Fp(-x)

proc (x) options operator, arrow; -Fp(-x) end proc

(3)

# Residual Sum of Squares

RSS_p := add((Yp -~ Fp~(Xp))^~2);
RSS_n := add((Yn -~ Fn~(Xn))^~2);

HFloat(0.019499374850576047)

 

HFloat(0.019499374850576047)

(4)

P := plots:-pointplot(X,Y,symbol=solidcircle,symbolsize=12,color=blue):
plots:-display(
        plot(Fn(x), x=min(Xn)..max(Xn), thickness=3),
        plot(Fp(x), x=min(Xp)..max(Xp), thickness=3),
        P,
        view=-2..2, size=[500,350]
);

 

# Acer's model y = a+b*ln(abs(c*x))

AM := x -> a+b*ln(c*abs(x));

AM_p := x -> a+b*ln(c*x);
AM_n := x -> a+b*ln(-c*x);
 

proc (x) options operator, arrow; a+b*ln(c*abs(x)) end proc

 

proc (x) options operator, arrow; a+b*ln(c*x) end proc

 

proc (x) options operator, arrow; a+b*ln(-c*x) end proc

(5)

Mn[sort(Mn[..,2], output= permutation)], Mp

Matrix(6, 2, {(1, 1) = -0.1e-3, (1, 2) = -1.0, (2, 1) = -0.1e-2, (2, 2) = -.95, (3, 1) = -0.2e-2, (3, 2) = -.825, (4, 1) = -0.4e-2, (4, 2) = -.74, (5, 1) = -0.10e-1, (5, 2) = -.7, (6, 1) = -0.12e-1, (6, 2) = -.695}), Matrix(6, 2, {(1, 1) = 0.1e-3, (1, 2) = 1.0, (2, 1) = 0.1e-2, (2, 2) = .95, (3, 1) = 0.2e-2, (3, 2) = .825, (4, 1) = 0.4e-2, (4, 2) = .74, (5, 1) = 0.10e-1, (5, 2) = .7, (6, 1) = 0.12e-1, (6, 2) = .695})

(6)

tol := optimalitytolerance=1e-10:

Target_p := add((Yp -~ AM_p~(Xp))^~2):
opt_p    := Optimization:-Minimize(Target_p, tol);

Target_n := add((Yn -~ AM_n~(Xn))^~2):
opt_n    := Optimization:-Minimize(Target_n, tol);




Target_p0 := add((Yp -~ AM~(Xp))^~2):
opt_p0    := Optimization:-Minimize(Target_p0, tol);

Target_n0 := add((Yn -~ AM~(Xn))^~2):
opt_n0    := Optimization:-Minimize(Target_n0, tol);

[0.853463620628423618e-2, [a = HFloat(0.39083394260534965), b = HFloat(-0.07010121681473487), c = HFloat(1.0499186134191993)]]

 

[0.853463616064624106e-2, [a = HFloat(-0.381043037459527), b = HFloat(0.07010294137732709), c = HFloat(0.9131999189529437)]]

 

[0.853463620628423618e-2, [a = HFloat(0.39083394260534965), b = HFloat(-0.07010121681473487), c = HFloat(1.0499186134191993)]]

 

[0.853463616064624106e-2, [a = HFloat(-0.381043037459527), b = HFloat(0.07010294137732709), c = HFloat(0.9131999189529437)]]

(7)

# Lack of antisymmetry between opt_n and opt_p (or opt_n0 and opt_p0) come probably from different
# initial points.
# Here are the solutions obtained for initial points that are "antisymmetric")

opt_p  := Optimization:-Minimize(Target_p , tol, initialpoint = {a= 0.4, b=-0.1, c=1});
opt_n  := Optimization:-Minimize(Target_n , tol, initialpoint = {a=-0.4, b= 0.1, c=1});
opt_p0 := Optimization:-Minimize(Target_p0, tol, initialpoint = {a= 0.4, b=-0.1, c=1});
opt_n0 := Optimization:-Minimize(Target_n0, tol, initialpoint = {a=-0.4, b= 0.1, c=1});

[0.853463616064328336e-2, [a = HFloat(0.38799470970932537), b = HFloat(-0.07010293340095336), c = HFloat(1.0083975487110437)]]

 

[0.853463616064327642e-2, [a = HFloat(-0.38799470970932476), b = HFloat(0.07010293340095351), c = HFloat(1.008397548711049)]]

 

[0.853463616064328336e-2, [a = HFloat(0.38799470970932537), b = HFloat(-0.07010293340095336), c = HFloat(1.0083975487110437)]]

 

[0.853463616064327642e-2, [a = HFloat(-0.38799470970932476), b = HFloat(0.07010293340095351), c = HFloat(1.008397548711049)]]

(8)

 


 

Download pwlog_revisited.mw

 

 

100% agree with Rouben and Kitonum.

But if you drop out the term "rational" the function 
f := a*x^2*tanh(x) / (b^2-x^2);
(not a rational one!)
has horizontal asymptotes y=+/-a and vertical asymptotes x=+/-b

Maybe you where looking for something like that ?

 

 

@Carl Love @JAMET

   Hey, Carl, in case you have enough patience i did some basic formatting.
But mistakes do appear quickly (a procedure of name "EQ" is missing) So, JAMET, I think you should start by correcting this.

PS JAMET: I added some "plots:-" here and there but you would be better loading the "plots" package fot your "implicitplot" commands to work

restart

a := 5:
b := 7:
k := 9:
A := [a, 0]:
B := [0, b]:

#A et B fixes

P := [t, 0]:
Q := [0, k/t]:

#P et Q 2 points mobiles

cir := -a*x-b*y+x^2+y^2 = 0;
sol := solve(subs(y = 5, cir), x);
cen := [solve(diff(cir, x)), solve(diff(cir, y))];
x0  := sol[1]:
y0  := 5:
M   := [x0, y0]:
R   := sqrt(cen[1]^2+cen[2]^2);


EQ(M, cen); #... EQ is undefined...

#... thus solve returns nothing

solve(EQ(M, cen), y)

x^2+y^2-5*x-7*y = 0

 

5/2+(1/2)*65^(1/2), 5/2-(1/2)*65^(1/2)

 

[5/2, 7/2]

 

(1/2)*74^(1/2)

 

EQ([5/2+(1/2)*65^(1/2), 5], [5/2, 7/2])

(1)

beta := arctan(diff(solve(EQ(M, cen), y), x)); #... and diff(nothing, x) generates an error

Error, invalid input: diff expects 2 or more arguments, but received 1

 

# Recherche des valeurs de t pour que les 2 droites soient perpendiculaires

eq := t^2*(y0-b)+t*(a*b-a*y0+b*x0-k)-x0*(a*b-k) = 0;
sol := solve(eq, t);
t := sol[1];
tp := sol[2];
P1 := [t, 0];
Q1 := [0, k/t];
PQ1 := simplify(x*(-a*b+b*t+k)+y*t*(t-a)-t*(-a*b+b*t+k)) = 0:

#1ere tangente

PQ2 := simplify(x*(-a*b+b*tp+k)+y*tp*(tp-a)-tp*(-a*b+b*tp+k)) = 0:

#2ième tangente P2 := [tp, 0]; Q2 := [0, k/tp];

CIR := implicitplot(cir, x = -4 .. 8, y = -4 .. 12, color = red);
 

x^2+y^2-5*x-7*y = 0

 

5/2+(1/2)*65^(1/2), 5/2-(1/2)*65^(1/2)

 

[5/2, 7/2]

 

(1/2)*74^(1/2)

 

Error, invalid input: diff expects 2 or more arguments, but received 1

 

-2*(5/2+(1/2)*65^(1/2))^2+(5/2+(1/2)*65^(1/2))*(37/2+(7/2)*65^(1/2))-65-13*65^(1/2) = 0

 

Warning, solving for expressions other than names or functions is not recommended.

 

Error, (in solve) a constant is invalid as a variable, 5/2+(1/2)*65^(1/2)

 

Error, invalid subscript selector

 

Error, invalid subscript selector

 

[5/2+(1/2)*65^(1/2), 0]

 

[0, 9/(5/2+(1/2)*65^(1/2))]

 

implicitplot(x^2+y^2-5*x-7*y = 0, x = -4 .. 8, y = -4 .. 12, color = red)

(2)

Fig := proc (alpha)
  local Dr1, DR1, Dr2, DR2, N, u0, v0, Po, t, tp, sol;
  global a, b, k, cen, R;
  u0  := cen[1]+R*cos(alpha);
  v0  := cen[2]+R*sin(alpha);
  N   := [u0, v0];
  sol := solve(t^2*(v0-b)+t*(b*u0-a*v0+a*b-k)-u0*(a*b-k) = 0, t);
  t   := sol[1];
  tp  := sol[2];
  Dr1 := simplify(x*(-a*b+b*t+k)+y*t*(t-a)-t*(-a*b+b*t+k)) = 0;
  DR1 := implicitplot(Dr1, x = -4 .. 8, y = -4 .. 12, color = brown);
  Dr2 := simplify(x*(-a*b+b*tp+k)+y*tp*(tp-a)-tp*(-a*b+b*tp+k)) = 0;
  DR2 := implicitplot(Dr2, x = -4 .. 8, y = -4 .. 12, color = pink);
  Po  := pointplot([N[]], symbol = solidcircle, color = [black], symbolsize = 8);
  plots:-display([Po, DR1, DR2])
end proc;
 

DrPQ1 := implicitplot(PQ1, x = -4 .. 22, y = -4 .. 12, color = blue);
DrPQ2 := implicitplot(PQ2, x = -4 .. 22, y = -4 .. 12, color = blue);
Points := pointplot([A[], B[], M[], P1[], P2[], Q1[], Q2[], cen[]], symbol = solidcircle, color = [green], symbolsize = 10);
T := plots:-textplot(
          [[A[], "A"], [B[], "B"], [M[], "M"], [P1[], "P1"], [P2[], "P2"], [Q1[], "Q1"], [Q2[], "Q2"], [cen[], "cen"]],
          font = [times, 10], align = {below, left}
     );
n := 19;

plots:-display([seq(Fig(2*i*Pi/n), i = 0 .. n), Fig(beta), CIR, DrPQ1, DrPQ2, Points, T], scaling = constrained, size = [500, 500])

Error, invalid input: diff expects 2 or more arguments, but received 1

 

-2*t^2+t*(37/2+(7/2)*65^(1/2))-65-13*65^(1/2) = 0

 

(7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2), (7/8)*65^(1/2)+37/8+(1/8)*(2474+102*65^(1/2))^(1/2)

 

(7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2)

 

(7/8)*65^(1/2)+37/8+(1/8)*(2474+102*65^(1/2))^(1/2)

 

[(7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2), 0]

 

[0, 9/((7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2))]

 

implicitplot(x^2+y^2-5*x-7*y = 0, x = -4 .. 8, y = -4 .. 12, color = red)

 

proc (alpha) local Dr1, DR1, Dr2, DR2, N, u0, v0, Po, t, tp, sol; global a, b, k, cen, R; u0 := cen[1]+R*cos(alpha); v0 := cen[2]+R*sin(alpha); N := [u0, v0]; sol := solve(t^2*(v0-b)+t*(b*u0-a*v0+a*b-k)-u0*(a*b-k) = 0, t); t := sol[1]; tp := sol[2]; Dr1 := simplify(x*(-a*b+b*t+k)+y*t*(t-a)-t*(-a*b+b*t+k)) = 0; DR1 := implicitplot(Dr1, x = -4 .. 8, y = -4 .. 12, color = brown); Dr2 := simplify(x*(-a*b+b*tp+k)+y*tp*(tp-a)-tp*(-a*b+b*tp+k)) = 0; DR2 := implicitplot(Dr2, x = -4 .. 8, y = -4 .. 12, color = pink); Po := pointplot([N[]], symbol = solidcircle, color = [black], symbolsize = 8); plots:-display([Po, DR1, DR2]) end proc

 

implicitplot((51/8)*x+(49/8)*x*65^(1/2)-(7/8)*x*(2474+102*65^(1/2))^(1/2)+(1387/16)*y+(85/16)*y*65^(1/2)-(7/32)*y*65^(1/2)*(2474+102*65^(1/2))^(1/2)-(17/32)*y*(2474+102*65^(1/2))^(1/2)-(721/16)*65^(1/2)-10375/16+(49/32)*65^(1/2)*(2474+102*65^(1/2))^(1/2)+(155/32)*(2474+102*65^(1/2))^(1/2) = 0, x = -4 .. 22, y = -4 .. 12, color = blue)

 

implicitplot((51/8)*x+(49/8)*x*65^(1/2)+(7/8)*x*(2474+102*65^(1/2))^(1/2)+(1387/16)*y+(85/16)*y*65^(1/2)+(7/32)*y*65^(1/2)*(2474+102*65^(1/2))^(1/2)+(17/32)*y*(2474+102*65^(1/2))^(1/2)-(721/16)*65^(1/2)-10375/16-(49/32)*65^(1/2)*(2474+102*65^(1/2))^(1/2)-(155/32)*(2474+102*65^(1/2))^(1/2) = 0, x = -4 .. 22, y = -4 .. 12, color = blue)

 

pointplot([5, 0, 0, 7, 5/2+(1/2)*65^(1/2), 5, (7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2), 0, P2[], 0, 9/((7/8)*65^(1/2)+37/8-(1/8)*(2474+102*65^(1/2))^(1/2)), Q2[], 5/2, 7/2], symbol = solidcircle, color = [green], symbolsize = 10)

 

Error, (in plots:-textplot) improper op or subscript selector

 

19

 

Error, (in plots:-display) cannot make plot structure from object with name pointplot

 

 


 

Download formatting.mw

Very pretty!
Perhaps state borders could improve readability in the early stages ?

could you give some hints about the way you proceeded. For instance how did you get the coordinates of the center of the circles? 
Or the Maple's version you used?

 

@acer 

Sorry for the late.

Thank you acer, but this is not exactly what I wanted. I certainly didn't explain myself quit well, but tomleslie's solution suits me perfectly.

Thanks again

@tomleslie 

Sorry for the late.

Thanks, this is exactly what I wanted. 

First 106 107 108 109 110 111 112 Last Page 108 of 154