cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Can i form a trochoidal wave ?

MM_10735997
7-Bedrock

Can i form a trochoidal wave ?

Is there any way to form trochoidal wave from its equation of any values if X and Y.

 

 

ACCEPTED SOLUTION

Accepted Solutions
Werner_E
25-Diamond I
(To:MM_10735997)

Ranges and vectors are quite different beasts bust unfortunately look the same when displayed in Prime.

Furthermore you forgot the unit (meter) when you defined A.

There is an undocumented trick to turn a range into a vector by simply immediately  evaluating it in the same region where you define it:

Werner_E_0-1691127398530.png

Now A is not a range anymore but a true vector.

A more "legal" way to define the very same vector is using a range i which is needed to index the elements of the vector.

Werner_E_1-1691127534461.png

Note that the index used is a vector/matrix index, not a literal index.

 

Once you defined the vector A either way, the definition of the vector B works as expected and also the calculation of the vectors X1 and Y1 (feel free to use better names):

Werner_E_3-1691127883952.png

 

Some additional remarks:

.) The time yo used for t is larger than the period T    Werner_E_7-1691128824200.png. This does no harm as of the periodicity of sine and cosine. Just thought I'd mention it

 

.) If you defined vector A using the index range i, you can define the vector B by typing

Werner_E_4-1691127943229.pngagain you have to use the vector index.

 

.) Vectorization is not actually needed as Prime would apply implicit vectorization automatically if you don't vectorize. But this depends upon how the function X ( ) is defined and so you are on the safe side if you vectorite and its generally good habit to do so when you feed a vector into functions which normally expect scalar arguments.

 

.) If you are just after a single wave (which you now should already see if you plot Y1 over X1) you don't even need the vector B at all.

You could simply write

Werner_E_5-1691128201150.png

and get the very same result vector X1.
The idea for the vector B stems from my first idea about how to plot multiple waves (for different depth values b) as one plot. But also this could be achieve without using these vectors. So what this means is - vector B is not needed at all 😉

 

.) Without using small programs you may now calculate vectors X2 and Y2 and the only difference would be that you now use a different b-value, lets say b=-10m. Vector A (horizontal values) remains the same for all waves.

Werner_E_6-1691128587797.png

Now you may add a second plot  Y2 over X2 showing a second wave and you may format it differently (color, dot size, line style...) from the first.

If you create five or six waves and want to plot them without individually typing in each X.., Y.. you may consider stacking all individual vectors and just use the stacked vectors XX and YY for the plot. You will see the same waves, but they form now one single trace and so you can't format them differently. This was done with the blue waves in the picture posted above.

Werner_E_0-1691138267320.png

Werner_E_1-1691138281470.png

As you can see I am separating the individual waves by NaN's. This is done to avoid Prime to connect the last point of a wave with the first point of the next one if you decide to show lines along with the points (or just lines). In Prime unfortunately its necessary to provide a unit even though its NaN.

 

So good luck, I guess you should now succeed in plotting some waves.

View solution in original post

8 REPLIES 8
LucMeekes
23-Emerald III
(To:MM_10735997)

There sure is a way, but it starts by you entering the equations properly in a Prime worksheet file.

 

Success!
Luc

Werner_E
25-Diamond I
(To:MM_10735997)

I agree with Luc that its you who has to make some attempts first.

Define a value for k first. I would suggest that you use units throughout as this sure is a strength of Prime and Mathcad. k is of dimension 1/length.

Then based on k you calculate c (constant of gravity g is a predefined constant ready for use).

Now you already can define the functions X and Y as shown in your picture.

Now try to calculate and plot a single point - the position of a single particle (defined by a and b) for a specific time t.
Don't forget that a and b must use a length unit, b should be non-positive and t is of dimension time.

 

If you have succeeded in calculating and plotting a single point, you can go ahead.

You define  a vector  A with values equally spaced, preferably covering at least the range of lambda or more.

Define a vector B of equal size as A with values (b) all the same - you may use something like  B:=-10m+0*A  if you want to see the wave with b=-10m.

Now calculate the x- and y-values for all the particles in this wave:

Werner_E_0-1691030143210.png

Note that the function calls are vectorized (the arrow over the expression)

Now you can plot the vector Y1 over the vector X1 and its up to you to format the plot to either show only points, only lines, or both.

The last step would be to stack the x- and y-vectors for different values of b on top of each other and plot them to get what you are possible looking for.

So start creating your worksheet and plots and if get stuck, come back here, explain the problem you experience and post your sheet. I'll sure have a look - if the sheet has a meaningful name and is no named again "Untitled"!

 

Prime does not support animations, so Prime is only able to give you a still picture for a specific time t.

Using Mathcad 15 or below you could create an animation, too, and show, that every particle is moving on a circular path:

wave.gif

 

 

Could you help me by providing the calculation sheet?

 

 

I've tried many values but i couldnt get any single particle value since units are not getting compatible.

 

Werner_E
25-Diamond I
(To:MM_10735997)

Two errors:

1) You defined the variables a, b and t with correct units, but you call the function X( ) using unit-less numbers! Why don't you use the already defined variables?

2) You have to type a multiplication sign between the k and the opening parenthesis as otherwise its interpreted as a function k(...) which if course is not defined.

Werner_E_0-1691060585388.png

BTW, you should use negative values for b as otherwise you get trochoids with a loop in the wave crest 😉

Here you see the effect of b=+5m

My animation showed 6 waves with b-values from 0m down to -25m

Werner_E_2-1691061361421.png

 

With b=+50m the loop will go up to more than 600 m!

 

 

im getting another error in defining the range.

Werner_E
25-Diamond I
(To:MM_10735997)

Ranges and vectors are quite different beasts bust unfortunately look the same when displayed in Prime.

Furthermore you forgot the unit (meter) when you defined A.

There is an undocumented trick to turn a range into a vector by simply immediately  evaluating it in the same region where you define it:

Werner_E_0-1691127398530.png

Now A is not a range anymore but a true vector.

A more "legal" way to define the very same vector is using a range i which is needed to index the elements of the vector.

Werner_E_1-1691127534461.png

Note that the index used is a vector/matrix index, not a literal index.

 

Once you defined the vector A either way, the definition of the vector B works as expected and also the calculation of the vectors X1 and Y1 (feel free to use better names):

Werner_E_3-1691127883952.png

 

Some additional remarks:

.) The time yo used for t is larger than the period T    Werner_E_7-1691128824200.png. This does no harm as of the periodicity of sine and cosine. Just thought I'd mention it

 

.) If you defined vector A using the index range i, you can define the vector B by typing

Werner_E_4-1691127943229.pngagain you have to use the vector index.

 

.) Vectorization is not actually needed as Prime would apply implicit vectorization automatically if you don't vectorize. But this depends upon how the function X ( ) is defined and so you are on the safe side if you vectorite and its generally good habit to do so when you feed a vector into functions which normally expect scalar arguments.

 

.) If you are just after a single wave (which you now should already see if you plot Y1 over X1) you don't even need the vector B at all.

You could simply write

Werner_E_5-1691128201150.png

and get the very same result vector X1.
The idea for the vector B stems from my first idea about how to plot multiple waves (for different depth values b) as one plot. But also this could be achieve without using these vectors. So what this means is - vector B is not needed at all 😉

 

.) Without using small programs you may now calculate vectors X2 and Y2 and the only difference would be that you now use a different b-value, lets say b=-10m. Vector A (horizontal values) remains the same for all waves.

Werner_E_6-1691128587797.png

Now you may add a second plot  Y2 over X2 showing a second wave and you may format it differently (color, dot size, line style...) from the first.

If you create five or six waves and want to plot them without individually typing in each X.., Y.. you may consider stacking all individual vectors and just use the stacked vectors XX and YY for the plot. You will see the same waves, but they form now one single trace and so you can't format them differently. This was done with the blue waves in the picture posted above.

Werner_E_0-1691138267320.png

Werner_E_1-1691138281470.png

As you can see I am separating the individual waves by NaN's. This is done to avoid Prime to connect the last point of a wave with the first point of the next one if you decide to show lines along with the points (or just lines). In Prime unfortunately its necessary to provide a unit even though its NaN.

 

So good luck, I guess you should now succeed in plotting some waves.

Announcements

Top Tags