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}]
Rule
expressions you will need to convert them to bare numbers. See for example: (1616091), (8355218), (6669) $\endgroup$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}]
$\endgroup$f
so I left it out. If you wish to save the definition off
itself please see: (2008) $\endgroup$