nmacsai

205 Reputation

8 Badges

3 years, 114 days

MaplePrimes Activity


These are questions asked by nmacsai

restart

NULL

Is there a direct way to have the int command return the anti-derivative plus an arbitrary constant of integration? I am imagining the process to look like:
int(f(x), x) = F(x)+c1

NULL

Consider the integral of f(x)=x.f := x

x

(1)

Int(f, x); int(f, x)

(1/2)*x^2

(2)

Notice that the output has no intregration constant or the constant has been assigned the value of zero and is not displayed in the output.

Maple 2021 Help states, "Indefinite integration  is performed if the second argument x is a name. Note that no constant of integration appears in the result. Definite integration is performed if the second argument is of the form x=a..b where a and b are the endpoints of the interval of integration."

I'd like Maple to output the anti-derivative plus an arbitrary constant in the same way dsolve outputs a general solution of an ode with arbitrary constants. My first work around was to just use dsolve.  

There is a sense in which performing an integration is equivalent to solving an ode:
diff(h(x), x) = g(x); int(diff(h(x), x), x) = int(g(x), x); h(x) = int(g(x), x)+c1; h(x) = G(x)+c2
    

Is there a way to force int to output arbitrary constants of integration or should I stick to just using dsolve if I want that effect?

Download constants_of_integration_int_output.mw

How do I make a new dataframe based on the criteria that a particular row is included when a particular element in that row is equal to a specific string, say, "Ontario"?

I downloaded the publicly availble covid dataset from the Gov. of Canada website.  I want to look at data pertaining to Ontario only. Each data entry corresponds to a row of data where the second column represents the province or territory.  My goal is to create a new dataframe of rows where the second column entry is equal to the string "Ontario".

I have attached my maplesheet.  I can't upload the data but it can be downloaded here: https://open.canada.ca/data/en/dataset/261c32ab-4cfd-4f81-9dea-7b64065690dc.

In the image below, see how the second column is a mix of different strings.  I want a new dataframe where the second column reads only "Ontario".  I have included my naive attempt to select data with 'prname'="Ontario".

sort_data_and_make_new_df_Covid_Analysis_Sheet_1.mw

restart;
with(Physics);
with(Physics[Vectors]);
with(geom3d);
with(LinearAlgebra);
with(ColorTools);
with(plots);

When I define a vector with Physics[Vectors] as:

a1 := a/2*(0*_i + _j + _k)

Maple returns:

a1:= a/2*(_j + _k)

Which is fine but if you try to take the cross product it won't work because the command expects a vector in R3 but interprets a1 as a vector in R2.

How do I ensure Physics[Vectors] understands a1 is a vector in R3

zero_component_problem.mw

Programatically assigning colors to points in geom3d not working.  I just want all the points drawn by the draw command, to be the same color.  The output does not respond to programatic specification of the object color.

Maple 2021 Help says: "

geom3d: draw command

calling sequence:
draw(obj,...)
draw([obj_1,...,obj_n],...)

A typical call to the draw function is draw([ obj_1(localopts_1),...,obj_n(localopts_n) ], globalopts) where obj_1, ..., obj_n are geometric objects, localopts_1, ..., localopts_n are local options for a particular object, and globalopts are  options which apply to all of the objects.

localopts_i is a sequence of type equation. The set of options allowed for localopts_i is color = red."

I tried: color = "Red", color = "red", color = Red, color=red.  The command goes through but the colors remain distinct per point.  You can use the context menu to change the color after the command goes through but it is inefficient for my purposes. 

Here is an image of it not working:


 

Setup:
I am working with a 'large' data set( ~70MB .csv file).  Using the import command I can import the data into a maple worksheet.  After import the dimension of the imported object 434000 rows by 30 columns.  The first 2 columns contain time stamp strings, the rest are numeric. 

Issue:
Importing this data set takes about 5 minutes everytime the command is called, which is everytime the worksheet is opened or re executed.  This is a lot of redundent processing.

Question:
Is there a way that I can import the data once and have it saved as a variable in the variable manager associated with the worksheet?  I want to avoid using the import command in a reduent manner.

1 2 3 4 5 6 Page 6 of 6