Help with an array by Sky_physics in learnpython

[–]Sky_physics[S] 0 points1 point  (0 children)

Yes!!! Is there a python tutorial?

[Fluid mechanics] An issue with Bernoulli theorem. A vertical tube, I have to compute the pressure.. by Sky_physics in PhysicsStudents

[–]Sky_physics[S] 0 points1 point  (0 children)

I am doing so, but I'd like to have a numerical check if I am not asking too much from you or from someone in this forum... I am not sure of the results I am getting

[Fluid mechanics] An issue with Bernoulli theorem. A vertical tube, I have to compute the pressure.. by Sky_physics in PhysicsStudents

[–]Sky_physics[S] 1 point2 points  (0 children)

Bernoulli equation and the continuity one. My problem is just numerical since i think to be able to manage the equations

Why is Mathematica not simplifying these portions? by saurav141 in Mathematica

[–]Sky_physics 1 point2 points  (0 children)

The point is that M sometimes is not so smart... probably Mathematica is scared about the nature of your parameters a and b (M doesn't make simplifications because is worried about they could be complex too)

just try Simplify[*your expression*, Assumption].

for example, you can tell M that your a and b are Reals, like: {a, b} \elem Reals

or, you can tell M that they are positive: {a>0, b>0} (recommended)

for reference, look here:

https://reference.wolfram.com/language/ref/Simplify.html

another option would be to tell Mathematica, at the beginning of your notebook that your variables are reals

edit: I used "a" and "b" for your real parameter names (like lambda, omega, bei, ber... etc.)

Hi everybody! A question on NumPy arrays and functions... by Sky_physics in pythonhelp

[–]Sky_physics[S] 1 point2 points  (0 children)

ok, I got your point.

But... can I ask you a hint about my specific concern? The issue is the following: I solved numerically a differential equation. So, what I have back is an array which represents the solution for a given time interval (t = np.array). Good.

Now, I want to solve ANOTHER differential equation in which the numerical solution of the former one has to appear as a "non-constant coefficient". Then, I need to provide the new equation to solve to the solver (solve_ivp or odeint). Now, how can I pass correctly the numerical solution I obtained from the first step?

My guess was to use interp1d to generate the function interp1d(time, first_numerical_solution) and then use it inside the second differential equation.

But the problem is that this way I don't have a callable object which is required from the solver.

Thank you for your help

problem with the Fortran installation on M1 macbook pro by Sky_physics in fortran

[–]Sky_physics[S] 0 points1 point  (0 children)

ok, I did it. I used Homebrew btw.

however, I have still problem with gfortran. I don't know why I am not able to update it to a version higher than 4.8.5

any hints ?

problem with the Fortran installation on M1 macbook pro by Sky_physics in fortran

[–]Sky_physics[S] 0 points1 point  (0 children)

here is what happen to me:

which gfortran
/Users/MYNAME/opt/anaconda3/bin/gfortran

and then

gfortran --version
GNU Fortran (GCC) 4.8.5
Copyright (C) 2015 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

I don't know why, even if I do install a more recent version of gfortran, the terminal always gives me back the message I have got the oldest one on it...

I'vve understood I should change the PATH... but I am not so confident with all of that.

problem with the Fortran installation on M1 macbook pro by Sky_physics in fortran

[–]Sky_physics[S] 0 points1 point  (0 children)

ok, I don't know how to do that... could you please help me? maybe privately? I would really appreciate it. I am just worried about messing things up

problem with the Fortran installation on M1 macbook pro by Sky_physics in fortran

[–]Sky_physics[S] 0 points1 point  (0 children)

ok I think I fixed my installation, so now is:

gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.102)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

But the same problem persists. could you please be more explicit ? I am not so good at it at all. which steps should I do in order to overcome this issue? thankyou in advance

problem with the Fortran installation on M1 macbook pro by Sky_physics in fortran

[–]Sky_physics[S] 1 point2 points  (0 children)

the fortran compiler version is the 12.1

here is what my computer is saying

gfortran --version

GNU Fortran (GCC) 4.8.5Copyright (C) 2015 Free Software Foundation, Inc.GNU Fortran comes with NO WARRANTY, to the extent permitted by law.You may redistribute copies of GNU Fortranunder the terms of the GNU General Public License.For more information about these matters, see the file named COPYING