nmacsai

205 Reputation

8 Badges

3 years, 114 days

MaplePrimes Activity


These are questions asked by nmacsai

Using with(plots) and with(plottools), how do you change the color of the line enclosing a disk? I can change the line style of the line, but I can't figure out how to change the color of the line. I didn't find anything in plot options that would fit my purpose.

how_do_i_change_the_color_of_the_line_around_a_disk_while_using_plottools.mw

Can one evaluate dirac spinor products using the Standard Model package? How far can I take the evaluation in the package? See maplesheet with commentary.

Evaluating_spinor_products_with_the_standard_model_package.mw

out_parameter_for_Sample(_)_and_rtables.mw
When I generate sample data using a random variable, a normal distribution and the Sample command, I want to see the sample and the values used to randomly evaluate the distribution which generates said sample. The Maple help sheets say you can so this with the out parameter in the Sample command. I try several different calls and hoped the rtable is filled on execution. As seen below, the execution fails. Am a specifying the rtable incorrectly? See attached Maple sheet.

restart

NULL

NULL

with(Statistics)

with(LinearAlgebra)

NULL

When I generate sample data using a random variable, a normal distribution and the Sample commands, I want to see the sample and the values used to randomly evaluate the distribution. The Maple help sheets say you can so this with the out parameter in the Sample command.

NULL

NULL

NULL

From the help, we are required to specify a float rtable, that will be filled when the Sample command is succesfully executed.

NULL

Define a random variable.

X := RandomVariable(Normal(0, 1))

_R

(1)

Sample that random variable. We sample it 10 times and look at the output.

A := Sample(X, 10)

Vector[row](%id = 36893491057099280004)

(2)

The float rtable is defined with the sample number of elements as will be sampled.

tab1 := rtable(1 .. 10, datatype = float)

Array(%id = 36893491057099270012)

(3)

NULL

tab2 := convert(rtable(1 .. 10, datatype = float), list)

[HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0), HFloat(0.0)]

(4)

Now I try several different calls and hope the rtable is filled on execution.

A := Sample(X, 10, out)

Error, invalid input: no implementation of Statistics:-Sample:-ModuleApply matches the arguments in call, 'Statistics:-Sample:-ModuleApply(X,10,out)'

 

A := Sample(X, 10, out = tab1)

Error, invalid input: no implementation of Statistics:-Sample:-ModuleApply matches the arguments in call, 'Statistics:-Sample:-ModuleApply(X,10,out = tab1)'

 

A := Sample(X, 10, out = tab2)

Error, invalid input: no implementation of Statistics:-Sample:-ModuleApply matches the arguments in call, 'Statistics:-Sample:-ModuleApply(X,10,out = tab2)'

 

A := Sample(X, 10, out = true)

Error, invalid input: no implementation of Statistics:-Sample:-ModuleApply matches the arguments in call, 'Statistics:-Sample:-ModuleApply(X,10,out = true)'

 

NULL

As seen above, the execution fails. Am a specifying the rtable incorrectly?

NULL

NULL

NULL


 

Download out_parameter_for_Sample(_)_and_rtables.mw

 

Can Maple carry around an unevaluated/inert  Matrix-Vector product(A matrix product without executing the matrix multiplication)? See Maple sheet.

inert_matrix_products.mw

restart

with(LinearAlgebra)

NULLNULL

Can Maple carry around an unevaluated/inert explicit Matrix-Vector product?

 

Define a matrix K and vector U as:

 

U := `<,>`(u1, u2)

Vector[column](%id = 36893490583464982996)

(1)

K := Matrix(2, 2, symbol = k)

Matrix(%id = 36893490583464975884)

(2)

I can take their product using MatrixVectorMultiply( ) I get,

MatrixVectorMultiply(K, U)

Vector[column](%id = 36893490583464964812)

(3)

however output I am really looking for is

 

(Matrix(2, 2, {(1, 1) = k[1, 1], (1, 2) = k[1, 2], (2, 1) = k[2, 1], (2, 2) = k[2, 2]})).(Vector(2, {(1) = u1, (2) = u2}))

NULL

In the later case, K.U is still a product however the actual matrix multiplication is not carried out. Sure, eventually I will want to evaluate the matrix-vector product but sometimes when setting up a problem I want to look at the explicit matrix equation before any explicit matrix multiplication is carried out.NULL

NULL

Here I show some ideas that don't work but may give a sense of what I am going for. I am essentially trying to mute the computation of the product while keeping the elements of the product together for further substitutions elsewhere. This there a standardized way to complish this? Or do I have to write my own procedure for something like this?

 

`&MatrixVectorMultiply`(K, U)

`&MatrixVectorMultiply`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(4)

%MatrixVectorMultiply(K, U)

%MatrixVectorMultiply(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(5)

`&.`(K, U)

`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))

(6)

K*%.U

`&.`(Matrix(%id = 36893490583464975884), Vector[column](%id = 36893490583464982996))*Matrix(%id = 36893490583464939756).Vector[column](%id = 36893490583464982996)

(7)

NULLNULL

Download inert_matrix_products.mw

I often want to export an expression from Maple to LaTeX. Often, the output will contain commands that my LaTeX compiler doesn't recongnize. This hinders my LaTeX document production efficiency greatly. I use MiKTeX and Texmaker to generate documents in LaTeX language. Naively I assumed that Maple sticks to core LaTeX packages when generating an output. I still don't know if that is the case. The main issue is that, I don't know which LaTeX packages some of the Maple outputs use, and so, I don't know which packages to load in my LaTeX document.

As a concrete example, I show how I convert an expression to LaTeX language and how that particular output contains commands: \iup and \idn which are not recongnized by my LaTeX compiler since I don't know which package these commands come from. I google search for commands \iup and \idn came up empty. How do I figure out what package these commands come from

Latex_export_problems_1.mw

1 2 3 4 5 6 Page 3 of 6