Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

@Preben Alsholm

I see your point. The stepsize clearly makes a difference. 

@Jahani_21 

You have an existing thread on Riemann sums. Followups about Riemann sums should go in that thread.

@Yiannis Galidakis

The evalhf command has been around since at least Maple V r 4, which was also my first version. You should've been using it since the very beginning. It originally didn't work with complex values, but I used to code Julia sets by working with the real and imaginary parts separately.

You just take the Answer to your previous question, change 4 to 2, change 100 to 200, and change sqrt to (x-> x^3). If you're incapable of that level of abstract thinking, you really, really don't belong in whatever class you're taking.

@Jahani_21 What do you think the line below does???

Exact:= int(sqrt(x), x= 0..4);

It "calculate[s] and output[s] the actual area using integration."

@Jahani_21 Just change the second parameter from 20 to 10. That should be obvious.

plot(Sin(x,10), x= -2*Pi..2*Pi);

This thread about the Taylor expansion of sine. If you want to discuss Riemann Sums, USE A DIFFERENT THREAD! I just deleted all other references to that other topic from this thread.

Why would you alter it? Unless you have a special algorithm that works for numbers with only four prime factors, what's the point? Just compute n and apply quadsum.

@tomleslie Yiannis (the OP) is using a 400 x 400 grid and 300 max iterations per point, 88 average iterations per point.

@J4James 

Setting Digits:= 5 gives much faster plots, even at 500..511 t range Preben used. Not every initial condition leads to the cycle (they may lead to singularities, or the at least the numerical method thinks they do), so I chose a random 5. This plot is nearly instantaneous:

randinitial:= combinat:-randcomb(initialset, 5);
Digits:= 5:
DEtools[DEplot](
     [Eq||(1..5)], [x,y,z,v,w](t),
     t= 500..511, maxfun= 0,
     randinitial,
     linecolor= magenta, axes= boxed, scene= [x,y],
     view= [5.2..7.2, 0.2..1.6], scaling= constrained,
     thickness= 0
);

@Preben Alsholm

I noticed that you changed the stepsize from 0.01 to 0.1. This has no effect. The stepsize is only used with classical methods. The default method is rkf45 (same as dsolve), which uses variable step sizes chosen based on error-tolerance settings.

@Chirag I am sorry, but that is far beyond my level of knowledge, and I can't give you any help with it.

@Kitonum 

The algorithm is simply to "walk" along the circle x^2+y^2 = n in a down-the-staircase manner from theta = Pi/4 to theta = 0. If the current point is outside or on the circle, we step down (decrement y); if it is inside the circle, we step forward (increment x). My major improvements were to use isqrt (which is extremely fast) to avoid unit stepping, and to avoid unnecessay recomputation of the squares.

@GPY Certainly. I see how that could be confusing. x2 + 2*x - 1 is the new value of x^2. Here's a proof: Let x be given, let x2= x^2, and let newx= x+1. Then

newx^2 = (x+1)^2 = x^2 + 2*x + 1 = x^2 + 2*x + 2 - 1 = x^2 + 2*(x+1) - 1
           = x2 + 2*newx - 1. Since we've changed x to newx, that becomes x2+2*x-1.

@Chirag 

Yes, of course, if you replace diff(theta(t),t) with theta_prime(t) then theta(t) is completely meaningless to the system. Of course you get 0 as an answer. You need to change the EulerLagrange command to

EulerLagrange(L3, t, theta_prime(t));

Then you will get the answer that you expect.

@J4James 

The complexity of the plot is very affected by your range of t (the independent variable) and by the number of initial conditions that you use. Your original set of initial conditions numbered 180. I decided to work with a randomly selected 5 to 10 of those.

The quality of the plot is greatly increased by setting thickness= 0.

Re-execute this several times to get different random subsets of initial conditions.

randinitial:= combinat:-randcomb(initialset, rand(5..10)());

DEtools[DEplot](
     [Eq1,Eq2,Eq3,Eq4,Eq5], [x(t),y(t),z(t),v(t),w(t)],
     t= 0..140,
     randinitial,
     stepsize= 0.01,
     linecolor= magenta, axes= boxed, scene= [x(t),y(t)],
     view= [5.2..7.2, 0.2..1.6], scaling= constrained,
     thickness= 0
);

First 505 506 507 508 509 510 511 Last Page 507 of 709