## how to find how many occurances a function shows u...

I need to count how many times a special function shows up in an expression.

The problem is that indets returns a set. So if the same function shows up more than one time in the original expression, with same arguments, only one of these will show up in the result. So I would not know if there were mmore than one of these.

Here is a simple example, using sin(x) here.

```restart;
expr:=sin(x)+3*cos(x)*sin(x)+1/sin(2*x);
indets(expr,'specfunc(anything,sin)')

#gives
#   {sin(x), sin(2*x)}
```

So when I do nops() on the above, it gives 2 and not 3.

How to obtain number of times a function shows in an expression, even it if is repeated?

## Error, (in dsolve/numeric/process_input) system mu...

Hi everyone, I have copied soem code from a paper. I hope to try and manupiluate some of the varables. However it seems while I am coping the code I get this error Error, (in dsolve/numeric/process_input) system must be entered as a set/list of expressions/equations .I have checked online but it seems that there is nothing I can find to fix this problem. My code is posted below

Thanks for your time and help!

 (1)

We will now declare our first equations

## Error, mismatched or missing bracket/operator-----...

Hi, everyone! I am a new user to maple and I need to import some code I have found from a paper, just so I can manupluate some of the variables. However when I have copied and pasted my code, I keep getting the error Error, mismatched or missing bracket/operator.  I did check online and it seems to be a bracket missing but I have copied without errors from the source.

I have attached a picture and did a copy paste of the code that is giving me an error below.

x[1] := l[1]*sin(theta(t));
y[1] := -l[1]*cos(theta(t));

x[2] := -l[2]*sin(theta(t));
y[2] := l[2]*cos(theta(t));
R[1] := vector(2, [x[1], y[1]]);
R[2] := vector(2, [x[2], y[2]]);
'R[1]'':=map(diff,R[1],t):

## Unexpected results from pdsolve...

 > restart;
 > pde := diff(u(x,t),t) + u(x,t)*diff(u(x,t),x) = 0;

These are all wrong:

 > pdsolve({pde,u(x,0)=f(x)}); pdsolve({pde,u(x,0)=sin(x)}); pdsolve({pde,u(x,0)=erf(x)});

But these ones are correct:

 > pdsolve({pde,u(x,0)=exp(x)}); pdsolve({pde,u(x,0)=x});

## how to tell Maple not to automatically expand nu...

in a worksheet, typing

`r:=(x^2 - 2*x - 1)/4;`

Maple returns

But when typing

```r:=(x^2 - 2*x - 1)/(4*x);
```

Now it does not expand terms and gives what is expected

Is there a way to make the first example remain unexpanded? Same with Mathematica:

I know this only affects the display only. But it is annoying, as I want to see the numerator and denominator on the screen as I put them there and not have them change.

I tried changing the typesetting level, but this had no effect.

I used to like Maple becuase it does not change anything unless asked to, and everything is explicit, which is better.

Now I am starting to change my mind on this aspect of Maple.

## Remove limit from integration answer...

How should I handle the limit in the integration answe?. I don't see why it is necessary.

## what is the sign of I*sqrt(3) supposed to be?...

Is there an assumption or some other way I can tell Maple to avoid such errors when using odetest, as I get many of them.

I think the solution Maple gives is correct. But odetest generates these strange innternal error that it does not know the sign of a complex number.

```restart;
ode:=x^2*diff(y(x), x\$2) + (cos(x)-1)*diff(y(x), x) + exp(x)*y(x) = 0;
sol:=dsolve(ode,y(x),series):
odetest(sol,ode,series,point=0);
```

Error, (in odetest/series) need to determine the sign of I*3^(1/2)

I've seen such error many times before and it is still not fixed in release after release.

I am using Maple 2022.1 on windows 10.

## Programmatically Add Angstroms Symbol in Plot Axis...

Hi ---

I know how to add the Angstrom symbol to a plot's axis label using my mouse and the palette menu.  How can I add the Angstroms symbol programmatically to the plot command?  Thanks!

David

## How do I solve a nonlinear (overdetermined) system...

Hello,

I have a nonlinear system of 12 SYMBOLIC equations in 6 variables. I am using solve() but it's taking me ages and will probably return the "Kernel connection has been lost" error after a half-day/ a day.

How do I solve it? Is it even possible to solve it? Is there a way to solve it approximately?

Thanks

## Can I insert a Hyperlink to a Geogebra document?...

I would like to insert a hyperling to a geogebra document but the hyperlink box deosn't appear to allow general files. Can this be done?

## debugger problem using coerce with with object...

This is a much simplified version of a problem I am seeing. I think I have to remove all the coerce code I added as it seems to have problems.

Made an object with constructor that take an optional argument. These optional arguments use coerce to convert different types on one type of list.

I have another proc foo() that is called with these arguments, also same optional ones, and it then creates the object passing these arguments to it.

The problem is that if foo() is called with an optional argument itself, which will default to empty list [], I am not able to create the object now, when doing  ':-ic'=ic  since debugger gives

Error, invalid input: too many and/or wrong type of arguments passed to ModuleCopy; first unused argument is [] = []

Even though I made sure to pass the optional argument using  ':-name'=value.

The strange thing is that this only shows in the debugger. i.e. when typing the command in the debugger window. But in my application, it does not work inside the debugger and outside since it is much more complicated setup.  This is the simplest example I could make to show the same error in the debugger.

A small example will show the problem.

```restart;
A:=module()
option object;
export ode;
export ic;

export ModuleCopy::static:=proc(_self, proto::A, ode::`=`,
{ ic::coerce( (ic::list(`=`))->ic,
(ic::set(`=`))->[ic[]],
`:-NoUserValue`):=[]
},\$)
print("ode=",ode);
print("ic=",ic);
end proc;
end module;

foo:=proc(ode::`=`,{ ic::coerce( (ic::list(`=`))->ic,
(ic::set(`=`))->convert(ic,list),
`:-NoUserValue`):=[]
},\$)
local o;
DEBUG();
o:=Object(A,ode,':-ic'=ic);
end proc:

# and now

foo(diff(y(x),x)=1)
```

Now the debugger window shows at the line above just before calling the object constructor. This is what happens next

But if I click continue it does not produce an error and actually works. (in my main application, with similar setup, it gives an exception).

If I can figure why debugger gives this error, may be that will help me figure my more complicated setup.  I know if I do not use coerce, the debugger error goes away. Here is a version without coerce, and it works

```restart;
A:=module()
option object;
export ode,ic;
export ModuleCopy::static:=proc(_self, proto::A, ode::`=`, { ic::list(`=`):=[] })
print("ode=",ode);
print("ic=",ic);
end proc;
end module;
A := Object<<2457889631168>>

foo:=proc(ode::`=`, { ic::list(`=`):=[]})
local o;
DEBUG();
o:=Object(A,ode,':-ic'=ic);
end proc:

#now do
foo(diff(y(x),x)=1)
```

Now the debugger window comes up, but now see the difference:

No error!  even though  `ic` was [] in this case also, like the first example.

So for now, I will remove all the coerce code just to get my application to work again even though I like it, but it seems to cause a problem.

question: What the first example above given an error in the debugger?

Notice this error only shows up when using a module of type object

Update

This is just to confirm that removing the coerce API and replacing it back as it was with traditional optional arguments as in the second example above the exception went away.  My code is way too large to post here, but that is the only difference I have.  I think there is a problem using coerce with Object constructor calling somewhere.  But I am OK now, and able to continue work.

## Problem with long description in a procedure...

I have a long description that contains some Maple commands.
I dont want to use # as the lines dont show up when i use

```Isee:=proc(a)
interface(verboseproc = 3);
printf("%P", eval(a));
end proc
```

The long description is. Any way around the problem?

```Test:=proc(A,B,C)  description  "Computes projective line through 2 projective points or intersert of 2 projective lines as a projective point or coincidence of piont  line
Does some checking on validity of inputs.
Mobposn:- Global Variable, must = 1 or 3.
Points are returned as <1,x,y> or <x,y,1>
Lines are returned as <z,x,y> or <x,y,z>,
normalgpt :- Global Variable must be 0 or 1.
Points with algecraic elements are not reduced to <1,x,y> or <x,y,1> if 0
Points are defined as row vectors and  lines as column `vectors"`;

print(A,B,A-C);

end proc;```

## How can an row Vector be extended?...

I need to conver 2D points to projective points. Originally I used lists but now need to handle vectors too. To add to that that the projective coordinate for points is now being stated as [1,x,y] instead of [x,y,1]. That is was easy enough to handle for lists.

I have a lot of old worksheets that use the list form [x,y,1] that I want to maintain compatibility with. I only have one procedure I need to convert.

```Mobposn := 1;
testP := [2, 7];
if Mobposn = 1 then
[1, op(testP)];
else
[op(testP), 1];
end if;```

I need to do the same for vector definition of the points. The points are defined as row Vectors

`A:=<2,7>^%T`

to get

```Ap:=<1,2,7>^%T

or

Ap:=<2,7,1>^%T```

I know coud just do (as these are short vectors)

```Ap:=<1,A_1,A_2>^%T

or
Ap:=<A_1,A_2,1>^%T```

Is there a more general way?

## Basins of attraction...

Hello,

I'm trying to draw the basins of attraction for King's method with f(z) = z^3 - 1

## Can converting mathematical expressions to strings...

I have the following expression:

```q1:=2.800000000*10^(-30)*a+2.7800000000*10^(-29)*b+2.7800000000*10^(-31)+3.0*10^(-21)+2.*10^(-32)*c+3.*10^(-30)*d;
```

I saved it as a string, but the format seems to have changed.

`q2:=convert(q1,string)`

Can I output it as follows:

`"2.800000000*10^(-30)*a+2.7800000000*10^(-29)*b+2.7800000000*10^(-31)+3.0*10^(-21)+2.*10^(-32)*c+3.*10^(-30)*d"`
 First 29 30 31 32 33 34 35 Last Page 31 of 39
﻿