Calculate r^2*q Faster in Just 1 Click: Tips and Techniques

  • Context: Mathematica 
  • Thread starter Thread starter shafieza_garl
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on efficiently calculating the expression r * s^2 * q for varying values of r without manually inputting each value. A user inquires about automating this process, specifically for r values of 1 through 5, while keeping s and q constant. The solution provided involves defining a function in Mathematica: f[r_, s_, q_] := r * s^2 * q, and using the Table function to generate results in a single command. This method allows for quick computation of the desired outputs.

PREREQUISITES
  • Basic understanding of mathematical functions and expressions.
  • Familiarity with Mathematica programming language.
  • Knowledge of the Table function in Mathematica.
  • Concept of variable manipulation in mathematical computations.
NEXT STEPS
  • Learn how to define and use functions in Mathematica.
  • Explore advanced features of the Table function in Mathematica.
  • Investigate optimization techniques for mathematical computations in programming.
  • Study how to automate repetitive calculations in other programming languages like Python or R.
USEFUL FOR

Mathematics enthusiasts, programmers using Mathematica, and anyone looking to automate repetitive calculations in mathematical expressions.

shafieza_garl
Messages
20
Reaction score
0
hye everyone...i would like to ask question. i just wonder how to calculate question faster without solving one by one.for my equation given.i want to know
if r increase by=1,2,3,4,5 and value of s are not change,how can i do without fill r by 1,2,3,4,5 one bye one.(q is fixed value).example
if s=1,q=3
and r is variable 1,2,3,4,5
so it become;
1(1^2)(3)=?
2(1^2)(3)=?
3(1^2)(3)=?
:
:
r(1^2)(3)=?
i want the output of all the answer in just 1 click.
i hope anyone can help me.
 

Attachments

  • test3.jpg
    test3.jpg
    1.4 KB · Views: 469
Physics news on Phys.org
I'm pretty sure that I don't understand what you want.
Do you want to generate a table of elements of the form r * s^2 * q ?

If so, then define
f[r_, s_, q_] := r * s^2 * q
and the table with s=1,q=3 is generated by
Table[f[r,1,3], {r, 1, 10}]
 
Thanx u very much.u answer helped me a lot.^^
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
14
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K