Carl Love

Carl Love

28045 Reputation

25 Badges

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

MaplePrimes Activity


These are replies submitted by Carl Love

The code that you gave above does not parse. The first statement in the first for loop has two := assignments, which Maple does not allow. Correct the syntax errors, and then I'll have a look at the optimize issue. It is not possible that the code that you have above gave the warning messages that you describe because that code never would've gotten past the parser.

@acer Do you have any idea what went wrong with the method (and the method) that I used?

@acer Do you have any idea what went wrong with the method (and the method) that I used?

When the technique is applied to a definite integral, a spurious imaginary part is introduced, although the real part is correct. I guess that it is jumping over branch cuts.

restart:
J:= Int(sin(x)/cos(x)/sqrt(1+sin(x)^3), x= 0..Pi/4):
FWIW, note that the integrand is analytic in an open disk centered at the origin and
containing both endpoints of integration.
IntegrationTools:-Change(J, t= sin(x));
              /0                                    
             |                       t              
             |            ----------------------- dt
             |                     (1/2)            
            /       (1/2) /  3    \      / 2    \   
             - 1/2 2      \-t  + 1/      \t  - 1/   
value(%):
evalf(%);
            0.322446488989322 + 0.555360367269405 I
evalf(J);
                       0.322446488991541

When the technique is applied to a definite integral, a spurious imaginary part is introduced, although the real part is correct. I guess that it is jumping over branch cuts.

restart:
J:= Int(sin(x)/cos(x)/sqrt(1+sin(x)^3), x= 0..Pi/4):
FWIW, note that the integrand is analytic in an open disk centered at the origin and
containing both endpoints of integration.
IntegrationTools:-Change(J, t= sin(x));
              /0                                    
             |                       t              
             |            ----------------------- dt
             |                     (1/2)            
            /       (1/2) /  3    \      / 2    \   
             - 1/2 2      \-t  + 1/      \t  - 1/   
value(%):
evalf(%);
            0.322446488989322 + 0.555360367269405 I
evalf(J);
                       0.322446488991541

Do all of yangtheary's problems come from a list of problems posed by Robert Israel? Is yangtheary Robert Israel in disguise?

Do all of yangtheary's problems come from a list of problems posed by Robert Israel? Is yangtheary Robert Israel in disguise?

@Bendesarts I don't know about exporting it,

@Bendesarts I don't know about exporting it,

@abbeykabir Thank you for the kind words.

Sorry, I have no idea what "error analysis" means with respect to this problem.

I noticed something about the way you set the values of the x[i] that seemed strange. This might be the source of your problem. You have

x[i]:= x[i-1] + i*h

I think that should be either (both the below are equivalent)

x[i]:= x[0] + i*h

or

x[i]:= x[i-1] + h

You are essentially doing both of the above, with the result that your x[i] are not evenly spaced (and that seems strange to me).

You are right about seq, but not every for loop can be replaced by seq.

First check out what I said about the x[i]'s, then I'll show you how to replace your for loop.

@abbeykabir Thank you for the kind words.

Sorry, I have no idea what "error analysis" means with respect to this problem.

I noticed something about the way you set the values of the x[i] that seemed strange. This might be the source of your problem. You have

x[i]:= x[i-1] + i*h

I think that should be either (both the below are equivalent)

x[i]:= x[0] + i*h

or

x[i]:= x[i-1] + h

You are essentially doing both of the above, with the result that your x[i] are not evenly spaced (and that seems strange to me).

You are right about seq, but not every for loop can be replaced by seq.

First check out what I said about the x[i]'s, then I'll show you how to replace your for loop.

@Alex Smith : If you don't like the 2d input, why don't you just make 1d Maple Input the default?

I agree with you about the pedagogical value of the Maple Input syntax.

@henryabiola Does your matrix contain n[s] in element a11? Or should that be eta[s] as in element a22?

Also, note that you mislabelled element a56 as a66.

@mehdi jafari 

Let S(d) = sum(p(k), k= 1..10^d-1)

(so S(2) = p(1) + ... + p(99), for example).

Then S(d) satisfies the recurrence

S(d) = 46*(S(d-1) + 1) - 1, S(0) = 0.

Using this, it is easy to get the answer "by hand" as

2*S(3) + 1 + 2 + 2*S(1) + 2 + 2 + 4 + 6 + 8 = 194785

Note: 1+2+...+9 = 45

Yes, I will help. Just try to write something in Maple, however crude, for the Euler method for a single equation. Then post it here, send me an email, and I'll help.

Oh, by the way, these methods are pre-coded into Maple's dsolve command, but I guess that you have been assigned to write them from scratch. Well, at least that gives you something to compare your answers with. See ?dsolve,numeric,classical .

First 623 624 625 626 627 628 629 Last Page 625 of 709