BigGeorge

20 Reputation

3 Badges

3 years, 150 days

MaplePrimes Activity


These are questions asked by BigGeorge

Hello, we need to do an integral based on two numerically approximated functions given by a second degree coupled differential equation.

The integral:
Where xs and xu are functions of the variable t.

We wish to do a half-sums to approximate the integral, that is:

Define an N = number of points, such that we get a delta_x = L/N.

We then wish to get two vectors x_s = [x_s(0),x_s(1),...,x_s(N)] and x_u = [x_u(0),x_u(1),...,x_u(N)] by running some kind of for loop over our approximation procedure.

Is there any function for this already inside of Maple? We need to approximate the integral using Riemann sums and no other method.

Opgave 1)
restart;
with(LinearAlgebra);
with(plots);

a = radius 1
b = radius 2
h = højde
Error, unexpected number
a := 213/2;
b := 144/2;
h := 46;
Vi definerer A_g(a,b)= areal af grundfladne, hvor a og b er de to radiusser.
r(u,v) = parametrisering af fladen i rummet
jf = Jacobi for fladen
r(u,v,w) = parametrisering af voluminet i rummet
jv = jacobi for voluminet
v(u0,u1,v0,v1,w0,w1) = voluminet af figuren
A_f(u0,u1,v0,v1) = voluminet af fladen
Error, missing operator or `;`
A_g := (a, b) -> b*a*Pi;
V := (a, b, h) -> 2/3*b*a*Pi*h;
x := (u, v) -> a^cos(u)*sin(v);
y := (u, v) -> b*sin(u)*sin(v);
z := (u, v) -> h*cos(v);
r := (u, v) -> <x(u, v), y(u, v), z(u, v)>;
ru := (u, v) -> diff(r(u, v), u);
rv := (u, v) -> diff(r(u, v), v);
jac := CrossProduct(ru(u, v), rv(u, v));
jf := sqrt(jac[1]^2 + jac[2]^2 + jac[3]^2);
           /                        
           |                        
           |               2       4
     jf := |10969344 cos(u)  sin(v) 
           \                        

                            2                             
               /     cos(u)\                 2           /
               |/213\      |        2   /213\        4   |
        + 2116 ||---|      |  sin(u)  ln|---|  sin(v)  + |
               \\ 2 /      /            \ 2 /            \
              cos(u)                              
         /213\             2   /213\              
     -72 |---|       sin(u)  ln|---| sin(v) cos(v)
         \ 2 /                 \ 2 /              

                                                \      
                                cos(u)       \  |      
                           /213\             |  |      
        - 72 cos(u) sin(v) |---|       cos(v)|^2|^(1/2)
                           \ 2 /             /  /      

      /                                                   
      |               2       4                  2       4
jf := \10969344 cos(u)  sin(v)  + 24000201 sin(u)  sin(v) 

                                                               2\ 
     /            2                            2              \ | 
   + \-7668 sin(u)  sin(v) cos(v) - 7668 cos(u)  sin(v) cos(v)/ /^

  (1/2)


Opgave b)

A_g(a, b);
                            7668 Pi

evalf(7668*Pi);
                          24089.73247

V(a, b, h);
                           235152 Pi

evalf(235152*Pi);
                                      5
                        7.387517958 10 


Opgave b)

Vi skal blot løse integralet for
u \in [0,2*Pi] og v \in [0,Pi/2].

V bestemmer hvor langt z skal gå. Da dette er vores højde, lader vi denne gå til 0. Men ikke længere.
Error, missing operator or `;`
NULL;
int(jf, [u = -Pi .. Pi, v = 0 .. Pi/2]);
                             "(->)"

                             34384.


Opgave c)

Humlen er her, blot at definere en f(x,y,z)=z0-hældning*z, hvor:

hældning = df/dz
z0 = f(z=0)

I opgaven får vi
z=0 -> f = 20
z=46 -> f=10

Det er en fastprocentdel, så vi skal bruge eksponentialfunktion:

Hældning := (10/20)^(1/46)

Vi går så m(u,v) = f(x(u,v),y(u,v),z(u,v))

Bagefter, skal vi gange med jacobi og tage integralet.

Error, missing operator or `;`

z0 := 20;
`hældning` := (10/20)^(1/46);
f := (x, y, z) -> 20*`hældning`^z;
m := (u, v) -> 20*(1/2*2^(45/46))^(46*cos(v));

NULL;
int(m(u, v)*jf, [u = 0 .. 2*Pi, v = 0 .. Pi/2]);
                             "(->)"


                           129.98 jf

NULL;
Question:
Whenever I run any of the double integrals in this script, Maple freezes out and doesn't come back. What am I doing wrong? Why does it lag so much?

restart;
with(LinearAlgebra):

l_1 := diff(x1(t), t) = 1/2*x1(t) - x2(t) + cos(4*t);
                 d          1                         
         l_1 := --- x1(t) = - x1(t) - x2(t) + cos(4 t)
                 dt         2                         

l_2 := diff(x2(t), t) = 3/2*x1(t) - 2*x2(t) - 1;
                    d          3                    
            l_2 := --- x2(t) = - x1(t) - 2 x2(t) - 1
                    dt         2                    

dsolve({l_1, l_2}, {x1(t), x2(t)});
    /          4               296              28          
   { x1(t) = - - exp(-t) _C1 + ---- sin(4 t) - ---- cos(4 t)
    \          3               1105            1105         

           /  1  \                                    
      + exp|- - t| _C2 + 2, x2(t) = -2 exp(-t) _C1 + 1
           \  2  /                                    

         93              36                /  1  \    \ 
      - ---- cos(4 t) + ---- sin(4 t) + exp|- - t| _C2 }
        1105            1105               \  2  /    / 


A := <<1/2 | -1>, <3/2 | -2>>;
                           [1            ]
                           [-  &uminus0;1]
                           [2            ]
                      A := [             ]
                           [3            ]
                           [-  &uminus0;2]
                           [2            ]

Eigenvectors(A, output = list);
              [                  [        /[2]\ ]]
              [[-1      /[1]\ ]  [        |[-]| ]]
              [[--, 1, { [ ] }], [-1, 1, < [3] >]]
              [[2       \[1]/ ]  [        |[ ]| ]]
              [                  [        \[1]/ ]]

NULL;

I assume, I am getting a result in the format of:

Which implies, that the eigenvalues from dsolve are -1/2 and -1, which are correct according to the eigenvalues gotten from the matrix A.

But the eigenvector for the eigenvalue -1/2 appears to be incorretly given by dsolve, I should get 2/3 and no -4/3 in the top axis of the V_lambda(-1). For the second row I am getting -2 and not 1. It appears that Maple has multiplied the eigenvector for the eigenvalue -1 with -2? Or am I missing something?

If I am not missing anything; what appears to cause this issue?

Page 1 of 1