How to fix this error:"Input arguments must be convertible to floating-point numbers."

1 vue (au cours des 30 derniers jours)
CHUNYI YEH
CHUNYI YEH le 25 Jan 2021
Modifié(e) : CHUNYI YEH le 30 Jan 2021
I want to use the maximum value to solve R, but I don't know how to fix the error.
clc; clear all; close all;
syms R
step = 10^-12;
t = [-1*10^-8 : step : 1*10^-7];
A=12;
%R = 2.66e-3;
L = 0.406e-9;
C = 1.716e-9;
a = R/(2*L);
n = 1/(sqrt(L*C));
d = sqrt(((n)^2)-(a^2));
T = 15*10^-9 ; % + sqrt(L.*C)%;
m = A/T;
tow = R*C;
unitstep_1 = t>=0;
unitstep_2 = (t-T)>=0;
Vct_t = unitstep_1.*( t - (2.*a./n^2) + (exp(-a.*t)./d).*(( (2.*a./n).*sin(d.*t + atan(d./a))) - sin(d.*t) ));
Vct_T = unitstep_2.*( (t-T) - (2.*a./n^2) + (exp(-a.*(t-T))./d).*(( (2.*a./n).*sin(d.*(t-T) + atan(d./a))) - sin(d.*(t-T)) ));
Vc = m.*(Vct_t - Vct_T);
Vmax = max(Vc);
ANS = solve( round(Vmax,2) == 13.10 )
  3 commentaires
Steven Lord
Steven Lord le 25 Jan 2021
What should this return? Is x greater than y, less than y, equal to y, or can we not determine their ordering?
syms x y
M = max(x, y)
Error using symengine
Input arguments must be convertible to floating-point numbers.

Error in sym/privBinaryOp (line 1034)
Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});

Error in sym/max (line 108)
C = privBinaryOp(X, Y, 'symobj::zipWithImplicitExpansion', 'symobj::maxComplex', nanflag);
CHUNYI YEH
CHUNYI YEH le 26 Jan 2021
Oh, I think it’s not determine. But how to avoid this problem if I need the maximum value? Use for loop to change R and find the maximum value which is equal to my setting?But I think it’s not the best solution...😂 Thank you

Connectez-vous pour commenter.

Réponses (1)

Gaurav Garg
Gaurav Garg le 28 Jan 2021
Hi Chunyi,
I ran the code as it is, and couldn't reproduce the issue.
  1 commentaire
CHUNYI YEH
CHUNYI YEH le 30 Jan 2021
Modifié(e) : CHUNYI YEH le 30 Jan 2021
Hello, Gautama, thanks for the information. Maybe I will ran again in my lab’s computer, but I don’t think it’s the version problem.🤔

Connectez-vous pour commenter.

Catégories

En savoir plus sur Oceanography and Hydrology dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by