Can Someone Pls Help With This Mathematica Problem?

  • Mathematica
  • Thread starter windfloyd
  • Start date
  • Tags
    Mathematica
In summary: My question is how do I input a list of values in the same way as when I input a list of values to solve a single equation?
  • #1
windfloyd
6
0
I just start to learn Mathematica to solve some engineering problem, and got stuck when I was trying to solve a set of equations. Pls see the attachment for the nb. file.
 

Attachments

  • unsolved.nb
    6.4 KB · Views: 408
Physics news on Phys.org
  • #2
Welcome to PF!

I suggest you copy and paste the part(!) of the code you suppose you're having trouble with getting right and explain what you want to do.

If possible it would also be a good idea to state your problem as general as possible (nobody but you cares about some points specific to your particular problem which actually are not part of the question.)

Anyways, I haven't looked at the file yet (no mathematica here), maybe everything's fine.:smile:
 
  • #3
The main problem is the names of the variables are too fancy, with subscripts and multiplication sign in the superscripts. Make sure your identifiers are symbols.

I see your programming in a C style, try putting your code in a Block:

Block[{a = 1, B = 2}, NDSolve ... ]
 
  • #4
Crosson said:
The main problem is the names of the variables are too fancy, with subscripts and multiplication sign in the superscripts. Make sure your identifiers are symbols.

I see your programming in a C style, try putting your code in a Block:

Block[{a = 1, B = 2}, NDSolve ... ]

I have simplified the variables, but still got no answer. See new attached.
 

Attachments

  • unsolved1.nb
    4.2 KB · Views: 370
  • #5
Use Solve instead of NSolve for functions that aren't polynomials. There should be a comma at the end of the first line, and if you do get it running, it may take awhile to run.
 
  • #6
I got it working. The major problem was that you used square brackets [ ] for grouping, when this is mathematica's notation for a function f[x].
 

Attachments

  • solved.nb
    7.1 KB · Views: 402
  • #7
Thank you so much guys! It works now! But I still have a "silly" question: I'm supposed to get different results based on different input values for variables in the "Block" part, but I don't know how to input a list of values to let the software calculate at the same time instead of one by one? Can you please tell how to do that? In what form should I input the values of the variables?
 
  • #8
You could use a For loop. Or if you have a predetermined list of values you could use a Table command. Look these up in the documentation center.
 
  • #9
Crosson said:
You could use a For loop. Or if you have a predetermined list of values you could use a Table command. Look these up in the documentation center.

Thanks! I have looked up the information about how to input a list of values, but that doesn't apply here in my solving-equations problem. I want to get solutions of the simultaneous equations for different values of a variable in the equations. In the new attachment, i want to change t from 50 to 1000, ang get answers for the five unknowns.
 

Attachments

  • Untitled-1.nb
    6.2 KB · Views: 364

1. What is Mathematica and how does it work?

Mathematica is a software program used for mathematical and scientific computing. It uses a programming language called Wolfram Language to perform calculations, manipulate data, and create visualizations.

2. How can I get help with a Mathematica problem?

There are several ways to get help with a Mathematica problem. You can check the official Mathematica documentation, search online forums and communities, or ask for help from a colleague or tutor.

3. Can Mathematica solve any type of mathematical problem?

While Mathematica is a powerful tool for many types of mathematical problems, it may not be able to solve every type of problem. It is best suited for symbolic and numerical calculations, as well as data analysis and visualization.

4. How can I improve my skills in using Mathematica?

The best way to improve your skills in using Mathematica is to practice and explore its various features and functions. You can also take online tutorials or attend workshops and seminars to learn more about the program.

5. Is there a community or support system for Mathematica users?

Yes, there is a large and active community of Mathematica users who share their knowledge, tips, and solutions through online forums and communities. You can also find official support from the developers of the program through their website or customer service.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
248
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • Precalculus Mathematics Homework Help
Replies
6
Views
611
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
Back
Top