I tried to solve some equation for different values of parameter t and put results into array. Then I wanted to write this data into a txt-file. So i did it with Write function. But strings in this file look like:
{{y -> -300.339}}
Are there some parameters of Write function for numbers (with sign) writing only?
Array[f, 1000]
x := 2
z := 1
v := 0.98
T := 10
dt := T/1000
For[i = 0, i < 1000,
i++, f[i] = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y]]
I tried this one, but it doesn't help:
For[i = 0, i < 1000,
i++, { a = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y],
f[i] /. a}]
Ruleexpressions you will need to convert them to bare numbers. See for example: (1616091), (8355218), (6669) – Mr.Wizard Feb 08 '15 at 11:17x := 2 z := 1 v := 0.98 T := 10 dt := T/1000
For[i = 0, i < 1000, i++, f[i] = Solve[-T/2 + idt - y == Sqrt[x^2 + (z - vy)^2], y]]`
I tried this one, but it doesn't help:
– newt Feb 08 '15 at 11:34For[i = 0, i < 1000, i++, { a = Solve[-T/2 + i*dt - y == Sqrt[x^2 + (z - v*y)^2], y], f[i] /. a}]fso I left it out. If you wish to save the definition offitself please see: (2008) – Mr.Wizard Feb 08 '15 at 11:43