How do I print out the results of a function F(n, x) where n := 0..10 and x is fixed?

How do I print out the results of a function F(n, x) where n := 0..10 and x is fixed? - Messages

#1 Posted: 12/22/2010 8:06:17 PM
VinylCyril

VinylCyril

0 likes in 3 posts.

Group: User

Hi everyone.
First of all, immense kudos and thanks to Andrey Ivashov! Spasibo, zemlyak!
This software looks really promising, but I can't yet figure out how to reach a desired result

For example, let's say we have

(which is of course the Maclaurin for e^x) and I want to print out the results of S(n, x) for each value of n (and for each of two arguments, x1 and x2).
However, when I try to do this:

I run into an error shown in the screenshot: Limits must be integer.
If I substitute S with simpler functions, like x^n, the error is just Cannot calculate.

Is there a way to do what I want to do? I get a feeling I'm just using the wrong method.
Thanks in advance!
#2 Posted: 12/23/2010 4:25:55 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,

Here is one of the possible solutions.
[MATH=eng]x.1←0.71[/MATH]
[MATH=eng]x.2←1.62[/MATH]
[MATH=eng]n←10[/MATH]
[MATH=eng]S(n,x)←line(for(k,range(0,n),el(MC,k+1)←sum(({x^i}/{i!}),i,0,k)),MC,2,1)[/MATH]
[MATH=eng]S(n,x.1)=mat(1,1.71,1.96,2.02,2.03,2.03,2.03,2.03,2.03,2.03,2.03,11,1)[/MATH] [MATH=eng]S(n,x.2)=mat(1,2.62,3.93,4.64,4.93,5.02,5.05,5.05,5.05,5.05,5.05,11,1)[/MATH]

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Posted: 12/23/2010 7:07:16 PM
VinylCyril

VinylCyril

0 likes in 3 posts.

Group: User

One simple question though: how do I make that big vertical line in front of the for structure?
Either I'm looking in a wrong place again, or the documentation for SMath doesn't cover everything yet.
#4 Posted: 12/23/2010 7:35:05 PM
Brian Runagle

Brian Runagle

13 likes in 27 posts.

Group: User

Look in the Programming section of the side panel and select Line. It can be extended by selecting it and dragging the marker downwards.

Make sure the side panel is enabled, there's an icon in the menu bar to do this.

Hope this helps.

Brian
#5 Posted: 12/23/2010 7:52:11 PM
VinylCyril

VinylCyril

0 likes in 3 posts.

Group: User

Thanks!
I was kinda dumb for not noticing the "line" button right next to the known to me "for" one

Everything now works like a charm, thank you so much!

Where can I read about such constructions and more? I still have no idea what MC stands for, etc, etc.
#6 Posted: 12/24/2010 6:05:52 AM
Brian Runagle

Brian Runagle

13 likes in 27 posts.

Group: User

Don't worry, it happens to all of us!

Regarding more info, have a look here:
https://smath.com/wiki/Tutorials.ashx

There's an Introduction to version 0.88 and an updated Introduction to Programming, both from Gilberto Urroz.

Have fun

Brian
#7 Posted: 12/24/2010 6:08:03 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello,
Wrote


Where can I read about such constructions and more? I still have no idea what MC stands for, etc, etc.


I would agree with Brian and suggest you to read the material on the Wiki (Tutorials, Examples etc.). I think you would not need to much time to read it.
BTW.,MC is a vector name (vector - column matrix, single index). This name is not important, you could have put here whatever you want. This is just a vector name which the multiple line function ( defined with "line" ) will return as its result (the last name in the "line" environment)

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
  • New Posts New Posts
  • No New Posts No New Posts