Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@bliengme Thank you for the kind words. I look forward to seeing the plot that you come up with. There are so many options that can be added.

Unfortunately, you've introduced a major new error into the worksheet, and it's much more serious than anything else discussed so far in this thread. It's only by a remarkable coincidence that you still got the correct final answer. The error is the line k:= k*t. The remarkable coincidence is that that's effectively the same as temporarily setting t=1, which happens to be what t should be at that point. But you can't rely on that! And it's totally baffling to the reader.

@Kitonum Thank you for catching that. I corrected the code in the original.

The OP's header says Maple 2018. In that case, features like until and embedded assignment are too good for me to not use. If there's any legitimate request, I'll retrofit the code.

@Hyan The parameterization is trivial in this case. Just use Kitonum's Answer with the corrected function.

@Hyan "The function provided" -- I think that there's a mistake in your function, 2*x^2 + 3^2 - x*y - 4, because it's highly unusual for a problem at this level to be stated in a form that can be simplified by trivial arithmetic, 3^2 - 4 = 5. So, would you check that please?

"I know spacecurve is for vector sketching" -- I suppose that you could say that. It depends on how you define "vector", whose mathematical definition allows some flexibility (particularly with respect to whether there's a geometric or algebraic point of view). Certainly, points in space could be (and often are) considered vectors. For me, the key distinctions among the various plotting commands are the number of dimensions of input and output. The command spacecurve is for functions from R^1 to R^3 (R = real numbers), i.e.,1 dimension of input and 3 dimensions of output. So, often a space curve is called a "vector-valued function of a single real variable".

"but f(x,1) and f(1,y) should be polynomials right?" -- Yes, they're polynomials (in one variable), but that is a bit beside the point if your interest is getting the space curves. The (totally abstract) specification of a space curve requires at least two equations in three variables[1]. A more-practical specification, and that which is required by spacecurve, is a parameterization: a list (or vector) of three functions of a single real variable. For example, plotting f(1,y) as a space curve could[2] use the parameterization [1, y, f(1,y)], provided that f has been suitably defined, as it is in Kitonum's Answer below.

[1]The situation of 2 equations in 3 variables is handled by plots:-intersectplot. For example, {z = f(x,y), x = 1} is a set of 2 equations in 3 variables, and it's an abstract specification of the space curve in question as the intersection of two surfaces.

[2]I said "could" because parameterizations are not unique. There are an infinitude of parameterizations possible for any given space curve.

@isifesai You can't assign values to both x and x[i] and use them independently. The two names are intrinsically linked. So, you need to change one of the xs.

You should call or email the Maplesoft Customer Service Department.

Since your situation seems a bit suspicious to me, I won't be surprised if they make you take some extra steps to verify that you are the legitimate owner of the license.

@Kitonum Why is it better to not set global Digits?

@vv Oops, I just made a small change to the example code. Please try it again. If you read the plaintext file, you'll understand why the switch makes a difference. This time, there's definitely a difference between .m and .mpl files.

So, the issue has nothing to do with tables or eval.

@jthress1 Hmm. Over the years, I have occasionally noticed non-idempotency in simplify. That is, one hopes that for any X the following relation is true:

simplify(X) = simplify(simplify(X))

But I have definitely (although rarely) encountered situations where the right side is simpler. This may apply in your situation. These should be considered bugs.

Regarding your attempt at further simplification: subs is not algebraically sophisticated. In order for subs(A= B, C) to work, A must be a distinct entity with its own memory address that C has a link (or links) to. Another way of looking at it: If you think of C as a tree of its subexpressions, then A must be a node (or nodes) in that tree.

You can do some more sophisticated substituting like this:

simplify(X, {n__x*u + n__y*v + n__z*w= lambda});

However, this only works for expressions that are essentially polynomials.

@acer If DF is a DataFrame containing columns C1, ..., Cn, then with(DF) is like C1:= DF[C1]; ...; Cn:= DF[Cn];

@bliengme Plot axes can be any variable that you want. And you can include units in the labels. For example (assuming that Z is a function of t, not of x):

plot(Z, t= -6..2, labels= [time*Unit(hour), Temp*Unit(Fahrenheit)]);

@jthress1 You wrote:

  •  Here is my attempt with your method. Did I input this in incorrectly?

It looks correct to me. Is there something that made you supect that it was wrong?

Here's a systematic way to check such a large expression. The command for searching an expression for subexpressions of a certain type is indets. Square roots are stored internally as expressions raised to fractional powers whose denominators are 2. The command for extracting the denominator of a fraction is denom. So the type spec for a square root is anything^(2 &under denom). So the indets command to check your matrix X is

indets(X, anything^(2 &under denom));

If I do the substitution and call the res ulting matrix X1 and rerun the indets with X1 in place of X, the empty set is returned, indicating that there are no more square roots.

@Joe Riel I had the same experience as the OP: On some runs, the solution is simpler: One way that it's simpler is that there are no square roots in denominators.

@jthress1 You're not doing anything wrong. The issue is as Joe said. Square roots that appear in denominators are stored internally differently than square roots in the numerator, even though the two may appear the same in the GUI display. (You can use lprint to view something  that's much closer to the internal storage format.) Thus they need to be subsed separately (which nonetheless can be done in a single Maple command).

However, for some unknown reason, my original X has no square roots in denominators, so my subs works.

@awass If I cut and paste your procedure and correct the quotes, then everything is fine. So, I'd like to see your worksheet to see where these quotes come from. I am absolutely certain that those quotes are the problem.

The help page says that description should be followed by a "sequence of strings". Strings have quotes.

First 305 306 307 308 309 310 311 Last Page 307 of 709