MaplePrimes Questions

Dear all

i am a very new user of Maple.
is there an equivalent Mathematica function of

thank you very much and best regards

bruno

a way to test conditional statements for truth...

I'm seeking a way to test conditional statements for truth in Maple (2022).

The statements are like

1) how can I input such kind of statements?

2) how can I get a result in form true/false

a) for entire expression

b) (depending on range)

using operator assignments without getting recursi...

Does anyone use the /= assignment operator?

I am trying to do a

while error  > error_tol do

sequence of ops,

# update error from last loop
# simple example of assignment test

error /= 2;    #to simulate decreasing error each loop.  Real equation on RHS is error(i) = error(i-1) + comparison of last iterates.

# Real operator assignment I'd like to use is error += comparison

end do;

the divide / keeps applying as the single divide and a long line under the variable before I can type =.   This happens in both 1-D and 2-D.   The "Operator Assignments" help page doesn't have a lot of help on syntax problems using these.

Thanks,
Bill

Why romberg method do not work for integration if...

I am trying to find a fast method for integration of a function composed of several Heavisides. I used Quadrature-Romberg, but no success. What is the problem with it and what method do you recommend instead?

 >
 >
 >
 >
 >
 >
 >
 (1)
 >
 (2)
 >

How to solve this integral?...

I am trying to solce eq (2) by integration. But maple integrate only 1st term in eq. Why not other two terms?

Solve_integral.mw

An error occurred when I ran the function DeleteB...

And my code is:

restart;

local base, badchar, char, cnt, msg, outfile, str, unicode;
for cnt from 0 do
try
XMLTools:-ParseString(str);
break;
catch "An invalid XML character":
msg := lastexception[2];
if not StringTools:-RegMatch("Unicode: 0x([^)]+)", msg, 'all', 'unicode') then
error;
end if;
unicode := sscanf(unicode,"%x");
char := convert(unicode,'bytes');
str := StringTools:-SubstituteAll(str, char, "");
end try;
end do;

if cnt=0 then
printf("no errors in file\n");
else
if not StringTools:-RegMatch("^(.*)\\.mw\$", file, 'all', 'base') then
error "problem extracting basename";
end if;
outfile := sprintf("%s-fixed.mw", base);
FileTools:-Text:-WriteString(outfile, str);
fclose(outfile);
printf("wrote updated file to %s\n", outfile);
end if;
return NULL;
end proc:
NULL;
NULL;

And the error is

"Error, (in XMLTools:-ParseString) XML document structures must start and end within the same entity."

I use maple 2021.  Thank you very much!

why is this ode Homogeneous ODE of Class C accordi...

I can not find my Kamke book right now. But according to Maple help, Homogeneous ODE of Class C is the following

If I understand the above, it is saying that the RHS of the ode should be ratio of two polynomials, and both should be linear in y and x. Correct?

Given the above, then why Maple says the following ode is _homogeneous, class C ? Since the RHS is not linear in y and not linear in x:

restart;
ode:=diff(y(x),x)=(2*y(x)-1)*(4*y(x)+6*x-3)/(y(x)+3*x-1)^2;
ode:=lhs(ode)=expand(numer(rhs(ode)))/expand(denom(rhs(ode)))


DEtools:-odeadvisor(ode)


[[_homogeneous, class C], _rational]

What Am I overlooking/misunderstanding  from reading this definition?

Bug in Maple...

The system does not correctly calculate the CDF of a Binomial using the Regularized Incomplete Beta for p=0.5.



restart;
n := 10;
f := x -> int(t^(n - x - 1)*(1 - t)^x, t = 0 .. 1 - p)/Beta(n - x, x + 1);
p := 0.5;
plot(f(x), x = 0 .. 10);

I cannot generate an analytic solution here nor ...

gaussian.m.mw

This is the maple worksheet

How do I solve 6 coupled differential equations ?...

It's showing an error. It's showing an error with its conditions. What to do? How can I solve it? Got stuck here on this issue?Unable to solve this problem. Please help me. This the maple worksheet:

6coupled.m.mw

How do you implement recursion...

I have a function that refuses to allow "fsolve" to compute a root for.  I'm trying to use a brute force Newton (or secant) algorithm to find the root.  This is successful

But I'm new enough in Maple Flow (and Maple) that I can't build an automatic recursion method.  All ideas welcome.

inner bisector equation...

EqBIS := proc(P, U, V)
local a, eq1, M1, t, PU, PV, bissec1;
a := (P - U)/LinearAlgebra:-Norm(P - U, 2) + (P - V)/LinearAlgebra:-Norm(P - V, 2);
M1 := P + a*t;
eq1 := op(eliminate({x = M1[1], y = M1[2]}, t));
RETURN(op(eq1[2])); end proc;
EqBIS*([4, 5], [11, 7/3], [11, 5]);
why such a procedure gives no result Thabk you.

How to use jets package for calculus of variations...

Trying to use the jets package from http://jets.math.slu.cz/ (file jets.s) for calculus of variations.

Test example -

coordinates([x,y],[f],3);
parameter(p);
g:=(f_x)^2+(f_y)^2-2*p*f;
vg:=variation(g,f);                  # first variation of g (from line 4354 of jets.s)

Now I want to find g from vg - inverse problem. The code for this starts on line 4367 of jets.s, command is lagrangian.

Tried -

Lg:=lagrangian(vg,f);
Lg:=lagrangian([vg,f]);
Lg:=lagrangian(vg,[f]);
Lg:=lagrangian(f=vg);

but all give syntax errors.

The authors of the package don't respond to query and the manual does't help.

Does anyone know what the correct syntax of lagrangian is. Or is there a better package to use for inverse problem.

Thank you.

nested convert to set...

I am doing some error I dont know where in the usage

T := [[1, 2], [3, 4]];
convert(T, set, nested);

{[1, 2], [3, 4]}

But I expected internal lists also to be converted to sets like {{1,2},{3,4}}  my list may be a big list just taken a example

what i am trying to do is

n:=8;

k:=2;

C:=choose(n,k);
convert(C,set,nested);
not making all nested all as set as mentioned in the simple example.

some simple program and fast kind help