Live editor
Publicado por Nerea (6 intervenciones) el 21/01/2020 10:10:34
Hola,
Quiero resolver un sistema de ecuaciones de 30 incógnitas y 30 ecuaciones. Me da el siguiente error:
Error using sym.getEqnsVars>checkVariables (line 87)
Second argument must be a vector of symbolic variables.
Error in sym.getEqnsVars (line 54)
checkVariables(vars);
Error in solve>getEqns (line 429)
[eqns, vars] = sym.getEqnsVars(argv{:});
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
El programa es el siguiente:
Quiero resolver un sistema de ecuaciones de 30 incógnitas y 30 ecuaciones. Me da el siguiente error:
Error using sym.getEqnsVars>checkVariables (line 87)
Second argument must be a vector of symbolic variables.
Error in sym.getEqnsVars (line 54)
checkVariables(vars);
Error in solve>getEqns (line 429)
[eqns, vars] = sym.getEqnsVars(argv{:});
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
El programa es el siguiente:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
syms Na Ex Ey Bx By Fx Fy Cx Cy Gx Gy Jx Jy Gx Gy Ix Iy Kx Ky Mx My Lx Ly Nx Ny Ox Oy Dx Dy Np Nf Md
d=81/1000;
a=25/1000;
b=23.5/1000;
h=(340+b)/1000;
l1=200/1000;
l2=375/1000;
l3=l2;
l4=l2;
l5=l2;
l6=151/1000;
l7=l6;
l8=100/1000;
l9=310/1000;
l10=l9;
l11=375.8/1000;
m1=60/1000;
m2=110/1000;
m3=110/1000;
m4=110/1000;
m5=m4;
m6=50/1000;
m7=50/1000;
m8=30/1000;
m9=(930)/2000;
m10=(930)/2000;
m11=(1200)/2000;
me1=0.05/2;
me2=0.05/2;
me3=0.07/2;
mt=22.35/2;
x1=0.595;
x2=0.78;
x3=0.57;
x4=0.5;
x5=0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