m_i*x_i''=k_{i+1}(x_{i+1}-x_i) -k_i(x_{i}-x_{i-1}), forces on the i-th floor, i>0
on the zero floor (ground floor) acts analogous restorative force proportional to the shift relative to the ground: i.e.f(t)=G*sin(gamma t)
acts on the ground floor (level 0) e.g .gamma=3.for(){ }, while(){ }, do{ } while()
,
option - p should be given interactively from the keyboard by an user
fopen(), fclose(), fwrite(), fread(),
fprintf(), fscanf(), fgetchar() feof()etc
Write a code that will write a vector (double
array)to a file - binary or ascii (text) file
then another code that will read it from the file.
Test for: [1 2 3 4 -9.45].
float,double
etc.
Write a a C function generating a vector sin(x)
for a given vector x (e.g .equidistant points on [a,b]) -
parameters : a pointer to x (or ends of interval - easier version))
and pointer to returned vector with sin(x) - C function should allocate memory
and write to that memory sin(x), optionally export this vector to
binary file (fwrite()
)
and then read it back to memory to another memory address
#define #if
etc
Modify the code from the previous function in such a way that depending on the precompiler options it will work either for doubles or floats (single
precision).
float
array in C. Then show the matrix on the computer display.
#include
"mojblas.h"
) with the proper headers of this functions (in order to use them in your C code)
dgtsv()
solve the tridiagonal system
system Ax=f with the tridiagonal matrix A with 7 on the main diagonal, -2 on superdiagonal,
and -1 on subdiagonal for f=[7;-1;0;0;..;0] for N=15.Check if you get athe right solution!
dnrm2()
and ddot()
dnrm2()
function - and dynamically allocating memory (using
malloc(); free()
functions
dgesv()
function - solving a simple linear system and computing the inverse of A
dgels()
function solving a regular LLSP with i.e.
max rank matrix A MxN - underdetermined system i.e. M>N; there is also a function linreg()
solving linear regression using dgels()
dnrm2()
and ddot()
dnrm2()
function - and dynamically allocating memory (using
malloc(); free()
functions
dgesv()
function - solving a simple linear system and computing the inverse of A