Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

Login

Username

Password

Not registered yet?

#1 2014-01-01 16:09:08

prathima
Member

Offline

scilab programmes

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 examsdunno

Last edited by prathima (2014-01-01 16:27:06)

 

#2 2014-01-01 17:48:23

bobbym
Administrator

Offline

Re: scilab programmes

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.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#3 2014-01-01 18:13:48

prathima
Member

Offline

Re: scilab programmes

ok....

 

#4 2014-01-01 18:30:59

bobbym
Administrator

Offline

Re: scilab programmes

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.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#5 2014-01-01 19:09:36

prathima
Member

Offline

Re: scilab programmes

non fibonacci sequence is 4,6,7,9.10,11,12,14,15,16,17,18,19,20,...

 

#6 2014-01-01 20:15:19

gAr
Star Member

Offline

Re: scilab programmes

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,

Code:

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."
 

#7 2014-01-01 21:18:47

prathima
Member

Offline

Re: scilab programmes

i dnt knw hw to insert the condition that a∈[1,10] in newton raphson method

 

#8 2014-01-01 21:24:05

bobbym
Administrator

Offline

Re: scilab programmes

Hi;

Is it continuous?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#9 2014-01-02 00:04:11

prathima
Member

Offline

Re: scilab programmes

i dont know.
in question it is not clear that a is continous or not

Last edited by prathima (2014-01-02 00:06:38)

 

#10 2014-01-02 00:06:16

bobbym
Administrator

Offline

Re: scilab programmes

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.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#11 2014-01-02 00:10:46

prathima
Member

Offline

Re: scilab programmes

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]

 

#12 2014-01-02 00:13:30

bobbym
Administrator

Offline

Re: scilab programmes

Why not use the code gAr provided for python.

Code:

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.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#13 2014-01-02 00:23:58

prathima
Member

Offline

Re: scilab programmes

thank youup:)

 

#14 2014-01-02 00:25:07

prathima
Member

Offline

Re: scilab programmes

scilab program to obtain non fibonacci series

 

#15 2014-01-02 00:33:21

bobbym
Administrator

Offline

Re: scilab programmes

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.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#16 2014-01-02 00:46:46

prathima
Member

Offline

Re: scilab programmes

zeroing the array element means

 

#17 2014-01-02 00:48:51

bobbym
Administrator

Offline

Re: scilab programmes

Putting a zero in the array element.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#18 2014-01-02 00:50:04

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: scilab programmes

prathima wrote:

it is imporant for my examsdunno

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'
'Who are you to judge everything?' -Alokananda
 

#19 2014-01-02 00:52:40

bobbym
Administrator

Offline

Re: scilab programmes

i am not getting

Do you know what an array is?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#20 2014-01-02 00:58:32

Agnishom
Real Member
Award: Wink Sherlock

Offline

Re: scilab programmes


'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'
'Who are you to judge everything?' -Alokananda
 

#21 2014-01-02 01:00:26

anonimnystefy
Real Member

Offline

Re: scilab programmes

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-02 01:00:47)


The limit operator is just an excuse for doing something you know you can't.
“It's the subject that nobody knows anything about that we can all talk about!” ― Richard Feynman
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
 

#22 2014-01-02 01:00:53

bobbym
Administrator

Offline

Re: scilab programmes

He can not do that yet.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#23 2014-01-02 01:01:26

prathima
Member

Offline

Re: scilab programmes

in scilab array set values in vector form for ex. A=[1 2 3]

 

#24 2014-01-02 01:02:20

bobbym
Administrator

Offline

Re: scilab programmes

Do you know how to access an individual array element?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

#25 2014-01-02 01:03:41

bobbym
Administrator

Offline

Re: scilab programmes

What is pg?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.
 

Board footer

Powered by FluxBB