142 reputation
10
bio website inpursuitoflaziness.blogspot.…
location Mumbai, India
age 20
visits member for 2 years, 9 months
seen Sep 19 at 22:19

I am an engineering physics student who loves the sciences.

enter link description here


Aug
15
asked EquationTrekker-like behavior for state space?
Jan
31
awarded  Citizen Patrol
Jan
16
comment How can I simulate this toggle mechanism?
I think you first have to choose the length of the rod so that it fits in the distance between the two centers, and subsequently use trigonometry to calculate the position of the point on the lower circle.
Jan
3
awarded  Talkative
Dec
17
accepted How should I go about writing more functional and list based code?
Dec
17
comment How should I go about writing more functional and list based code?
@rm-rf Yep, it is. Hadn't looked at the second answer, and it is really relevant. Thanks :)
Dec
17
comment How should I go about writing more functional and list based code?
Hmm, this is interesting :) I haven't used Fold much but I can see how it would be useful here. (Also, I don't "come from" Lisp, I just am comfy with it but I am much more at ease with procedural things).
Dec
17
comment How should I go about writing more functional and list based code?
@Nasser Thing is, I am reasonably comfortable with Lisp. But Mathematica has its own style, and the problems faced are different. Plus, there are many in-built commands that work well with functional programming or lists.
Dec
17
asked How should I go about writing more functional and list based code?
Nov
4
awarded  Commentator
Nov
4
awarded  Teacher
Oct
30
comment Writing NDSolve-like functions
Oh wait, nevermind. It's only being used on the symbol inputs, now I think I got it. Thanks :)
Oct
30
comment Writing NDSolve-like functions
Ah, thanks. Why does it work in this case though? When I try t = 5; Print[t]; Block[{t}, Print[t]; t = 6;]; Print[t], the t in the block is taken as a fresh variable. Whereas here it seems to be substituted in from the outside.
Oct
30
comment Writing NDSolve-like functions
It seems to work both ways, though. What's the difference? Is it preventing the variables from messing with outside variables?
Oct
30
comment Writing NDSolve-like functions
Thanks! I didn't know about SetAttributes, (or Block, I've been using Module which is lexical.), which must be where I went wrong. I also didn't know about the ability to use lists in the function declaration itself. I think that there may be a syntax error here, though, the t,xvar,yvar shouldn't be in the Block statement. Not sure.
Oct
30
accepted Writing NDSolve-like functions
Oct
29
revised Writing NDSolve-like functions
added 153 characters in body
Oct
29
comment Writing NDSolve-like functions
@rm-rf Well, if that can be genericized I don't mind, but when I use this set of code I usually don't need much of a range for t -- in fact, none at all. I'll add that bit, though.
Oct
29
revised Writing NDSolve-like functions
added 50 characters in body
Oct
29
comment Writing NDSolve-like functions
@rm-rf The ICs are the ParametricNDSolve parameters, they get substituted with x,y later on. The vector plot is a plot of $(v'(t),\omega'(t))$ at various initial conditions. The plot ranges are specified in the {{v[t],-2,1}, {ω[t],-1.2,0.5}} (i.e. the {{var1,varmin,varmax},{var2,varmin,varmax}}) part.