herclau

Mr. Hermes Rozsa Iglesias

1038 Reputation

13 Badges

19 years, 242 days

MaplePrimes Activity


These are answers submitted by herclau

symbolic

B := Matrix(3, 3, symbol = m);

                           [m[1, 1]  m[1, 2]  m[1, 3]]
                           [                         ]
                      B := [m[2, 1]  m[2, 2]  m[2, 3]]
                           [                         ]
                           [m[3, 1]  m[3, 2]  m[3, 3]]

for i to LinearAlgebra:-RowDimension(B) do convert(B[i, select(proc (t) options operator, arrow; is(i <> t) end proc, [`$`(1 .. LinearAlgebra:-ColumnDimension(B))])], `+`) end do;

                              m[1, 2] + m[1, 3]
                              m[2, 1] + m[2, 3]
                              m[3, 1] + m[3, 2]

 

How could simplify, compacting the following code?

for i to LinearAlgebra:-RowDimension(B) do;
 convert(B[i, select(proc (t) options operator, arrow; is(i <> t) end proc, [`$`(1 .. LinearAlgebra:-ColumnDimension(B))])], `+`) end do;
                                    -108
                                     -47
                                     -95
Gracias
 

 

If I delete assignment j := 2, I get the above error.
I need an outer loop for j, the columns?

Gracias

Hi Robert;

I get this error,

Error, bad index into Matrix

by implementing the following steps:

j = 2;
A := Matrix(3, 3, {(1, 1) = 27, (1, 2) = 99, (1, 3) = 92, (2, 1) = 8, (2, 2) = 29, (2, 3) = -31, (3, 1) = 69, (3, 2) = 44, (3, 3) = 67}):
 B := Matrix(3, 3, symbol = m):

add(A[i, j], i = `minus`({`$`(1 .. 3)}, {j}));


Sum(B[i, j]*piecewise(i = j, 0, 1), i = 1 .. 3);

I want to add the elements of the rows without taking the element of the diagonal.

Gracias

 

 

This is what I have got

View 9494_ProcITS90_SEA.mw on MapleNet
or Download 9494_ProcITS90_SEA.mw
View file details

 Gracias

HerClau

Thank you.: Robert !!!!

 

 

HELP ME

When I click on file Mananger get the following message:
!!!! Pop-up window has been blocked .!!!!!

restart;
T := 30:
A0 := 370000:
A := t-> A0*(1/2)^(t/T);
plot(A(t), t = 0 .. 100, A = 0 .. 400000, useunits = [Unit('years'), Unit('Bq')]);

http://www.mapleprimes.com/files/9494_units_graph.jpg

 


my goal is to evaluate by the function
ScientificErrorAnalysi "combine (dWdtSEA (t), errors)
The procedure dWdt() with 
t = ScientificErrorAnalysis:-Quantity (2.3, 0.1) for numerical values
or t = ScientificErrorAnalysis:-Quantity (t, dt), so symbolic.
So far I fail to get the desired result, namely that dWdt (Quantity (2.3, 0.1)) returns another value Quantity (Newt, dt)
Excuse my ignorance, but do not see how I can achieve the proposed target with what you stated.
Gracias
HerClau

jakubi,

Could demonstrate a simple example, how to enable this, within a procedure.
 If you could be with the procedure dWdt or dWdTSEA better!!!!

HerClau

Gracias!!!!!!

 

restart;
R1 := ScientificErrorAnalysis:-Quantity(80.0, 4.0)*Unit(ohm);
R2 := ScientificErrorAnalysis:-Quantity(120.0, 6.0)*Unit(ohm);
Req := combine(R1*R2/(R1+R2), errors);

restart;
with(Tolerances);
R1 := `&+-`(80.0, 4):
print(`output redirected...`); # input placeholder
R2 := `&+-`(120.0, 6):
print(`output redirected...`); # input placeholder
R := 1/(1/R1+1/R2);

48.0 `&+-` 2.40

restart;
R := 1/(1/R1+1/R2):
print(`output redirected...`); # input placeholder
dR := sqrt(((diff(R, R1))*dR1)^2+((diff(R, R2))*dR2)^2):

subs(R1 = 80.00, R2 = 120.00, R);
48.00000001

subs(R1 = 80.0, R2 = 120.0, dR1 = 4.0, dR2 = 6.0, dR);
1.730664613

I've implemented it targeted. No results found.

dWdtSEA := proc (t::{float, specfunc(anything,ScientificErrorAnalysis:-Quantity)})
 local DW, DW2, T;
description "Se calcula dWdt  según el valor de temperatura";
T := t+273.15; if 273.15 <= T then
 DW := add(((1/481)*i-1/481)*C[i, 1]*((1/481)*T+(-1/481)*754.15)^(i-2), i = 2 .. 10)
else
DW2 := add((i-1)*A[i, 1]*((ln(T/273.16)+1.5)/1.5)^(i-2)/(1.5*T), i = 2 .. 13);
DW := Wr(t)*DW2
end if;
evalf[9](DW)
end proc;
 

t := Quantity(ta, dt, relative);

t := Quantity(ta, dt*ta)

combine(dWdtSEA(t), errors, correlations = false);

Error, (in dWdtSEA) cannot determine if this expression is true or false: 0. <= ScientificErrorAnalysis:-Quantity(ta, dt*ta)

t1 := Quantity(ta, dt);

t1 := Quantity(ta, dt)

combine(dWdtSEA(t1), errors);

Error, (in dWdtSEA) cannot determine if this expression is true or false: 0. <= ScientificErrorAnalysis:-Quantity(ta, dt)

evalf(t); ScientificErrorAnalysis:-GetError(t);
ta
dt*ta

y:=combine(dWdtSEA(t1), errors);
Error, (in dWdtSEA) cannot determine if this expression is true or false: 0. <= ScientificErrorAnalysis:-Quantity(ta, dt)

evalf(y); ScientificErrorAnalysis:-GetError(y);
y
Error, (in ScientificErrorAnalysis:-GetError) expecting a quantity-with-error structure, but got y
 

 


Thank you.

 
Thanks Jakubi,
I will it. It's that simple? 
Or should I make any further adjustment in the code?

thanks Robert!!!!

Thank longrob,

How to derive the MGF ?

Following your idea, ...

f := piecewise(a < x and x < b, x/(b-a), 0);E1:=int(x/(b-a), x = a .. b):

E2:=int(x^2/(b-a), x = a .. b):

Var:=E2-E1^2:

simplify(Var);

 factor(%);

`assuming`(%, [b > a]);
I would like to perform the steps using with piecewise;

E1:=int(f, x = a .. b);
E2:=int(f^2, x = a .. b);

Here I do not know how to proceed ...

 

Thanks Jakubi,
I'm clear, you suggest  remove the variable declaration procedure flaot?
How else, could declare variables, keeping the float condition and that the procedure can be used with the package ScientificErrorAnalysis?
What can you say about the first point:
1 - I do not understand because i get different values when evaluating different significant figures.
Thank you.
2 3 4 5 6 7 8 Page 4 of 10