## 202 Reputation

4 years, 237 days

## two variable function?...

Unless I am missunderstanding your question, you could define a two-variable function and then put a into it?

```f:=(x,a)->a*x;
f(t,3);
```

## Could create a procedure...

Not sure if this is what you are after but you can create a procedure with your symbolic variables and then use evalhf.

You can see in the file that the computation speed for 1000 evaluations is much less then half a second.

Proc_evalhf.mw

## simplify,symbolic...

```restart;

with(Student:-MultivariateCalculus):
A := [0, 0, 0]:
B := [a, 0, 0]:
C := [a, a, 0]:
DD := [0, a, 0]:
S := [0, 0, h]:
d1 := Line(A, C):
d2 := Line(S, DD):
d:=Distance(d1,d2):
simplify(d,symbolic) assuming h::positive

```

simplify.mw

## Use circle also ...

Create a circle with same centre and radius and display them both together.

circle.mw

You need to put multiplications between your expresseion that you want multiplied. Then it will work.

`PDE:=diff(G(a, H, phi, PI), a)*(aH) + diff(G(a, H, phi, PI), H)*(k/a^2 - kappa^2/2*PI^2/a^6) + diff(G(a, H, phi, PI), phi)*(PI/a^3) = diff(G(a, H, phi, PI), PI)*(a^3*diff(V(phi), phi))`

## Not Fourier, could make PDE...

That is not the Fourier transform of function f(x) that is just the coefficients. If you do not want to just directly compute as suggested by @nm you could make a PDE and ask it to solve and you can get your transform of f(x) from there. The only thing you have to decide is if you want cosine or sine, so you need to modifiy boundary conditions. You can then manipulate as you wish.

## The second boundary condition...

The second boundary condition is not defined properly. You still have the B[i] term, so it cannot solve the ODE numerically.

You need to set B[i]=1 as outlined by your a[i] terms. See attached.

HNF_1_Response.mw

Now I know this isnt a proper fix, but if you are looking for the solution I think you are then it will work..

You can separate your function v(r,t) and lambda(r,t) (ie separation of variables). Then you have two functions in each exponent that only depend on one variable. Now this isnt a gimme because PDEs cannot always be seperable but for what you are doing this should be sufficient.

I have attached your example in the sheet provided.

SepVariables.mw

## Use sequence not loop...

Hi, use a sequence and not a loop and you can you use the add command and with Students[Statistics] the Mean command.

## A couple different ways...

There are a few ways to do what you want to do, but one thing I would suggest is change your function definition from q1(t) to q[1](t) or q_1(t) similarly with q2(t) or just have different functions in general, ie f(t),g(t),q(t) etc. How to do what you want can be found by two methods:

The easiest way in my oponion is to use the Physics package and the LagraneEquation command. If you want to "brute" for it you can as well, both situations are shown in the attached file.

Lagrangian.mw

## Yes, a few ways...

1)

`Coordinates(X=[t,r,theta,phi])`

or

`Setup(coordinatesystems=[X=(t,r,theta,phi)])`

and then when you call a metric it will organize into the form of your coordinates. Or you can define your own metric.

Coordinates.mw

## A couple things...

First of, Psi is inside of a ln, so when doing the command degree it fails. You would need to convert the expression into a polynomial in Psi first.

Secondly you are solving for but there is no only c1.  As well the system of equations you are trying to solve is overdetermined, You have 7 equations and 4 unkowns inlcuding more logarithmic functions so it even more complicated. Hope this helps.

Degree.mw

## Yes, with Physics. Unsure about GRTensor...

Your question title mentioned GRTensorIII but then you spoke of the physics package in your post so I am unsure what you are interested in exactly but wtih the Physics package you can get specific geodesics and integrate numerically. I have attached a radial free fall solution to show you how this can be done.

You can modify this to include more geodesics or different physical situations.

If there is something unlcear feel free to ask.

GeodesicsPhysics.mw

## Digits and evalf...

Set your digits at the top of your notebook and then define the matrix as a variable and evalf the variable?

Unless you want something else with a little more sophistication.

DigitsMatrix.mw

## numpoints in wrong position...

The numpoint command should come after you specify your ranges. See attached.

DEplot.mw

 Page 1 of 1
﻿