Carl Love

Carl Love

28035 Reputation

25 Badges

12 years, 322 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@chrisc I didn't deny that it was a bug; I said that it should be corrected. But given that x::complex is Maple's default assumption anyway, it's worth being more careful with expressions such as abs(1,x) that don't even make sense (at least to me) when is nonreal.

Please post the expression Lagerkraft in plaintext form so that we can copy and paste it. The command lprint(Lagerkraft) will present it in plaintext form.

I suspect that the problem is the trunc. If that's the case, you may be able to fix the problem by giving the command

`diff/trunc`:= 0;

before the dsolve. (Note that diff(trunc(x), x) = 0 is true almost everywhere as they say in Real Analysis (meaning that the set of x for which it is not true is infinitesimally small (technically, measure zero)), so just making it 0 should be good enough for a numeric dsolve solution (which is, after all, a form of integration, so what happens on a set of measure zero doesn't change the result).)

To achieve the results from your linked video, change the projection from the plane to the sphere to

P__pl_to_sph:= (r, theta)-> (theta, 2*arctan(2/r))

And change the sphere's color function to

Color__sph:= (psi, phi)-> COLOR(HSV, (1+sin(phi)*cos(psi))/2, 1, 1)

or

Color__sph:= (psi, phi)-> COLOR(HUE, (1+sin(phi)*cos(psi))/2)

Everything else can remain the same. Let me know if this is the plot that you want:

I needed to use Maple 2020 instead of Maple 2021 to post the plot.
 

@Earl Thank you. I've added a few details to the Answer above, and I did a lot of clarifying of the typography, so please reread it carefully (and probably several times).

I just watched the video on Mobius transforms that you linked. I can see that the projection that I used is different from that used in the video. And, of course, the coloring function is different. Both of these details can be changed simply by changing the projection function and the coloring function in the code. No change is needed to the expository text or the algebraic/functional framework that it lays out.

The projection from the sphere to the plane that I used gives the point on the plane where it is intersected by a line tangent to the sphere at the preimage point. To get the projection from the plane to the sphere, I simply inverted that function algebraically (which is trivial in the coordinate systems that I used). However, in the video, the projection from the plane to the sphere is where the line connecting the plane's preimage point to [0, 0, 1] intersects the sphere. This line goes through the sphere rather than being tangent to it.

I'm doing that algebra now.

I have two questions about your system:

  • Why do you say it's nonlinear?
  • Do you think that it's possible to solve it without specifying falphaomega, and x__||(1..4)||0?

You mentioned "matrix" twice---in the title and in the body of your Question. Yet I see no matrix, only a vector. What do you consider the matrix?

@tomleslie So why don't you move it to the other thread?

According to the help page ?ifactor, there are 5 algorithms that can be used for difficult numbers (after the easy methods have been exhausted). These are

mpqs     - Multiple Polynomial Quadratic Sieve method
morrbril - Morrison and Brillhart's continued fraction method
squfof    - Shanks' undocumented square-free factorization
pollard   - Pollard's rho method
lenstra   - Lenstra's elliptic curve method

Or perhaps there's an undocumented multi-core method. There are 30 procedures whose names begin `ifactor/...` in the Maple 2021 library.
 

@mmcdara The replacement for convert(..., listlist) is convert(..., list, nested). It works for rtables of any number of dimensions.

Here is a correction to the bug of the blue exclamation points:

`print/%factorial`:= n-> 
    subs(
        "!"= ("!", mathcolor= "#909090"),
        InertForm:-Typeset(%factorial(n))
    )
:

I incorporated this into the code in my Reply that generates the matrix in the Question. I don't know whether this'll work with InertForm:-Display because I did it all via more primitive methods, i.e., `print/...procedures and Typesetting markups.

@acer I did notice that quirk: the blue exclamation points that should be gray. I chose not to mention it because it's a superficial bug (i.e., doesn't really change how the computation is done), so mentioning it would seem to me to be a cluttering and ephermal detail in an Answer that's already quite complicated and intended not to be ephemeral.

I just added another coded example to my Reply to my Answer which you may not have read.

Here is a coded example showing some of the things described in the above Answer. The end result is a solution to the specific example in your Question.

Download InertFactorial.mw

Here is the code. Download the worksheet and/or execute the code to see the output. [Edit: I updated this code to correct the blue exclamation points. This simply required adding the short procedure `print/%factorial`.]

restart
:
#A syntax-checking inert procedure
`%!`:= (N::list(algebraic), D::list(algebraic))-> 
    'procname'(args) #return unevaluated
:
#The evaluation procedure
`value/%!`:= (N,D)-> mul(N!~)/mul(D!~)
:
#The display procedure. This is invoked automatically when the inert
#form is displayed prettyprinted.
`print/%!`:= (N,D)-> 
    `%*`(%factorial~(N)[]) %/ `%*`(%factorial~(D)[])
:
#Another display procedure to make ! gray:
`print/%factorial`:= n-> 
    subs(
        "!"= ("!", mathcolor= "#909090"),
        InertForm:-Typeset(%factorial(n))
    )
:

#Examples:
e:= `%!`([3,5,7], [4,6]);
lprint(e);
value(e);
#The specific example from your Question:
M:= Matrix((5,5), (m,n)-> `%!`([2*m+3*n-5], [m+2*n-2, m-1, n-1]));
value(M);


And the following code uses some features not described in my Answer:

You were attempting to use NoSimpl. This cannot be used as a function; it needs to be used with the use command, and it overloads infix operators. See the help pages ?InertForm,NoSimpl and ?use. Unfortunately, the syntax is unusual. Here's one way to do it:

restart
:
`%!`:= %factorial: #simply for abbreviation, not the same as the previous example
NS:= InertForm:-NoSimpl: #simply for abbreviation
use NS:-`*`, NS:-`/` in #Just overload those two operators
    M:= Matrix(
        (5,5), 
        (m,n)-> 
            `%!`(:-`*`(2,m) + :-`*`(3,n) - 5) /
            (`%!`(m + :-`*`(2,n) - 2)*`%!`(m-1)*`%!`(n-1))
    )
end use;
value(%);


Note that :-`*` refers to the ordinary (i.e., non-overloaded) multiplication. Unfortunately, the use of quotes is necessary, and thus it must be used in prefix functional form rather than as an infix operator.

I only showed the above to show you correct usage of NoSimpl. The above is not worth doing, and I strongly prefer @acer 's coding of your example. I haven't corrected the blue exclamation points in this code because it's significantly more difficult to do here, and it's not worth elaborating on the NoSimpl approach anyway.

@Sradharam I've attached your worksheet to your original Question (above) and deleted your new Question. We try to keep all the material related to one problem in a single thread.

I vaguely remember something like that in Windows from about 15-20 years ago. Are you using the latest version of Windows Defender? 

Anyway, please post a screen shot of the dialog where it asks you for a "code integrity policy file". Someone here or at Maplesoft Customer Support may be able to tell you the file name to use 

@Carl Love 

I found a very simple worksheet that I can upload (with both Firefox and Chrome). How strange. Tom's Replies show that the complexity of the worksheet cannot be the whole issue since he can display a worksheet that I cannot display---the exact same worksheet.
 

1. Any number can be used as an operator that returns that number:

2.5(x);

2.5

(1)

2(x);

2

(2)

2. Operators can be combined with symbol operators to form new operators:

SetTo0:= lhs-rhs = 0:

SetTo0(x^2 = y^2);

x^2-y^2 = 0

(3)

(lhs-rhs = 0)(x^2 = y^2);

x^2-y^2 = 0

(4)

3. An operator can be used as the first argument to fsolve. This tells fsolve to search for an argument for that operator which would make the operator return 0, or close to it.

fsolve(sin, -1..1);

0.

(5)

fsolve(sin, 3..4);

3.141592654

(6)

fsolve(sin-1, 1..2);

1.570796327

(7)

 


 

Download Operators.mw

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