I am new to programming and try to calculate the values of A[t]
for $t$ from 0 to 0.5 in steps of 0.025 as follows but it does not work;
Block[{$RecursionLimit=Infinity},
Mass = m = 500000;
StiffnessCoefficient = k =300000000;
{NaturalFrequency = Sqrt[k/m], Period = 2*Pi/NaturalFrequency, FundamentalFrequency = 2*Pi}//N;
P0 = 5000000;
P[t_] := P0*Sin[FundamentalFrequency*t];
Δτ = 0.025;
A[0] = 0;
A[t_] := A[t - Δτ] + P[t - Δτ]*Cos[FundamentalFrequency*(t - Δτ)] + P[t]*Cos[FundamentalFrequency*t];
Table[A[t], {t, 0.025, 0.5, 0.025}]
]
I also tried different looping structures using Do
, For
or While
sequences but I don't understand how to achieve it.
Could you help me solve my problem please ?