Carl Love

Carl Love

28100 Reputation

25 Badges

13 years, 105 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@Haley_VSRC 

I just substantially updated my previous Reply. (I was doing it while you were writing yours.) Please read that. I asked a few more questions. And I gave formulas for the partial derivatives of f in terms of f and the partial derivatives of MF, which I think is specifically what you're asking for. Let me know if that answers your Question. If so, I'll upgrade my Reply to an Answer.

So, I take your P.S. to mean that the isosurface is topologically disk-like for given intervals of y and z and that there's a unique x for each (y,z) in those intervals. In other words, x = f(y,z) is a function (in the strict sense of the word) defined over a rectangle (y0 <= y <= y1) x (z0 <= z <= z1) in the (y,z) plane. Is that correct? That'd probably be the easiest situation for finding the surface area by numeric computation.

I changed your title to reflect what may be possible with Maple. If you don't approve, suggest another, and I'll change it again.

It's an interesting problem. In order to wrap by brain around it, it'd help me to know the topology of the surface. Is it a simple closed surface, i.e., is it topologically homeomorphic to a sphere? I don't know if that ultimately will make a difference in the computation; it may just help me think about it. Being homeomorphic to a disk is the other case that's relatively easy to think about.

Let me verify what you have currently: You currently have a procedure that will give you a numeric approximation of MF(x,y,z) for any x, y, and z (within certain ranges, of course). Is that correct? So we could use numeric differentiation (command fdiff) to approximate all partial derivatives of MF.

You suggested expressing x as a function of y and z. Is there a reason that you chose x, such as that there's a unique x for every (y,z) pair (which would necessarily mean that the topology is not sphere-like)? Given that you have a procedure MF as described in the previous paragraph and given that there's a unique x for each (y,z) pair, then we can write the "x return" function for the isosurface as

F:= proc(y,z) local x; fsolve(MF(x,y,z)=11, x) end proc

using a minor modification to MF to allow it to return unevaluated when passed any symbolic input. If the x isn't unique, then it's trickier. The partial derivatives of F (which you called Fy and Fz) can easily be expressed in terms of and the partial derivatives of MF. They are 

D[k](F)(y,z) = -(D[k+1]/D[1])(MF)(F(y,z), y, z))  (for k = 1,2)

Let me know if you need help understanding Maple's D notation that I just used.

What do you mean by "special" derivatives of MF?

@Markiyan Hirnyk 

My blues are graded from medium blue to black. The plot that you showed used medium blue to white. Mathematically, it's the same thing, but it's harder to see the gradation blue to black. I'll try to make it blue to white using the HSV scale. It's a slightly more difficult computation.

@Markiyan Hirnyk 

Okay, granted, the color is important. Anyway, that's just what I did. The blues are the positives and the yellow-greens are the negatives. I think that Maple's color scaling may be wrong. Tomorrow I'll try using HSV instead of RGB.

Note that I only implemented the first of the many, many Matlab programs given in the paper, and this isn't the algorithm used for the plot that you showed.

@Markiyan Hirnyk 

I used the Matlab code from page 4 of this paper. I didn't use or even look at the Mathematica code. The mathematical object is represented by a greyscale image. Adding the color is only "art for art's sake" as you like to say, and I only did it because the image that you posted was split into orange and blue. I think that you are not seeing the variation in the blue fields in my plot. Try looking at the underlying greyscale images. Use this code:

restart:

Digits:= 15:
GRF:= proc(n::posint, r::posint)
uses AT= ArrayTools, IT= ImageTools;
     (IT:-View@IT:-FitIntensity@IT:-Convolution)(
          AT:-RandomArray(n, 'distribution'= 'normal'),
          Matrix(2*r+1$2, (i,j)-> `if`((i-r-1)^2 + (j-r-1)^2 <= r^2, 1, 0))        
     )
end proc:

GRF(200, 12);

Compare with the left greyscale image on page 2 of the paper.

All of the numeric information from the greyscale images is included in the color images; it just may be difficult to see variations in some color ranges.

@Preben Alsholm 

Okay, the spam-deleters strike is on.

@acer Thanks for the correction!

@rlopez 

I appreciate where you're coming from with that desk-drawer analogy, but I'm afraid that it might give some readers the wrong idea about sets for some uses unrelated to this post. Sets are stored in a strict, reliable, and predictable order that is determined by Maple---the user has no control over it. Long ago, that order was session dependent (being partially determined by memory addresses, I believe). In modern Maple, the order is consistent across sessions and even across different computers.

@Harry Garst 

Never use the with command inside a procedure. If you must use anything, use uses instead. See my reformulation of your code below for an example of uses.

Your posted code doesn't appear to use StringTools, but I assume that you've only posted a small portion of the overall code. If you do plan on doing with(StringTools) at some point, then you'll need to change the procedure name Generate.

While it's perfectly fine to map (or ~) an undefined symbol over a Matrix, I have a feeling that you expect int8 to actually do something; yet it's undefined. Do you mean to truncate the entries to 8-bit integers? 8-byte integers?

Pick a coding style (including an indentation style) and use it! You don't have to follow my style (below), but you should have a style.

What exactly do you mean by "did not work"?

restart;

MultivariateNormalSample:= proc(Sigma, V, N)
uses LA= LinearAlgebra, AT= ArrayTools, S= Statistics;
local d:= LA:-Dimension(V);
     LA:-LUDecomposition(Matrix(Sigma, datatype= float[8]), 'method'= 'Cholesky') .
     AT:-Alias(S:-Sample(Normal(0,1), d*N), [d,N]) +
     AT:-Replicate(Vector[column](V, datatype= float[8]), 1, N)
end proc:

 
Generate:= proc()
local S;
     S:= MultivariateNormalSample(< 1,2 ; 2,5 >, <2,3>, 100);
     map(int8, map(round, S));
end proc:


W:= Generate();

 

Here's something that would help, that I've suggested before, and that wouldn't place the slightest extra burden on legitimate new members: When any item posted by someone with zero reputation is deleted by someone other than the poster, the poster's account should be blocked. This would help because a lot of spam comes from repeat offenders.

I've deleted many hundreds (probably thousands) of Posts, Questions, Answers, Replies, and Comments in my three years here. Here's some guessed-at statistics to help understand why the above would help:

  • 100% of spam comes from users with zero reputation.
  • 98% of spam is in the form of Posts and Questions (about evenly divided) rather than Answers, Replies, and Comments.
  • I've never deleted a non-spam Post or Question from a user with zero reputation.
  • 99% of spam is immediately recognizable as spam.
  • 1% of spam seems to be mathematically related.
  • 0.1% of spam comes in the form of Question-Answer pairs where the Answer logically follows the narrative of the Question.

An alternative to what I suggested in the first paragraph would be a "Delete as Spam" button added to the pull-down list that includes Delete. This would delete the item and block the user if and only if the user has zero reputation. That way there would be very little chance of doing damage by accidentally using the button. Like I said, 100% of spam comes from users with zero reputation.

The current "Mark as Spam" button is probably worthless. I have no idea how often it is used, but I'd guess not much. How about replacing it with the "Delete as Spam" button as described in the previous paragraph?

(By "spam", I strictly mean inappropriate advertising of products and services. The definition of the term seems to have enlarged in recent years to include other forms of inappropriate posting such as repetitive, abusive, or nonsensical posting. I don't include any of these latter forms in my usage of the term.)

@al-faraj What you call "crazy" is the correct answer. Why do you doubt it? Plot it, and you'll see.

@Christopher2222 

Please delete it. I delete about a dozen pieces every night. (Most of it seems to come during my night.)

@Preben Alsholm Thanks, yes, I just noticed that myself. My suspicion was aroused because the original dsolve commands executed much too quickly.

@Mac Dude You wrote:

the order in which the code is arranged is important... I actually thought about that but decided that it should not be that way, assuming that Maple is using some kind of two-pass system when parsing the code.

The two-pass parsing is impossible because the code of the inner procedure may depend on computations done in the outer procedure. The code of inner procedure may have been changed by a subs command.

@smith_alpha 

Where have you found documentation on an APPEND option to FileTools:-Text:-WriteFile? There is no such option. A quick look at the procedure's code with showstat will confirm that. If you include an option in square brackets between a procedure's name and its arguments, the stuff in square brackets will be ignored unless the procedure is specifically coded to look for it. So, your APPEND is just being ignored. I certainly agree that the procedure should operate in append mode, but sadly it doesn't.

To the Maple designers: It's ridiculous that this command doesn't operate in append mode by default. What's the most common use scenario? Answer: The user wants to open a file, add one line to the end, and close the file. Who wants to create a file with just one line? Answer: That's not a very common operation.

First 459 460 461 462 463 464 465 Last Page 461 of 709