Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@mehdibaghaee Actually, Tom's first set of commands will also produce the results that you want. At first reading, I hadn't realized that that first set also started with the Array command, which is the crucial difference from your code.

@vv Using Newton's method with Digits:= d is sufficient to accurately solve erf(z) = 1 - 10^(-d).

@Preben Alsholm Instead of using the "magic number" 1e-22*I, I'd rather do this:

restart:
u:= ((-5*ln(x)^4-20*ln(x)^2-8)/120 + MeijerG([[0$2], [1$3]], [[0$5], []], x^Pi)/Pi^4)/(x-1)^2;
ode:= diff(y(x),x) = Re(u);  #*** Notice the Re. ***
res:= dsolve(
   {ode, y(.4) = 0}, numeric, 
   output= Array([.6]), relerr= .5*10.^(1-Digits),
   method= dverk78  #*** Notice the relerr and method. ***
)[2][1][1,2];

Result:  -0.555168769092963e-2

Default method rkf45 gets fewer correct digits.

@mehdibaghaee If you use Tom's second set of commands, then Wn[0,0,1] will return 3.

@Markiyan Hirnyk Vote up. This is a very useful method to keep in mind. The accuracy that you achieved is amazing considering your very large epsilon. Using default epsilon, it uses about 3 times the effort (set infolevel[`evalf/int`]:= 5 to see that), but it only makes a difference to the least-significant digit of the result.

How did you come to choose such a large epsilon?

@Rouben Rostamian  Thanks, that was a very clear explanation. Vote up.

@Rouben Rostamian  I don't see the relevance of finding the values of x that simultaneously make both the first and second derivative 0.

I can't make sense of your Question. A vector field in the Euclidean plane is a function R^2 -> R^2 (i.e., 2 real inputs and 2 real outputs). For example:

VF1:= (x,y)-> < x^2 + y^2, x^2 - y^2 >;

I don't see anything like that in your Question.

@elen When you say "when I type enter, nothing will be done", do you mean that nothing at all happens---that there's no output at all? Or do you mean that you get output (blue text) that is equivalent to your input? If you get no output at all, then there is some serious low-level problem with your installation. But I'll guess that you have the other situation: Your output is equivalent to your input. Well, you didn't ask for anything to be done other than to name your equation eqn, which Maple did do, right? What do you want done with your equation? If you enter some simple arithmetic like 2+3, it's reasonable for Maple to guess that you want that simplified to 5. This is called automatic simplification. But with your eqn, there's no obvious thing to do with it. You need to ask for something. Do you want to solve the equation for a? Then enter

solve(eqn, a);

@max125 

Yes, if V is a list or set, then V[] returns the arguments (or entries). This only works for lists and sets.

Regarding the s: It does appear in eval([H,HD], s), which is nearly equivalent to subs(s, [H,HD]). Note that every value of s is a set of the form {x= ..., y= ...}, and H and HD do in general contain x and y. To evaluate an expression at particular values of its variables, it's preferred to use eval rather than subs. See ?eval, and note that there are two completely different commands named eval that are described there. The eval that you used in your Question is one of them; the eval that I'm using is the other.

@Britzel There are many ways to do that, and copy-and-pasting code is never needed or recommended. Most of the good ways of doing it involve having an initialization file. Do you have one? If not, see help page ?worksheet,reference,initialization. Create an initialization file, and get back to me. Or get back to me if you have trouble creating the file.

@raskr Indeed, your worksheet has convinced me that Maple 2017 is the lone exception. Thus, it is the only version of Maple for which displayprecision does something reasonable. Its behavior in Maple versions both before and after Maple 2017 is ridiculous.

I think that this is an intermediate representation that's internal to the GUI and external to the kernel. If I enter

_EXPSEQ(1, -1);

at a command prompt, and I have interface(prettyprint) set higher than 1, then I get just

      1, -1

So, the _EXPSEQ part seems to be some instruction for the GUI to process.

Please issue the commands

interface(version); kernelopts(version);

and check that the "Build ID" (the final number) of each matches.

 

@mmcdara I fully understand the situation that you're describing and have illustrated in your two most-recent worksheets "Still_not_clear" and "reply". Yes, I agree that those illustrate a weakness of Maple. I'm not sure that I'd call it a bug. I will get to addressing those issues. However, this is not the same issue as occurs in the worksheet "NeedHelp". My answers so far have applied to that worksheet alone (because it was the only worksheet at the time that I wrote my first two answers). In that worksheet, you used op to extract the polynomial from a RootOf and proceeded to get solutions for that polynomial (using subs, then solve, then allvalues). After you've explicitly extracted it, that polynomial is (and rightly ought to be) independent of the original radical equation from which it was derived. That polynomial has some roots that don't satisfy the original equation. As I've tried to illustrate, that's a mathematical necessity. So you can't blame Maple or its solve command for that; you can't say "Mr Maple has done only a part of the job" because solve (correctly) can only see the polynomial, not the original equation.

So please look over NeedHelp again very carefully and then tell me if you now understand and agree with my replies

  • In the first case, you've used solve on an equation that contains radicals. In the second case, you've used solve on a non-radical polynomial equation derived from the radical equation. As is very well known, that process has the risk of introducing extraneous solutions.  Those solutions need to be verified in the original equation.
  • It [The introduction of extraneous solutions] is a fundamental mathematical principle....

in light of the fact that that worksheet was the only thing that I had to work with at the time that I wrote those replies. When I said "Those solutions need to be verified," I did not mean that all solutions produced by solve need to be verified; I was only referring to those solutions produced by the process that I described in that paragraph.

After you reply, I'll address the other issue. Please only address the issues in the worksheet NeedHelp without adding any more context or worksheets.

@mmcdara If you've done the exercise as instructed, then you've converted the radical equation into a polynomial equation without radicals. Doing that involved two steps of squaring both sides of the equation (thus applying a non-injective function to both sides of the equation). The polynomial is a very simple quadratic with two roots. Only one of those two satisfies the original equation.

Now look at every RootOf expression in your two worksheets NeedHelp and Still_not_clear. Notice that the first argument of every one is a polynomial with integer coefficients and no radicals. The process of deriving those polynomials from the original radical equation involves steps equivalent to raising both sides of an equation to an integer power. So a non-injective function has been applied.

You have done different things in the two worksheets. The differences may seem insignificant to you, but they change the precise reason why you got a different number of results from solving in two different ways. My first two answers only apply to the worksheet NeedHelp because you hadn't yet posted the other.

(to be continued.)

 

First 316 317 318 319 320 321 322 Last Page 318 of 709