フィルターのクリア

Error with Matlab Solve Function

6 ビュー (過去 30 日間)
Tyler Reohr
Tyler Reohr 2021 年 9 月 28 日
コメント済み: Walter Roberson 2021 年 9 月 28 日
I'm trying to solve for the critical points of the Lorenz Equations symbolic (i.e. in terms of ), but keep getting an error that I don't recognize at all when I try to run my code. I ran it on matlab online because I've never had an issue using solve before and it worked fine, but on my own computer (has every Matlab toolbox installed), I couldn't get it to work.
Here's my code:
clear all; close all; clc
syms sigma rho beta x y z; % Symbolic variables to solve system of ODEs
F1 = sigma*y - sigma*x; % First Lorenz ODE
F2 = rho*x - x*z - y; % Second Lorenz ODE
F3 = x*y - beta*z; % Third Lorenz ODE
F0 = [F1;F2;F3]; % Lorenz system of ODEs
critPoints = solve(F0 == 0, [x y z]); % Solves the system for the critical points
% The rest of the code prints it out
critPoints.x
ans = 
critPoints.y
ans = 
critPoints.z
ans = 
It also runs fine here, but for reference here's the exact error message I'm getting when trying to run it on my own computer:
Error using sym/solve (line 89)
Error using maplemex
Error, (in MTM:-solve) Vector(3, [0,0,0], datatype =
integer[1]) is not valid equation or expression
Error in Homework2 (line 14)
critPoints = solve(F0 == 0, [x y z])
I'm using Matlab2021a
Thanks!

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 28 日
You have Maple installed on your computer and you asked it to install the connection software between MATLAB and Maple. You are not using the Symbolic Toolbox, you are using Maple instead.
  2 件のコメント
Tyler Reohr
Tyler Reohr 2021 年 9 月 28 日
編集済み: Tyler Reohr 2021 年 9 月 28 日
I do have Maple but don't think that I've used it more than one time. Do you know how to unlink the two? I thought it might be useful at somepoint but I don't think I'll ever actually use it.
*Edit*
I tried running the uninstaller, which worked to uninstall the maple toolbox, but now Matlab doesn't seem to recognize it's own symbolic toolbox. I get the following error:
Unrecognized function or variable 'syms'.
Error in Homework2 (line 9)
syms sigma rho beta x y z real;
Walter Roberson
Walter Roberson 2021 年 9 月 28 日
restoredefaultpath; rehash toolboxcache
If that works, then
savepath
If it does not work, then reinstall the Symbolic Toolbox.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by