Ecuaciones no lineales
Publicado por Crissss (6 intervenciones) el 23/07/2017 03:26:23
Hola amigos... Necesito hacer un programa que resuelva un sistema de ecuaciones no lineales, el problema es que, cuando ingreso ecuaciones con funciones trigonoetricas o exponenciales me sale el siguiente mensaje:
El codigo es el siguiente:
¿Como puedo hacer que mi programa reconozca todo tipo de funciones? Se los agradeceria mucho si alguien pudiera colaborarme.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Error using symengine
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
Error in sym/double (line 588)
Xstr = mupadmex('symobj::double', S.s, 0);
Error in nolineal2var>pushbutton1_Callback (line 114)
set(handles.text4,'String',num2str(double(p(1))));
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in nolineal2var (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)nolineal2var('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating UIControl Callback
El codigo 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
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
a=get(handles.edit1,'String');
b=get(handles.edit2,'String');
c=get(handles.edit3,'String');
e1=sym(a);
e2=sym(b);
if(str2double(c)==0)
[p,q]=solve(e1,e2);
p1=size(p);
q1=size(q);
set(handles.text4,'String',num2str(double(p(1))));
set(handles.text5,'String',num2str(double(q(1))));
if ((p1(1))>1)
set(handles.text10,'String',num2str(double(p(2))));
end
if ((q1(1))>1)
set(handles.text11,'String',num2str(double(q(2))));
end
else
e3=sym(c);
[x,y,z]=solve(e1,e2,e3);
x1=size(x);
y1=size(y);
z1=size(z);
set(handles.text4,'String',num2str(double(x(1))));
set(handles.text5,'String',num2str(double(y(1))));
set(handles.text6,'String',num2str(double(z(1))));
if ((x1(1))>1)
set(handles.text10,'String',num2str(double(x(2))));
end
if ((y1(1))>1)
set(handles.text11,'String',num2str(double(y(2))));
end
if ((z1(1))>1)
set(handles.text12,'String',num2str(double(z(2))));
end
end
clc
¿Como puedo hacer que mi programa reconozca todo tipo de funciones? Se los agradeceria mucho si alguien pudiera colaborarme.
Valora esta pregunta


0