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 replies submitted by erik10

@Kitonum Thanks. A third way to do it, and with gaps ...

Erik

@dharr Thanks for your nice alternative plot, which will hold information of all three categories. 

Erik

@Carl Love  

Thanks a lot for showing me how discrete plots can be accomplished using this matrixplot command. I understand the indidual parts, except for the tickmarks option. How can the matrixplot command deal with a list like [1.5=0, 2.5=1, ... ]?

Another thing: I found myself getting stucked in as easy a task as to draw a 1-dimensional histogram with data like the following data:

(1,4), (2,3), (4,5)

meaning that there should be a column at 1 with the height 4, a column at 2 with the height 3, etc. How is this done? Eventually the data could be given in lists: X=[1,2,4] and Y=[4,3,5]. I didn't find that very straight forward in Maple. It seems lige the Histogram command cannot be used in this situation ...

Erik 

@acer 

That was an easy trick to make it work. Thanks a lot. I appreciate your work. Also nice to have the bug reported ...

Erik

@acer Thanks, that settles it all, I think. Thank you for your effort to help me.

Erik

@acer Maybe I understand now: It has to do with the order in which things is being evaluated? All this is due to the presence of the linearInterpolation, I presume.

Now I have finished my task, which is to plot the entire P-wave trajectory. I also allow the angle for the bottom of the curve to be other value than 0, naming it theta_0. I made a mirror plot and put it all together in the attached file. 

One strange thing, though: If I alter r_0 from 5338 to 5330 or less, the calculations takes a lot of time. Maybe due to there being a singularity in the integral around that value ...

Seismology_acc_ev_ac_ev.mw

@acer OK, thank you for the explanations. Now, I also wanted to convert the polar coordinates to rectangular coordinates: See my attached document. Unfortunately my simple approach does not work. It is probably because I don't really understand how the data is represented in Maple due to the Interpolated function being present. My goal is to plot this vector function in 2D along with a circle of radius R = 6338 (using the display command). I will however also have to mirror the curve, because I only get half the propagation path for the P-waves using the integral ...

Seismology_acc_ev.mw

@acer 

Great! I tested both of your methods and they both took about 20 seconds to execute on my computer. Although I don't get the integral displayed in 2D notation in the worksheet, I think I prefer your last acc method. This is mainly because I am able to insert values for the radius into the Theta-function in order to receive angles for specific values of radius. This doesn't happen in the ac method, where I just receive an abstract expression.

A couple of questions:

What does the adaptive=false option in the plot command mean?

Did you choose numpoints=41 by trial and error?

You are doing a great job here at Mapleprimes indeed! The solution to my questions wasn't as easy as expected, and I don't think I could have figured it out myself, even if struggling more.

Erik

Hi Acer and thanks for your valuable answer. My underlying problem was however even more complicated. Maybe your additions will help solve it even then. It is about Seismology, where I have data for the velocity of P-waves for certain steps of radius r. Then I wanted to use linear interpolation (or spline maybe even better) to construct a function v_lin(r) for alle values of r. This function has to be put into an integral with other expressions in order to construct the solution of the wave propagation of a P-wave through the Earth: Angle as a function of radius r (polar coordinates of path). This means I get another level of complication, because now the limit of the integral is becoming the variable. I attach the file. I guess you will grasp my idea rather quickly. But how do I make Maple calculate this integral, which is in reality a new function? ...

Seismology.mw

Yes, that one is indeed even nicer. Easier to grasp when viewing the code. Thanks!

Erik

Wow is it that simple. Thanks! So I was on the right track. I guess that this is the most convenient way to do it then - with assigments put into an if condition. 

Erik

@jganding 

Your way is maybe the most proper way to do it (not using workarounds), although it is a bit lengthy. Sometimes one just needs to have the x-axis drawn at the right place in order not to get fooled by false zeros, when the x-axis is displayed at a certain constant non-zero y-value. Maplesoft should provide a more decent way to make this happen. In the current situation the user is supposed to choose a function by himself, so I need to have Maple display the graphs automatically in a way, which includes the x-axis. 

Again thank you to all of you for your contributions. 

@Preben Alsholm 

Thanks to you and Rouben.

Rouben: It works, but not especially pleasing to have to create a "fake" invisible point and then use display to glue those plots together.

Preben: Your suggestion is more simple and the additional plot on the x-axis is barely noticeable. 

I will use one of those if nothing else works. I guess there is no other way to access the y_min and y_max which Maple is using when plotting a function - before actually plotting? Some kind of range command ...

Also I wish it was possible to make a y-range halfway default by being able to write something like y=0..default. Or eventually make an option possible for inclusion of certain values. It could be a wish for Maple 2025 ;)

Thank you for your suggestions. 

Erik

Thanks a lot. Looks like it is what I am looking for!

Regards,

Erik V.

Thanks to all of you. I like the single line function definition, which is simple and seems to work. It also seems to work for special French and German letters: 

LEN("éâü") = 3

Regards,

Erik V.

1 2 3 4 5 6 7 Last Page 1 of 17