mmcdara

7886 Reputation

22 Badges

9 years, 46 days

MaplePrimes Activity


These are replies submitted by mmcdara

@acer 

I modified your Tab3 by replacing the fixed values of the weights in Column(weight=...)) by someting like Column(weight=`if`(icond, weight1, weight2)) and proceed this way for the width of the image.
The final result is fine with me:





I'll test all the material tomorrow with real objects.
In case Tab3 do not work at first, I think I will be able to take inspiration from it and possibly modify it in an appropriate way.
I'll give you the results as soon as possible.

Thanks again

@Carl Love 

I didn't found. 
I was looking for a greek font (by the way, I always work with the old fashioned "worksheet mode" style, not the "document style") and some kind of LaTeX \uparrow.

The only thing I found in the help pages when typing "ascii" was a new Maple 2018 feature in ImageTools.

I'll do some research with the entry "unicode" when back to the office.

Thanks for the tip

@Carl Love 

Yes, it's on the help pages, but maybe not in the correct one: dsolve, numeric, interactive
I don't remember how I put my finger on it.

And yes, "it must be accessed after calling sol(t) for numeric t.", just like eventstop for instance, wich requires calling sol(t) for a value of t larger than the expected stopping time.
 

@acer 

Thank you acer.

Right now, I only have Maple 2015 and I can't test Tab2.mw (I'll do this tomorrow from office).


I already used more or less what you do in Tab1 but it didn't suit me.

In fact, and I realize I should have been more precise, the objects I want to display in a single shot are: 

  • a matrix (of type Statistics:-GridPlot but adapted to my own purpose) 
  • and a Graph (not the one GraphTheory:-Draw could produce, but this same graph after some modification based on ImageTools to display non ascii characters).

While the first object is displayed with DocumentTools:-Tabulate, the second is displayed with ImageTools:-Embed.

I propose to send you an example when I get back to the office and after having tested Tab2 with Maple 2018.

Thanks for your answer,  I'll keep in touch

@Preben Alsholm 

Thank you Preben for the explanation.

If it's not too much to ask (maybe this could be a question set in another thread?) could you take a look at the piece of code below. In this one, hypotheses on a variable "d", which should not a priori affect the definitions of circles A and B, actually cause the circle procedure (A,[P, R]) to crash.
Is this behaviour related in any way to what you have written?

Thanks in advance
 

restart:

interface(rtablesize=10):

with(RealDomain):
with(geometry):

_EnvHorizontalName := x: _EnvVerticalName := y:

assume(r > 0);
assume(R > 0);

additionally(R >= r);

assume(x__Q > 0):

point(P,0,0);
circle(A,[P, R]);

P

 

A

(1)

assume(x__Q > 0):

point(Q, x__Q, d+r);
circle(B,[Q, r]);

Q

 

B

(2)

assume(d > -R-2*r):  # conditions on d are used to help IsOnCircle to return a result
additionally(d < R):

point(M, x__M, y__M);

M

(3)

# condition for M on A

IsOnCircle(M, A, 'cond__A'):
cond__A

IsOnCircle: hint: unable to determine if -R^2+x__M^2+y__M^2 is zero

 

-R^2+x__M^2+y__M^2 = 0

(4)

# condition for M on B

IsOnCircle(M, B, 'cond__B'):
cond__B

IsOnCircle: hint: unable to determine if x__M^2+y__M^2-2*x__Q*x__M+(-2*d-2*r)*y__M+x__Q^2+(d+r)^2-r^2 is zero

 

x__M^2+y__M^2-2*x__Q*x__M+(-2*d-2*r)*y__M+x__Q^2+(d+r)^2-r^2 = 0

(5)

 

 

SECOND TEST: assumptions on d are grouped with those on r and R
 

restart:

interface(rtablesize=10):

with(geometry):

_EnvHorizontalName := x: _EnvVerticalName := y:

assume(r > 0);
assume(R > 0);

additionally(R >= r);

assume(x__Q > 0):
assume(d > -R-2*r):
additionally(d < R):

point(P,0,0);
circle(A,[P, R]);

P

 

circle: hint: R > 0

Error, (in geometry:-circle) not enough information: the radius might not be positive

 

 


 

Download CrossEffect.mw

@tomleslie 

Great, thanks.

I hadn't think to use 'distance'

I was stuck trying to express the tangent condition in an appropriate form. 

  • My first idea was to express under what condition the circles A and B are tangent.
    But the option AreTangent(A, B, 'cond') asks for additional conditions which, even after having been set, do not lead to an answer.
     
  • I also tried unsuccessfully to express that the the contact point lies on the line of centers. 
    Here again I met the same difficulties as above.
    In fact they both seem related to the fact that adding extra assumptions on quantities that already have one has induces new difficulties (I've just open  aquestion on this point)

 

Do you think it could be possibleto obtain the solution by using only the procedures the "geometry" package contains?
That is s "without explicitely using solve"

Thanks again


 

@tomleslie 

It's always the same problem: "What did the OP mean?"

  • If we refer to the picture d is obviously positive.
    Then the particular case you raise is no purpose.
     
  • But maybe the original question was "Let B be a circle of radius r whose center is at a height r+d, ...".
    And now your particular case is relevant.


Note that this second interpretation includes the situations d > R and d+2r < -R which both lead to no solutions.

In my own reply which uses the geometric package I EXPLICITELY wrote assume(d > 0), which seemed natural to me given the picture, but restrictive. I then got the same solution that vv's.
I bet that writting instead assume(d <0) and assume(d > -R-2*r) would have return a solution that encompasses your particular case.

With the  geometry package you need to explicitely set your assumptions to avoid that Maple returns FAIL very rapidly.
So the solution you get can be argued.

I believe the true questions are:

  • Why the approach vv used implicitely considers 0 <= d <= R?
  • How could one modify this functional approach ("solve" mainly) in such a way that it returns the good answer for all d in   -R-2*r <= d <= R?

Once again this can easily be done with 'geometry' for all the assumptions are explicit.

@Christopher2222 

For other purposes I sometimes use Geogebra (https://www.geogebra.org unfortunately I think there is no English version) or Cabri (http://www.cabri.net) and I am always admiring in their ability to model and solve geometric problems in the way that we all have learned about school.

Even if I am not familiar with this geometry package, I have already tried to apply it to a few geometric problems.
It works very well on "simple problems" but, probably because I don't know it well enough, I've often got stuck on more complex problems.
I think one day I'm really going to go deeper into all this.

@sand15 

A little complement to tomleslie's answer


 

restart:

interface(rtablesize=10):

randomize(): # random choice of the seed

roll := rand(1..2):

# simulate missing data at random places

V := Vector(10, i-> `if`(is(roll(), even), i, 'NULL'));  # simulate missing data at random places

V := Vector(10, {(1) = NULL, (2) = NULL, (3) = NULL, (4) = 4, (5) = NULL, (6) = 6, (7) = 7, (8) = 8, (9) = NULL, (10) = 10})

(1)

W := remove[flatten](x -> x='NULL', V);

W := Vector(5, {(1) = 4, (2) = 6, (3) = 7, (4) = 8, (5) = 10})

(2)

#  mean from ae Maple's procedure

Statistics:-Mean(W)

HFloat(7.0)

(3)

# mean from the basic formula

N := numelems(W):
add(W)/N

7

(4)

# Now a harder problem: regression with missing variables

# simulate missing data at random places

N := 10:
P := 2:

roll := rand(1..4):
V    := Matrix(N, P, (i,j) -> `if`(roll() < 4, i+j, 'NULL'));  # simulate missing data at random places

V := Matrix(10, 2, {(1, 1) = NULL, (1, 2) = 3, (2, 1) = 3, (2, 2) = 4, (3, 1) = 4, (3, 2) = 5, (4, 1) = 5, (4, 2) = NULL, (5, 1) = 6, (5, 2) = NULL, (6, 1) = NULL, (6, 2) = 8, (7, 1) = 8, (7, 2) = 9, (8, 1) = 9, (8, 2) = 10, (9, 1) = 10, (9, 2) = 11, (10, 1) = NULL, (10, 2) = 12})

(5)

W := map(n -> if `and`(seq(V[n, p] <> NULL, p=1..P)) then V[n] end if, [$1..10]):
N := numelems(W):
W := < W[] >

W := Matrix(5, 2, {(1, 1) = 3, (1, 2) = 4, (2, 1) = 4, (2, 2) = 5, (3, 1) = 8, (3, 2) = 9, (4, 1) = 9, (4, 2) = 10, (5, 1) = 10, (5, 2) = 11})

(6)

Statistics:-LinearFit([1, x], W, x)

HFloat(0.9999999999999968)+HFloat(1.0000000000000002)*x

(7)

 


 

Download MissingData.mw

Generally peple who ask a question and get an answer keep using the same thread instead of asking a second question on the same subject in a new discussion.
This question here seems clearly related to the post scriptum I added when I answered your previous question
Doing some Substitution

Perhaps you could have been polite enough to say thank you in response or, if I was completely out off subject that my answer was worthless...

Your problem reminds me of plate vibration problems.
This is quite ancien to me, but I have  just reopen an old Timoshenko's book on the subject and  it seems that one usually try to compute only the few first vibrating modes.
While following this idea I wrote some stuff I put  the attached file.
Nebertheless The exercise is limited by the fact that some functions are not explicitly set (f__1, w__0 and nu), making the  formal integration impossible, even after using the double serie expansion.

Maybe this will give you some ideas ?

Download Trial.mw


PS: there exists a very powerful package (Physics), which I'm not familiar with but that some people here know very well, that also could help you.
Waiting for an answer you might try to look to the corresponding help pages

@minhthien2016 

Any poynomial with indeterminate x tends to plus or minus infinity when x tends tends to plus or minus infinity.
What's bothering you?
Did you expected that your fit would go flat when x tends tends to plus or minus infinity ?

Look also Tom's answer

@tomleslie 

Tom, you made a little mistake: there are not 6 points but 7 and thus not 5 derivatives but only 4.
You were probably lured by the plot the OP produced which does not correspond to the data it uses.

More of this I dont think your spline interpolation is pertinent because you do not account for the conditions the OP gave. Only its polynomial fitting seems correct.

Please look to my answer to the OP.

@Carl Love 

You're right on all the points, and the OP surely thought  "Quantile".
 


Wtachout, an inverse normal distribution is a particular statistical distribution: it has nothing to do with the Quantiles of a normal distribution.
see for instance https://en.wikipedia.org/wiki/Inverse_Gaussian_distribution

The Excel function norminv "Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation" 
(see https://support.office.com/en-us/article/norminv-function-87981ab8-2de0-4cb0-b1aa-e21d4cb879b8 ), that is to say what is dubbed Quantile.

So acer's answer is very likely the answer to your question, just be careful about the terms you use.

First 129 130 131 132 133 134 135 Last Page 131 of 154