« first day (2042 days earlier)      last day (583 days later) » 

4:56 AM
@JohnRennie Hello
 
@pi-π Hi :-)
 
@JohnRennie Write a program using C language that reads different names and addresses into the computer and rearrange the names into alphabetical order using the structure variable.
 
@pi-π I'm busy answering another question at the moment. Shall I ping you when I'm free?
 
@JohnRennie Okay
 
5:36 AM
@pi-π Hi :-)
 
@JohnRennie Hello !
 
How well do you know C?
 
@JohnRennie I can program easily in C
 
So creating an array of structs and reading data into it should be straightforward. Yes?
 
Yes
 
5:39 AM
So where is the problem with this? How to sort the data?
 
@JohnRennie Yes! Sorting the data
 
C has a built in sort function that you can use. In stdlib.h there is a function called quicksort() that you can use to sort arrays.
 
okay!!
 
If you write the program to read the data into an array of structs I can show you how to use quicksort() to sort the data.
 
 
3 hours later…
8:14 AM
Hi @JohnRennie
 
Hi :-)
I need to go out soon I'm afraid. Is it quick?
 
Ok, go ahead.
 
x(t)=x(0)e^(-kt/m) is eqn of spring. How is it behaving?
 
Have you drawn a graph of x against t to see what it looks like?
 
8:18 AM
No
 
Draw the graph and see.
 
At zero it is at 5 say the x0=5 as t tends to infinity x tends to zero
 
Yes, this is an example of damped motion.
 
Meaning?
 
Normally a mass on a spring will just oscillate i.e. the motion looks like:
x(t) = x₀ sinωt
When there is damping the motion looks like:
x(t) = x₀ sinωt e⁻ᵃᵗ
where 𝑎 is the damping constant.
 
8:26 AM
@JohnRennie Okay! X0 is starting point where the sprint is in stretched state
?
 
If we make 𝑎 large enough we lose the oscillatory motion completely and we just get:
x(t) = x₀ e⁻ᵃᵗ
The point at which the osclaltion disappears is known as critical damping
If you Google this you'll find lots of articles about it.
And now I need to go. I'll be back ina couple of hours.
 
Ok! But what is x0?
 
x₀ is the initial displacement i.e. the displacement at time 0.
 
Means in stretched state?
 
i.e. you stretch the spring a distance x₀ then let go at time zero.
 
8:28 AM
Ok! Thank you
 

« first day (2042 days earlier)      last day (583 days later) »