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

@Aysan

According to ?dsolve,rosenbrock, the default values for both relative and absolute tolerance (options relerr and abserr, respectively) are both 10^(-6). Where did you see 10^(-3)?

@Aysan 

Consider the following piecewise expression of three pieces:

f:= piecewise(
     t < 1,  #operand 1
     t,      #operand 2
     t < 2,  #operand 3
     t^2,    #operand 4
     t >= 2, #operand 5
     t^3     #operand 6
);

So, the Boolean conditions tend to be the odd-numbered operands, and the algebraic "pieces" tend to be the even-numbered operands.

@Kitonum I like this better than my solution with diff.

Since dsolve returns multiple solutions, the odetest call needs to be

odetest({sol}, ode);

Can an expression that contains a RootOf where the RootOf variable appears as a limit of integration of an undoable integral really be considered to be a "solution" of the ODE?

@Aysan 

Since eq1 is independent of x, the answer is just a constant multiple of the original answer, the constant being int(sin(Pi*x), x= 0..1), which is 2/Pi.

@smith_alpha 

As shown by Kitonum, my procedure does not work when the base variable appears in the exponent.

@Aysan 

f:= t-> piecewise(t < 10, 1-t, t):
ode:= diff(y(t),t$2) - y(t)^2 = f(t):
Sol:= dsolve({ode, y(0)=0, D(y)(0)=0}, numeric):
plots:-odeplot(Sol, [t, y(t)], t= 0..12);

@Kitonum 

Your code fails for many special cases, such as when the variable appears to power 1, when the variable appears multiple times in the expression, and when the variable does not appear in the expression.

@liushunyi To obtain just the sequence do

seq(coeff(p, x, k), k= degree(p,x)..0, -1);

or

PolynomialTools:-CoefficientList(p, x, termorder= reverse)[];

In general, if L is a list or set, then L[] is the corresponding sequence. The same thing can be achieved with op(L), but the operation is so common that that just clutters up the code.

@Mac Dude Indeed, I'd recommend that the OP use the interface command that you gave because "I don't want to click on 'properties' each time I execute my worksheet."

Please give us the commands that you are using to do the export.

@casperyc 

S:= map(x-> sprintf("%a", lhs(x)), v1):
S:= map(StringTools:-PadRight, S, max(length~(S))):
R:= rhs~(v1):
seq(
     printf("%s = %s %3.3f\n", S[k], `if`(R[k]<0, "-", "  "), abs(R[k])),
     k= 1..numelems(v1)
);

eta[p2]   =    0.260
eta[p3]   =    0.113
eta[p4]   = - 0.013
eta[p5]   =    0.215
eta[p6]   = - 0.189
eta[phi2] =    0.020
eta[phi3] =    0.063
eta[phi4] = - 0.014
eta[phi5] = - 0.414
eta[phi6] =    0.067
mu[p]     =    0.466
mu[phi]   = - 0.169
tau[p3]   =    0.000
tau[p4]   =    0.000
w[1]      =    0.023
w[2]      = - 0.447
w[3]      = - 0.110
w[4]      =    0.035
w[5]      =    0.445

@Alejandro Jakubi Thanks for the powsubs info. Yes, that's the key to what's unusual about this particular usage of changevar. I noticed that

subs(sinh(x)= sqrt(tanh(x)^2/(1-tanh(x)^2)), e)

yields a more-complicated expression.

@Mac Dude In your code

Matrix(<seq(<x|x^2>,x=1..10)>);

the Matrix is superfluous. The angle brackets already make it a Matrix.

@mehdi jafari 

P:= proc(M::seq(realcons))
local n,x;
     plot([seq](1+2*(1+x)^n, n= M), x= 0..5, legend= [seq]('n'=n, n= M))
end proc:

P(-1, -1/2, 0, 1/2, 1);

First 535 536 537 538 539 540 541 Last Page 537 of 709