Rouben Rostamian

MaplePrimes Activity


These are replies submitted by Rouben Rostamian

@spalinowy I have already shown how to linearize about any ψ0(t).  In particular we see that if ψ0(t)≡ 0, then the linearized expression is just zero. This is analogous to linearizing the function f(x) = x*sin(x) at x=0 — you just get zero.

 

I know the meanings of the "Newton method", "modified Newton method", "secant method", but I don't know "modified Newton secant method".  What is it?  References?

 

@Joe Riel And here is a cruder way:

 y := 2*4^n;  

2*4^n

simplify(log[2](y)) assuming n>0;

2*n+1

2^%;

2^(2*n+1)

@brian bovril You essentially have the answer in the first four lines of your spline.mw.  Just change the first line from Y := [3,10,2,7,7] to Y := [3,10,2,7,7,42]. That is, the answer "42" is not arrived at by accident; it is built in!

The result may be cast into Horner's form through convert(f, horner).

 

@rallezet I can't make sense of what you are asking. Don't be afraid of using more words to explain what you have in mind.

I think you had better explain more clearly what it is that you are asking.

@Samir Khan I tried displaying your globe on 4 different computers, all running 64-bit Linux:
1. Thinkpad X301
2. Thinkpad X301
3. Thinkpad X1
4. ThinkStation C30

The X1 and C30 display the globe  perfectly.   The two identical X301 machines both display the globe with the artifacts that I have shown.  I suppose that this is due to the limitations of the graphics cards in X301.

What I really like about your software is how responsive the globe is to the mouse motion—there is no resistance to the motion at all.  In contrast, the globe produced by the previously noted plot3d() method with the image=… option is somewhat difficult to rotate; it appears that the globe is recalculated/repainted with each incremental rotation.  So all else being equal, I prefer your globe. 

 

@acer That code snippet does exactly what I wanted. It works particularly well with NASA's Earth images which are referenced in the old post that you cited.  Thanks!

@Samir Khan Thank you very much for the sample. It's a very good application.   The 3D globe, however, exhibits some strange artifacts.  I can't tell whether it is a software or hardware problem.  Here is what I see in the north Africa part of the globe:

This is with Maple 2017.3 on 64 bit Ubuntu Linux.

 

  1. In a couple of places you have a^().  What is that meant to be?
  2. You have Omega:=(0..376).  But later you do Omega[i]:=i*step which overwrites the previous definition in Omega.  Do you really mean that?

I have not looked at the rest of the code.

 

@assma You seem not to understand what I am saying.  When I ask "Why are you interested in the CPU time at all?", your reply of "I need a time of implementation for all errors" is not saying why, does it?  That may be due to a language barrier. Maybe.

Anyway, after these 20 or so exchanges, I have failed to get useful answers from you.  So here is what I can offer.   Taking your questions literally, it appears that this is what you wish to calculate:

err3 := unapply(abs(wr(x,y,z)-w3(x,y,z)), [x,y,z]);
n := 10;   # change as needed
d := 2*Pi/n;
Linfinity := max(seq(seq(seq(err3(i*d, j*d, k*d), i=0..n), j=0..n), k=0..n));
L1 := add(add(add(err3(i*d, j*d, k*d), i=0..n), j=0..n), k=0..n)*d^3;
L2 := sqrt(add(add(add(err3(i*d, j*d, k*d)^2, i=0..n), j=0..n), k=0..n)*d^3);

To obtain the CPU usage information,  apply CodeTools:-Usage() to the last three lines.  For example,
L1 := CodeTools:-Usage(add(add(add(err3(i*d, j*d, k*d), i=0..n), j=0..n), k=0..n)*d^3);

You should be able to get some numbers out of these, but I am afraid that this would be a useless exercise, especially for a PhD project.  Best wishes.

 

 

@assma I asked you several question which you did not answer.  Let me summarize:

  1. Why are you interested in the CPU time at all?  Explain!
  2. If you want to look at the CPU time at all, shouldn't you be looking at the CPU time of obtaining the solutions themselves?  The CPU time of evaluating the error norms are generally not very interesting.  If they are interesting to you, can you explain why?
  3. I asked why you want to restrict the calculations to an n×n grid.  You answered by saying that you need to restrict your calculations to an n×n grid.  That does not answer my question.  Explain!
  4. To calculate the L1 and L2 norms you need to integrate the pointwise error.  Since you say you wish to calculate those errors by information only on a discrete grid, I asked if you know how to integrate a function which is defined on a finite set of points.  You did not answer. I am not asking how you would do that in Maple.  I am asking how you would formulate that mathematically.
  5. The x, y, z, ranges extend to 6.28 or 2*Pi?  Which?

There are five question here.  I will respond only after you supply five answers.

 

@assma It will help if you would explain the reasons why you want to do what you are asking, because on the face of it, what you are asking makes no sense.

  • Why are you so interested in the CPU time of evaluating the error norms?  I can understand it if you were interested in the CPU time of calculating the solution w3(x,y), but I don't understand what is so interesting about the CPU time of calculating the error norms.  Can you explain?
  • The CPU time itself is not a very well-defined concept.  As you have observed, you can get wildly inconsistent results.  That has partly to do the the caching of the results in Maple, partly with the caching of the results in your computer's CPU chip, and partly due to background activities of your computer while it is running Maple.  That's the way computers work.  And that's why I am wondering why you are so focused on the CPU time rather than on the correctness of your calculations.
  • Can you explain why you want to evaluate the error on a discrete n×n grid?  By restricting the values to a subset of available information, you are decreasing the accuracy and reliability of your results.
  • If you insist on calculating the error on a discrete n×n grid, the L norm may be calculated in the obvious way, but the L1 and L2 norms will require further intervention.  How would you integrate a function which is available only on a finite set of points?  There are ways of doing that, but you had better explain very clearly the reasons why you want to do that.
  • You have specified the ranges of your x, y, z variables as 0..6.28.  I wrote that I am assuming that you mean 0..2*Pi but you did not comment on that.  Is it 6.28 or is it 2*Pi?  If it is 2*Pi, then by writing it as 6.28 you are introducing further unnecessary errors in your calculations.  Why would you want to reduce your accuracy when it can be easily avoided?
  • As to the meanings of "real time", "gc time", and "alloc change", see the help page on CodeTools:-Usage.

 

@AndrewG The best-fit line that is constrained to go through (2,21) is not parallel to the unconstrained best-fit line.  Here are the two lines, calculated through TomLeslie's approach:

restart;
with(CurveFitting):
pts1 := Vector([0, 1, 2, 6, 12, 15]):
pts2 := Vector([0, 13, 21, 45, 54, 77]):

Line passing through 2, 21

LeastSquares(pts1, pts2, x, curve = 21+a*(x-2));

(602/145)*x+1841/145

General line:

LeastSquares(pts1, pts2, x, curve = a*x+b);

791/97+(434/97)*x

Download mw.mw

 

@aamit The code you posted has at least two problems which have been pointed out.  One: It divides by J[1][2] which is zero, and two, it refers to L[1][4] which does not exist.  It's difficult to offer remedies since there is no documentation.

For a very nice working code for Apollonian Gasket see:

https://www.mapleprimes.com/questions/222071-Drawing-An-Apollonian-Gasket

First 63 64 65 66 67 68 69 Last Page 65 of 99