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

@waseem 

I don't understand how what my code does is different from what you want. My code gives three side-by-side plots, each with three curves, and each for a different value of R.

@Markiyan Hirnyk 

The first root that you got from evalf@solve is completely wrong because Maple is applying evalf to the quadratic formula. It is a very well-known result from numerical analysis that the naive application of the quadratic formula to floating-point numbers gives garbage results when one root is close to zero and the other isn't (a phenomenon called catastropic cancellation). Do a Google search on "catastropic cancellation quadratic formula". If you use fsolve instead of solve on the quadratic Taylor polynomial, you will get a result very close to the correct result:

P:= series(mul(x+j, j = 0 .. 2015)-1, x, 3):
p:= convert(P, polynom):
fsolve(p);

Rouben's explanation is sound. I add my vote.

@jahan 

I didn't give you a command for plotting different functions!

You plot for n = 0:

p1:= odeplot(...);

You plot for n = 0.1:

p2:= odeplot(...);

You combine the plots:

plots:-display([p1,p2]);

If you can't figure it out from there, I can't help you any more until you post some code.

@jahan 

Your error is simply because you've misspelled odeplot as odeplots.

To combine two plots, first issue separately the command to generate each plot:

p1:= odeplot(...);
p2:= odeplot(
...);

Then combine the plots with

display([p1,p2]);

This works for any number of plots.

@RAfossey 

You did not use the invztrans command that I gave you! Your rearrangement of the expression has changed its meaning. Your sum has several errors: There should be no f (where did you get f from?), you need a * between the k and the 5, and the limits of summation should be k= 0..n.

If you'd done it correctly, the result of the simplify would've been 1---nothing more.

@patient Use the legend option to the plot. See the attached worksheet.odeplot_(1).mw

@rasemenov What do you mean by "I'd really think twice about piecewise application"?

@jahan The method that you use to solve the ODEs makes no difference. You say that you already know how to make a single plot. The command to combine multiple plots is plots:-display.

Please post your code as an attached worksheet. To attach a worksheet to a post, use the green uparrow tool that is the last item on the second row of the toolbar in the MaplePrimes editor.

@mangaba 

Using Windows 8 64 on an i7 with Maple 2015/64, I get the answer instantly.

Please attach the Standard (i.e., "Java") worksheet that you executed to get this error. Surely there is something suspicious about lend2-lend2, lenh1-lenh1, and degb1-degb1. Sometimes variables can be different even though they appear to be spelled the same, especially in 2D input. An expert can usually detect this by examing the worksheet.

The algebraic expressions in the first part of your Question are ambiguous. You need to use parentheses to clarify them. Also, your summation needs an upper limit. I guess n, but I'm not sure.

The second part of your Question, the part beginning "Also although", is a repeat of your Question from April 20. If you have a problem implementing the Answers that you got to that Question, then you should post a Reply in that thread.

@northpole11 

Here's a "sandbox" for testing/adjusting parameters:

pde1:= diff(f(x,t),t$2) - diff(f(x,t),x$2) = 0:
pde2:= subs(f= g, pde1):
sys:= {
     pde1
    ,pde2
};
INF:= 20:
IBC1:= {
     f(inf,t) = inf, f(x,0) = sin(x), f(-inf,t) = -inf
    ,g(inf,t) = inf, g(x,0) = sin(x), g(-inf,t) = -inf
    ,D[2](f)(x,0) = 0
    ,D[2](g)(x,0) = 0
}:
pds2:= pdsolve(sys, eval(IBC1, inf= INF), numeric, spacestep= .5):
pds2:-plot(f(x,t), x= -INF..INF, t= 0, numpoints= 100*INF);

It's set up to make commenting out specific lines easy. The maximum value of INF for which I get good results (that's with only looking at the t=0 plot) is 20. My guess is that the spacestep should be smaller than 1/4 of the period of the waves. For the initial conditions above, that would be Pi/2.

You wrote:

Anyway varying spacestep seems to help but i don't get the expected result with this.

Well, what are the expected results? I can't work on this without knowing.

What is the best way to set boundary conditions then?

Well, this is getting out of my area of knowledge, but I suppose that you mean What is the best value INF? The plot of the initial conditions gets "choppy" looking for INF >> 20, even at small values of spacestep and large values of numpoints.

@rbd66 

You may have already corrected these (as per your followup edit), but I thought that I'd mention anyway the two issues that I found. The first is that your restart command is in a text field rather than a command field. That's why it doesn't work. The second is that when you want to use the results of one command as input to a subsequent command, then you need to assign the results of the first command to a variable. You had

solve(..., {u[2,2], u[2,3]});
eval(< u[2,1], u[2,2], u[2,3] >, omega[2]);

That needs to be

omega[2]:= solve(..., {u[2,2], u[2,3]});
eval(< u[2,1], u[2,2], u[2,3] >, omega[2]);

or

results:= solve(..., {u[2,2], u[2,3]});
eval(< u[2,1], u[2,2], u[2,3] >, results);

or, for a quick-and-dirty computation,

solve(..., {u[2,2], u[2,3]});
eval(< u[2,1], u[2,2], u[2,3] >, %);

where the % represents the results of the most recently executed command, which is not necessarily the same as the command immediately above it.

Consider the first plot in this Post that's on a black background (it's simply a plot of a gold hemisphere). I guess that that plot was made in MapleSim. Is it possible to make that plot in Maple proper (minus the black background perhaps)? I want it exactly like that, with the metallic effect and the two lights.

First 491 492 493 494 495 496 497 Last Page 493 of 709