Mathcad vs MATLAB vs Maple vs Mathematica

  • Mathematica
  • Thread starter Entropia
  • Start date
  • #51
2
0
plot streamline for this equation y=(ψ-ax3 –cx)/b

hi

Please I need your help to plot in wolfram mathematica to plot streamline for this equation

To plot streamlines, we solve the given equation for either y as a function of x and c, or x as a function of y and c. In this case, the former is easier and we have

Equation for a streamline:
y=(ψ-ax3 –cx)/b
A=0.5
B=-2
C=-1.5

Thanks
 
  • #52
Khashishi
Science Advisor
2,815
492
I've used all of these. Different tools for different purposes.
Matlab is for number crunching. It's better for efficiently loading, analyzing, and plotting real data sets. By efficiently, I mean in terms of time spent writing code. Everything is a matrix, so it gets more clumsy when working with things which aren't matrices.
Mathematica is better for symbolic math, and for plotting continuous functions (as opposed to tabulated functions).
Mathcad seems to have a weird purpose, when demonstrating the calculation to someone else is important. It is kind of interesting since it has the appearance of working on a piece of paper, which perhaps makes it better for presenting the calculation and results to an audience. The audience doesn't have to read code to appreciate and understand what you have done. Since you can arrange expressions anywhere on the paper, you have artistic freedom in making it presentable.
 
  • #53
51
2
Eh, I prefer Mathematica now after using it so much at UCLA. It's got a sort of Python/C++ feel to it. Here, it's the program that the physics department uses.

But I'm intrigued. Would it be easy to simulate, say, a number of particles bumping around in a box?
I haven't tried a project like that yet. One may have to develop a way to tell the particles to reverse the normal component of the velocity when it collides or hits a wall, and in the algorithm I have in mind, would involve continuously comparing the locations of the particles, and performing the reversal if the appropriate conditions are met. This may be a little tricky to implement with the conditional functions available in Mathematica. For instance, but correct me if I'm wrong, Mathematica doesn't have conditional "blocks" of code which execute together, something you'd commonly see in C++/Python.

On the other hand, you could easily set up equations of motion through Hamiltonian mechanics and solve them numerically, but that would limit you to conservative potentials. It seems like a stretch, but maybe you could use delta functions as potentials? Prof. Corbin taught us how to simulate N-bodies which interact via gravity during one of his workshops. It is definitely good for certain simulations.
 
  • #54
489
188
For instance, but correct me if I'm wrong, Mathematica doesn't have conditional "blocks" of code which execute together, something you'd commonly see in C++/Python.
Do you mean like so?
C:
if (condition) {
   //Do some stuff that needs multiple functions
}else{
   //Do other stuff with multiple functions
}
You can do that with Mathematica using semi-colons

Code:
If[ condition,
     (* Condition evaluates as true *)
     temp = Table[ i, {i,1,100}];
     tempSquared = Table[i^2, {i,1,100}];
     tempSum=Sum[temp,{i,1,100}];
     tempSumSquared = Sum[ tempSquared, {i,1,100}];
     difference = tempSumSquared-tempSum; ,
     (* Else block *)
     temp = Table[ i, {i,1,100}];
     tempCubed = Table[i^3, {i,1,100}];
     tempSum=Sum[temp,{i,1,100}];
     tempSumCubed = Sum[ tempCubed, {i,1,100}];
     difference = tempSumCubed-tempSum;
]
It is harder to read in a notebook though.
 
  • #55
51
2
Do you mean like so?
C:
if (condition) {
   //Do some stuff that needs multiple functions
}else{
   //Do other stuff with multiple functions
}
You can do that with Mathematica using semi-colons

Code:
If[ condition,
     (* Condition evaluates as true *)
     temp = Table[ i, {i,1,100}];
     tempSquared = Table[i^2, {i,1,100}];
     tempSum=Sum[temp,{i,1,100}];
     tempSumSquared = Sum[ tempSquared, {i,1,100}];
     difference = tempSumSquared-tempSum; ,
     (* Else block *)
     temp = Table[ i, {i,1,100}];
     tempCubed = Table[i^3, {i,1,100}];
     tempSum=Sum[temp,{i,1,100}];
     tempSumCubed = Sum[ tempCubed, {i,1,100}];
     difference = tempSumCubed-tempSum;
]
It is harder to read in a notebook though.
Yes, thanks for the correction. I didn't know you could do that. Does Mathematica have a simple way to implement more than two cases (in other words an equivalent to C++ "else if")?
 
  • #56
489
188
As far as I know it doesn't exist. You should read the docs to make sure I didn't forget something.
You could define a similar function yourself though.

Thinking about it for a while you could hack something together using the Which-function from the docs.
This discussion should be a separate topic.
 
  • #57
DrClaude
Mentor
7,049
3,199
Yes, thanks for the correction. I didn't know you could do that. Does Mathematica have a simple way to implement more than two cases (in other words an equivalent to C++ "else if")?
Since Mathematica executes different code depending on whether the condition is true or false,
the functionality of "else if" can be implemented by nested if's:
Code:
If [ , , If [ , , ] ]
 
  • #58
I have been using octave instead of matlab. For the user, they seem almost the same, but octave is free software and matlab is proprietary.
 
  • #59
46
1
I use Matlab for numerical calculations. The language is very easy. It is on the other side very expensive. I use Maple for symbolic calculations.
 
  • #60
FactChecker
Science Advisor
Gold Member
5,238
1,862
In the field I was in (embedded control laws), MATLAB was a must. We advised students that a working knowledge of MATLAB was an advantage when job hunting. It worked with Simulink and could auto-generate C code that ran on the on-board computers.
 
  • #61
9
1
I believe that Matlab scribts are more functional than Mathematica and maple. But I am also octave user.
 

Related Threads for: Mathcad vs MATLAB vs Maple vs Mathematica

Replies
10
Views
19K
Replies
18
Views
137K
  • Last Post
Replies
7
Views
6K
  • Last Post
Replies
4
Views
5K
  • Last Post
Replies
14
Views
32K
Replies
2
Views
5K
  • Last Post
Replies
20
Views
176K
  • Last Post
Replies
12
Views
960
Top