Carl Love

Carl Love

28055 Reputation

25 Badges

13 years, 1 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@ 

You wrote:

If Maple solves with rkf45dae it probaly means that is solves dy/dt =f with algebraic equations may be as a constraint.

That is not the understanding that I get from the help page ?dsolve,numeric,DAE_extension. In particular, it explicitly says that the systems can be partially implicit.

Patient, convert all of your equations to dy/dt =f .

That doesn't appear to be possible for this system.

If needed differentiate the algebraic equations,

Patient's system doesn't have any algebraic equations. Nonetheless, it seems to require a DAE solver because of its implicit nature. It is possible that another of Maple's IVP solvers can handle it. I haven't tried yet.

If some one posts *.mws worksheet that works, I will try. ( or at least in that format, 1D math)

The worksheets posted so far in this thread have been in 1D form.

@acer 

Thanks, Acer. Using option threadsafe and using eval to run compiled code inside evalhf were the things that I didn't know about. I made the outer, recursive procedure evalhfable with your suggestion of passing the arguments in an Array and I declared most arguments of the inner, compiled procedure as float. (This was much much faster than the default integer arguments.) With these changes, I made a factor-of-three improvement of your version, coming in at just under six minutes. And I got 100% processor utilization (M18/64 on Windows 8/64). I am curious if you can get 100% utilization on Linux with this. (I also had a version where I only got 65% utilization.) The worksheet is attached.

Note that I was able to use ceil in the compiled code without any threadsafe issues. It makes sense since the compiled C code should be using a completely different ceil. I'd still like to know how evalhf has threadsafe issues when using ceil.

One thing that was a disaster was trying to have one compiled procedure call another compile procedure. In particular, I compiled a version of Ceil, and ran it in parallel. I used threadsafe in both (and they truly were threadsafe). The execution deadlocked immediately: No processor usage, no memory comsumption, no way to kill the program other than killing the kernel. In another case, I didn't use threadsafe in either. This code executed correctly, but much slower than if I had just used uncompiled Maple. So, do you know anything about one compiled procedure calling another?

Download LatticeCountmodif4f.mw

My algorithm is incorrect. (It has a fundamental flaw, not just an error in coding.) The one posted by Kitonum in a separate Post is correct and much faster. So this is probably a moot point. Still, I learned a lot about making programs faster and was able to combine three of the major techniques (evalhfCompile, and Threads) into one short program.

@momoklala 

One problem is the in Eq1. It should be B*. The way it is now makes it a function rather than a coefficient. However, making this change, I still don't get what your instructor got. You may still be entering parts of Eq1 incorrectly. Perhaps you should post the original statement of the problem.

@acer 

Okay, I see that the problem is that eval may not recognize expressions that become 0/0, and it may evaluate them based just on the numerator. So what can be done in this specific case? My unconfirmed belief is that curve crosses the axis at 3220 and its tangent is vertical there. Is there any way to confirm or disprove? 

@ecterrab But PDEtools:-dsubs doesn't work with expressions in notation, which is the point of this Question.

@Markiyan Hirnyk That 3220 is a root for any x can be verified by exact computation. I explained that in my Answer.

pp:= -55471918776960000*tanh((1/3220)*sqrt(10368400-cp^2)*Pi*x/cp) +
           5350094400*tanh((1/3220)*sqrt(10368400-cp^2)*Pi*x/cp)*cp^2 -
           129*tanh((1/3220)*sqrt(10368400-cp^2)*Pi*x/cp)*cp^4 +
           2670899840*tanh((1/6450)*sqrt(41602500-cp^2)*Pi*x/cp) *
           sqrt(41602500-cp^2)*sqrt(10368400-cp^2):
eval(pp, cp= 3220);

     0

So, it is unquestionable that 3220 is a root. You pollute the computation by using decimal points in the 8000 and 3220. That Roots is unable to find the root at 3220 is up to floating point error. Note that the curve becomes vertical at that point, which can confuse root finders. Check the derivative at 3220.

In Maple 18, I get
Digits:= 150:
eval(x= 8000.0, pp), cp= 3220.0);

     0.

which differs from what you got.

@Sagar With respect to which variable are you integrating from 0 to 1? with respect to t? with respect to X?

@Kitonum Shouldn't you be using chebpade instead of pade?

@Markiyan Hirnyk 

That's an astounding performance by DirectSearch:-GlobalOptima. What's the significance of the 2921? I thought that it was the number of objective function evaluations. But if there were only 2921 evaluations, what was it doing for several hours?

@Markiyan Hirnyk 

I don't understand what point you're trying to make. Your plot and computation simply confirm what I said.

@Markiyan Hirnyk 

Maple can complete the integration even without knowing eta(t) if you follow the steps in my Answer below. Since the integration is wrt x, the functions of can be factored out.

@reinhardsiegfried 

Oh, yes, you can use any strings whatsoever as the labels of the legend. There is no need to include the algebraic expressions such as xx^2, or x^3.

@kegj 

So there really is no course website that you could direct me to? That is suprising. That makes it hard for me to help you. Could you email me (privately) photographs of the syallabus and exercises? If so, I'll send you my email address.

What data structures have you covered? Lists, tables, arrays, stacks, queues? Perhaps even trees and graphs?

As to control flow, fortunately there's only a handful of statements that you need to know. Study their help pages thoroughly. They are
for...while...do
if...then...elif...else
proc 
return 
break
next

and perhaps try...catch...finally and module.

(return only makes sense inside a procbreak and next only make sense in a do loop.)

By the way, I think that you are being too harsh on Rouben. I believe that his advice was well intentioned but overly idealistic. As a professional tutor who helps students study for exams, I know that studying for the exam is essential for the vast majority of American college science courses.

@tomleslie 

Most of the old-timers here on MaplePrimes are inured to bug reports: We've seen literally thousands of them. Just because we don't get emotionally worked up over them doesn't mean that we find them acceptable. So, most bug-related discussion here is about finding practical solutions (aka workarounds) to your problems that can be implemented immediately, before the bug is fixed.

You should use the green uparrow to upload your worksheet. That is much more useful than pictures. The green uparrow is the last tool on the second row of the toolbar in the MaplePrimes editor.

My first guess is that the fsolve is being executed, but that it cannot find any real solutions. You can determine if this is the case by putting the fsolve command in its own execution group, or by using 1D math.

First 487 488 489 490 491 492 493 Last Page 489 of 709