i am very new in programming in c,but i have to learn many things very quickly because of some lessons i have took on my university!!
my English are not very good but l will try to explain what i want to built!!!
i have to write a code which solves differential equations (-u''+u=f)
with two methods after many hours compiling i achieve this but this was not the end the next step is my problem!!!
on those methods i use one [a.b] separate it in N pieces and find prices for my U
after that, i have to calculate one error for each price let's say it H(i) (and here comes my problems) when H(i)>= (small price) i have to put one more piece between N(i-1) and N(i) [the [{N(i)-N(i-1)}/2] and calculate one new price for my U, when H(i)<(small price) i have to delete this N(i) and when i have H(i) = (small price) i don't have to do nothing,this loop must be continuing until all my errors become = (small price).
i unterstand that i have to use dynamic memory because i don't know how many pieces i would need,i think that the best way to write these is to use quotes but the problem is that after trying many hours i didn't achieve to write it right!!
if anyone understands what i have to do and have an idea for a code i begging for a solution!! at the end i want to print all my n(i) and all my U(i)...
please inform me with anything because i have only four days until the day of crisis!!!
my English are not very good but l will try to explain what i want to built!!!
i have to write a code which solves differential equations (-u''+u=f)
with two methods after many hours compiling i achieve this but this was not the end the next step is my problem!!!
on those methods i use one [a.b] separate it in N pieces and find prices for my U
after that, i have to calculate one error for each price let's say it H(i) (and here comes my problems) when H(i)>= (small price) i have to put one more piece between N(i-1) and N(i) [the [{N(i)-N(i-1)}/2] and calculate one new price for my U, when H(i)<(small price) i have to delete this N(i) and when i have H(i) = (small price) i don't have to do nothing,this loop must be continuing until all my errors become = (small price).
i unterstand that i have to use dynamic memory because i don't know how many pieces i would need,i think that the best way to write these is to use quotes but the problem is that after trying many hours i didn't achieve to write it right!!
if anyone understands what i have to do and have an idea for a code i begging for a solution!! at the end i want to print all my n(i) and all my U(i)...
please inform me with anything because i have only four days until the day of crisis!!!