## I get a negative integral of an absolute value fun...

Hello

I am trying to calculate a definite integral of an absolute value function. I should get a positive result, but I end up getting a negative result. Why is this?

The line I am trying to run is this

ET2 := int(abs(1/(x - 2) + 0.5333 + 0.3333*x + 0.1333*x^2), x = -1 .. 1);

And the result I get is:
ET2 := -0.056854377998556975271421429744140962019176108843917

What am I missing?

## Make my Own Code and Call to other file and Get Re...

Hello;

Hope you are fine. I need to learn how can I call my code in the other file of maple, define new value for A and can get results. For this purpose, I just take an simple example as

questionmaple.mw

 >
 (1)

## Generalized Compressibility Chart...

Is there a generalized compressibility chart in Maple?

## Applying chain functions...

Hello guys,

From time to time I use the procedure below to chain functions to the right of the expression to be evaluated.

`&/`:=()->args[-1](args[1],args[2..-2]):

For example:

(sin(x)^2+cos(x)^2)&/simplify                      1

For functions that work with just one argument, it's okay, but with functions that take more than one argument (like convert, subs), I don't know how to implement it.

0.76&/ convert(???,fraction)

(a*x+*x*b)&/simplify&/subs(a=2,b=3,???)

If someone more experienced can help, I'd be very grateful.

Oliveira

## How can we obtain the absolute path to a file whos...

Let's say I have a file test.mpl file in the path ~/maple/Packages/MyPackage/test.mpl.

From the code in this file, I wish to save something to a file in the directory at the relative path ./Animations, which has absolute path ~/maple/Packages/MyPackage/Animations.

Now, on my machine, because I know the path to this directory I can easily save using the absolute path.

What if I send this directory MyPackage (which is essentially a package) to someone else. Maybe they keep it in a different location such as ~/projects/maple-projects/MyPackage.

I would like that this person be able to run test.mpl and it will save the aforementioned something to a file in the relative location ./Animations, which on their machine is the absolute path ~/projects/maple-projects/MyPackage/Animations.

I am stuck on how to accomplish this.

I found out that if I am in a worksheet that is in the directory MyPackage then I can use interface(worksheetdir) to find out the path to the worksheet, so if everything were run from a worksheet contained in the MyPackages directory then I could use a relative path to the Animations directory.

Problem is, the normal usage of test.mpl is to just create some new worksheet and read the file and use it. But a new worksheet like this is located in the home directory by default.

## matrix index out of range...

 > restart;
 > A:= Matrix();
 (1)
 > i_choices:= [seq(i,i=0..10,1)];
 (2)
 > j_choices:= [seq(j,j=0..10,1)];
 (3)
 > for i in i_choices do:  for j in j_choices do:    A[i,j] :=i+j;    print(A[i,j]);  od: od;

## The value of global variables in procedure...

I would ask, why is the value of the global variable changed in procedure?

for example, we first define a global A2 and a proc()
but the value of A2 is changed in proc()?

How to fix this error?

## Can this system of non-linear coupled PDE's be sol...

Dill_ABC_Model_PDE_System_Solution.mw

The attached Maple 2019  document attempts to solve a non-linear system of two coupled, time-dependent first-order PDE's, given a list of initial and boundary conditions.  The system models the optical transmittance through a thin photoresist layer whose transmittance changes upon exposure to the incident exposure energy, and hence, the cumulative transmittance through the layer is itself a function of both the exposure time and the distance traveled through the resist layer.  The list of fixed parameters, P, defines the characteristics of a particular photoresist (hereafter "pr") and an assumed exposure irradiance.

My first attempt towards a general solution without initial or boundary conditions (hereafter "ics" & "bcs") apparently "succeeds" (in that no error messages are thrown), however, the form of the solution is quite complicated and difficult (for me at least) to interpret.  I think I understand that the _Cn are undefined constants that require supplying ics & bcs to determine the solutions for the transmitted intensity I(z,t) & the normalized molar fraction of the photo-active component in the pr, M(z,t).  However I do not understand what the symbol _f refers to in the returned solutions.

I make a second attempt to solve the system numerically, supplying a list of the [ics,bcs] as arguments to Pdesolve, however the error message "Error, (in pdsolve/numeric/process_PDEs) PDEs can only contain dependent variables with direct dependence on the independent variables of the problem, got {Iota(0, t), Iota(z, 0), Mu(0, t), Mu(z, 0)}" raises the question of whether I have misunderstood the required syntax in using Pdesolve or that the system as posed is in fact insoluble by Maple.

I would appreciate any insights that readers of this post can contribute, as my experience using Maple and PDesolve in particular must be considered embryonic at best.

Scott Milligan

## create a random simple directed graph...

Is their way to create a Random simple directed graph using random graphs package

RandomDigraph function I dont see an option to restrict it to give only simple graphs

Kind help if any code or way I can do that

One more thing is I dont see any directed special graph in maple

## How to import data from a gsheet...

I would like to read data from a google sheet document. I can download a local copy to excel format, but then I'm no longer tied to the origional file.

## What is the recommended way to save results of big...

Let's say I am solving a system of differential equation numerically with dsolve.

In psolve, I use the option output = Array(...), and I assign the result of the call to a variable p. Given my problem such calls can take a few minutes to run.

Later I use odeplot and pass in this variable p. In this workflow I am doing all this in a single worksheet.

Now, I'd like to run dsolve multiple times and save the results of calls to files so that I can plot them later (what I am actually doing is running some code using the Grid package, and I would like each parallel process to save the plot data).

It would actually be great if I could run this code as a batch file. I am not sure how to do this yet (I read about some command line mode that would be best for this).

So my questions are

- What is the recommended way to save data to files for loading later on?

- Does the answer the the above question work in command-line mode?

## Expanding Derivatives in Equations...

Hi Everyone,

ich have a question, that is probably rather trivial. I am currently doing some calculations with the differential geometry package. (I know the Physics package was recommended, however, the DG package seems more appropriate for my purposes after having a look through the Physics help page)

My goal is to substitute a functional expression into equations derived in curvilinear (spherical and helical) coordinates. my problem now is that maple won't expand the differentials of the expressions I have substituted.

I hope the answer isn't too trivial. Although I assume it will be :)

 >
 >
 >
 >
 (1)

Defining the Metric Tensor and Calculating the Connection Coefficients

 >
 (1.1)
 >
 (1.2)
 >
 >
 (1.3)

Defining the PDF as a Tensor (Metric) Density

 >
 (2.1)
 >
 (2.2)
 >

Convective Operator

 >
 >
 >
 (3.1)
 >

In particular, the last line should simplify quite a bit when expanding derivatives.

## Reduce length of sum of products...

I hope the solution is not too obvious...

My expression is

G1*P3 + G1*P5 + G1*P6 + G2*P3 + G2*P6 + G3*P2 + G3*P5 + G4*P2 + G4*P3 + G4*P5 + G4*P6 + G5*P2 + G5*P3 + G5*P5 + G5*P6 + G6*P3 + G6*P6 + G7*P2 + G7*P5 + G8*P2 + G8*P3 + G8*P5 + G8*P6

I want this to become as short (in terms of display characters) as possible. I tried simplify, which gives

(G1 + G2 + G4 + G5 + G6 + G8)*P3 + (G1 + G3 + G4 + G5 + G7 + G8)*P5 + (G1 + G2 + G4 + G5 + G6 + G8)*P6 + P2*(G3 + G4 + G5 + G7 + G8)

How do I get

(G1 + G2 + G4 + G5 + G6 + G8)*(P3+P6) + (G1 + G3 + G4 + G5 + G7 + G8)*P5 + (G3 + G4 + G5 + G7 + G8)*P2

which is shorter and which you can get from directly looking at the expression? The Terms Gi and Pj are just scalar variables as a placeholder. Using collect seems only to work on one variable.

## Looking Help for change of view of graph...

Good day to all,  I have plotted a simple graph for my problem. I am trying to change this view but failed. I am attaching my maple worksheet in which I have plotted a line graph but now trying to draw a graph of that function that looks like the picture which is attached as a reference below.

worksheet.mw