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

1 visualizzazione (ultimi 30 giorni)
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 Commenti
Steven Lord
Steven Lord il 25 Gen 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 il 26 Gen 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

Accedi per commentare.

Risposte (1)

Gaurav Garg
Gaurav Garg il 28 Gen 2021
Hi Chunyi,
I ran the code as it is, and couldn't reproduce the issue.
  1 Commento
CHUNYI YEH
CHUNYI YEH il 30 Gen 2021
Modificato: CHUNYI YEH il 30 Gen 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.🤔

Accedi per commentare.

Categorie

Scopri di più su Oceanography and Hydrology in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by