Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
[Wolfram Mathematica] - how scripts work in Mathematica
Reply to thread
Message
[QUOTE="Hernaner28, post: 4564063, member: 401900"] Thanks mate! I think I could fix it with this: [CODE]Euler[c_, final_, step_, o_, r_, b_] := Module[{x}, x = ConstantArray[0, {Quotient[final, step], 3}]; x[[1]] = c; For[i = 2, i <= Quotient[final, step], i++, x[[i, 1]] = o*(x[[i - 1, 2]] - x[[i - 1, 1]])*step + x[[i - 1, 1]] ; x[[i, 2]] = step*(r*x[[i - 1, 1]] - x[[i - 1, 2]] - x[[i - 1, 1]]*x[[i - 1, 3]]) + x[[i - 1, 2]] ; x[[i, 3]] = step*(x[[i - 1, 1]]*x[[i - 1, 2]] - b*x[[i - 1, 3]]) + x[[i - 1, 3]] ; ]; x ][/CODE] What this does is to give the points to the solution of the Lorenz system using Euler's method. Try Euler[{0, 2, 0}, 10, 0.5, 10, 28, 8/3] . Now the question is, how can I get a three dimensional plot using those points I get as a result? I should see the Lorenz attractor Thanks! Edit: Just found this code on the Internet: [CODE]With[{ip = ListInterpolation[#, {{0, 1}}] & /@ Transpose[x]}, func[t_] := Through[ip[t]]]; ParametricPlot3D[func[t], {t, 0, 1}, BoxRatios -> 1][/CODE] and it's working like a charm! The code seems to be working! Try this: x = Euler[{0, 2.01, 0}, 10, 0.01, 10, 28, 8/3] and then put that code to see the Lorenz attractor [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
[Wolfram Mathematica] - how scripts work in Mathematica
Back
Top