Items tagged with syntax syntax Tagged Items Feed

Hi everyone,

I have to create a double wishbone suspesione model that can be edited by different users, only introducing some reference point values (called Hard Points). So I need some tool that, in some way, passes from the entered reference point values to the actual values of the bodyframes link. 

I found an already done model (from this link) that seems to be perfect to me because contains an attached Maple document that does exactly what I need working on the base of symbolic parameters applied to the MapleSim model. Now my problem is that I need to deeply change the model and so having the possibility to change the parameter set and insert for example nex parameters. But when I try to do that some problems come out with the Maple document: the syntax of the nex parameter set is different from the default (in the sense of already built in the model I downloaded) one and there are some syntax errors. Below I'll put a screenshot of the error.

 

under the XData code line, you can also see the syntax of one of the parameters that is very long and complicated: below I'll insert another image from which it can be seen the syntax with the original parameter set.

Now if you another idea for solving the initial problem, that would be great! Instead do you have an idea on how to fix the problem with the downloaded model? In my opinion there is a different MapleSim version problem, in the sense that could be thatn the model I downloaded has been done in another MapleSim version in which the parameter set syntax was different.

i want to solve an equation by fsolve but i cant assign a value as an input for next step!

please help me

s := fsolve(G), x = -1 .. 1     

s := .1449607418, x = -1 .. 1  

 a:=s+1  

Error, invalid input: subs received .1449607418, which is not valid for its 1st argument                  

Hello,

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

thank,

Gerard.

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,
Mads 

 



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.

 

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;

Add 3635.25 to all sides
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?

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;

1352*(diff(diff(x(t), t), t))+540.04*cos(alpha(t))*(diff(diff(alpha(t), t), t))+[540.04*[diff(alpha(t), t)]^2*sin(alpha(t))]-0.42e-1*sin(.56*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;

-540.04*sin(alpha(t))*(diff(diff(alpha(t), t), t))+[540.04*[diff(alpha(t), t)]^2*cos(alpha(t))]-13263.12-0.42e-1*sin(.56*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;

587*[10+.92*cos(alpha(t))]*(diff(diff(x(t), t), t))+[7796.8368+5400.40*cos(alpha(t))]*(diff(diff(alpha(t), t), t))-587*sin(alpha(t))*[-9.20*alpha(t)^2]+[5297.7924*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;

540.04*cos(alpha(t))*(diff(diff(x(t), t), t))+7796.8368*(diff(diff(alpha(t), t), t))-5297.7924*sin(alpha(t)) = 0

(4)

CI:= x(0)=0,alpha(0)=0,D(x)(0)=0,D(alpha)(0)=0;

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

 

 

NULL


thanks for your help

Download tangage.mw

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/

Dear all,

Please, I need help to remplace in the code attached,  addadd(beta[i]*u(x+[i]*h),i=0..N)+Error; 
by add(beta[i]*u(x+alpha[i]*h),i=0..N)+Error;  I see, that we must add a function, alpha, but how.

I think I must modify this rows: but how:

stencil := add(a[ii[i]]*subsop(r=op(r,phi)+ii[i]*stepsize,phi),i=1..N);

Question2.mw

 

Many thinks

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

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: y''-3y'-4=e^xsin4x

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!

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.

Thanks for your help,

Sian

 

 

1 2 3 Page 1 of 3