tomleslie

13876 Reputation

20 Badges

15 years, 176 days

MaplePrimes Activity


These are replies submitted by tomleslie

There is no such thing as a "MapleTA server"

"MapleTA" is a 'package' of more or less *useful* commands - like "LinearAlgebra" or "plots", or any other Maple package.

So do what I said before. When you find a case where only one root is generated, trap the values of a, b, timeT, and h_given and post them here.

Otherwise, claiming you have a problem which no-one can replicate, and for which you refuse to provide the necessary data, is going to get you precisely nowhere

The horizontal axis does not start at rho=0. It starts at r=0!

  1. You have defined your ODE system as a BVP with independent variable 'r'.
  2. You supply boundary conditions for r=0 and r=1.0e-05. Hence you can only calculate solutions for  the ODEs between r=0 and r=1.0e-05.
  3. In other words you can calculate the dependent variables P(r), m(r), v(r) for any values of 'r' in the range 0..1.0e-05
  4. Now these solutions will vary (a bit) depending on the value you select for the parameter 'rho', and the consequent value of the function epsilon(rho).
  5. So I have modified my earlier worksheet. It now plots 'm(r)' versus 'r' over the range of 'r' specified by you boundary conditions (ie 'r' =0..1.0e-05) for several differnt values of 'rho', in pretty colors, with a legend so that you can see which 'm(r)' curve corresponds to which 'rho' value
  6. As a further enhancement, I have added an execution group which plots 'm(rVal)', (obviously with 'rVal' in the range 0..1.0e-05), as a function of of the parameter 'rho'

odeProb3.mw

If this does not fulfil your requrement then you are going to have to get very, very, clear about exactly what you do want!!

I can generate plots for any pairwise combination of r, m(r), P(r), v(r), rho. My problem is that you seem to have no idea what you actually want - so think!

You have used the my second suggestion of correcting the range over which you are correcting for roots: so the only remaining possibility is the first case in my previous post.

I have just checked your code for 1000 random input combinations, using the following

rootsProb1.mw

I get 985 cases of two roots, and 15 cases of four roots. Since this is a problem involving random variables, then you may get somewhat different answers, but the important point is that there are no cases of one root.

As stated in my earlier post, I can see a condition where you *might* get only one root, by selecting a value of h_given which happens to correspond to the global maximum of the function f. But you would have to be seriously unlucky (or trying a lot of test cases), to hit this condition

I cannot generate the case of one root: but apparently you can. I suggest you *trap* the case of one root and supply the values of h_given, a, b, timeT for which it occurs. Then I will be able to determine whether

  1. There is in fact one root, or
  2. There is some weird coding problem (which I have been unable to detect so far), which reports one root, when in fact more than one root occurs

As stated in the manual, the semantics of the piecewise() function are the same as those of an if-then-elseif-then-elseif....endif statement.

So each condition statement is tested in sequence, provided that the preceding condition fails. When the 'condition' returns true, then the associated value is computed.
So with the (numbered) condtion statements

(1) rho < 180.4, undefined,
(2) rho < 378.65, alpha[0]*rho+beta[0]^Gamma__0,
(3) rho < 605.84, alpha[1]*rho+beta[1]^Gamma__1,
(4) rho < 1060.74,alpha[2]*rho+beta[2]^Gamma__2,
(5) undefined

Consider what happens when rho =800 (say)

condition(1) fails - so value is >= 180.4. Now try condition(2):
condition(2) fails - so value is >=378.65. Now try condition(3):
condition(3) fails - so value is >=605.84. Now try condition(4):
condition 4 succeeds because value>=605.84 and <1060.7  so evaluate the associated expression, ie alpha[2]*rho+beta[2]^Gamma__2

You could use 'and' statements, to identify specific ranges, as in

rho>=180.4 and rho<378.65

but this is redundant - so why bother

###################################################################

In the attached I have changed the final couple of execution groups to plot m(r) versus r for a sequence of different values for rho - in case that is what you are getting at in your remark

"could their be possible graph between P vs rho, and P vs epsilon."

odeProb2.mw

There is no mathematical process or software package which is guaranteed to find a global maximum (minimum), for anything other than convex functions.

Whilst I am prepared to accept that some "global" optimizers may be better than others (and directSearch is pretty good) - don't believe the advertising. It cannot guarantee to find global optima. It can however return something which has a pretty good chance of being a global optima.

There is a huge difference between "guaranteed" and "pretty good chance"

Test example

I basically followed Kitonum's approach of generating random data points. I constructed these so that some would be inside a defined cylinder and some outside. I then split these points into two sets. Those inside the defined cylinder are coloured green and those outside the cylinder are coloured red. I set the cylinder 'transparency' to be 0.5 so that points inside would be visible. Check out the attached

insOuts.mw

On 64-bit Win7

this code runs in Maple 2016.2
this code runs in Maple 2015.2
this code fails in Maple 18.02 - apparently beciause in this release the rand() function did not accept a range of floats (I could probably work around this but I have no plans to do so)

*****************************************************************************************************
Using OP's data

The data supplied by the OP in his/her text file bothers me, and the following may be completely incorrect, but wtf, my guessing capability needs some exercise, so \I have assumed the following

  1. The data in the first column would seem to be an angle (in degrees). It varies from 0 to 360 in steps of 0.1. In the worksheet which the OP posted, there is no degrees to radians conversion - so I have done this
  2. I have assumed that the data in the second column represents 'height', ie 'z' in cylindrical polars. No justification for this assumption other than the fact that the data increases monotonically from 0 to 972
  3. I have assumed that the data in the third column represents radius. Now these values extend from -1.33 to 2.16, and the concept of a negative radius makes me a little twitchy - but bear with me, with this interpretation, the final plot looks quite 'sensible'

With the above assumptions, the supplied data becomes a 'tapering' spiral with a (slightly) tilted axis.

I have plotted this spiral with points inside the defined cylinder colored green and points outside the cylinder colored red.

Of course the attached might be completely wrong: but I'm sure if I could get a clear definition of what coordinates are provided in the OP's textfile, I could fix it fairly quickly

insOuts2.mw

 

we would need to see the PDEsystem and the code you are running. Upload the failing worksheet using the the big green up-arrow in the MaplePrimes toolbar

But no solution

  1. As the graphs you supply indicate, solutions seem to be identical when one changes the value of the parameter 'We'. Now 'We' is the coefficient of only one term in your system: since changing this parameter "does nothing", the implication is that the associated multiplicand is (more or less) zero
  2. Your equations contain the cot() function in a couple of places. Since cot(n*Pi) is infinite for integer n, one would expect this quantity to become infinite four times (including x=0) within the range of x for which you require solutions. Attempting to produce numeric solutions when a quantity in your equations is  guaranteed to become infinite is never a good idea
  3. Rather than using 2-D plots, if I attempt to produce 3-D plots for any of f(x,y), theta(x,y), phi(x,y) then these always fail with the error message  Error, (in pdsolve/numeric/plot) unable to compute solution for x>HFloat(1.7999999999999998): Newton iteration is not converging
  4. So solution surfaces can be plotted up to x=1.8 (and for y=0..12): but something breaks at x=1.8. This does not seem to be a problem with the cot() function mentioned above (because cot(1.8) is finite here). Plotting the solution surfaces for f(x,y), phi(x,y), theta(x,y), in the range x=0..1.79, y=0..12, nothing untoward seems to be happening as x->1.8, but at this x-value, the numerical solution breaks - and (so far) I haven't been able to figure out why or work around it :-(

 

In general, The simplest 'event' which one can define is a basic rootfinder.So if the variables of the problem are [t, ca(t)], one can construct any function of these variables, say f( t, ca(t) ), and look for 'roots' of this expression. In other words locate values for t, ca(t), when f(t, ca(t))=0

In your specific case, you are looking for the condition ca(t)=0.2, or equivalently ca(t)-0.2=0. Hence the function whose 'root' you are looking for is

f(t, ca(t) = f( ca(t) ) = ca(t)-0.2 or the condition ca(t)-0.2=0

In fact, as with finding roots with fsolve(), you only actually need to enter the expression, without bothering about the right hand side ( ie ca(t)-0.2 ) and Maple will 'interpret' this as finding the solution(s) of the equation ca(t)-0.2=0. For reasonably 'simple' expressions, you don't even have to write it as expression=0, because Maple will 'simplify' it appropriately: so ca(t)=0.2 will also work.

Hence for your case, I *could* have written the dsolve() command as any of

sol:= dsolve({sys}, numeric, events=[[ca(t)-0.2=0, halt]])
sol:= dsolve({sys}, numeric, events=[[ca(t)-0.2, halt]])
sol:= dsolve({sys}, numeric, events=[[ca(t)=0.2, halt]])

All will work: which form you use is a matter of personal taste

But you may want to contemplate the output generated by the commands

plots:-contourplot(r*sin(phi), r = 0 .. 10, phi = 0 .. Pi, coords = spherical, contours=100);
plots:-contourplot(r*sin(phi), r = 0 .. 10, phi = 0 .. Pi, coords = spherical, contours=[seq( j, j=1..10,0.1)]);

to see if either of these solve your problem -if not, then you will have to be a lot more specific about what you are trying to achieve

as the help page suggests, you could try

plots:-animate(plotcommand, plotargs, t=a..b, options)

Now all you have to do is ensure that you have a syntactically correct 'plotcommand', with the relevant ''plotargs'. Hey presto you have an animation! Now what's difficult?

No one here is going to do anything with a "picture" of your code - I mean (seriously), what are we supposed to do? Retype all of your code from a picture?

MaplePrimes provides a means for you to upload actual code, which is editable, executable etc. This is what people here want!

Use the big green up-arrow in the MaplePrimes toolbar

Error cases have nothing to do with loops in the graphs

Suggested "workaround" *might* work, but *might not*

This is a bug - and a nasty one

Consider vv's "solution" to your example problem

restart:
G1:= GraphTheory:-Digraph(4, {[1,3],[1,4],[2,1],[3,2],[4,1],[4,2]}):
G2:= GraphTheory:-Digraph(4, {[1,4],[2,3],[2,4],[3,1],[4,2],[4,3]}):
GraphTheory:-IsIsomorphic(G1,G2);
GraphTheory:-IsIsomorphic(G2,G1); # flip argument order

I think(?) we agree that it doesn't have anything to do with loops: in an earlier response to the OP's problem, I deliberately selected only those matrices whose graphs have three loops: there are 64 such graphs. I ran the isomorphism check across this complete set: it completed with no errors.

For me the astonishing thing is vv's discovery that, on all "Error" examples found so far, flipping the order of the argument's makes the error go away!!! I have difficulty with the concept of a "non-commutative" isomorphism

on 64-bit win7

Maple18 - plot looks OK-ish
Maple2015.2 - plot looks a bit rough
Maple 2016.2 - plot looks good

Definitely the Maple 2015.2 plot is the worst of the lot - by a considerable margin.

I'd have to disagree (slightly) with Preben's earlier comment.
On my machine, I'd have to say that the Maple 2016.2 plot *looks* a little better than the Maple 18.02 plot. Both of these are waaaay better than the Maple 2015.2 plot.

So I very much doubt that the problem has anything to do with your OS or graphics hardware/drivers

 

First 123 124 125 126 127 128 129 Last Page 125 of 207