You are not logged in.
i need scilab progam for
1. to obtain fibonacci series
2.to obtain non fibonacci series
3. to find the root of the equation f(x,a)=a*cos(x)-x*e(-a*x) for different values of a∈[1,10]
please reply soon.
it is imporant for my exams
Last edited by prathima (2013-12-31 17:27:06)
Offline
I do not program in Scilab. Best I can do is pseudocode, you will and should write them.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
ok....
Offline
1. to obtain fibonacci series
I guess you mean Fibonacci sequence.
1) x1 = 1;
2) x2 = 1;
3) h = x2;
4) x2 = x1 + x2;
5)Print[x2]
5) x1 = h;
6) Goto 3
Remember to debug it if necessary. I am partying.
2.to obtain non fibonacci series
What is a non Fibonacci sequence specifically?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
non fibonacci sequence is 4,6,7,9.10,11,12,14,15,16,17,18,19,20,...
Offline
The example for Fibonacci is there: http://hkumath.hku.hk/~nkt/Scilab/IntroToScilab.html
for 3, you can use newton-raphson,
E.g. in python,
from math import exp, sin, cos
t=3
told=1
a=5
while abs(t-told) > 0.00000000001:
told=t
t=t - (a*cos(t) - t*exp(-a*t))/(a*t*exp(-a*t) - a*sin(t) - exp(-a*t))
print t
"Believe nothing, no matter where you read it, or who said it, no matter if I have said it, unless it agrees with your own reason and your own common sense" - Buddha?
"Data! Data! Data!" he cried impatiently. "I can't make bricks without clay."
Offline
i dnt knw hw to insert the condition that a∈[1,10] in newton raphson method
Offline
Hi;
Is it continuous?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
i dont know.
in question it is not clear that a is continous or not
Last edited by prathima (2014-01-01 01:06:38)
Offline
What values can a take? a = 1,2,3,4... integers? Or any value from 1 to 10 like 7.27?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
question is
scilab program to find the root of eqn f(x,a)=a*cos(x)-x*e^(-a*x) for different values of a∈[1,10]
Offline
Why not use the code gAr provided for python.
from math import exp, sin, cos
t=3
told=1
input[a];
while abs(t-told) > 0.00000000001:
told=t
t=t - (a*cos(t) - t*exp(-a*t))/(a*t*exp(-a*t) - a*sin(t) - exp(-a*t))
print t
I just changed one line to Input[a]. Now you can enter any a you want.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
thank you:)
Offline
scilab program to obtain non fibonacci series
Offline
Generate the fibonacci numbers like I did in the first post and then an array of {1,2,3,4,5....}. When you get a fibonacci number cross it out by zeroing the array element.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
zeroing the array element means
Offline
Putting a zero in the array element.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
it is imporant for my exams
I hope you do not mind me asking but what grade student are you?
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
i am not getting
Do you know what an array is?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
I'm not crazy, my mother had me tested.
Offline
Hi prathima
Basically, just take the array {1,2,3,4,5,6,...} and put a zero instead all the numbers which are Fibonacci numbers.
Last edited by anonimnystefy (2014-01-01 02:00:47)
Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.
Offline
He can not do that yet.
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
in scilab array set values in vector form for ex. A=[1 2 3]
Offline
Do you know how to access an individual array element?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline
What is pg?
In mathematics, you don't understand things. You just get used to them.
If it ain't broke, fix it until it is.
Always satisfy the Prime Directive of getting the right answer above all else.
Offline