« first day (2042 days earlier)
← previous day
next day →
last day (879 days later) »
pi-π
04:56
@JohnRennie Hello
John Rennie
@pi-π Hi :-)
pi-π
@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.
John Rennie
@pi-π I'm busy answering another question at the moment. Shall I ping you when I'm free?
pi-π
@JohnRennie Okay
John Rennie
05:36
@pi-π Hi :-)
pi-π
@JohnRennie Hello !
John Rennie
How well do you know C?
pi-π
@JohnRennie I can program easily in C
John Rennie
So creating an array of structs and reading data into it should be straightforward. Yes?
pi-π
Yes
John Rennie
05:39
So where is the problem with this? How to sort the data?
pi-π
@JohnRennie Yes! Sorting the data
John Rennie
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.
pi-π
okay!!
John Rennie
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…
cOnnectOrTR 12
08:14
Hi @JohnRennie
John Rennie
Hi :-)
I need to go out soon I'm afraid. Is it quick?
cOnnectOrTR 12
yes
John Rennie
Ok, go ahead.
cOnnectOrTR 12
x(t)=x(0)e^(-kt/m) is eqn of spring. How is it behaving?
John Rennie
Have you drawn a graph of x against t to see what it looks like?
cOnnectOrTR 12
08:18
No
John Rennie
Draw the graph and see.
cOnnectOrTR 12
At zero it is at 5 say the x0=5 as t tends to infinity x tends to zero
John Rennie
Yes, this is an example of damped motion.
cOnnectOrTR 12
Meaning?
John Rennie
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.
cOnnectOrTR 12
08:26
@JohnRennie Okay! X0 is starting point where the sprint is in stretched state
?
John Rennie
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.
cOnnectOrTR 12
Ok! But what is x0?
John Rennie
x₀ is the initial displacement i.e. the displacement at time 0.
cOnnectOrTR 12
Means in stretched state?
John Rennie
i.e. you stretch the spring a distance x₀ then let go at time zero.
cOnnectOrTR 12
08:28
Ok! Thank you
« first day (2042 days earlier)
← previous day
next day →
last day (879 days later) »
all rooms
Transcript for
Sep
28
Sep '22
29
Sep
30
Problem Solving Strategies
General chat for high school physics. For MathJax see
meta.sta...
9
fluid-statics
homework-and-exercises
newtonian-mechanics
join this room
about this room
00:00
06:00
12:00
18:00
all times are UTC
site design / logo © 2025 Stack Exchange Inc;
legal
mobile