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

@primogen Please post your worksheet by using the green uparrow that's on the top line of the toolbar of the MaplePrimes editor.

@primogen expr is my name for whatever your expression/equation is. Go to the command line that generates your expression that you want to differentiate. Begin that command line with expr :=  .  This operation is called assignment; it's the most fundamental operation in most computer languages. You can (and should!) replace my expr with whatever name is actually meaningful for your situation.

@torabi Your syntax issue is due to the curly braces { } that you used in the assignment to ICs. Get rid of them. The plot specification should be [t, Z(t)], not [t,v], which'll just plot a constant as we discussed already. 

After that, there are convergence issues. I think that you are misinterpretting that PDF. You seem to think that V(t) and v are the same thing. That seems pretty strange to me. And what happened to lambda= 0.11?

@ainsyah The numeric solution of BVPs of this type (nanofluid related) is one of the most commonly asked Questions on MaplePrimes, and searching the archives should turn up hundreds of posts (although, I have to admit, the search feature of MaplePrimes is a very bad search engine, and hence I rarely use it). I just wrote a very long Post on this topic three days ago. It is currently the second-most-recent Post (in the Recent Posts section).

Please read that Post and download the worksheet. Make a copy of the worksheet with a scratch name. Open that in Maple. Try to follow my format for entering the ODE, the BCs, etc. Just practice with that at this point. Don't worry about solving yet. I'll be awake for a few hours probably, so post your worksheet as soon as your improvement of it and your learning starts to slow down significantly. If you have specific questions, type them right in the worksheet.

You are missing one boundary condition.

I don't know much about the symbolic solution of this type of problem. I'm amazed that it's possible at all when all the parameters are symbolic, or even numeric but nonzero.

 

@Ronan You are using y on the left side of the equation, but Y as an argument to collect; whereas Christian used Y in both places.

Could you post a screenshot showing any of the above expressions in actual use, either as input or output?

@torabi Well? I'm not going to type those equations into Maple. You type them, then I'll help.

My theoretical knowledge of electricity is small, but I think that what you show as V(constant) should be 0, i.e., the voltage varies sinusoidally between -3 volts and +3 volts. If I am wrong about that, then you'll need to either specify the constant part, or give one more initial (t=0) or boundary (t = b, b <> 0) condition for Z or Z' (or a condition combining Z and Z').

@ecterrab Wow, that was shortest time between a bug report and a published patch for it that I've ever seen from Maple. Good job!

@kencom1 I thought that maybe they were intended to be functions. In that case, they should be defined as "arrow expressions":

L[1]:= f-> diff(f, eta$3) - diff(f, eta)
L[2]:= theta-> diff(theta, eta$2) - theta

Now, it doesn't matter that f and theta are re-used, because any variables on the left side of an arrow are local to that arrow expression.

Note that this WON'T work: L[1]:= f-> diff(f(eta), eta$3)  - diff(f(eta), eta). I mention it because it is closer to what you had.

Remember that now you'll need to take away the extra spaces that you may have added because of the previous Answer.

When you see unexpected tables appearing in error messages, the cause is usually attempting to use a "parent" name after an assignment has been made to one of its indexed "children". The assignment turns the parent into a table.
 

What is the range of your parameter A? Are complex solutions for x3 and x4 acceptable?

@torabi If V(t) is constant, then why are you interested in plotting it? Or did you mean that you want to plot Z(t) vs. t?

@David Sycamore 

Maple's Li is the integral from 0, so Li(x) - Li(2) is the integral from 2. Neither of these functions has any singularities for x > 2, which is the only useful domain for our purposes.

The issue with .../2/p vs. .../2*p has nothing to do with generating the data. It only affects the asymptotic function, so, only the plot. 

"Decoupling" the code that counts the pairs from the code that generates the plot is utterly, utterly trivial, so I encourage you to just do it, and if you do it incorrectly, I''ll let you know.

The thing with the r-tuples is vaguely interesting. Since it's simple to code, I'll do it. It will be slower than the code for pairs, but not horribly slow. It is the "independence" that makes these things less than fully interesting.

@David Sycamore 

There is a certain aesthetic to asymptotic expansions. I automatically think of the terms being "nice" functions. Li(x), x > 2, is a very nice function---strictly monotonic, analytic, and capable of being quickly evaluated to arbitrary precision for arbitrarily large arguments; whereas pi(x) is a nasty function with none of those properties. But we know pi(x) ~ Li(x). (*1)

Maple's Li is the Li used in analysis. The Li used in number theory requires a tiny adjustment: It's Li(x) - Li(2). This doesn't change the asymptotic relationship (*1).

Now here's the easy rest of that derivation that I left for the interested reader:

Let's suppose p > 3 is prime. The only two inverse pairs with a repeated number are (1,1) and (p-1,p-1), neither of which contain a prime. There remain (p-3)/2 pairs to check, each being a pair of distinct values. The expected number of prime pairs is

"number of pairs" * "probability that an arbitrary pair contains two primes". (*2)

Assuming the "asymptotic independence", (*2) becomes

(p-3)/2 * "prob. 1st member of pair is prime" * "prob 2nd member is prime" =

(p-3)/2 * pi(p-2)/(p-3) * (pi(p-2) - 1)/(p-4) =

pi(p-2)*(pi(p-2) - 1) / (2*(p-4)) ~

(Li(p-2) - Li(2))*(Li(p-2) - Li(2) - 1)/2/(p-4)

This is a slightly sharper estimate than I had before. Note that the singularity at p = 4 is removable. I can use pi(p-2) because it's guaranteed that p-1 is composite.

@Josci95 

The command randomize(42) does the same thing globally. So, the seed option to GenerateGaussian is superfluous. Using randomize() with no argument sets the seed to a value based on the system clock.

When the GenerateGaussian command was introduced, I immediately noticed that its code contained a randomize() call. If this had stayed, it would've prevented the possibility of doing exactly the thing that you want to do---generate reproducible random numbers. I complained, and MapleSoft immediately fixed the command and someone threw in that seed option, I guess not realizing that it was superfluous. That's why the seed option is not mentioned in the top section of the help page ?GenerateGaussian---because it was added at the last minute.

What is the size and datatype of your matrices? Even for dense matrices of hardware floats with millions of entries, getting the generalized eigenvectors on my computer takes less than 10 seconds:

(FF1,FF2):= 'LinearAlgebra:-RandomMatrix(1600,1300,datatype= float[8])'$2:
CodeTools:-Usage(
   LinearAlgebra:-Eigenvectors(LinearAlgebra:-MatrixInverse(FF2, method= pseudo).FF1)
);

memory used=260.99MiB, alloc change=247.71MiB, cpu time=8.89s, real time=4.47s, gc time=0ns


The fact that the real time is significantly less than the cpu time indicates to me that there's already some parallel programming being used.

First 301 302 303 304 305 306 307 Last Page 303 of 709