## Rounding numbers...

restart:

a:=0.0000000000000000000000213123123;

evalf[3](a);

I think the above is the same as if I were to change the precision tab, to display 3 decimals.

Is there a way to ask Maple to display it as  (printf(  "%3.3f",a);)

0.000

But I want this as a standard Maple ouput.

and I am not just working with a single scalar, I need something that works for a Vector, Matrix, and perhaps, in general.

Thanks,

casper

## How do align in printf ?...

v1:=[
eta[p2] = 0.260 ,
eta[p3] = 0.113 ,
eta[p4] = -0.013 ,
eta[p5] = 0.215 ,
eta[p6] = -0.189 ,
eta[phi2] = 0.020 ,
eta[phi3] = 0.063 ,
eta[phi4] = -0.014 ,
eta[phi5] = -0.414 ,
eta[phi6] = 0.067 ,
mu[p] = 0.466 ,
mu[phi] = -0.169 ,
tau[p3] = -0.000 ,
tau[p4] = 0.000 ,
w[1] = 0.023 ,
w[2] = -0.447 ,
w[3] = -0.110 ,
w[4] = 0.035 ,
w[5] = 0.445
]:

for i to numelems(v1) do
printf("%a = %3.3f , \n",lhs(v1[i]),rhs(v1[i]));
end do:

This runs and returns:

eta[p2] = 0.260 ,
eta[p3] = 0.113 ,
eta[p4] = -0.013 ,
eta[p5] = 0.215 ,
eta[p6] = -0.189 ,
eta[phi2] = 0.020 ,
eta[phi3] = 0.063 ,
eta[phi4] = -0.014 ,
eta[phi5] = -0.414 ,
eta[phi6] = 0.067 ,
mu[p] = 0.466 ,
mu[phi] = -0.169 ,
tau[p3] = 0.000 ,
tau[p4] = 0.000 ,
w[1] = 0.023 ,
w[2] = -0.447 ,
w[3] = -0.110 ,
w[4] = 0.035 ,
w[5] = 0.445 ,

Is there a way to align the qual signs? also to align the decials like this:

eta[p2]   =  0.260 ,
eta[p3]   =  0.113 ,
eta[p4]   = -0.013 ,
eta[p5]   =  0.215 ,
eta[p6]   = -0.189 ,
eta[phi2] =  0.020 ,
eta[phi3] =  0.063 ,
eta[phi4] = -0.014 ,
eta[phi5] = -0.414 ,
eta[phi6] =  0.067 ,
mu[p]     =  0.466 ,
mu[phi]   = -0.169 ,
tau[p3]   =   0.000 ,
tau[p4]   =   0.000 ,
w[1]       =   0.023 ,
w[2]       = -0.447 ,
w[3]       = -0.110 ,
w[4]       =  0.035 ,
w[5]       =  0.445 ,

For the negative numbers, I prefer to have 1 space of indentation.

Thanks,

casper

## Maple 18 error "too many levels of recursion" when...

We deploy Maple to our users using Microsoft App-V; We have been using App-V 4  to successfully deploy Maple for some time. When I package Maple 18 for App-V 5 deployment, when a user launches Maple there is an error "too many levels of recursion".

After clicking OK to clear the error, choosing any of the options on the start screen, e.g. signal processing, simply launches a help screen with the message "no matches found" instead of launching a new worksheet.

App-V is our standard method of deploying applications, and has always worked OK in the past. Do you have any recommendations for packaging Maple 18 via App-V?

Thanks.

## Substitute variable...

Hi,

Excuse me, I have a following expression

x^2+x+2;

I want to replace all x as x+1

x:=x+1 does not work.

Is there any simple solution?

Thank you very much in advance

## i need a help for solve ...

hi,

here are  equations like this

sol := [abs(r)^2+abs(t)^2 = 1, r*conjugate(t)+t*conjugate(r), abs(r) = abs(t)]

when i solve this equations using command solve，the result  is none. and i used r=x+I*y,t=u+I*v in the equations,

sol:=[u^2+v^2+x^2+y^2 = 1, 2*u*x+2*v*y, sqrt(x^2+y^2) = sqrt(u^2+v^2)]

i still can't get a result.why,can you help me.

thanks.

## return a list of indices that match a condition...

a:=Vector([2,3,4,5]);

select[flatten](x->x>=3,a);

This returns a Vector that satisfies the above condition. What's the most efficient way to get the indices of those entries?

For example, a list l:=[2,3,4] that correspond to the a[l] entries that satisfies the above condition.

l:=[2,3,4];

a[l]; # gives the same answer

Thanks,

casper

## How to let maple add two arrays only with the coef...

Let x:=2*[x_1,x_2,...,x_n];   y:=3*[x_1,x_2,...,x_n]; If I input x+y, it will turn out  5*[2x_1,2x_2,...,2x_n]; But I want to get  5*[x_1,x_2,...,x_n]. What should I do? Thanks!!

## How to generate 3d objects with desired dimensions...

Good morning.

I request your kind suggestion to my query posted.

With thanks & Regards

M.Anand

Assistant Professor in Mathematics

SR International Institute of Technology,

## Batch process worksheets and save as PDF...

Hi,

I wonder if there is a way to achieve this, say I have 4 Maple worksheets,

sheet1.mw

sheet2.mw

sheet3.mw

sheet4.mw

all of them can run seperately. Each of them runs on lots of data, and takes a big chuck of time. I hope to run them one by one. After each file is completed, save (Export) as PDF file, and move on to the next one.

On my own PC, I use Maple X64 windows version. I have never used the command line, but I suppose that will be done in this version, instead of the GUI version?

On the school server, it's Maple X64 linux version. So it's also has the maple command line version as well as the xmaple version.

Thanks,

casper

## The differences between two sequences...

restart:
seq1:=seq(i,i=1..5);
seq2:=seq(i,i=2..6);
dseq:=seq2-seq1;
seq1:=seq(i,i=1..5);
seq2:=seq(i,i=1..5);
dseq:=seq2-seq1;
seq1:=[seq(i,i=1..5)];
seq2:=[seq(i,i=1..5)];
dseq:=seq2-seq1;

Is that possible to get the differences between two sequences directly? (instead of using a list)

I don't quit understand why the second method would collapse the 0s into just a single value. It's not a set.

Thanks,

casper

## Fast random generation...

It says at

http://www.maplesoft.com/products/maple/new_features/maple18/Language_Programming.aspx#random

"When generating matrices and vectors of floats and integers, these flavors are very fast. "

But when I compare the new

time[real](Generate(('Matrix')(float, 300, 300)))

and

time[real](RandomMatrix(300, 300))

I find RandomMatrix over 300 times faster. Am I doing something wrong, or is RandomMatrix still the fastest way to generate random numbers?

## How do I get rid of editing lines in excess?...

Everytime I re-run a workfile, I get several extra editing lines inbetween my own command lines. Have I missed something in my settings?

Best regards
Emilijan Vuletici

## Prevent Maple from converting [[cm^3]] to [[m^3]]?...

Now that I got my units converted I have a new problem:

I have g/mol and g/cm^3, and the result is supposed to be per cm^3 too. So I would like to keep my grams as well as my  cm^3. However, Maple converts it all to kg and m^3!

That means I have to divide the final result by 10e6. No big deal, only that it looks strange on my worksheet (when I divide the units stay the same, so if I show that to someone they'll be amazed at the gigantic m^3 result number I got instead of just a few cm^3).

By the way, turing off the automatic unit cancellation (see link, my question a few days ago) does not change anything, the g->kg and cm^3->m^3 conversion take place as soon as I enter the values:

results in

and

gives

## Why does allvalues not eliminate all RootOf's ?...

Hi guys,

im trying to solve the linear equation system:

Then, assigning the solutions:

Then, eliminating the RootOf's for variable a:

Unfortunately, a_explicit still contains RootOf's. How can I avoid this?

Thanks,

Martin

 First 74 75 76 77 78 79 80 Page 76 of 81
﻿