Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - mannuri

Pages: [1]
1
Lua / Re: Lua Q&A
« on: July 29, 2013, 10:39:43 am »
var.store() and math.eval() for me is like you put all out of lua and solve as a basic ti language, and take it back to lua.

2
Lua / Re: Lua Q&A
« on: July 28, 2013, 07:57:23 am »
thanks, but still got the same error.
Im using the ti cas teacher edition to edit and run the script. lastest version.
im using the TI Master Box Tool.
Quote
function Tipo1:Save()
    --Turn string into number--
    qi=math.eval(numberBoxQ.text)
    li=math.eval(numberBoxL.text)
    di=math.eval(numberBoxD.text)
    cvi=math.eval(numberBoxcv.text)
    ki=math.eval(numberBoxK.text)
    --If no imput variable get 0--
    if numberBoxQ.text == "" then
    qi=0
    end
    if numberBoxL.text == "" then
    li=0
    end
    if numberBoxD.text == "" then
    di=0
    end
    if numberBoxcv.text == "" then
    cvi=0
    end
    if numberBoxK.text == "" then
    ki=0
    end
    --Solving the problem--
    ui=(qi*4)/(math.pi*di*di)
    rei=(ui*di)/(cvi)
    --Using tostring to insert into formula--
    rei=tostring(rei)
    di=tostring(di)
    ki=tostring(ki)
    --Declaring yi close value from the real expected--
    yi="0.01"
    --full formula--
    math.eval("yi^(−0.5)=:fl")
    math.eval("−2*log(((ki)/(di*3.7))+((2.51*yi^(−0.5))/(rei)),10)=:fr")
    --solving the formula--
    yi=math.eval("nSolve(fl=fr,yi)")
    --disp results--
    helpLaunch(Resultados1)
end
    --simple round--
function round(num, idp)
  local mult = 10^(idp or 0)
  return math.floor(num * mult + 0.5) / mult
end

Resultados1 = class()

function Resultados1:init()
   
    labelBoxu = LabelBox("          U = "..round(ui,7).." m/s")
    labelBoxre = LabelBox("          Re = "..round(rei,7))
    --Got problem here--171: attempt to concatenate global 'yi' (a nil value)--
    labelBoxy = LabelBox("          λ = "..yi)

I have trie sneack into formula pro lua code, but i dont understand how the solve works there  <_<
maybe if the nsolver dont disp only 1 awsner yi got nil? how i solve it?

Sorry for the big post.
edit:change left and right to fl and fr, because left() is a nspire function. still got yi nil value

edit 2:
FINNALY!!!, i made it!
i just need var.store() all vars and its done.

Thank you guys i love you all!!

3
Lua / Re: Lua Q&A
« on: July 27, 2013, 05:27:17 am »
Thanks!

I used the script:
Quote
rei=tostring((ui*di)/(cvi))
    di=tostring(di)
    ki=tostring(ki)
    yi="0.01"
    formula="yi^(−0.5)=−2*log(((ki)/(di*3.7))+((2.51*yi^(−0.5))/(rei)),10)"
    yi="nSolve("..formula.."),yi)"

and i got the output display:
Quote
yi=nSolve(yi^(−0.5)=−2*log(((ki)/(di*3.7))+((2.51*yi^(−0.5))/(rei)),10)),yi)
All is going good :)

but when i change the code to:
Quote
yi=math.eval("nSolve("..formula.."),yi)")
yi got nil value :(

4
Lua / Re: Lua Q&A
« on: July 26, 2013, 04:25:22 pm »
Hi, Im triing make a program that need solve complex stuff, and i need to use nsolve( or solve( function since is for cas version.

here is my code:
Quote
cvi=cvi*10^(-7)
    ui=(qi*4)/(math.pi*di*di)
    rei=tostring((ui*di)/(cvi))
    di=tostring(di)
    ki=tostring(ki)
 
    formula = "yi^(−0.5)=−2*log(((ki)/(di*3.7))+((2.51*yi^(−0.5))/(rei)),10)"

    var.store("formula", formula)
    equacao = "string(nSolve(expr(formula), yi)|yi<0.1 and yi>0"
    yi = math.eval(equacao)

When i go display, i got error.
Quote
attempt to concatenate global 'yi' (a nil value)

I have trie:
Quote
--whitout var.store("formula", formula)
equacao = "nSolve(formula, yi)|yi<0.1 and yi>0"

Please help me. thanks!

5
Lua / Re: Lua Q&A
« on: February 24, 2013, 12:50:55 pm »
People dont like to call programs like prog() and nspire dont have the dialog comand like voyage 200, i know a bit about ti basic but nothing about lua. So that tool is amazing because it solve the imput problem. Now i can prob to my friends Nspire is better than voyage 200. :)

6
Lua / Re: Lua Q&A
« on: February 24, 2013, 11:36:29 am »
Yeahh, thank you guys!  ;D

Im just putting the var.store at bad place  :w00t:

7
Lua / Re: Lua Q&A
« on: February 24, 2013, 11:12:11 am »
Thanks,

If i use:
Code: [Select]
var.store("qi",NumberBox[numberBoxQ].text)I got that error:
Code: [Select]
attempt to index field '?' (a nil value)
If i use:
Code: [Select]
var.store("qi",NumberBox_numberBoxQ.text)I got that error:
Code: [Select]
attempt to index global 'NumberBox_numberBoxQ' (a nil value)
 :'(

8
Lua / Re: Lua Q&A
« on: February 24, 2013, 10:23:32 am »
Thanks, i know how to use var.store() i dont know what is the  NumericUpDown_Name.num name.

Code: [Select]
if widgetNoFocus == false then
            if self.widgets[self.widgetFocus].typeBox == "NumberBox" then
                -- Concatenamos el nuevo caracter.
                self.widgets[self.widgetFocus].text = self.widgets[self.widgetFocus].text .. char

i have many NumberBox, and the self.widgets[self.widgetFocus].text is the variable i think (learn from Nspire tutorial)

At start is some close to this:
Code: [Select]
    numberBoxj = NumberBox(70, "CENTER")
    numberBoxL = NumberBox(70, "CENTER")

    MASTERBOX:addWidget(numberBoxj)
    MASTERBOX:addWidget(numberBoxL)

and i want store the var from numberBoxj into "j".

9
Lua / Re: Lua Q&A
« on: February 24, 2013, 08:28:55 am »
Hi all,

I think some of you have heard about timasterbox, http://code.google.com/p/timasterbox/.
The autor seems to be busy so im leave my question here.
Im not a lua programer, but im triing to creat my school programs using that tool.
My problem is How i get the values imputed at numberBox. I want use the comand var.store() but i dont know what is the imput table name.

When i put an image into lua string i lost to mush quality. Can someone show a way to keep most of that quality.

Please LuaGod's help me  :P

10
News / Re: Release of FormulaPro for the Nspire
« on: November 23, 2012, 06:18:54 pm »
maybe the problem is there:

 --Reynolds number
 aF(2, 1, "Re=V*D/"..c_nu, U("Re","V","D",c_nu))

trie
aF(2, 1, "Re=V*D/"..c_nu.."", U("Re","V","D",c_nu)) or something close dont use the _ simbol maybe it works

If you edit you .tns using student software you may be able to replace c_nu per ν

edit: ops ν isnt v but the greeg letter, sry my poor english

edit again xD: you have 5 incognits and 4 equations so..

You need use a iterations giving a initial value to f or other variable

11
That is a big unfortunately lucky. So isn't going hapen.

thanks, i didnt know that.

Edit: My problem isnt about games but about Apps like http://www.smart-programs.org/

12
Hello,

I have trie found anything about emulating TI89, TI89-Titanium, TI92+, V200 in a Nspire but i dont have found anything.
there is so many consoles emulatores, why dont apears other calc emulators. For Basic programs i dont relay need a emulator, only few things change but I dont know nothing about Flash Apps code, and .lua code is a bit complicate/confusing language for a ''basic builder''.

I junt dont understand why no one talks about it.

thank you .

13
Introduce Yourself! / Hello all
« on: November 18, 2012, 10:30:09 am »
Hi guys,

This forum is amazing!

I have visited this forum many times. But i have a question that no one talk about and im unable to write it a nspire help forum.

I have trie found anything about emulating TI89, TI89-Titanium, TI92+, V200 in a Nspire but i dont have found anything.
there is so many consoles emulatores, why dont apears other calc emulators. For Basic programs i dont relay need a emulator, only few things change but I dont know nothing about Flash Apps code, and .lua code is a bit complicate/confusing language for a ''basic builder''.

I junt dont understand why no one talks about it.

thank you ;)

Pages: [1]