Items tagged with convert

Feed
Also available: convert

Good day everyone,

I'm trying to convert a series solution back to its original function but its given me "Error, (in rsolve/linindex) invalid subscript selector".

Anyone with useful informations please.

Attached is the series below

 

theta := convert(a-(1/2)*beta*a^2*y^2+(1/12)*beta^2*a^3*y^4-(1/72)*beta^3*a^4*y^6+(1/504)*beta^4*a^5*y^8-(5/18144)*beta^5*a^6*y^10+(1/27216)*beta^6*a^7*y^12-(95/19813248)*beta^7*a^8*y^14+O(y^16), polynom);
     1       2  2   1      2  3  4   1      3  4  6
 a - - beta a  y  + -- beta  a  y  - -- beta  a  y 
     2              12               72            

       1      4  5  8     5       5  6  10     1       6  7  12
    + --- beta  a  y  - ----- beta  a  y   + ----- beta  a  y  
      504               18144                27216             

         95        7  8  14
    - -------- beta  a  y  
      19813248             
L := [seq(coeff(theta, y, n), n = 0 .. 14)];
  [        1       2     1      2  3       1      3  4     
  [a, 0, - - beta a , 0, -- beta  a , 0, - -- beta  a , 0, 
  [        2             12                72              

     1      4  5         5       5  6       1       6  7     
    --- beta  a , 0, - ----- beta  a , 0, ----- beta  a , 0, 
    504                18144              27216              

         95        7  8]
    - -------- beta  a ]
      19813248         ]
with(gfun);
rec := listtorec(L, u(n));
[ //      2     2  3         2     2  2          2     2  \        
[{ \2151 a  beta  n  - 1434 a  beta  n  - 30592 a  beta  n/ u(n) + 
[ \                                                                

  /             3                  2                  
  \2476 a beta n  - 137904 a beta n  + 207248 a beta n

                  \         
   + 424320 a beta/ u(n + 2)

     /         3           2                      \           
   + \-153660 n  - 322920 n  + 1803360 n + 2545920/ u(n + 4), 

                               1       2          \      ]
  u(0) = a, u(1) = 0, u(2) = - - beta a , u(3) = 0 }, ogf]
                               2                  /      ]

rsolve(rec[1], u);
      / //      2     2  3         2     2  2          2     2  \ 
rsolve|{ \2151 a  beta  n  - 1434 a  beta  n  - 30592 a  beta  n/ 
      \ \                                                         

         /             3                  2                  
  u(n) + \2476 a beta n  - 137904 a beta n  + 207248 a beta n

                  \         
   + 424320 a beta/ u(n + 2)

     /         3           2                      \           
   + \-153660 n  - 322920 n  + 1803360 n + 2545920/ u(n + 4), 

                               1       2          \    \
  u(0) = a, u(1) = 0, u(2) = - - beta a , u(3) = 0 }, u|
                               2                  /    /
sum(%*y^n, n = 0 .. infinity);
Error, (in rsolve/linindex) invalid subscript selector

thanx

 

A very big data was imported by me through

data := Import("http://fs3.fex.net/get/245716150875/11071260/data.txt");
"3.0994584798345
22.889020258043
....

26.082759642081
42.911810680717
6.4578968130322"



I need to convert it to Vector/Array. Now its type is "string":

whattype(data);
                             string

Here is my unsuccessful attempt:

convert(data,Vector);
Error, invalid input: `convert/Vector` expects its 1st argument, V, to be of type {Array, Matrix, Vector, array, sequential}, but received 3.0994584798345
22.889020258043
....

data.mw

How to convert "123" into integer 123

i use sprintf %d still can not convert to integer

I am not unfamiliar with the Wolfram syntax but also not very good with it, and there is a particular element in a Mathematica code I have been given which I do not entirely understand how to efficiently write in Maple. The basic idea is to read in a list of expressions from an external file (LIST) and process the non zero elements and assign them to a function (COEF) which can be called later on. Here is the Mathematica exert:

k = 0;
i = 0;
a = b = \[Theta];
Do[k = k + 1; KK = LIST[[k]]; 
  If[KK =!= 0, i = i + 1; ff = Factor[KK]; 
   COEF[x,y, z, l_, m_, n_] = ff], {z, -2, 
   2}, {y, -2, 2}, {x, -2, 2}];

The LIST has the following form and only contains l, m and n and another factor E which is left undefined for now. It does not contain x, y or z. The LIST can contain any number of terms depending on the problem. Here is an example:

LIST={0, 0, 0, 0, 0, 0, 0, a^2 b m (-1 + n) n (a^2 + b^2 - 2 E), ... ,0,0, a^3 n(l+1+m) ... }

So the Do loop cycles through the LIST and extracts out the non zero terms. What I am unsure about is how it is looping over x,y and z when they do not appear in the LIST at all. I assume it is attaching a x,y,z combination to each COEF and they can be called like this:

COEF[0,1,1,0,2,3]

For the instance of when x=0, y=1, z=1, l=0, m=2 n=3. Is this correct? What would be the best way to replicate this in Maple?

- Yeti

Hi,

I am looking for a way of exporting a large number of Maple files (*.mw) into text files (*.txt) automatically. Here are two questions:

  • Is there a ready-made tool allowing to do this?
  • If not, is it possible to export a maple file to text from the command line interface?

Thanks!

Samuel

It is suggested  

hypergeom([1/3, 2/3], [3/2], (27/4)*z^2*(1-z)) = 1/z

if z > 1. Here is my try to prove that with Maple:


 

a := `assuming`([convert(hypergeom([1/3, 2/3], [3/2], (27/4)*z^2*(1-z)), elementary)], [z > 1])

-(1/((1/2)*(27*z^3-27*z^2+4)^(1/2)+(3/2)*z*(3*z-3)^(1/2))^(1/3)-1/((1/2)*(27*z^3-27*z^2+4)^(1/2)-(3/2)*z*(3*z-3)^(1/2))^(1/3))/(z*(3*z-3)^(1/2))

(1)

b := `assuming`([simplify(a, symbolic)], [z >= 1])

2*(-(12*(3*z+1)^(1/2)*z-12*z*(3*z-3)^(1/2)-8*(3*z+1)^(1/2))^(1/3)+(12*(3*z+1)^(1/2)*z+12*z*(3*z-3)^(1/2)-8*(3*z+1)^(1/2))^(1/3))/((3*z-3)^(1/2)*(12*(3*z+1)^(1/2)*z+12*z*(3*z-3)^(1/2)-8*(3*z+1)^(1/2))^(1/3)*(12*(3*z+1)^(1/2)*z-12*z*(3*z-3)^(1/2)-8*(3*z+1)^(1/2))^(1/3)*z)

(2)

plot(1/b, z = 1 .. 10)

 

simplify(diff(1/b, z), symbolic)

-48*(((3*z-2)*(3*z+1)^(1/2)+z*(3*z-3)^(1/2))*((12*z-8)*(3*z+1)^(1/2)-12*z*(3*z-3)^(1/2))^(1/3)+((12*z-8)*(3*z+1)^(1/2)+12*z*(3*z-3)^(1/2))^(1/3)*((-3*z+2)*(3*z+1)^(1/2)+z*(3*z-3)^(1/2)))/((3*z+1)^(1/2)*(3*z-3)^(1/2)*((12*z-8)*(3*z+1)^(1/2)+12*z*(3*z-3)^(1/2))^(2/3)*((12*z-8)*(3*z+1)^(1/2)-12*z*(3*z-3)^(1/2))^(2/3)*(((12*z-8)*(3*z+1)^(1/2)-12*z*(3*z-3)^(1/2))^(1/3)-((12*z-8)*(3*z+1)^(1/2)+12*z*(3*z-3)^(1/2))^(1/3))^2)

(3)

``


 

Download simplification.mw

Hi all, I have a problem someone can help me

F := {a^2, b^2, c^2, ab, bc, ca}

G := [a^2, b^2, c^2, ab, bc, ca]

How to convert F to G and G to F ?

Thanks you very much.

I solved two inequalities using

[solve]({f(theta) >0, f(theta) <=Pi}, theta)

for some complicated function f of theta, an solve gives me a list of intervals such as

[{theta <= Pi-arccos(-3/4+(1/4)*sqrt(13+16*sqrt(2))), arccos(3/4) < theta},

{arccos(-3/4+(1/4)*sqrt(13+16*sqrt(2)))+Pi <= theta, theta < 2*Pi-arccos(3/4)},

{theta <= 3*Pi-arccos(-3/4+(1/4)*sqrt(13+16*sqrt(2))), 2*Pi+arccos(3/4) < theta}]

I would like to convert each of the intervals to the range form a..b so I can plot the function over this range.

Is there a comand to convert something like {theta <=b, a < theta} to
a..b (assuming a and b are real numbers in some form)?  I can think of a rather complicated procedure to do it, but there should be something simpler.

 

How do I convert an equation into a vectorial form in Maple?

Say you hav f_1(v)=-1/2*C*p*v*V

where V=[vx, vy] and v=|V|.

 

v=46m/s^2, A=18m^2, p=1,1

 

After days of fruitlessly searching the help files and the Internet for a means of converting a Dataseries of strings into numeric values in Maple I changed tack and determined how to do it myself.

I was surprised there was no built in Maple function to do this. From searching the Internet I can see I am not alone.
Since there are no other solutions on the net, here is mine:

toNumeric := (y) -> map(x->parse(x),y);

This creates the function toNumeric() that accepts a DataSeries of text values and returns it converted to a Dataseries of numeric values.

thing := DataSeries(["10", "20", "30", "55.9"], 'labels' = ["a", "b", "c", "d"]);
thing := toNumeric(thing); 

dataframething := DataFrame([["cow", "sheep", "goat", "alpaca"], ["10", "20", "30", "55.9"]], rows = ["a", "b", "c", "d"]);
dataframething[2] := toNumeric(dataframething[2]);


If you want to see this in Maple, try:
 typecastdataseries-maple




 

HI

HOW I convert root of in to another form

thanks

lorenz_5.mw

When I copy mathml into Maple it always pasted the subscipts as indexed.  How could I quickly convert the indexed subscripts into literal subscripts without having to right click and convert each variable?

Hi,

I'm currently writing my thesis and actually haven't used Maple before.

I've got the following problem with converting the results of a sequence:

seq(Optimization:-Maximize(function with 2 variables), parameter:0..1,0.1)

The results are ok, but I can't convert the values to a spreadsheet with 4 columns (parameter value, maximum value, value of variable 1, value of variable 2).

Thank you!

Best regards

I want to apologize if this being neither necessarily a minimal working example for one question nor just one question is uncomfortable. The "MWE" was created on and is designed for Linux machines including ImageMagick. The problem itself should be obvious to all users though, as the subfolder and creation of the gif are just conveniences. I have three sections concerning the different problems occuring in my attempts.

(which I was told is not doable in maple ... hence the gif)

link

The goal was to create an animation that zooms in on a function. As maple just wouldn't allow scaling of axis in animations I decided to export single frames and then convert those with ImageMagick. Maple offers ssystem(„...“) which allows for command line usage.

The problem (may as well be a bug) occurs when I try to export images in a for loop with exportplot(...). If the path as well as previously exported images exist, it won't output an error but still not export the desired images. Exporting frames separately works just fine, as well as doing the very same operation in a separate for loop.

(see the first red comment and export section)

After using the workaround in a second for loop. I couldn't figure out how to import the images and then create an animation from them. The main obstacle is the fact that the imported pictures are put into plot-functions.

(see the second red comment)

 

restart;

with(plottools):

f1 := s -> sin(2*s):

max_frame := 10: # = number of steps

for k from 0 to max_frame do
    pic[k] := plot(f1(x), x=-Pi*(1-k/max_frame)..Pi*(1-k/max_frame),
                    filled=true, #color = ["Orange"],
                    color = ColorTools:-Color([0,
                                              floor(128*k/max_frame),
                                              floor(255*k/max_frame)
                                              ]),
                    view=[-Pi*(1-k/max_frame)..Pi*(1-k/max_frame), -1..1]
                    ):
end do:

path := FileTools:-TemporaryDirectory();
path_list := ssystem("pwd");
path := path_list[2];
ssystem("mkdir ./pics"); # creates a subfolder
path := FileTools:-JoinPath([path, "pics"]); # need to change path to subfolder

plotsetup(window, plotoptions="width=480, height=600");
for k from 0 to max_frame do
    file[k] := FileTools:-JoinPath([path,
                                     MapleTA:-Builtin:-strcat("frame_",
                                                              convert(k, string),
                                                              ".jpg")
                                    ]);
    # exportplot(file[k], pic[k]); # does not work
end do:

exportplot(file[0], pic[0]); # works

# =====================================================================================
# export
# =====================================================================================
for k from 0 to max_frame do
  exportplot(file[k], pic[k]);
od; # also works

# =====================================================================================
# import
# =====================================================================================
for k from 0 to max_frame do
    reimported_pic[k] := importplot(file[k]); # this might take a while (depending on the amount of frames)
end do: # import works but [Length of output exceeds limit of 1000000]

whattype(reimported_pic[0]); #seems to create a plot function
show := convert(reimported_pic,list):
#Error, while processing result #There is no help page available for this error

show[1]; # works

# =====================================================================================
# create an animated gif at least
# =====================================================================================
delay_time := ceil(evalf(100/max_frame));
command_for_gif := MapleTA:-Builtin:-strcat("convert -delay ",
                                            convert(delay_time, string),
                                            " -loop 0 ", # -reverse ",
                                            FileTools:-JoinPath([path, "frame_*.jpg "]),
                                            FileTools:-JoinPath([path, "animation.gif"])
                                            );
ssystem(command_for_gif);

 

 

Download bug_report_maybe.mw

 

I would be grateful for any suggestions. Moreover I have run accross

?DocumentTools:-Components:-VideoPlayer

which I could not figure out how to use by the help pages (I tried to create an avi and import that). If someone has informations on that, please share!

Is there a way to automatically convert and paste my clipboard contents as 2D math?

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