Items tagged with convert convert Tagged Items Feed

hi...how i can convert 3 couple equations to 1 equation with Placement each other?

thanks...

 

3-1.mw

pd1 := A1*(diff(U(x, theta), x, x, x, x))+A2*(diff(U(x, theta), x, x))+A3*(diff(U(x, theta), x, x, theta, theta))+A4*(diff(V(x, theta), x, x, x, theta))+A5*(diff(V(x, theta), x, theta))+A6*(diff(V(x, theta), x, theta, theta, theta))+A7*(diff(W(x, theta), x, x, x))+A8*(diff(W(x, theta), x))+A9*(diff(W(x, theta), x, theta, theta))+A10*(diff(U(x, theta), theta, theta))+A11*(diff(U(x, theta), theta, theta, theta, theta))-A12*omega^2*U(x, theta)

A1*(diff(diff(diff(diff(U(x, theta), x), x), x), x))+A2*(diff(diff(U(x, theta), x), x))+A3*(diff(diff(diff(diff(U(x, theta), theta), theta), x), x))+A4*(diff(diff(diff(diff(V(x, theta), theta), x), x), x))+A5*(diff(diff(V(x, theta), theta), x))+A6*(diff(diff(diff(diff(V(x, theta), theta), theta), theta), x))+A7*(diff(diff(diff(W(x, theta), x), x), x))+A8*(diff(W(x, theta), x))+A9*(diff(diff(diff(W(x, theta), theta), theta), x))+A10*(diff(diff(U(x, theta), theta), theta))+A11*(diff(diff(diff(diff(U(x, theta), theta), theta), theta), theta))-A12*omega^2*U(x, theta)

(1)

pd2 := B1*(diff(V(x, theta), x, x, x, x))+B2*(diff(V(x, theta), x, x))+B3*(diff(V(x, theta), theta, theta, theta, theta))+B4*(diff(V(x, theta), theta, theta))+B5*(diff(V(x, theta), x, x, theta, theta))+B6*(diff(U(x, theta), x, x, x, theta))+B7*(diff(U(x, theta), x, theta, theta, theta))+B8*(diff(U(x, theta), x, theta))+B9*(diff(W(x, theta), x, x, theta))+B10*(diff(W(x, theta), theta, theta, theta))+B11*(diff(W(x, theta), theta))-B12*omega^2*V(x, theta)

B1*(diff(diff(diff(diff(V(x, theta), x), x), x), x))+B2*(diff(diff(V(x, theta), x), x))+B3*(diff(diff(diff(diff(V(x, theta), theta), theta), theta), theta))+B4*(diff(diff(V(x, theta), theta), theta))+B5*(diff(diff(diff(diff(V(x, theta), theta), theta), x), x))+B6*(diff(diff(diff(diff(U(x, theta), theta), x), x), x))+B7*(diff(diff(diff(diff(U(x, theta), theta), theta), theta), x))+B8*(diff(diff(U(x, theta), theta), x))+B9*(diff(diff(diff(W(x, theta), theta), x), x))+B10*(diff(diff(diff(W(x, theta), theta), theta), theta))+B11*(diff(W(x, theta), theta))-B12*omega^2*V(x, theta)

(2)

pd3 := C1*(diff(W(x, theta), x, x, x, x, x, x))+C2*(diff(W(x, theta), x, x, x, x))+C3*(diff(W(x, theta), x, x, x, x, theta, theta))+C4*(diff(W(x, theta), x, x))+C5*(diff(W(x, theta), x, x, theta, theta))+C6*(diff(W(x, theta), x, x, theta, theta, theta, theta))+C7*(diff(U(x, theta), x, x, x))+C8*(diff(U(x, theta), x))+C9*(diff(U(x, theta), x, theta, theta))+C10*(diff(V(x, theta), x, x, theta))+C11*(diff(V(x, theta), theta))+C12*(diff(V(x, theta), theta, theta, theta))+C13*W(x, theta)+C14*(diff(W(x, theta), theta, theta))+C15*(diff(W(x, theta), theta, theta, theta, theta))+C16*(diff(W(x, theta), theta, theta, theta, theta, theta, theta))-C19*omega^2*W(x, theta)-C18*omega^2*(diff(W(x, theta), theta, theta))-C17*omega^2*(diff(W(x, theta), x, x))

C1*(diff(diff(diff(diff(diff(diff(W(x, theta), x), x), x), x), x), x))+C2*(diff(diff(diff(diff(W(x, theta), x), x), x), x))+C3*(diff(diff(diff(diff(diff(diff(W(x, theta), theta), theta), x), x), x), x))+C4*(diff(diff(W(x, theta), x), x))+C5*(diff(diff(diff(diff(W(x, theta), theta), theta), x), x))+C6*(diff(diff(diff(diff(diff(diff(W(x, theta), theta), theta), theta), theta), x), x))+C7*(diff(diff(diff(U(x, theta), x), x), x))+C8*(diff(U(x, theta), x))+C9*(diff(diff(diff(U(x, theta), theta), theta), x))+C10*(diff(diff(diff(V(x, theta), theta), x), x))+C11*(diff(V(x, theta), theta))+C12*(diff(diff(diff(V(x, theta), theta), theta), theta))+C13*W(x, theta)+C14*(diff(diff(W(x, theta), theta), theta))+C15*(diff(diff(diff(diff(W(x, theta), theta), theta), theta), theta))+C16*(diff(diff(diff(diff(diff(diff(W(x, theta), theta), theta), theta), theta), theta), theta))-C19*omega^2*W(x, theta)-C18*omega^2*(diff(diff(W(x, theta), theta), theta))-C17*omega^2*(diff(diff(W(x, theta), x), x))

(3)

``


Download 3-1.mw

hi

i have a problem with convert mathematica code in to maple one

i attached maple file .some line have error.please help me for remove error

thanks

fdm.mw

fdm.pdf

Dear Community,

Is there an easy way to convert elapsed days since January 1 1900 to date, i.e. to year, month, day in Maple? E.g. 23021 days should convert to 1963.01.10. Also what is the opposite, i.e. from date to elapsed days?

tx in advance,

best regards

Andras

hi.how convert root of to explicit form.

w is a imaginary..

thanks

123.mw

restart; w := (1/2)*(2*d-5+I*sqrt(4*d-9))/(d-2)

(1/2)*(2*d-5+I*(4*d-9)^(1/2))/(d-2)

(1)

with(LinearAlgebra):

{Q1 = RootOf((2*I)*(4*d-9)^(1/2)*_Z*d-((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b*d+2*((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b-2*d*_Z), Q2 = -(1/2)*d*(I*(4*d-9)^(1/2)+1)*RootOf((2*I)*(4*d-9)^(1/2)*_Z*d-((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b*d+2*((2*d-5+I*(4*d-9)^(1/2))/(d-2).(d*(I*(4*d-9)^(1/2)+1)*_Z/((d-2)*b)))*b-2*d*_Z)/((d-2)*b)}

(2)

``

 

Download 123.mw

hi

if possible to convert matlab file in to maple fie program??convert_to_maple_program.txt

thanks

 

Hi guys,

 

I would like to convert a piecewise defined function of two variables into an if structure
Example :

F := (x,y) -> piecewise(x < 0, piecewise(y < 0, 0, 1), piecewise(y < 0, 1, 0));

What I expect is something like (the indentation is just for fun)
if x < 0 then
   if y < 0 then 0 else 1 end if;
else 
   if y < 0 then 1 else 0 end if;
 end if


I tried the following :

convert(F(x,y), `if`)  # but it only converts the "outer x condition" and keeps the "inner y conditions" unchanged

And next this :

map(u -> convert(u, `if`), F(x,y)):   # fails to give m
# and
map(u -> convert(u(x,y), `if`), F(x,y)): 
# ...

without success.

Can anoybody help me please.
I am also interested in an explanation of the reasons why the previous command do not work.

Thanks all

I resolve the surface flat grinding of a metal pieces in Mathematica, but I would like convert this program in Maple syntaxis. 

Thanks in advance!

For example, I havd matrix m:=[0 1 0 1 0 1 0], I want to convert it back to m:=[0,1,0,1,0,1,0]. Can someone help to solve? Thank you.

A wealth of knowledge is on display in MaplePrimes as our contributors share their expertise and step up to answer others’ queries. This post picks out one such response and further elucidates the answers to the posted question. I hope these explanations appeal to those of our readers who might not be familiar with the techniques embedded in the original responses.

The Question: Transforming functions to names

Bendesarts wanted to know how to make programmatic changes to characters in a list. He wrote:

I have this list :

T:=[alpha(t),beta(t)]

I would like to create this list automatically:

Tmod:=[alpha_,beta_]

In other words, how can I remove the 3 characters "(t)" and replace it by "_"

Do you have ideas to do so ?

Thanks a lot for your help

Joe Riel provided a complete answer that had three different approaches. He wrote:

Map, over the list, a procedure that extracts the name of the function and catenates an underscore to it. The function name is extracted via the op procedure, e.g. op(0,f(a,b,c)) evaluates to f. Thus 

map(f->cat(op(0,f),_),T);

Note that this fails if the name of a function is indexed, e.g. f[2](a). No error is generated but the catenation doesn't evaluate to a symbol. Presumably that isn't an issue here.  One way to handle that case is to first convert the indexed name to a symbol, then catenate the underscore.  So a more robust version is

map(f->cat(convert(op(0,f),'symbol'),_),T);

However, if you are actually dealing with indexed names you might want a different result. Another way to do the conversion, and combine it with the catenation, is to use nprintf, which generates a name (symbol). Thus

map(f -> nprintf("%a_", op(0,f)),T);

 

Let’s discuss each approach by understanding the definitions and functionalities of the commands used. 

The map command, map(fcn, expr, arg1, ..., argN) applies a procedure or name, fcn, to the operands or elements of an expression, expr. The result of a call to map is a copy of expr with the ith operand of expr replaced by the result of applying fcn to the ith operand.  This concept is easier to grasp by looking at a few examples related to the usage of map in this question.

Example 1.  map(x-> x2,x+y)         returns     x2+y2                    

Example 2. map(a -> a-b, sin(x))    returns     sin(x-b)

 

The cat function, cat(a,b,c,…), is commonly used to concatenate (or join) string and names together. This function’s parameters: a,b,c…, can be any expressions.

Example 1. cat(a,2)                      returns     a2

Example 2.  cat(“a”,3,sin(x))          returns    “a3sin(x)”

 

The op function, op(i..j,e), extracts operands from an expression. The parameters i and j are the integers indicating positions of the operands and e is the expression. For functions, as in this example, op(0,e) is the name of the function.

Example 1.  op(0,alpha(t))            returns   the symbol alpha

Example 2.  op(0, sin(x))              returns    sin

 

Now analyzing Joe Riel's code will be easier.

  1. map(f->cat(op(0,f),_),T);

In this approach Joe is extracting the name of the functions, alpha and beta, and then concatenating it to the underscore symbol. Then using the mapping function he applies the previous procedure to the list T.

  1. map(f->cat(convert(op(0,f),'symbol'),_),T);

This approach is a lot similar to the previous one, but he added the convert function in case the function inside of map was indexed. Convert(expr, form, arg3,..), is used to change an expression from one form to another. In this example op(0,f) has been changed from type name to type symbol.

  1. map(f -> nprintf("%a_", op(0,f)),T);

Again this is a similar approach but it uses nprintf. This command, nprintf(fmt,x1,..xn), is based on a C standard library command of the same name. It uses the format specifications in the fmt string to format and writes the expression into a Maple symbol, which is returned. In this example the format specified is the algebraic format “%a”.

 

This blog was written by Maplesoft’s intern Pia under the supervision of Dr. Robert Lopez. We both hope that you find this useful. If there is a particular question on MaplePrimes that you would like further explained, please let us know. 

Hi everyone,

 

I converted a code from Maple 18 to Fortran 77 but the code is badly cut, for instance:

cg = -(F * h * p ** 2 - F * h * q ** 2 + 0.2D1 * F * k * p * q + c
     #os(F) * sqrt(-e ** 2 + 0.1D1) * p ** 2 - cos(F) * sqrt(-e ** 2 + 0.

Is there an option which can force the line cut to be done in an optimized way?

Thank you very much for your help!

>nombor1:=[4,6,2];

nombor1:=[4,6,2]

 

Hi, anyone know hot i need to continue my command to get 462 from [4,6,2]?

Thank you~=]]

>mylist:=468;

mylist:=468

 

Hi, how i need to continue my command to get [4,6,8] from 468?

Thank you~=]]

Experts.

When I subtract (in base 10) 235 (octal digits) from its reverse I get  [-1,-1,2]. converting this list to number equals 189 (base 10)....divisible by 7. [I would think the list would be [9,8,1] ;

in wolfram alpha 532 base 8 - 235  base 8 = 189 base 10 ).

Converting 189 to octal yields 275. All this is done correctly in Maple.

Now when I add 275 base 8 to 572 (edit: not 575 as I had before) base 8 I should get 1067 base 8, but I don't....

for sure i've done something silly

octal.mw

Sorry for disturbing you. I am wondering if there is an easier approach in Maple that could convert a system of second order differential equations into matrix form. Of course, we could do it by hand easily if the degrees of freedom is small. I would like to know if we could use Maple to do so. 

Here is an example with 6 degrees of freedom: the variables are u, v, w, alpha, beta and gamma. And, this is a uncoupled system.

Vector(6, {(1) = 2*R^2*(diff(w(t), t))*Pi*Omega*h*rho+R^2*(diff(u(t), t, t))*Pi*h*rho-R^2*u(t)*Pi*Omega^2*h*rho = 0, (2) = R^2*(diff(v(t), t, t))*Pi*h*rho = 0, (3) = -2*R^2*(diff(u(t), t))*Pi*Omega*h*rho+R^2*(diff(w(t), t, t))*Pi*h*rho-R^2*w(t)*Pi*Omega^2*h*rho = 0, (4) = (1/4)*R^4*Pi*(diff(alpha(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(alpha(t), t, t))*h^3*rho+(1/6)*R^2*Pi*(diff(gamma(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*alpha(t)*Omega^2*h^3*rho = 0, (5) = (1/2)*R^4*Pi*(diff(beta(t), t, t))*h*rho-(1/2)*R^4*Pi*beta(t)*Omega^2*h*rho = 0, (6) = (1/4)*R^4*Pi*(diff(gamma(t), t, t))*h*rho+(1/12)*R^2*Pi*(diff(gamma(t), t, t))*h^3*rho-(1/6)*R^2*Pi*(diff(alpha(t), t))*Omega*h^3*rho-(1/12)*R^2*Pi*gamma(t)*Omega^2*h^3*rho = 0});

The objective is to reform it into matrix form : M*diff(X(t), t, t)+C*diff(X(t), t)+K*X(t)=F.

Thank you in advance for taking a look. 

Hi, anyone know the command to convert a digit to 8 bits binary number ?

Thanks for help..

1 2 3 4 5 6 7 Last Page 1 of 41