sand15

867 Reputation

13 Badges

10 years, 259 days

MaplePrimes Activity


These are replies submitted by sand15

Lets take a sphere S of radius r whose center C has coordinates (a, a, a).
So the intersections of S with each of the three canonic planes are circles of identical  radii (provided of course that the intersections do exist, that is that r > a). Let u this common radius
Now move the center at  another place (A, A, A) (A > a), rgere is always a value or R > r such that R2-A2=u2.
So the radius and the coordinates of the sphere cannot be uniqueky determined by the radii of the intersection circles.

"the sphere's radius r and the coordinates of its center can be determined?": NO

One has exactly the same result in 2D for a circle intersecting two orthogonal lines.

@KIRAN SAJJAN 

saying "When I change the value of j, only one line is plotted".
If you make a zoom you will see there are 4 curves. Change for instance Grt from 0.1 to 2 to convince yourself the code gives different resullts.
For instance



By the way I wonder by what mistery you can have past 12 hours working on the code I posted only 8 hours ago?

@KIRAN SAJJAN 

I only took Br=0.1 has an illustration of what you can do for the other values in BrVals.

Feel free to go further when and proceed as described in the second part of the worksheet for those other Br values.
I don't think it is an impossible task for you, you have just to change the value of j here


As I told you I don't have more time to spend on this problem and your initial worksheet symetry_paper_work.mw proves you know perfectly how to browse all Br values in BrVals, build a table of results and display them...so I don't feel you need me any longer.
 

@KIRAN SAJJAN 

I guess this is closer to what you have in mind:

  • The first part of the worksheet 2_domains_sand15 explains the strategy I use.
    The whole solution (the "two-domains" solution) depends on two parameters A and B where A is the common unknown value of u1(0) and u2(0) and B is the common unknown value of Theta1(0) and Theta2(0).
    In domain D1 = {y, y in [-1, 0]} the differential system is well posed and can be solved numerically a soon as numerical values a and b have been assigned to A and B. Let S1(y ; a, b) the solution of the problem 1 on domain D1.
    In domain D2 = {y, y in [0, +1]} the differential system can also be solved numerically and let S2(y ; a, b) its solution.
    Let Jump the vector whose components are
    Jump1 := (D(u1))(0)     - Z1*(D(u2))(0),
    Jump2 := (D(Theta1))(0) - Z4*(D(Theta2))(0)
    
    For an arbitrary choice of a and b there is no reason for Jump1 = Jump2 = 0  when S1(0 ; a, b) and S2(0 ; a, b) are used to assess D(u1))(0), D(u2))(0), D(Theta1)(0) and D(Theta2)(0).
     
  • Second part of the worksheet 2_domains_sand15.
    I wrote a procedure named TwoDomainsSolver(a, b) wich gathers all the steps presented in the first part and returns the L2 norm of the Jump vector.
    Then all you have to do is to use an optimization function to findthe couple (a*, b*) wich minimizes the output of TwoDomainsSolver(a, b) over some (a, b) domain.
    Once (a*, b*) is found you can draw the "left" and "right" solutions.

I provide you two worksheets corresponding to two different data
2_domains_sand15.mw
2_domains_sand15_other_data.mw

For other data, for instance higher values of the Grashof number, you may get this error

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

A quite common one but an error which is always borring and may be relatively difficult to fix, even if some recipes are given here Numerical Solution of Difficult ODE Boundary Value Problems

One example is given in 2_domains_sand15_Gr=15.mw where this error appears for Gr=15.
You will find in this worksheet a way to fix it (read carefully the last comment lines).

I'm sory to tell you that I'm done with this thread because I am a lot of other things to do.
I hope this response has been helpful.

@KIRAN SAJJAN 

Your initial problem contains:

  • 4 bc given at point y=-1 and/otr point y=+1
  • 4 continuity equations written at point y=0

This cannot ne solve this way and a "true" nv problem requires 8 bc written at points y=-1 and y=+1.
So I rewrite your initial problem in term of a well-posed bvp but introducing some "degrees of freedom":

u2(-1)     = au, 
Theta2(-1) = aT, 
u1(1)      = bu, 
Theta1(1)  = bT,

where au, aT, bu and bT are formal quantities and not numbers.

Maple does not allow solving a bvp with "parameters" (as it does for initial value problems).
So I defined a procedure F(au, aT, bu, bT) which takes as input 4 numbers and deliver a measure of the error E on the continuity equations

u1(0) - u2(0) = 0,
Theta1(0) - Theta2(0) = 0,
(D(u1))(0) - Z1*(D(u2))(0) = 0,
(D(Theta1))(0) - Z4*(D(Theta2))(0) = 0

For arbitrary values of au, aT, bu, bT there is no reason for E to be equal to 0.
So I use Optimization:-NLPSolve to find a set of values for au, aT, bu, bT such that E is equal, or tlose, to 0.

The other method (resolution of two separate problems, one over [-1, 0] and the other over [0, 1], with formal bv at 0 (let's say a, b, c, ..., for instance u1(0)=au2(0)=a, Theta1(0)=b, Theta2(0)=b, ... in order to satisfy the first relation above) is essentially the same.
Indeed there is no reason that for arbitrary values of a, b, c, ..., the odes are verified over [-1, +1].
For instance you could chose a=0, b=0, c=0, ... and get some pattern of an aggregated solution which trivialy verifies the 4 continuity solutions, verifies the odes in each subdomain, but doesn't verify those ode over the whole (-1, +1) domain.
So here again you will have to sweep the domain a, b, c, ... are assumed to belong to, in order to find some correct values for a, b, c, ....
I found this strategy more complex to manage than the one I developped in my worksheet.

To sum pu, ok to "solved first for -1 to 0 and solved for 0 to 1 and merged both graphs in single plot", but what bv do you take at y=0?

@Andiguys 

display(
  plot3d(
    TRC(tau1, delta), tau1 = 0 .. 1, delta = 0 .. 1
    , axis[3] = [tickmarks = 8] # add more tickmarks for the z axis
  ), 
  # add plane z=0
  plot3d(0, tau1 = 0 .. 1, delta = 0 .. 1, style = wireframe, color = "LightGray"), 
  pointplot3d(P, color = red, symbol = solidcircle, symbolsize = 17), 
  textplot3d([P[], "P"], font = [times, 16], align = {ABOVE, LEFT}), 
  orientation = [165, 75, 0], 
  labels = ['tau[1]', 'delta', 'Profit'], 
  view = [default, default, TRC(1, 1) .. -(1/2)*TRC(1, 1)]  # maximum value onthe z axis
)

I believe you really should give a look to the site plot/options which provides answers to your questions.

You asked "Also, how can I display the z-value at point P?" I recommend you to display these informations in the title and not through textplot3d: indeed text are not managed in a satisfactory way (IMO) when one rotates a 3D  plot.

@salim-barzani 

I dont' see what is complex in what I did; this is elementary algebra.
Never mind, I have update my previous worksheet by adding the conditions in order that a__12 = 0 might not be the only solution to the 29 equations.

help-parameter_sand15_2.mw

@salim-barzani 

Provide an updated worksheet instead of a single code snippet I don't know where to insert in your initial code.

@janhardo @Carl Love

Carl is right.

The problem you solve is "Finding the equation of the sphere which passes through the point A=[5, 1, 4] and whose intersections with planes xy, yz, zx intersect at the origin" (and if they have a common intersection this latter is necessary at the origin for the reason Carl mentioned).

Maybe this is what @yangtheary wanted to say but it is not what it said.

@Andiguys   @acer 

Here is an attempt to synthetize the expression @acer provided

Q_s_enhanced_readibility.mw

(for what it's worth)

@Muhammad Usman 

see assign help page.

Example:  general_procedure_2.mw  (read carefully the 2nd example)

@sym_group_p 

I worked for years on the simulation of complex physical systems where adaptive meshes made of billions or tens of billions of elements are required.
Those simulations were (still are) ran on MIMD parallel computers and we used to use the ScalaPACK library to postprocess the results (linear algebra on huge matrices for instance).

Here are two links which could give you some ideas
ScalaPACK
Big Data with R

(Good night and) good luck

@Andiguys 

There is no possibility to associate a legend to the structure named  back.

The attached file contains two straightforward alternatives plus another coding to mimic a legend.

This latter is more complex to code and require adjustements and tunning to render exactly what you want. So it will be up to you do these tunnings... but you have to be extremely careful: adjustng the position of a plots:-textplot will never make Maple crash or corrupt your file, but toying with the DocumentTools:-Layout:-Table structure can have dramatic consequences if you do something wrong (for instance a corrupted file that you won't be able to read)

3_possibilities.mw

Last point you must be aware of when using  DocumentTools:-Layout:-Table: contrary to a "classical" plot while clicking on it enables you to export it in some formatted file, there is no such possibility for a picture produced by DocumentTools.
So you have to realize a screenshot of this image, or part of it, and convert this latter in some format.
For instance the image below is a PNG conversion of a screenshot of the the last figure in the attached file.

@sym_group_p 

Something bothers me. You write "You write "My matrices are relatively sparse and I specified "storage=sparse" when creating them". storage=parse is a Maple option (maybe the same syntax in other softwares?): What is the software you use to create those matrices?

Aside:
(1) As it is a sparse matrix, asuming it is built in an astute way it does not contain about 1010 elements , so I do not understand why you speak about 105x105 matrix?
Let's take the extreme case of a diagonal matrix of size 105x105 : an astute way to represent it is to store only its diagonal... would you then ask the same question you asked?

(2) "... in the past... Perhaps, this particular example may be less sparse than other examples that I have considered".
I think so.
I understand this matrix (file) already exists, right? So you can be able to determine its size (because you have built it in some way or another) and determine if it is more or less sparse than the ones you already succcesfully loaded into Maple.

If these matrices have been built out of Maple, the question I would ask byself if I was in your position is "Why do I want to read, and probably work with, this matrix in Maple as it has likely be generated by some other software which, presumably, contains all the features to do what Maple is supposed to do?"

(1) Reading huge ascii formated structures is extremely time consuming.
It is always better to save them in binary format and read them using FileTools[Binary][Read]?
For instance I use to use Maple and R for statistical analysis and manipulate large matrices, typically 106 by 50.
Those matrices are generated by R: saving them in ascii format and then loading  into Maple takes about 30 seconds on my PC.
Using a binary format takes less than 1 second.

(2) The reading time put aside your matrix is huge
      Look to this file to see why your matrix will not use less than 110 gigabytes Bytes.mw

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