Hullzie16

281 Reputation

7 Badges

4 years, 329 days

MaplePrimes Activity


These are answers submitted by Hullzie16

You can define your tensor in one line using the Define command in the Physics package. 

If you are new to the Physics package I suggest looking at the Physics help page ?Physics as it has a lot of information that will help you learn about the package and how to navigate and compute with it. If you have any questions about the worksheet or more computations in Physics dont hesitate to ask. 

Tensor_Respond.mw

Yes, you can do this by using Define and writing your metric as a Matrix. 

restart;
with(Physics):
Setup(coordinatesystems=[X=[t,r,theta,phi]],signature=`-+++`)
Cont:=Matrix(4, 4, [[-1/f(r), 0, 0, 0], [0, f(r), 0, 0], [0, 0, 1/r^2, 0], [0, 0, 0, csc(theta)^2*1/r^2]]):
Define(g_[~mu,~nu]=Cont)

Contravariant_Metric.mw

I changed around a few things and I got it to run.

One major thing was that you did not specify the initial conditions properly. You need to have x[i](0) for the initial positions otherwise it doesnt make sense for the ODE system, it just said "x=stuff" which Maple doesnt know how to read - I assumed what you want to write was what I put in.

Secondly, the boundary conditions you wanted to apply should have be entered in a different way, either a) but just setting x[1]=0 and x[101]=0 in the differential equations. I created differential equations on each with initial conditions that force it to be zero for all time and then it runs. 

Let me know if you want some more details. If I can get yours to run with how you originally had it I will reply.

 dsolve_error_Fix.maple

Unless I am missunderstanding you can use the Explore and plots:-inequal commands and get the surface that satisfies your inequality for different values of t. 

Response_Rplot.mw

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);

 

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

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

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

circle.mw

Someone answered your previous question which was the exact same.

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))

 

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.

 FourierPDE.mw

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

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

AddMean.mw

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

You can define your own coordinate system in a couple ways after loading physics pacakge

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

 

1 2 Page 1 of 2