erik10

I have a degree in Mathematics and Physics from the Danish University Aarhus, comparable to a masters degree with thesis - majoring in Mathematics. In 1991-92 I was a visting scholar at UCLA, Los Angeles, following graduate courses in Applied Mathematics. Since 1992 I have been a teacher in a high school (gymnasium) in Denmark. Special interests: Applied mathematics, graphics and popularizing Mathematics.

MaplePrimes Activity


These are questions asked by erik10

Dear Maple users

I have a question about performing operations on a matrix and another one about retrieving information from a matrix. I am looking for the easiest (hopefully also the shortest) way to do it:

1. Given a matrix with several rows and columns. I want to permute the rows in such a way that the entries in a specific column are ordered (either ascending or decending as wished).

2. Given a matrix with several rows and columns. I want to count how many entries in a specific column are above a certain given fixed value.   

I am pretty sure some of you guys out there can do it in an elegant way. Examples will be appreciated.  

Regards,

Erik

Dear Maple users

I could probably make the things happen in an ad hoc way myself, but I am pretty sure there is a smart and conceptual way to do it in Maple, which will make things much easier. That's why I am asking you. 

I am trying to create a Random Variable X build on the outcomes of throwing two dice, i. e. X is a function from the Sample Space consisting of all 36 different 2-tuples of the kind (x,y), onto the Real Numbers. Let's say the dice are colored: one green and one red. The outcome (3,2) means that the green die is displaying 3 dots and the red die is displaying 2 dots. The Random Variable can be any function on that Sample Space: The sum of the number of dots, the square of the number of dots on the green die plus the number of dots on the red die, or it could be something completely different. In this example X will have a finite number of possible values: x1, x2, ..., xn. Now I would like to create such a Random Variable in Maple in a convenient way. Afterward I would like Maple to throw dice by random a number of times, say 100,000 times and show me a Histogram or a list of how many times X got the result x1, x2, etc.

I hope someone can help me get going in a problem like the one described above. 

Kind regards,

Erik V.

  

 

Dear Maple users

Sometimes I use the Explore command in order to watch how plots containing parameters change when the parameters are changed via sliders. I tried to do the same with an odeplot. I can make it work, but I cannot do it the same way as I use to do with ordinary plots: I like to define the plot outside the Explore command, because those Explore commands can be quite cluttered and hard to overview. It is not that bad in my attached example below. Sometimes I have display commands handling several plots ... 

In the attached file I show first how it works when the odeplot is inside the Explore command, but when I later move it outside, it won't work. Why this difference between ordinary plots and odeplots? Or maybe there is a workaround to make it work having the odeplot command outside ...

Regards,

Erik

 

odeplots_in_an_Explore_command.mw

Dear Maple users

Some ODE's like the Lotka Volterra system can only be solved numerically. I would like to solve some equations based on the numerical solution to that system. Let the x(t) and y(t) be the solutions to the ODE system. 

Now, obviously it won't work afterwards to write an equation like solve(x(t)=60,t), since the solution of the ODE only exists as a procedure. Of course I can make an odeplot and zoom in to get an approximate solution to x(t)=60. I would however like it to done automatically. How is this done in the most convenient way when the soltuion of the ODE is given as a procedure?

Example attached. 

Regards

Erik

Lotka_Volterra.mw

Dear Maple users

I am trying to test how well data from a real throw with a ball comply with the usual model, in which the air resistance is proportional to the square of the velocity. I succeeded in solving the ODE system numericallly using the rkf45 method and plottet the solutioncurve (see attached file). I am however unsure how I can retrieve the data from the model in the most convenient way in order to compare them to the data from the real throw. The latter I have as (t, x(t), y(t)) data in three columns in an Excel file. Of course I can import the x og y columns into Maple and create a plot containing both the (x,y) data from Excel and the (x,y) data from the model. The problem is however that even if the (x,y) curves are rather close, if may not be a good model. I need to take into account the time variabel as well! The data from the Excel file contains data for every 1/30 second. What I like is to be able to compute the Root Mean Square of all (xexperiment(t)-xmodel(t), yexperiment(t)-ymodel(t)) data - or would the Root Mean Square of the (Euclid) distances between the points be better?

Now back to my question on how to retrieve data from the ODE system in the most convenient way. I have read the help page for the dsolve command. There is however several options, that I am unsure about, for example the output option (listprocedure, etc). I hope someone can help. 

NB! Excel data are imported column by column into Maple as n x 1 matrices.

 

Regards,

Erik V. 

 

Throw_with_air_resistance_1.mw
 

2 3 4 5 6 7 8 Last Page 4 of 15