acer

32343 Reputation

29 Badges

19 years, 327 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@Carl Love Thanks.

Perhaps that means that somebody has edited the Question's body and defaced it by removing the original example.

I hope it wasn't the original poster. Deleting one's own question -- after anyone's spent time looking into it -- is very inconsiderate behaviour.

@Carl Love Where is the question?

@Rouben Rostamian  

That obtained solution procedure U only allows requests for arguments within the (earlier) specified range. Ie,

  U(-1e-5, 0.5);
    Error, (in solnproc) requested y value must be in the range HFloat(0.0)..HFloat(10.0)

And the call -D[1](U)(0,0.5) invokes fdiff to approximate the derivative numerically. It uses a simple symmetric differencing scheme with h=Float(1,-Digits/2), and thereupon attempts to call,
  U(-0.5e-5, 0.5)
which throws that same error. That error is caught and absorbed, in this situation.

With default working precision you could get this approximation,

  -D[1](U)(0.5e-5,0.5);
                    0.5443737835

Of course one is free to approximate the derivative manually, in some other fashion.

@MalakMMK You should show us all that you've done.

You can upload your worksheet using the green up-arrow in the Mapleprimes editor.

@Carl Love I thought those produce 1x3 Matrices. The OP asked for row Vectors, so I rejected those ways.

(I too concocted those ways, at first. And I thought that I'd checked them, in Maple 2022.1, ... but perhaps I missed something.)

@MalakMMK Did you look where (and how) I used either a simple iterative formula or a few iterated steps?

That is, using u[i], v[i], and u[i+1] instead of, say, x[n], y[n], and x[n+1].

Have you tried adjusting the formulas yourself?

Is this work for an academic course or project?

@MalakMMK I don't understand what you're trying to say.

@mmcdara Sure. Tabulate is just an easy-to-use front end, for some common situations.

Tabulate is built from those lower level DocumentTools widgets&things (Layout & Components), of which you've shown an example. Naturally, one can build more flexible or targeted applications from those, for specific situations.

@tomleslie The OP stated, "Note I want to monitor points during the loop running not after it finishes.", and what you've shown doesn't provide that.

@vs140580 Please add your very close followup query here, and not in a separate Question thread.

What are your ranges for alpha and eta?

Read binary file

I see that link in the Recent Questions subpanel (when I scroll down on my phone, or at the right on my computer).

I think that it didn't disappear from the Recent Questions subpanel/tab. But it wasn't listed in the recent/all set of freshly changed postings. I edited it, to make it appear there too.

@Axel Vogt Thanks, that's interesting. Above I used Maple 2022.1.

Those other examples like fsolve(IIf, 7..8) work OK for me (and quickly) in my Maple 2021.2 for Linux. I'll try and find a moment to check Windows.

@wswain You need to assign an initial value to the iterations variable. If you don't then the line,

  ++iterations;

involves a recursive assignment.

Eg,

Trial := proc() 
    
    local y2, test1, iterations:=0; 
    y2 := Vector(5, fill = 0.); 
    y2[5] := 1; 
    test1 := 1.0; 
    
    while 1e-5 < test1 do
        test1 /= 2.0; 
        ++iterations; 
    end do; 
    
    test1; 
    iterations; 
        
    end proc:

Trial();

        17

@Mac Dude Like many quadrature algorithms, Romberg's method's accuracy is related to smooth higher derivatives. It's not well suited to this problem, and accuracy problems here should not be a surprise.

I suspect that the OP asked about numeric quadrature because his choice of syntax for symbolic integration incurs a time-consuming computation. But, as I hoped to have shown, the symbolic integration can produce an accurate result quite quickly, using a more suitable syntax.

First 100 101 102 103 104 105 106 Last Page 102 of 592