I was one of the users who voted to close this question. I did it because the question is essentially asking how to solve a differential equation. Since at this point the question was past the physics and was more about the math, my vote was to migrate it to MathSE.
However, the majority of votes was for closing it as an off-topic homework problem, and I agree with this as well. Questions of the type "here is this problem, how do I solve it?" are considered to be off-topic on this site. Additionally, just asking for "any advice" is somewhat broad, so this is another issue with the question.
To summarize the above, questions that ask how to solve a specific problem without really asking about any specific underlying physics principles are off-topic for this site.
In terms of your personal experience, I think users were acting according to the usual site expectations. One user has already explained their comment in another answer to this post saying the comment was more advice than a call to remove your answer. The other user's comment was actually an automatically generated comment that arises from reviews of answers that have been flagged. I don't think anyone was being rude, but I agree that to someone who is new to the site it can be confusing and even off-putting to see resistance to helping users who ask homework questions.
Additionally, I don't see where anyone called your answer "useless". You are still free to edit your answer. And you are free to raise a flag to have a moderator restore your answer after you make it better. I agree that your answer as it stands is more of a comment, but given how open-ended the question was, I personally would not have voted to have it deleted. However, your second post was not an answer to the question, so it should have been deleted.
As for the other answers, in my opinion they should not have been posted. And at the risk of looking like a bad guy, I actually flagged the answers for being solutions to a homework-like question, which is also against site policy. Of course many users either don't know about this policy, or they don't really care about it, so answers that are solutions to homework problems still posted and still get up votes. Sometimes the thrill of solving a fun physics/math problem gets in the way of PSE's homework policy.
Something you have to keep in mind is that while the site has policies, those policies are not always followed perfectly. Different users will support, ignore, etc. each policy on a spectrum of support levels, so depending on which users happen to see and review which posts, you are bound to see a spectrum of outcomes in regards to how certain policies are carried out. Although I will say that I've never really seen answers that are solutions to homework questions get down voted as much as I think they should (but that's where I am on the spectrum for this policy I suppose).
Welcome to PSE. I am sorry your first experience was not as great as you (or I) would have liked. My advice is to keep participating and keep learning about the site. When I first joined I did not perfectly adhere to the site policies. I had some answers deleted, and when I go back and look at my early answers I am somewhat confused because I answered questions that I would not answer today in ways that I would now not do.
If there are any other points you want covered, please let me know and I will update accordingly. Thank you for bringing this up. I think it is always important to have discussions about the site policy, how well it is being implemented, and how it is being perceived.