Carl Love

Carl Love

28025 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

Eqs:= [sqrt((x-1)^2+(y-5)^2)+(1/2)*abs(x+y) = 3*sqrt(2), sqrt(abs(x+2)) = (2-y)]:
Y:= solve(Eqs[2], y);

X:= solve(eval(Eqs[1], y= Y));

[x,y] =~ eval([x,Y], x= X);

 

1. To convert an integer n to base b, use convert(n, base, b). To convert a float to another base (other than base 2) will require a custom procedure I think. I might work on it.

2. To do custom logical operations on strings of bits, use the Bits package. There are only 16 possible binary operations on two variable. Every one of them can be built from the operators given in the package. The example you gave is simply Not(2nd op); it doesn't depend on the first operand.

So,

Bits:-Not(235, bits= 8);

                        20

You almost had the answer. You apparently don't know about the value command, which converts inert integrals (those composed with Int) to active form (as if composed with int). You attempted to do this with eval. You also forgot the v= in the limits of integration. Also, those complicated (and not mathematically robust) applyrules are unnecessary; it can be done with convert and simplify.

Int(ln(1+x)/(1+x^2), x= 0..1):
IntegrationTools:-Change(%, x= tan(v/2));

convert(%, sincos);

simplify(%);

value(%);

I don't know how to make pdsolve solve this easy PDE. Here's a solution with Laplace transforms and dsolve.

restart:
pde:= diff(u(x,t),t$2) + 2*diff(u(x,t),t) - diff(u(x,t),x$2) = 18*sin(3*Pi*x/L):
ic:= u(0,t)=0, u(L,t)=0, u(x,0)=0, D[2](u)(x,0)=0:
inttrans[laplace](pde, t, s);

#Convert to an ODE:
eval(%, [ic, laplace(u(x,t), t, s)= U(x)]);

dsolve({%, U(0)=0, U(L)=0}, U(x));

#Final solution:
Sol:= inttrans[invlaplace](rhs(%), s, t);

 

 

"Length of out exceeds limit of ...." is not an error. The computation was carried out fully. Maple's (Standard) GUI simply chose not to display the output. This output can still be assigned to a variable for continued analysis and manipulation.

You can set the maximum length of an expression that will be displayed using the Tools menu. Select Options, then the Precision tab. The last item is "Limit expression length to ...." But, I warn you, having a long expression displayed can make the GUI unbearably slow. And, really, what's the point of looking at an expression that's hundreds of screens long?

This is only an Answer to the question that you posed in the title of your Question:

There are a few types of displayed output that a Maple program can have. One type---which is probably most familiar to users of compiled languages---is that generated by explicit output-displaying statements such as print, iolib (printf, etc.), lprint, userinfo, and error (there may be a few other kernel-level commands in that list that I am forgetting).

Another type---which may be more familiar to users of interactive interpretted systems such as Maple---is the return value of the most recently executed statement. It is only this latter type which is suppressed by ending with a colon. The latter type can also be controlled by using the variable printlevel, which is set to 1 by default.

A third type is output generated by including option trace in a procedure. This is a debugging option.

(There might be a few other types of displayed output that I am forgetting.)

To get a result in terms of a hypergeometric function, use definite integration with a variable upper limit. In my experience, Maple is more likely to give an answer when integrals are done this way.

int(cos(t)^n, t= 0..x);

Any string of characters can be a name in Maple. It would be artificial to forbid the string `pi` and allow all others. What does Mathematica do if you use lowercase pi?

Answering only your final question about taylor series, it can be done like this:

eval(taylor(1/(1+y), y=0), y= f(x));

convert(%, polynom);

You have the independent variable entered two different ways, one as the literal character string "eta" and the other as the Greek letter eta. These are treated as two separate variables by Maple (when you use the 2d input). This problem might be caused by using a palette in some cases and the keyboard in the others.

It's easy:

E:= a+b*sqrt(c):
Eminus:= evalindets(E, sqrt(algebraic), x-> -x);

G:= 0.1*(s+0.2)*exp(-4.5*s)/(s+0.5)/(s+0.4)/(s+0.1)/(s+0.02):
(AR,phi):= op(map(simplify@evalc, convert(eval(G, s= I*omega), polar)));

Your problem is that you are using T and X both in indexed and unindexed form. In the header code, you should initialize X[1] and T[1] rather than X and T. In the loop, you should update X and T via

X[k+1] := X[k]+sum(y[i]*h^i/factorial(i), i = 1 .. 2);
T[k+1] := T[k]+h;

To plot it, you need to index from 1 to n+1, not from 0 to 30.

The short answer is that you make a module with option package. Example:

MyPackage:= module()
option package;
export
     MyProc1:= proc(x) x^2 end proc,
     MyProc2:= proc(x) x^3 end proc
;
end module:

with(MyPackage);

MyProc1(2);
     4

MyProc2(3);
     27

convert(1/((1+x)*(1+x^2)), FormalPowerSeries);

First 282 283 284 285 286 287 288 Last Page 284 of 395