Carl Love

Carl Love

28055 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Why not this?

xlist:=[seq(X1(i), i=1..10)]:
flist:=[seq(F(xlist[i],i), i=1..10)]:

The inner integrand has a singularity of order O(1/x^3) at x=0, so this can't be integrated over. This can be determined by looking at the leading term of the Laurent series.

f:= HankelH1(1, x*exp(I*Pi/4))^2/x;

series(f, x=0, 0);

 

Okay, here is a point plot in the complex plane of the roots of the numerator and denominator.

f:= 6*(20*z^5+137*z^4+450*z^3+850*z^2+900*z+420)
     /(300*z^6-1490*z^5+4197*z^4-7800*z^3+9600*z^2-7200*z+2520):
R1:= [fsolve(numer(f), complex)]:  R2:= [fsolve(denom(f), complex)]:
plot((L-> [Re,Im]~(L)) ~ ([R1,R2]), style= point, symbolsize= 16,
      legend= [numer,denom], labels= [Re,Im]);

The (only) command that you need to use is PDEtools:-dchange.

restart:
macro(E=E(x,y,z,t)):
PDE:= diff(E,x$2)+diff(E,y$2)+diff(E,z$2) = mu0*eps0*diff(E,t$2):
PDEtools:-dchange({x= r*cos(theta), z= r*sin(theta)}, PDE, simplify);

 

The error message indicates that broSet is not initialized. There needs to be a line somewhere such as

broSet:= {};

If that is not enough information for you to be able to solve the problem, then please post the whole code.

restart;
ode:= diff(y(t),t) = t*(1-0.3*t)-t*y(t)/(1+0.6*t):
ic:= y(0)=1:
Sol1:= dsolve({ode,ic}, numeric):
Sol2:= dsolve({ode,ic}, numeric, method= classical[foreuler], stepsize= 0.1):
P1:= plots:-odeplot(Sol1, [t,y(t)], t= 0..1, color= red, legend= rkf45):
P2:= plots:-odeplot(Sol2, [t,y(t)], t= 0..1, color= green, legend= euler):
plots:-display(P1,P2);

The problem is that your procedure WindowN does not know what to do when passed a symbolic value of Ci. Remember that arguments are evaluated before they are passed, so it's trying to evaluate WindowN(RP0,Ci,CangleWidth+Ci).

There are two solutions. The first is to use unevaluations quotes on the call to WindowN:

'WindowN(RP0,Ci,CangleWidth+Ci)'

The second, the one I'd prefer, is to have WindonN return unevaluated when appropriate. Include this line near the beginning  of WindowN:

if not args[2]::realcons then return 'procname(args)' end if;

You can (and should) substitute the actual second parameter name where I have args[2].

First, you misspelled restart.

The type command will not apply any simplifications before checking the type. So, for example,

x:= (sqrt(3)-sqrt(2))*(sqrt(3)+sqrt(2)):
type(x, integer);
                         false

In other words, type only checks the properties that an expression has manifestly and explicitly. So, you need to simplify. Butthe simplify command is not good enough for this task. I did the following to your code:

p:=simplify((a+b+c)/2);
S:=expand(combine(sqrt(p*(p-a)*(p-b)*(p-c)), radical));
Now, setting N:= 4, I got 48 solutions in 5-8 minutes.

In Maple, an expression with an arrow (->) is equivalent to a procedure definition. So

f:= x-> ...f(x)...

defines f as a recursive procedure. All that is fine and legal in Maple.  Where you run into problems is when there is no base case to the recursion. Note that the error message was "too many levels of recursion", not "recursive assignment" which you would get if you attempted x:= x. The solution to your problem is to use unapply instead of the arrow, as Preben says.

I think that you have unfairly maligned Maple. Maple is no different in this respect from other languages that allow directly recursive procedures.

It seems that powsolve (and hence powseries) fails on this equation.

This dsolve solution doesn't explicitly derive one solution from the other, but it may be useful to you:

dsolve(myode, y(x), type= series);

Let V be the Vector of strings. Then do

sprintf(
     cat(
          "http://quandl.com/api/v1/multisets.csv?columns=",
          "%s," $ upperbound(V)-1, "%s"
     ),
     convert(V, list)[]
);

You need intial conditions for your system. I made up some completely arbitrarily for the code below. These are nonlinear ODEs, by the way---not that that distinction makes any difference in the code below.

sys:=
      diff(x(t), t) = 10*(y(t)-x(t)),
      diff(y(t), t) = x(t)*(28-x(t)) - y(t),
      diff(z(t), t) = x(t)*y(t) - 8*z(t)/3
;
ICs:= x(0)=1, y(0)=2, z(0)=3: #Initial conditions.
Sol:= dsolve({sys, ICs}, numeric):
plots:-odeplot(Sol, [x(t), y(t), z(t)], t= 0..100, numpoints= 10000);

With the specified initial conditions, y=0 is the complete solution. This is considered a linear ODE, by the way.

If you change the initial conditions to y(0)=1, D(y)(0)=0 and give the commands

ode:= x^2*diff(y(x), x$2) + x*diff(y(x), x) + x^2*y(x) = 0:
Order:= 11: #One more than the order of series that you need
dsolve({ode, y(0)=0, D(y)(0)=0}, y(x), type= series);

then you get

Add a table Color and add the color and legend options to the plot. Like this

(I had to add the tickmarks option to correct an unrelated bug.) Also add the variable Color to the list of locals. You can do the same with the option linestyle. The resulting plot is

And here's the updated worksheet: Equações_H,_S_e_G_(.mw

That a rather impressive thing you did with the try statements.

By adding the options abserr= 1e-4, relerr= 1e-4, minstep= .01 to the dsolve command, I was able to get the same plot that you showed in your link.

First 331 332 333 334 335 336 337 Last Page 333 of 395