이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Whenever I type in syms x and run it, Matlab seems like it's being looped and I also can't stop it. How do I fix it?
조회 수: 6 (최근 30일)
이전 댓글 표시
I always need to use task manager to stop Matlab because pressing X doesn't shut it down.The problem just started today and I don't now why it keeps happening.
채택된 답변
Steven Lord
2018년 5월 5일
댓글 수: 18
Jasper Chan
2018년 5월 7일
First of all I just want to say that its ridiculous that the solution to such a fundamental problem is "pay for the newer version of matlab", but I digress.
I've updated to R2018a. I'm not quite sure what R2018a Update 1 means, but the 'Check for Updates' window lists both MATLAB and the Symbolic toolbox as up to date, yet my problem still persists.
>> syms x
Error using mupadmex
Internal error with symbolic engine. Quit and restart MATLAB.
Error in sym>tomupad (line 1219)
S = mupadmex(numeric2cellstr(x));
Error in sym (line 211)
S.s = tomupad(x);
Error in syms (line 201)
toDefine = sym(zeros(1, 0));
Walter Roberson
2018년 5월 7일
Dishank Mittal
2018년 5월 20일
I was facing the same issue and trying to figure from 2 days. It worked finally. Thanks Walter! Cheers!
Vinayak Vadlamani
2018년 6월 27일
편집: Walter Roberson
2018년 6월 27일
Steven, I tried the fix but it doesn't seem to work. Made the 2017b update. I run LabView in parallel on this system FYI.
System Info (ver)
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.3.0.713579 (R2017b)
MATLAB License Number: ••••••••
Operating System: Microsoft Windows 10 Enterprise Version 10.0 (Build 17134)
Java Version: Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Steven Lord
2018년 6월 27일
According to the output of the ver function that you posted you have not installed the update. I just installed the update in my installation of release R2017b and the first two lines of my ver output are:
>> ver
--------------------------------------------------
MATLAB Version: 9.3.0.867777 (R2017b) Update 7
[I trimmed some of the dashes in the divider, otherwise this post would have scroll bars.]
Filipe Lima
2018년 7월 17일
>> ver
-----------------------------------------------------------------------------------------------------
MATLAB Version: 9.4.0.813654 (R2018a)
MATLAB License Number: STUDENT
Operating System: Microsoft Windows 10 Pro Version 10.0 (Build 17134)
Java Version: Java 1.8.0_144-b01 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
I have the latest version but the problem persists!
Steven Lord
2018년 7월 17일
You don't have the update installed. If you did, the MATLAB Version line would include "Update" and a number after the "(R2018a)".
Open the Bug Report link and click on the "R2018a Update 1" link in the Bug Report. [That now goes to a later update than Update 1, but the later updates include all the bug fixes from previous updates for that release.] Download and install the update.
GAGANDEEP KAUR
2020년 11월 3일
편집: Walter Roberson
2020년 11월 4일
I have updated the version for R2018a but is still hving issue with the syms command , keep on running the code and not showing any result.Please if I could get some help
Here is the section I am having trouble with
syms a b c d e;
K1=zeros(1,5);K2=zeros(1,5);K3=zeros(1,5);K4=zeros(1,5);K5=zeros(1,5);
for i=1:9
%calculating mole fractions of ionic species
x1=[0.5096 0.5092 0.5087 0.4852 0.4847 0.4834 0.4804 0.4805 0.4803];
x2=[0.0963 0.0964 0.0965 0.1163 0.1161 0.1158 0.1275 0.1266 0.1253];
x3=[0.3941 0.3944 0.3948 0.3985 0.3992 0.4008 0.3921 0.3929 0.3943];
T=[394.15 399.15 404.15 375.15 390.15 405.15 374.15 392.15 406.15];
%Equilibrium constant for reaction 1 (Solvation reaction)
K1(i)=exp((-8.549)+(6692/T(i)))
%Equilibrium constant for reaction 2(Ionization of water)
K2(i)=100
%Equilibrium constant for reaction 3(Dissociation of HI)
K3(i)=exp((16.93565)+((1250)/T(i))+(-2.575*log(T(i))))
%Equilibrium constant for reaction 4(Polyiodide formation a)
K4(i)=exp((-936.28)+((40216.27)/T(i))+(151.983*(log(T(i))))+(-0.1675*(T(i))))
%Equilibrium constant for reaction 5(Polyiodide formation b)
K5(i)=exp((1044.78)+(-45171.42/T(i))+(-165.20*log(T(i)))+(0.1511*(T(i))))
eqns=[((d*(c-e))/((x1(i)-a-b-c-d)^5)*(x2(i)-d-b-c))==K1(i),((a+b+c)*a)/((x1(i)-a-b-c-d)^2)==K2(i),((a+b+c)*(d+b))/((x1(i)-a-b-c-d)*(x2(i)-d-b-c-e))==K3(i),((a+b+c)*(c-e))/((x1(i)-a-b-c-d)^4*(x2(i)-d-b-c-e))==K4(i), (((e)*(x1(i)-a-b-c-d)^3)/((c-e)*(x3(i)-e)))==K5(i)];
S=solve(eqns,[a,b,c,d,e]);
S.a(S.a<0)=[];
S.b(S.b<0)=[];
S.c(S.c<0)=[];
S.d(S.d<0)=[];
S.e(S.e<0)=[];
S.a=double(S.a)
S.b=double(S.b)
S.c=double(S.c)
S.d=double(S.d)
S.e=double(S.e)
end
Walter Roberson
2020년 11월 4일
You should re-arrange.
... It will not help... but you should re-arrange.
syms a b c d e;
x1=[0.5096 0.5092 0.5087 0.4852 0.4847 0.4834 0.4804 0.4805 0.4803];
x2=[0.0963 0.0964 0.0965 0.1163 0.1161 0.1158 0.1275 0.1266 0.1253];
x3=[0.3941 0.3944 0.3948 0.3985 0.3992 0.4008 0.3921 0.3929 0.3943];
T=[394.15 399.15 404.15 375.15 390.15 405.15 374.15 392.15 406.15];
N = length(x1);
K1 = zeros(1,N);
K2 = zeros(1,5);
K3 = zeros(1,N);
K4 = zeros(1,N);
K5 = zeros(1,N);
Sout = struct();
for i=1:N
%calculating mole fractions of ionic species
%Equilibrium constant for reaction 1 (Solvation reaction)
K1(i)=exp((-8.549)+(6692/T(i)));
%Equilibrium constant for reaction 2(Ionization of water)
K2(i)=100;
%Equilibrium constant for reaction 3(Dissociation of HI)
K3(i)=exp((16.93565)+((1250)/T(i))+(-2.575*log(T(i))));
%Equilibrium constant for reaction 4(Polyiodide formation a)
K4(i)=exp((-936.28)+((40216.27)/T(i))+(151.983*(log(T(i))))+(-0.1675*(T(i))));
%Equilibrium constant for reaction 5(Polyiodide formation b)
K5(i)=exp((1044.78)+(-45171.42/T(i))+(-165.20*log(T(i)))+(0.1511*(T(i))));
eqns=[((d*(c-e))/((x1(i)-a-b-c-d)^5)*(x2(i)-d-b-c))==K1(i),((a+b+c)*a)/((x1(i)-a-b-c-d)^2)==K2(i),((a+b+c)*(d+b))/((x1(i)-a-b-c-d)*(x2(i)-d-b-c-e))==K3(i),((a+b+c)*(c-e))/((x1(i)-a-b-c-d)^4*(x2(i)-d-b-c-e))==K4(i), (((e)*(x1(i)-a-b-c-d)^3)/((c-e)*(x3(i)-e)))==K5(i)];
S=vpasolve(eqns,[a,b,c,d,e]);
mask = S.a < 0 | S.b < 0 | S.c < 0 | S.d < 0 | S.e < 0;
S.a(mask)=[];
S.b(mask)=[];
S.c(mask)=[];
S.d(mask)=[];
S.e(mask)=[];
Sout(i).a=double(S.a);
Sout(i).b=double(S.b);
Sout(i).c=double(S.c);
Sout(i).d=double(S.d);
Sout(i).e=double(S.e);
disp(Sout(i))
end
Walter Roberson
2020년 11월 4일
For the first iteration, the closest I can find to a solution so far is
0.00917672806222852 234268.624175873 -4.132761874031 -234268.627565044 5.76374428893838
Yes, this does involve some very negative numbers. When I restrict to positive values, I do not come at all close to a solution.
Walter Roberson
2020년 11월 4일
It also appears that there might be fairly noticable round-off problems near that location.
GAGANDEEP KAUR
2020년 11월 4일
Thank you respected Walter Roberson for your effort and time. I may need to reform this system of equations.
GAGANDEEP KAUR
2020년 11월 4일
I have tried to run the code you suggested once .As you have found problem with negative values so I made it to run without this constraint and it still keep on running. On pausing it showed following message:
Operation terminated by user during mupadengine/evalin (line 123)
In mupadengine/feval (line 182)
[S,err] = evalin(engine,stmt,'message');
In sym/vpasolve (line 172)
sol = eng.feval('symobj::vpasolve',eqns,vars,X0);
In Equilibrium_constant (line 26)
S=vpasolve(eqns,[a,b,c,d,e]);
Walter Roberson
2020년 11월 4일
That is the expected message when you control-c to stop execution.
vpasolve is either not able to find an answer or takes a very long time to find an answer even when I tell it to start at a position that is pretty close to working (but not quite working.) My searches have not found any solution when I confine the values to +/- 1e6. And definitely not positive values only.
By the way, the equations have a singularity when c==e, leading to +/- infinity.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)