calculate differentiation with large coefficient
    9 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Cholisina
 il 9 Mar 2023
  
    
    
    
    
    Modificato: Dyuman Joshi
      
      
 il 9 Mar 2023
            Please help me
I'm trying to solve differential equation with this script using diff, but the coefficient result appear as a big series of number. How can I simplified it the coefficient?
omeganol=2.5;
E=50;
I=30;
L=600;
syms x 
y=omeganol/(120*E*I*L)*(-x^5+2*600^2*x^3-600^4*x)
ydif=diff(y)
0 Commenti
Risposta accettata
  Sulaymon Eshkabilov
      
 il 9 Mar 2023
        Here is a bit improved solution:
omeganol=2.5;
E=50;
I=30;
L=600;
syms y(x)
y(x)=vpa(omeganol/(120*E*I*L)*(-x^5+2*600^2*x^3-600^4*x))
ydif=diff(y(x))
0 Commenti
Più risposte (2)
  Dyuman Joshi
      
      
 il 9 Mar 2023
        
      Modificato: Dyuman Joshi
      
      
 il 9 Mar 2023
  
      Use sym() to get accurate values.
The ideal approach would be to use sym() on every unique number.
omeganol=2.5;
E=50;
I=30;
L=600;
syms x
y=omeganol/sym(120*E*I*L)*(-x^5+2*600^2*x^3-600^4*x)
ydif=diff(y)
0 Commenti
  Arka
    
 il 9 Mar 2023
        Hi,
MATLAB offers a function named simplify, which can help simplify different algebraic expressions.
omeganol=2.5;
E=50;
I=30;
L=600;
syms x 
y1=simplify(omeganol/(120*E*I*L)*(-x^5+2*600^2*x^3-600^4*x))
y=omeganol/(120*E*I*L)*(-x^5+2*600^2*x^3-600^4*x)
Since the fraction is irrational, MATLAB prefers keeping it in the fraction form instead of converting it to scientific notation.
If you wish to learn more about simpliy, please refer to the MathWorks documentation below:
0 Commenti
Vedere anche
Categorie
				Scopri di più su Symbolic Math Toolbox in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!











