Carl Love

Carl Love

28015 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

This is obviously a Question, so I just converted it from a Post to a Question.

@nm Good Answer; voted up (and I also upvoted Tom's Answer).

You wrote:

  • You can also make y(x) itself a function. But I think it is better to use sol and keep y as free variable.

I strongly agree with that, but I see no problem with assigning the result of unapply to some other unused variable. If the original was y, I'd typically use or Y_ (but not _Y because you shouldn't assign to global variables whose names begin with underscore). 

@vs140580 You wrote:

  • As my remaing codes are in 2D inputs please help in 2D inputs please kind help please

You can mix 1D and 2D in the same worksheet. Just take my procedure definitions and put them in Maple Input execution groups, and the rest of what you have can remain in 2D Input. The two will execute together seamlessly. (The part of Maple that executes the code, called the kernel, doesn't even see the 2D Input, because the other part, called the GUI, translates the 2D Input to 1D before passing it to the kernel.)

@vs140580 Your recently mentioned requirement can be handled by sorting the rows (elements) of the listlists, like this:

WhereInVS:= (A::Matrix, B::Matrix)-> 
    WhereIn((sort~)~(subs(0= (), convert~([A,B], 'listlist')))[])
:

where WhereIn is the same procedure already given in my Answer.

@vs140580 You are using 2D Input. In your worksheet, look at the first pull-down box on the lowest tool bar. It says "2D Input". To run my code, you need to use 1D input, also known as Maple Input, as I said. You can find "Maple Input" in that pull-down box.

I'm thinking about the rest of your Reply now.

I posted code for your recent Graph Theory Algorithm Question, but you haven't acknowledged my Answer.

Both in standard algebra terminology and in Maple, simplifying and solving are separate operations with distinct targets. One simplifies expressions and only expressions; one solves equations and inequalities or sets of them.

Maple relaxes those target restrictions a tiny bit:

  • Simplifying an equation simplifies its two sides separately;
  • Solving an expression is treated as solving the equation formed by setting it to 0.

@vs140580 If you don't care about multiplicities, then using sets would be the best way, and it's trivial to code:

evalb({L2[]} subset {L1[]})

I gave a detailed response 2 weeks ago (it's below) explaining 4 possible reasons for the slowness and 3 possible ways to speed things up. You've given no response about whether they helped or even whether you read them.

I did this without being able to see the procedures/functions that you've defined that are in the integrand.

@AHSAN Ah. The English word that you mean in place of "desire" is "resolution" (in its technical sense related to displayed graphics).

@Christian Wolinski Although your Answer "works" in a limited sense in this case, it may give the user the wrong impression that square brackets can in general be used instead of algebraic parentheses as long as one uses expand afterwards. That's not true in the vast majority of cases. 

@C_R The options that I used are documented on the pages ?plot,axis, ?plot,tickmarks, and ?plot,typesetting.

@Fereydoon_Shekofte I don't see the connection. The matrices in this Question don't have any arithmetic properties, their entries aren't necessarily numbers, they aren't necessarily square matrices, and only rowwise, not columnwise, properties are considered.

@planetmknzm 

Let's say that you've plotted 2 spacecurves (on the unit sphere) and extracted their data arrays as explained at the beginning of this thread. Let's say those arrays are A1 and A2. The following code will give you the (arbitrary number; use however many you want) pairs of indices [i, j] such that the angle between A1[i] and A2[j] is as close to 30 degrees as can be achieved with the discrete (i.e., finite) number of points:

COS:= evalf(cos(30*(Pi/180))): #cos(30 degrees)
[lhs]~(sort([op(2, abs~(A1.A2^%T -~ COS))[]], key= rhs))[..9];
   [[178, 187], [14, 23], [62, 121], [80, 139], [65, 127],
    [74, 136], [15, 191], [10, 186], [29, 39]]

#Check angle of 1st pair:
arccos(A1[178].A2[187]^%T)*evalf(180/Pi);
                          30.00128868


The above computation takes 0.7 seconds on my computer.

I don't know if you've upgraded your Maple yet. Depending on your version, the key option to sort may not work. If that's the case, I can give you an easy workaround.

 

@planetmknzm Which are these scenarios is closest to your situation?

  1. You have a finite list or set of points on the sphere, let's say the points generated for the 2 space curves. You want all pairs of these points that are close to 30 degrees apart.
  2. You have a finite list or set of points on the sphere, the points generated for the 2 space curves. You want all pairs of these points that are close to 30 degrees apart containing 1 point from each curve.
  3. You have two curves that can be parameterized by a real parameter, let's say C1(t) and C2(s). Given a particular value of t, you want to find a value or values of s such that C1(t) and C2(s) are exactly 30 degrees apart.

Options 1 and 2 are crude. I would only use them if I couldn't get the curves continuously parameterized.

@vv Thanks for the correction.

First 83 84 85 86 87 88 89 Last Page 85 of 708