## how to write a^tilde on maple...

Hello,

how to write a^tilde , a^check on maple

thank,

Gerard.

## Conversion of chemical formulas to string...

Hi everyone

Right now I am working on a command that calculates the molar mass of molecules. Mostly it is working like a charm but in some cases the interpretation of the input goes wrong.
The command converts the input to a string, e.g.:

f:=convert(Ca3(PO4)2, string) = "Ca[3](PO[4])[2]"

f := StringTools:-Remove("[]_*^+-", f) = "Ca3(PO4)2"

However, sometimes information such as parentheses is lost (which is understandable considering the fact that maple does not know chemical syntax):

f := convert(NH[3][3]*PO[4], string) = "NH[3][3]*PO[4]"

f := StringTools:-Remove("[]_*^+-", f) = "NH33PO4"

In special cases it goes completely nuts (I am aware this is not a real molecule):

f := convert(Al(OH)2(NH3)2, string) = "Al(`#msub(mfenced(mi("OH")),mn("2"))`)(NH[3])[2]"

The problem could of course simply be solved by typing the input as a string with no subscripts but is looks much nicer with the correct chemical syntax as input.

Do any of you know a way to translate the input charactor by charactor into a (understandable) string?

Thanks in anvance,

## How to Correctly Define Elements of a Matrix Using...

I'm used to Mathcad, and I am very new to Maple. Something I cannot figure out right now is how to define multiple elments of a matrix using a function.

Input Data

Define system dimensions as n:=2;

i:=1..n;

j:=1..n;

lambda:=Matrix(n);

Lambda:=Matrix(n);

upsilon:=vector(n);

Minor side note: I originaly had upsilon defined using the syntax "Vector[row](ncomp)", but this was giving me an 'exponentiation' operation error, so I changed it to what it is now (basically a list/array, which I guess has different type definitions that no longer cause the error?).

lambda[1,2]:=471.0433;

lambda[2,1]:=883.7530;

upsilon[1]:=58.69;

upsilon[2]:=18.07;

The Problem I'm Having

Now I just want to define Lambda using a function to define all elements (like I would in Mathcad).

Lambda[i,j]:= (upsilon[j]/upsilon[i]) * exp (-lambda[i,j]/2853);

which gives me an extremely long error message:

Error, invalid input: exp expects its 1st argument, x, to be of type algebraic, but received Matrix(2, 2, {(1, 1) = -0.3504976272e-3, (1, 2) = -.16509955895845776, (2, 1) = -.30975332953088164, (2, 2) = -0.3504976272e-3}, datatype = float[8]

As far as I can tell (keep in mind that this is my very first Maple project) that it doesn't like lambda as a matrix? But shouldn't it just evaluate to the element? and why is (2,2) and (1,1) giving values, because it should intialize to zero, so exp(0) = 1 in these cases??

I tried to simplify further by just trying

Lambda[i,j]:=(upsilon[j]/upsilon[i]);

but then it just gives me 1, and when I look into Lambda all the elements are now 1 when only the diagnol elements should be 1 (the rest some fractional amount)??

I am at a complete loss. I thought about doing something like For i = 1 to n etc. but then it just looks like coding, which defeats the purpose of trying to make a calculation sheet documenting the procedure...

Any help and/or insights into what I am doing wrong here would be most welcomed :)

P.S. I've just noticed that there is an upload option :/ Wilson_Equation.mw.

## Compound Inequalities in Maple 18...

Here's an example compound inequality I'm working on.

Working it out manually....

Compound Inequality
4477.25 <= 4477.25+.25*(t-32450) <= 16042.25;

Distribute the coefficient
4477.25 <= 4477.25+.25*t - 8112.50 <= 16042.25;

Combine like terms
4477.25 <= -3635.25+.25*t <= 16042.25;

8112.50 <= .25*t <= 19677.50;

Divide all sides by .25
32450 <= t <= 78710;

How can I ask Maple to simplify this compound inequality? Obviously this is not the correct syntax, It seems Maple doesn't understand what I want it to do.

4477.25 <= 4477.25 + .25 * (t-32450) <= 16042.25;

0.00 <= 0.25 t - 8112.50 and 0.25 t <= 19677.50                (112)

Also is there a way to ask Maple to only perform one step? In the above example, is it possible to ask Maple to "Distribute the .25", then show the result, next ask it to combine like terms, etc?

## Error, (in DEtools/convertsys) unable to convert t...

Hello i want to solve the differentiel equation but i have these problem i don't understund  why !?

 > restart:with(plots):
 > mb:=765 : mp:=587 :Ib:=76.3*10^3 :Ip:=7.3*10^3 :l:=0.92 :d:=10:F:=0.042:omega:=0.56 :
 > eq1:=(mb+mp)*diff(x(t),t\$2)+mp*l*cos(alpha(t))*diff(alpha(t),t\$2)+mp*[l*[diff(alpha(t),t)]^2*sin(alpha(t))]-F*sin(omega*t)=0;
 (1)
 > eq2:=-mp*l*sin(alpha(t))*diff(alpha(t),t\$2)+mp*[l*[diff(alpha(t),t)]^2*cos(alpha(t))]-9.81*(mp+mb)-F*sin(omega*t)=0;
 (2)
 > eq3:=mp*[d+l*cos(alpha(t))]*diff(x(t),t\$2)+[Ip+mp*l^2+mp*d*l*cos(alpha(t))]*diff(alpha(t),t\$2)-mp*sin(alpha(t))*[-l*d*alpha(t)^2]+mp*[l*9.81*sin(alpha(t))]=0;
 (3)
 > eq4:=mp*l*cos(alpha(t))*diff(x(t),t\$2)+(Ip+mp*l^2)*diff(alpha(t),t\$2)-mp*9.81*l*sin(alpha(t))=0;
 (4)
 > CI:= x(0)=0,alpha(0)=0,D(x)(0)=0,D(alpha)(0)=0;
 (5)
 > sys := eq1, eq2, eq3, eq4:
 >
 > solution:=dsolve([sys,CI],numeric);
 Error, (in DEtools/convertsys) unable to convert to an explicit first-order system
 >

## Why is this definite integral note evaluating? ...

int((1-r^3+3*r^2-3*r)(r^3-3*r^2+3*r), r = 0 .. 1);
print(`output redirected...`); # input placeholder
/ 3 2
| / 3 2 \ / 3 2 \
int\-r\r - 3 r + 3 r/ + 3 r\r - 3 r + 3 r/

\
/ 3 2 \ |
- 3 r\r - 3 r + 3 r/ + 1, r = 0 .. 1/

## Ecountered : Error, unterminated procedure in Mapl...

Hi Mapleprimes community,

I am a maple novice and was trying to write a procedure but cannot tell what my syntax error is.  I would greatly appreciate if anyone can point out what I did wrong or any improvement in the code that I can make.  Thanks

SLRrepeatedsample_pr.mw

Henry

## how to map a function to a list, where the functio...

One can do igcd(12,8), and igcd(16,3), etc...

But how to define a list/set/array/vector/matrix, etc... that contains these pair of numbers, and then call/map igcd on this list?

I tried putting the pair of values in a list and set and even a matrix, calling calling map(igcd, lst) but not getting it right.

The confusing part for me with Maple is to know which data structure to use for each function, since there are more than one. Here are my silly attempts:

lst:={{12,8},{16,3}};
map(igcd,lst);

lst:=<<12|8>,<16|3>>;
map(igcd,lst);

lst:=[{12,8},{16,3}];
map(igcd,lst);

I was looking for something like in Mathematica:

lst = {{12, 8}, {16, 3}};
GCD @@ lst

{4, 1}

I am sure it is possible to do this in Maple (i.e. map igcd to list of pair of numbers), I just can't get the syntax right. I did look at few examples somewhat related, but did not understand what they are doing. They said I need to pass an extra argument for map in this case?

thank you

## Solve Differential Equation...

Solve Differential Equation: y''-3y'-4=e^xsin4x

## Reading in Matrix with Numeric File Name...

Hi,

I'm reading in a file as

eigvect:=ImportMatrix("C:\\Users\\Sorted_Eigenvectors_1.txt", source=csv):

but I want to generalize this to

eigvect:=ImportMatrix("C:\\Users\\Sorted_Eigenvectors_i.txt", source=csv):

where i is a positive integer, I tried

eigvect:=ImportMatrix("C:\\Users\\Sorted_Eigenvectors_%d.txt",i, source=csv):

but this is incorrect. What is the correct syntax?

Thanks!

## Maple syntax for eigenvalues result...

Hi,

I wonder if you could help me. I'm trying to calculate the eigenvalues of a complicated 3x3 matrix in Maple, but I'm not very familiar with Maple syntax. The answer maple has provided me with is in the form,

(&*(sin(pi*q/P),P/T,3x3 matrix))

How do I interpret this result? The eigenvalues are scalars.

Sian

## Programming Error Message...

Hi everyone, I'm new to the forum and also new to Maple.

I am trying to do the following:

"Write a procedure, marks, to take a student’s mark and output the appropriate grade, based on the following table:"

 Mark 0   – 39.99

## Polarplot issues with two polar equations...

The school computer labs use Maple 15. As it is a considerable drive for me to come in and use the lab during the hours I am not on campus, I picked up Maple 16. This has worked fine for me until today. I am trying to use the "polarplot" command to plot two equations r=8*cos(3θ) and r=4-2.5cos(θ). Doing so on the computer lab Maple 15 plots fine. When I do so on Maple 16 on my computer I get something different. If I switch the order of the equations on 16 I get...

## How to write a procedure for Linear Regression...

Hi,

I know all the necessary computational steps to create a Linear Regression line, but I am having trouble making it into a succient procedure. I have to make a 3 procedures for three methods, minimizing Vertical distance, Horizontal, and lastly, Diagonal.

I uploaded an example of my work to compute a linear regression line, minizming vertical distance. I have all the necessary steps for horizontal and diaganol as well.

## Why isn't my program working?...

`N:= 10:In:= evalf(2/Pi):for n from 0 by 1 to (N - 1) do  In:=evalf((1/(Pi^2))*(Pi-((2n+1)*(2n+2)*In))):   maple_In := evalf(Int((x^(2n))*sin(Pi*x), x = 0..1), 20):   printf( "%d %10.10f %10.10f %10.10f \n" , n + 1 , In , maple_In , abs( In - maple_In ...`