Carl Love

Carl Love

28015 Reputation

25 Badges

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

MaplePrimes Activity


These are answers submitted by Carl Love

In addition to the other Answers, note that the capitalization of Maple commands matters. You mentioned linsolve, but your screen shot shows that you used Linsolve. They are different commands.

Like Jerome, I recommend that you use LinearSolve in the LinearAlgebra package.

If your function is a polynomial, then you can do this:

f:= randpoly([a,x]);

solve({diff(f,x)>0, x>0, a>0}, {x}, parametric= full, parameters= {a});

 

 

 

See ?solve,parametric and ?solve,ineq .

If your function is not a polynomial, then you should post it: There's a good chance that an ad hoc technique can be worked out.

If f(x,y,t) is an unevaluated function call, then you can do

e:= eval(e, y= NULL);

But if f is a defined function, then you'll need to provide a more-specific example before the question can be answered.

Here are your two plot commands:

plot([ns, r, t = 10^11..10^15], 0.8..1.2, 0..1);
plot([ns, r, t = 10^11..10^17], 0.8..1.2, 0..1);

So, the second plot has a range 100 times larger than the first, yet you are using the same view window. Both plots use 210 points for the whole range. So in the second plot, those points are spaced out much more.

It seems that when the assignment to a variable occurs in a Maple-language procedure, that variable does not appear in the Variables sidebar in the Standard GUI. But if the assignment occurs in a kernel procedure, then it will appear. For example,

P:= proc(x) x:= 3 end proc:
p(y);

                                              3
y;

                                     3

But y does not appear in the Variables list.

The procedures that you used, quo and rem, are Maple-language procedures; whereas iquo and irem are kernel procedures. So,

iquo(9, 3, 'r');

and now r appears in the list.

 

The answer is ` $`. Note that there is a space before the $. If you try to use this as a parameter, it will be treated as if it were the end-of-parameters marker $. But `$` (no space) can be used as a parameter.

Indeed, when the end-of-parameters marker is used, it is translated upon automatic simplification to ` $` as a parameter. You can see this in the prettyprint of a procedure:

P:= proc(x, $) end proc;

lprint(%);
proc (x, ` $`) end proc

You can also see it if you look at op(1, ...(the parameter sequence) of the procedure:

lprint(op(1, eval(P)));
x, ` $`

Does the general form of the integrand suggest to you that a particular function might occur in the antiderivative (the answer)? Does it suggest a particular technique?

The problem is premature evaluation. The expression test(s) in the plot command is evaluated before s is given a numeric value. The cure is to delay the evaluation.

 

restart:

test:= s-> fsolve(t^3=s, t):

test(0);

0., 0., 0.

You need to include maxsols= 1 to cover the case of multiple roots at s=0. However, that is not the proximate cause of your problem.

test:= s-> fsolve(t^3=s, t, maxsols= 1):

test(0);

0.

This is the proximate cause: Note that you get the same error if you simply invoke test(s).

test(s);

Error, (in fsolve) s is in the equation, and is not solved for

The error is because the argument s is not numeric. There are three ways to correct this:

Method 1: Explicit delaying of evaluation with forward single quotes.

plot('test(s)', s= 0..8):

Method 2: Plot a procedure.

plot(test, 0..8, labels= [s, ``]):

Method 3: Procedure returns unevaluated when passed a symbolic argument.

test:= s-> `if`(

     s::numeric,

     fsolve(t^3=s, t, maxsols= 1),

    'procname(args)'

):

plot(test(s), s= 0..8);

 

To be more robust, you should make t a procedure local and protect the global name keyword maxsols.

test:= proc(s)
local t;
     `if`(

          s::numeric,

          fsolve(t^3=s, t, ':-maxsols'= 1),

          'procname(args)'

     )
end proc:

 

 

Download delay_eval.mw

You have a for loop defining the E equations. That loop begins at 3, so there is no E[2] equation. You need to start that loop at 2.

ex:= (1/6)*(-108+(12*I)*sqrt(1419))^(1/3)+10/(-108+(12*I)*sqrt(1419))^(1/3)+1:
simplify(Im(evalc(ex)));
                               0

I use AV instead of averagedValues just to save space; you can use the latter if you want.

AV:= readdata("mytextfile.txt", [integer, string, float]);
plot(AV[..,[1,3]], tickmarks= [AV[..,1] =~ AV[..,2], default]);

The problem with this is that Maple can only print tickmarks horizontally. So, when you have long tickmarks, you cannot fit very many on the horizontal axis. A workaround would be to interchange the roles of the horizontal and vertical axes:

plot(AV[..,[3,1]], tickmarks= [default, AV[..,1] =~ AV[..,2]]);

cat(FileTools:-ParentDirectory(currentdir()), "/Code_principal/");

You can't use square brackets [ ] for algebraic grouping, as another level of parentheses; only actual parentheses () can be used for algebraic grouping. I changed four pairs of [] to () in your worksheet, and it runs to the end without error.

hmm_working.mw

Good question. Here's how:

A:= [[a,b]], [[c,d,e]], [[f],[f,h]]:
subsindets([A], list(Not(list)), {op})[];
              [{a, b}], [{c, d, e}], [{f}, {f, h}]

Edit: I simplified `{}`@op to {op}. The two forms do the same thing.

(This problem can be seen in the originally posted Question; you don't need to download the worksheet.)

By referring to Flux_softening_point_V3(i) in your loop, you are treating it as if it were an Array. But in the initialization code immediately above the loop, you have Flux_softening_point_V3:= 100.0, which makes it a scalar, not an Array.

Also, you are doing Array indexing as both A[i] and A(i). Maple doesn't care about that, but your usage indicates perhaps that you believe that the two forms are doing something different. Do you believe that?

First 358 359 360 361 362 363 364 Last Page 360 of 394