Matematické Fórum


1. 8. 2026 (L) Fórum bude brzy uzavřeno 😿

Nejste přihlášen(a). Přihlásit

#1 03. 03. 2010 16:35

Stýv
Vrchní cenzor
Příspěvky: 5710
Reputace:   215 
Web
 

Mathematica - podivná chyba

zdravím kolegové, mam problém s jedním řádkem v mathematice:

Code:

RecurrenceTable[{x[n] == x[n - 1] + r*x[n - 1]*d + a*x[n - 1]*w[[n]], 
  x[0] == x0, t[n] == t[n - 1] + d, t[0] == 0}, {t, x}, {n, 1, 200}]

vypisuje mi hlášení:
Part::pspec: Part specification n is neither an integer nor a list of integers.
Part::pspec: Part specification n is neither an integer nor a list of integers.
Part::pspec: Part specification 1+n is neither an integer nor a list of integers.
General::stop: Further output of Part::pspec will be suppressed during this calculation.

přesto vrátí tabulku hodnot, která vypadá v pořádku. hlášení způsobuje člen w[[n]], ale vůbec netušim proč. nějaké nápady?

Offline

 

#2 03. 03. 2010 16:59

Pavel Brožek
Místo: Praha
Příspěvky: 5694
Škola: Informatika na MFF UK
Pozice: Student
Reputace:   194 
 

Re: Mathematica - podivná chyba

Stejnou chybu dává Mathematica i na jednodušším příkladu

Code:

w[[n]] /. {n -> 2}

takže to bude tím, že tam chce mít Mathematica číslo přímo. Nevyznám se v tom ale tolik, abych dokázal říct víc.

Offline

 

#3 03. 03. 2010 17:07

Stýv
Vrchní cenzor
Příspěvky: 5710
Reputace:   215 
Web
 

Re: Mathematica - podivná chyba

zřejmě to tak bude. trochu jsem pohledal na internetu, ale jediný "řešení", který jsem našel, je vypnout tenhle typ chybovýho hlášení...

Offline

 

Zápatí

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson