Carl Love

Carl Love

28025 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

@smith_alpha 

Yes, I see your PS now. The output generated by "cmaple inputfile > outputfile" is not meant to be reread by a computer; it is strictly for human reading. If you are writing a file that is strictly meant to be reread by Maple, then the save command is by far the easiest way to do it: no formatting necessary and the reread values are automatically assigned to the correct variable names. Otherwise, use writedata or fprintf.

I think that you'd be better off using the command ImportMatrix, which understands the format "comma-separated values" through the parameter source= csv.

The assignment

x[anything]:= anything;

turns x into a table. Change x[s] to x_s or x__s.

A Horner-form for loop is probably the most efficient way, despite your distaste for it.

r:= rand();

L:= convert(r, base, 10):

S:= L[-1]: for k from 2 to nops(L) do S:= S*10+L[-k] end do: S;

     22424170465

However, there is also a library way to do it:

convert(L, base, 10, 10^nops(L))[];

     22424170465

 

N:= proc(m::posint)
local P:= 1, p:= 1, k;
     for k to m do
          p:= nextprime(p);
          P:= P*p
     end do;
     P+1
end proc:
M:= [$1..15]:
P:= N~([$1..15]):
SmallestPrimeFactor:= (n::posint)-> ifactors(n)[2,1,1]:
interface(rtablesize=16):
H:= < m | N[m] | S[m] | p[m] >:
<H, < <M[]> | <P[]> | <SmallestPrimeFactor~(P)> | <ithprime~(M)> >>;

You need to use diff consistently for derivatives. You correctly have diff(C(t), t) but expressions like d/dt and d*diff(n(t),t)/dt are meaningless. For a second derivative, use diff(n(t),t,t) or diff(n(t),t$2).

Yes, it is something simple. Don't use capital D as a variable. It is the functional differentiation operator.

restart:
assume(xi::real, eta::real):
phi:= (2*xi-1)*(xi-1)*(2*eta-1)*(eta-1):
Grad:= <diff(phi, xi), diff(phi, eta)>;

v:= <0,1>:
int(Grad.v, eta);

int(Grad.v, xi);

Hint: Continuity at  x = 0 means that the limit from the right and the limit from the left are equal and that these equal beta. In Maple, that means

limit(f, x= 0, left) = limit(f, x= 0, right);

This gives you an equation that you can solve numerically for alpha with the fsolve command.

Yes, you can manipulate inequalities exactly like equations. But three-part inequalities and three part equations are not allowed. Unfortunately, Maple will let you enter expressions such as (a<b) < c or (a=b) = c, but these operators are not associative! The expressions are essentially nonsense to Maple.

InertForm:-Display(InertForm:-Parse("2+3"));

 

I strongly recommend editing in an external editor, like you suggest. Then you just need to keep a worksheet open with a read statement to load the Maple code file. But if you don't want to do that, then the GUI response time can be improved by removing any unnecessary output from your worksheet, especially plots.

You need to choose four variables to solve for including A, B, and C. Then compute B/A and C/A from what solve returns. For example:

Sol:= solve({eq||(1..4)}, {A,B,C,F}):
[B/A, C/A] =~ eval([B/A, C/A], Sol);

Or

(t-> t^2) ~ ([1,2,3]);

You do not need to close Maple and start again. Kill your mserver in Task Manager, then save your worksheet, then close your worksheet, then reopen it. That will start a new mserver.

First 284 285 286 287 288 289 290 Last Page 286 of 395